Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lighthouse#2273: Stop Fixtures attempting to set static (Map) fields #1281

Merged
13 changes: 8 additions & 5 deletions framework/src/play/test/Fixtures.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
Expand Down Expand Up @@ -265,11 +266,13 @@ public static void loadModels(boolean loadAsTemplate, String name) {

Model model = (Model) Binder.bind(rootParamNode, "object", cType, cType, annotations);
for (Field f : model.getClass().getFields()) {
if (f.getType().isAssignableFrom(Map.class)) {
f.set(model, objects.get(key).get(f.getName()));
}
if (f.getType().equals(byte[].class)) {
f.set(model, objects.get(key).get(f.getName()));
if (!Modifier.isStatic(f.getModifiers())) {
if (f.getType().isAssignableFrom(Map.class)) {
f.set(model, objects.get(key).get(f.getName()));
}
if (f.getType().equals(byte[].class)) {
f.set(model, objects.get(key).get(f.getName()));
}
}
}
model._save();
Expand Down