Tidy up usage of java.security.PrivilegedAction

Project:JNode Core
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed
Description

The "java.security.PrivilegedAction<T>" interface is widely used within the JNode codebase, and also the Sun and Classpath codebases. It defines one method, "T run()", and is used in conjunction with the "AccessController.doPrivileged(...)" method.

The original version of this interface was not generic, but Sun changed it a generic interface in Java 1.5. Some uses of this interfaces have been changed, but many unparameterized uses still exist. These show up as Eclipse type-safety warnings.

The attached patch fixes all unparameterized and incorrectly parameterized occurences in JNode and Classpath-originated code. It also changes "PrivilegedAction<Object>" to "PrivilegedAction<Void>" in cases where the "run" method always returns null.

The changes are mostly cosmetic, but they do avoid unnecessary typecasts in a few cases.

AttachmentSize
issues_6636.08 KB

#1

Status:active» closed

I've commited the patch except the parts affecting the non JNode speciffic files under core/src/classpath. This means that under core/src/classpath/ only core/src/classpath/vm is included. The reason behind this is that for classpath integration purposes we prefer to make as little change to the files comming from GNU classpath as possible, so that we can track the new changes in classpath easier.

Regards, Levente

#2

Thanks. I understand the position on Classpath code. I just got a bit carried away.

#3