Java - Syntax error, insert "AssignmentOperator Expression" to complete Assignment

 
Vista:

Syntax error, insert "AssignmentOperator Expression" to complete Assignment

Publicado por jagrane (1 intervención) el 10/04/2016 22:49:48
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

1
2
3
4
5
6
7
8
9
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:

1
2
3
(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
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder