< prev index next >

apps/samples/Ensemble8/src/app/java/ensemble/samplepage/PlaygroundTabs.java

Print this page
rev 10031 : 8165373: Ensemble8 uses setAccessible to access methods and fields of various classes
Reviewed-by:

*** 1,7 **** /* ! * Copyright (c) 2008, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * * This file is available and licensed under the following license: * * Redistribution and use in source and binary forms, with or without --- 1,7 ---- /* ! * Copyright (c) 2008, 2016, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * * This file is available and licensed under the following license: * * Redistribution and use in source and binary forms, with or without
*** 172,192 **** continue; } if (prop.propertyName.startsWith("get")) { property = object.getClass().getMethod(prop.propertyName).invoke(object); } else { - for (Field f : object.getClass().getDeclaredFields()) { - if (f.getName().equals(prop.propertyName)) { - f.setAccessible(true); - property = f.get(object); - break; - } - } - if (property == null) { property = object.getClass().getMethod(prop.propertyName + "Property").invoke(object); } - } if (object instanceof XYChart && prop.propertyName.equals("data")) { needsDataTab = true; dataTab.setContent(new XYDataVisualizer((XYChart) object)); } else if (object instanceof PieChart && prop.propertyName.equals("data")) { needsDataTab = true; --- 172,183 ----
< prev index next >