Bug 314365 - pointcut rewriter can have issues for large hashcode values
Summary: pointcut rewriter can have issues for large hashcode values
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.6.9M2   Edit
Hardware: PC Windows 7
: P2 major (vote)
Target Milestone: 1.6.9   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-25 17:32 EDT by Andrew Clement CLA
Modified: 2010-05-25 19:06 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 Andrew Clement CLA 2010-05-25 17:32:47 EDT
AJDT uses a pointcut like this:

(persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object)))))

After the pointcut rewriter has chewed on it, it is reduced to a normal form.  This is meant to be a stable form such that further rewrites of it would not change it.  This turned out not to be the case.  The hashcodes for some of the components were quite large and manifested as negative integers.  The arithmetic in the comparator for the elements would have a problem and give unhelpful responses.  For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A.  Whether it went wrong was dependent on the order in which the elements were collected by the rewriter.

This is now fixed.  It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
Comment 1 Andrew Clement CLA 2010-05-25 19:06:42 EDT
tests and fix committed