AppEngine sun.misc.Restricción no segura

Appengine seems to restrict the use of "sun.misc.Unsafe". Unfortunately, the Gson serialization library uses this to provide no-arg constructor instantaneous. Which works beautifully with Scala case classes.

Is this a valid restriction and if so, would it be reasonable to request a feature to allow it?

I realize that this type of reflection has some security ramifications, but App Engine does allow reflection on code within my own code base. Maybe the same could be true for "sun.misc.Unsafe"

Noticias: I realize, now, that Unsafe is in fact "too unsafe" to be allowed and the better solution would be find an alternative way to instantiate no-arg constructors, which the Gson team has not been able to achieve.

preguntado el 01 de julio de 12 a las 17:07

If I were you, I'd file a bug with Gson first. -

1 Respuestas

I realize that this type of reflection has some security ramifications, but App Engine does allow reflection on code within my own code base. Maybe the same could be true for "sun.misc.Unsafe" Unsafe as its name suggests, has very unsafe methods which can ruin the whole JVM. For example, you can change arbitrary location in memory, so it's impossible to restrict Unsafe only to your classes. Here are the methods:

setMemory(long l, long l1, byte b)
long getAddress(long l)
void putAddress(long l, long l1)

Respondido 01 Jul 12, 17:07

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.