No tengo mucha idea de programación en java, pero tengo que modificar un programa que he descompilado en el que aparece la siguiente rutina
private static String getSystemProperty(String key, String def)
throws SecurityException
{
(String)AccessController.doPrivileged(new PrivilegedAction() { private final String val$key;
private final String val$def;
public Object run() { return System.getProperty(this.val$key, this.val$def); }
});
}
eclipse, al depurar, me da error en la línea:
(String)AccessController.doPrivileged(new PrivilegedAction() { private final String val$key;
private final String val$def;
public Object run() { return System.getProperty(this.val$key, this.val$def); }
el error que marca es:
Multiple markers at this line
- Type safety: Unchecked invocation doPrivileged(new PrivilegedAction(){}) of the generic method doPrivileged(PrivilegedAction<T>)
of type AccessController
- Type safety: The expression of type new PrivilegedAction(){} needs unchecked conversion to conform to PrivilegedAction<Object>
- Syntax error, insert ";" to complete BlockStatements
- String cannot be resolved to a variable
- PrivilegedAction is a raw type. References to generic type PrivilegedAction<T> should be parameterized
- Syntax error, insert "AssignmentOperator Expression" to complete Assignment
¿Alguien me puede explicar cómo corregirlo?
Un saludo
José Antonio