Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 37858 Details for
Bug 135083
RangeUtil#isInInterval(...) takes significant amount of time while editing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed improvement
patch002.txt (text/plain), 3.90 KB, created by
David Audel
on 2006-04-06 05:50:44 EDT
(
hide
)
Description:
Proposed improvement
Filename:
MIME Type:
Creator:
David Audel
Created:
2006-04-06 05:50:44 EDT
Size:
3.90 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/RangeUtil.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/RangeUtil.java,v >retrieving revision 1.6 >diff -u -r1.6 RangeUtil.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/RangeUtil.java 29 Mar 2006 02:48:08 -0000 1.6 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/RangeUtil.java 6 Apr 2006 09:42:58 -0000 >@@ -169,29 +169,7 @@ > } > } > } >- >- public static boolean isInInterval(int start, int end, int[] intervalStart, int[] intervalEnd) { >- int length = intervalStart.length; >- for (int i = 0; i < length; i++) { >- if(intervalStart[i] <= start && intervalEnd[i] >= end) { >- return true; >- } else if(intervalStart[i] > end) { >- return false; >- } >- } >- return false; >- } >- >- public static int getPreviousInterval(int start, int end, int[] intervalStart, int[] intervalEnd) { >- int length = intervalStart.length; >- for (int i = 0; i < length; i++) { >- if(intervalStart[i] > end) { >- return i - 1; >- } >- } >- return length - 1; >- } >- >+ > public static boolean containsIgnoredBody(AbstractMethodDeclaration method){ > return !method.isDefaultConstructor() > && !method.isClinit() >Index: compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream.java,v >retrieving revision 1.7 >diff -u -r1.7 LexStream.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream.java 29 Mar 2006 02:48:08 -0000 1.7 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream.java 6 Apr 2006 09:42:58 -0000 >@@ -48,6 +48,7 @@ > private int[] intervalFlagsToSkip; > > private int previousInterval = -1; >+ private int currentInterval = -1; > > public LexStream(int size, Scanner scanner, int[] intervalStartToSkip, int[] intervalEndToSkip, int[] intervalFlagsToSkip, int firstToken, int init, int eof) { > this.tokenCache = new Token[size]; >@@ -78,7 +79,11 @@ > if(tokenKind != TokenNameEOF) { > int start = scanner.getCurrentTokenStartPosition(); > int end = scanner.getCurrentTokenEndPosition(); >- if(!RangeUtil.isInInterval(start, end, intervalStartToSkip, intervalEndToSkip)) { >+ >+ int nextInterval = currentInterval + 1; >+ if(intervalStartToSkip.length == 0 || >+ nextInterval >= intervalStartToSkip.length || >+ start < intervalStartToSkip[nextInterval]) { > Token token = new Token(); > token.kind = tokenKind; > token.name = scanner.getCurrentTokenSource(); >@@ -86,18 +91,19 @@ > token.end = end; > token.line = scanner.getLineNumber(end); > >- int pInterval = RangeUtil.getPreviousInterval(start, end, intervalStartToSkip, intervalEndToSkip); >- if(pInterval != previousInterval && (intervalFlagsToSkip[previousInterval + 1] & RangeUtil.IGNORE) == 0){ >+ if(currentInterval != previousInterval && (intervalFlagsToSkip[currentInterval] & RangeUtil.IGNORE) == 0){ > token.flags = IS_AFTER_JUMP; >- if((intervalFlagsToSkip[pInterval] & RangeUtil.LBRACE_MISSING) != 0){ >+ if((intervalFlagsToSkip[currentInterval] & RangeUtil.LBRACE_MISSING) != 0){ > token.flags |= LBRACE_MISSING; > } > } >- previousInterval = pInterval; >+ previousInterval = currentInterval; > > tokenCache[++tokenCacheIndex % length] = token; > > tokenNotFound = false; >+ } else { >+ scanner.resetTo(intervalEndToSkip[++currentInterval] + 1, scanner.eofPosition - 1); > } > } else { > int start = scanner.getCurrentTokenStartPosition();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 135083
: 37858