Skip to content

Commit ef00b9f

Browse files
committed
Phase 2C: remove PropertiesEnhancer from enhancer pipeline
- EnhancerPlugin: drop new PropertiesEnhancer() from defaultEnhancers(); ConstructorEnhancer already handles constructor generation - BeanWrapper: remove @PlayPropertyAccessor import and filter from isSetter/isScalaSetter; no such methods exist now that PropertiesEnhancer is off - PropertiesEnhancer: flip default of play.propertiesEnhancer.enabled from true to false; enhancer remains available as an explicit opt-in
1 parent 0eb4db8 commit ef00b9f

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

framework/src/play/classloading/enhancers/PropertiesEnhancer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030
public class PropertiesEnhancer extends Enhancer {
3131

32-
private final boolean enabled = Boolean.parseBoolean(Play.configuration.getProperty("play.propertiesEnhancer.enabled", "true"));
32+
private final boolean enabled = Boolean.parseBoolean(Play.configuration.getProperty("play.propertiesEnhancer.enabled", "false"));
3333
private final boolean generateAccessors = Boolean.parseBoolean(Play.configuration.getProperty("play.propertiesEnhancer.generateAccessors", "true"));
3434

3535
@Override

framework/src/play/data/binding/BeanWrapper.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import java.util.*;
66

77
import play.Logger;
8-
import play.classloading.enhancers.PropertiesEnhancer.PlayPropertyAccessor;
98
import play.exceptions.UnexpectedException;
109

1110
/**
@@ -63,11 +62,11 @@ public void set(String name, Object instance, Object value) {
6362
}
6463

6564
private boolean isSetter(Method method) {
66-
return (!method.isAnnotationPresent(PlayPropertyAccessor.class) && method.getName().startsWith("set") && method.getName().length() > 3 && method.getParameterTypes().length == 1 && (method.getModifiers() & notaccessibleMethod) == 0);
65+
return (method.getName().startsWith("set") && method.getName().length() > 3 && method.getParameterTypes().length == 1 && (method.getModifiers() & notaccessibleMethod) == 0);
6766
}
6867

6968
private boolean isScalaSetter(Method method) {
70-
return (!method.isAnnotationPresent(PlayPropertyAccessor.class) && method.getName().endsWith("_$eq") && method.getParameterTypes().length == 1 && (method.getModifiers() & notaccessibleMethod) == 0);
69+
return (method.getName().endsWith("_$eq") && method.getParameterTypes().length == 1 && (method.getModifiers() & notaccessibleMethod) == 0);
7170
}
7271

7372
protected Object newBeanInstance() throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {

framework/src/play/plugins/EnhancerPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
public class EnhancerPlugin extends PlayPlugin {
1313

1414
protected Enhancer[] defaultEnhancers() {
15-
return new Enhancer[] { new ConstructorEnhancer(), new PropertiesEnhancer(), new ContinuationEnhancer(), new SigEnhancer(), new ControllersEnhancer(),
15+
return new Enhancer[] { new ConstructorEnhancer(), new ContinuationEnhancer(), new SigEnhancer(), new ControllersEnhancer(),
1616
new MailerEnhancer(), new LocalvariablesNamesEnhancer() };
1717
}
1818

0 commit comments

Comments
 (0)