Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356402

Summary: complex analysis throws computation timeout
Product: z_Archived Reporter: Christian Campo <christian.campo>
Component: RecommendersAssignee: Marcel Bruch <marcel.bruch>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: lerch
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Christian Campo CLA 2011-08-31 16:06:05 EDT
I am loading quite a complex application into the workspace and I enabled the recommenders nature for all of them…….

For a number of classes I get the error message

Analysis of 'Lde/.…….Service' exceeded max compuation time limit, and thus, has been canceled….

(should be """computation""" in the error message BTW)

I get this for 40 classess. One class I checked had like 700 lines of code.

The stack trace is probably no surprise:

java.util.concurrent.CancellationException
	at org.eclipse.recommenders.commons.utils.Throws.throwCancelationException(Throws.java:75)
	at org.eclipse.recommenders.internal.rcp.analysis.WalaTypeAnalyzer.cancelAnalysisIfIInterrupted(WalaTypeAnalyzer.java:132)
	at org.eclipse.recommenders.internal.rcp.analysis.WalaTypeAnalyzer.analyzeEachMethod(WalaTypeAnalyzer.java:112)
	at org.eclipse.recommenders.internal.rcp.analysis.WalaTypeAnalyzer.run(WalaTypeAnalyzer.java:83)
	at org.eclipse.recommenders.internal.rcp.analysis.WalaCompiliationUnitAnalzyer.analyzePrimaryType(WalaCompiliationUnitAnalzyer.java:75)
	at org.eclipse.recommenders.internal.rcp.analysis.WalaCompiliationUnitAnalzyer.run(WalaCompiliationUnitAnalzyer.java:61)
	at org.eclipse.recommenders.internal.rcp.analysis.WalaCompilationUnitAnalyzerService.analyze(WalaCompilationUnitAnalyzerService.java:60)
	at org.eclipse.recommenders.internal.rcp.analysis.WalaCompilationUnitAnalyzerService.analyze(WalaCompilationUnitAnalyzerService.java:1)
	at org.eclipse.recommenders.internal.rcp.analysis.RecommendersBuilder.safeAnalyzeCompilationUnit(RecommendersBuilder.java:297)
	at org.eclipse.recommenders.internal.rcp.analysis.RecommendersBuilder.access$4(RecommendersBuilder.java:293)
	at org.eclipse.recommenders.internal.rcp.analysis.RecommendersBuilder$AnalyzerRunnable.run(RecommendersBuilder.java:88)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:680)

Anything I can do to make the code evaluate my code longer or is it the sign of a bug somewhere ?
Comment 1 Marcel Bruch CLA 2011-08-31 16:29:36 EDT
> Anything I can do to make the code evaluate my code longer or is it the sign of
> a bug somewhere ?

The analysis is automatically terminated after ~2 seconds. This is hardcoded at the moment. We'll consider introducing a timeout preference  in 0.4. General work on performance improvements is scheduled for October. I'll keep you posted when the timeout  preference is implemented.
Comment 2 Marcel Bruch CLA 2012-01-15 05:30:14 EST
This error won't occur in 0.5. We switched from WALA to JDT as primary analysis engine. Despite that, the general problem still exists when using WALA.  Closing this bug report as it targets on the completion engine - not export - which should work now w/o timeouts.

We move the analyzer/exporter into the sandbox and will do heavy testing there before delivering.