Bug 92895 - Syntax error in pointcut causes Error Log message without stack trace
Summary: Syntax error in pointcut causes Error Log message without stack trace
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: 1.2.0 M3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Helen Beeken CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-27 08:06 EDT by Matthew Webster CLA
Modified: 2005-07-05 07:32 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Webster CLA 2005-04-27 08:06:30 EDT
Take the aspect below, remove the “:” from the PCD and recompile (full or 
incremental). As well as an error message in the Problems view you will get 
(4) errors in the log like:

Error 2005-04-26 15:59:06.340 afterThrowing() [in Aspect [in [Working copy] 
Aspect.aj [in bug_nnnnn [in src [in Bugzilla]]]]] does not exist

Syntax error on token ")", : expected after this token	Aspect.aj

public aspect Aspect {

	after () throwing (Throwable th) : execution(* *(..)) {
		System.err.println(thisEnclosingJoinPointStaticPart);
	}

}
Comment 1 Sian January CLA 2005-04-27 10:22:37 EDT
I believe this error is originating from the cross references view because it 
does not happen if the view is closed, or if you have not saved the correct 
version of the aspect beforehand.  

As a side note it might be worth extending our FFDC aspect in all the AJDT 
projects so that we could get stack traces for things like this.
Comment 2 Helen Beeken CLA 2005-07-05 07:32:41 EDT
These errors were occuring because the update to the xref view was being driven
by a build and in this case the IJavaElement the cross reference view was using
as it's input no longer existed. 

The fix is in the selectionChanged(..) method inside the XReferenceView class.
In here we call out to another method to get a list of the XReferenceAdapters
corresponding to the current editor selection. There was a null check, however,
in the case of this bug, the list wasn't null, it was empty. Therefore, adding a
check to see whether the returned list is empty and if it is then to clear the
view fixes the problem.

The test for this is in org.eclipse.ajdt.ui.tests.visual.XReferenceView.

The fix can be found in build:

BUILD COMPLETE -  build.443
Date of build: 07/05/2005 11:13:48
Time to build: 44 minutes 22 seconds
Last changed: 07/05/2005 10:39:03