Author: dazarov
Date: 2011-11-02 21:12:02 -0400 (Wed, 02 Nov 2011)
New Revision: 36151
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java
Log:
Quickfix and Wizard for fixing ambigious injection warning is confusing
https://issues.jboss.org/browse/JBIDE-9940
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java 2011-11-03
00:47:54 UTC (rev 36150)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java 2011-11-03
01:12:02 UTC (rev 36151)
@@ -450,9 +450,7 @@
throws InvocationTargetException, InterruptedException {
monitor.beginTask(CDICoreMessages.CDI_UTIL_BUILD_CDI_MODEL, 10);
monitor.worked(3);
-
- //waitForIdle(1000, 5000);
- delay(1000);
+
try {
Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
} catch (InterruptedException e) {
@@ -461,45 +459,6 @@
monitor.worked(7);
}
-
-// public void waitForIdle(long delay, long maxIdle) {
-// long start = System.currentTimeMillis();
-// while (!Job.getJobManager().isIdle()) {
-// delay(delay);
-// if ((System.currentTimeMillis() - start) > maxIdle) {
-// Job[] jobs = Job.getJobManager().find(null);
-// StringBuffer str = new StringBuffer();
-// for (Job job : jobs) {
-// if (job.getThread() != null) {
-// str.append("\n").append(job.getName()).append(" (")
-// .append(job.getClass()).append(")");
-// }
-// }
-// throw new RuntimeException(
-// "Long running tasks detected:" + str.toString()); //$NON-NLS-1$
-// }
-// }
-// }
-
- public void delay(long waitTimeMillis) {
- Display display = Display.getCurrent();
- if (display != null) {
- long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
- while (System.currentTimeMillis() < endTimeMillis) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.update();
- }
- // Otherwise, perform a simple sleep.
- else {
- try {
- Thread.sleep(waitTimeMillis);
- } catch (InterruptedException e) {
- // Ignored.
- }
- }
- }
});
}catch(InterruptedException ie){
CDICorePlugin.getDefault().logError(ie);