This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
We would like to measure time of classpath scan , for example if new project is created or if user open new one . For this purposes I'd used your PERF_DEBUG property, but it's too low, so I created next patch: I added new property : PERF_TEST ... perf.refactoring.test If this property is used we will log name of the classpath element and time spend by scanning. Please review the patch, thanks in advance. ----------------- Index: src/org/netbeans/modules/javacore/JMManager.java =================================================================== RCS file: /cvs/java/javacore/src/org/netbeans/modules/javacore/JMManager.java,v retrieving revision 1.90 diff -r1.90 JMManager.java 73a74 > public static final boolean PERF_TEST = Boolean.getBoolean("perf.refactoring.test"); 1038c1039 < if (PERF_DEBUG) { --- > if (PERF_DEBUG || PERF_TEST) { 1045c1046 < if (PERF_DEBUG) { --- > if (PERF_DEBUG || PERF_TEST) { 1047a1049,1058 > > if (PERF_TEST) { > try { > Class c = Class.forName("org.netbeans.performance.test.utilities.LoggingScanClasspath",true,Thread.currentThread().getContextClassLoader()); // NOI18N > java.lang.reflect.Method m = c.getMethod("reportScanOfFile", new Class[] {String.class, Long.class}); // NOI18N > Object o = m.invoke(c.newInstance(), new Object[] {new String(uri), new Long(endT - startT)}); > } catch (Exception e) { > e.printStackTrace(System.err); > } > }
Pavel, what is the status of this issue ? Thanks and sorry ;)
From my point of view, I do not have anything against it as it is only code which runs with private property. I have only one question. Do we really need to use reflection? (Sorry for late answer.) I will add your property to arch-javacore.xml.
> From my point of view, I do not have anything against it as it is only > code which runs with private property. I have only one question. Do we > really need to use reflection? Do you know about any other solution ? > (Sorry for late answer.) > I will add your property to arch-javacore.xml. That's fine , thanks.
Yarda, a little bird told me that you are the boss responsible for approving reflection usage in our code base, so please could you look at this ? I would like to have this code in trunk before NB4.1 Beta branching, Thanks in advance.
I was speaking with Yarda and he agreed with this change. Pavel or Martin, I am not sure what has to be done for Arch, so if I can help you let me know what, where and ... I am applying for fast review, because we would like to measure scan classpath as soon as possible, at least we need data for Beta , and Beta is going to be branched on 15th of February ;(
Created attachment 20311 [details] here is the patch
Just document in arch.xml that there is such strange contract (api of property and reflection).
OK, we are going to merge this within the next 24 hours.
Checking in arch/arch-javacore.xml; /cvs/java/javacore/arch/arch-javacore.xml,v <-- arch-javacore.xml new revision: 1.17; previous revision: 1.16 done Processing log script arguments... More commits to come... Checking in src/org/netbeans/modules/javacore/JMManager.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/JMManager.java,v <-- JMManager.java new revision: 1.93; previous revision: 1.92 done
Pavel, thanks a lot - verified.
Reorganization of java component