Skip to content

Commit

Permalink
Switch to ReflectionFactory to prevent warnings in Java 9 (close #53)
Browse files Browse the repository at this point in the history
  • Loading branch information
henri-tremblay committed Jun 20, 2017
1 parent b5da971 commit 9b091e3
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -15,6 +15,9 @@
*/
package org.objenesis.strategy;

import java.io.NotSerializableException;
import java.io.Serializable;

import org.objenesis.ObjenesisException;
import org.objenesis.instantiator.ObjectInstantiator;
import org.objenesis.instantiator.android.AndroidSerializationInstantiator;
Expand All @@ -24,9 +27,6 @@
import org.objenesis.instantiator.perc.PercSerializationInstantiator;
import org.objenesis.instantiator.sun.SunReflectionFactorySerializationInstantiator;

import java.io.NotSerializableException;
import java.io.Serializable;

import static org.objenesis.strategy.PlatformDescription.*;

/**
Expand Down Expand Up @@ -62,7 +62,7 @@ public <T> ObjectInstantiator<T> newInstantiatorOf(Class<T> type) {
if(isGoogleAppEngine() && PlatformDescription.SPECIFICATION_VERSION.equals("1.7")) {
return new ObjectInputStreamInstantiator<T>(type);
}
return new ObjectStreamClassInstantiator<T>(type);
return new SunReflectionFactorySerializationInstantiator<T>(type);
}
else if(JVM_NAME.startsWith(DALVIK)) {
if(PlatformDescription.isAndroidOpenJDK()) {
Expand All @@ -77,7 +77,7 @@ else if(JVM_NAME.startsWith(PERC)) {
return new PercSerializationInstantiator<T>(type);
}

return new ObjectStreamClassInstantiator<T>(type);
return new SunReflectionFactorySerializationInstantiator<T>(type);
}

}

0 comments on commit 9b091e3

Please sign in to comment.