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 186898 Details for
Bug 329288
Fetching parameter names literally hangs on a class with a lot of methods
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
fix for 3.6.2
patch329288-362.txt (text/plain), 6.18 KB, created by
Ayushman Jain
on 2011-01-17 06:44:11 EST
(
hide
)
Description:
fix for 3.6.2
Filename:
MIME Type:
Creator:
Ayushman Jain
Created:
2011-01-17 06:44:11 EST
Size:
6.18 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/JavadocContents.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavadocContents.java,v >retrieving revision 1.2.4.1 >diff -u -r1.2.4.1 JavadocContents.java >--- model/org/eclipse/jdt/internal/core/JavadocContents.java 9 Aug 2010 09:44:39 -0000 1.2.4.1 >+++ model/org/eclipse/jdt/internal/core/JavadocContents.java 17 Jan 2011 10:02:30 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2009, 2010 IBM Corporation and others. >+ * Copyright (c) 2009, 2011 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -145,7 +145,7 @@ > for (int i = 0; i < this.tempAnchorIndexesCount; i++) { > int anchorEndStart = this.tempAnchorIndexes[i]; > >- if (anchorEndStart != -1 && CharOperation.indexOf(anchor, this.content, false, anchorEndStart) == anchorEndStart) { >+ if (anchorEndStart != -1 && Util.prefixEquals(anchor, this.content, false, anchorEndStart)) { > > this.tempAnchorIndexes[i] = -1; > >@@ -165,7 +165,7 @@ > > this.tempLastAnchorFoundIndex = anchorEndStart; > >- if (CharOperation.indexOf(anchor, this.content, false, anchorEndStart) == anchorEndStart) { >+ if (Util.prefixEquals(anchor, this.content, false, anchorEndStart)) { > return computeChildRange(anchorEndStart, anchor, indexOfSectionBottom); > } else { > if (this.tempAnchorIndexes.length == this.tempAnchorIndexesCount) { >Index: model/org/eclipse/jdt/internal/core/util/Util.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java,v >retrieving revision 1.143 >diff -u -r1.143 Util.java >--- model/org/eclipse/jdt/internal/core/util/Util.java 9 Apr 2010 13:38:05 -0000 1.143 >+++ model/org/eclipse/jdt/internal/core/util/Util.java 17 Jan 2011 10:02:31 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2010 IBM Corporation and others. >+ * Copyright (c) 2000, 2011 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -3621,4 +3621,60 @@ > } > } > } >+ >+ /** >+ * Answers true if the given name, starting from the given index, starts with the given prefix, >+ * false otherwise. isCaseSensitive is used to find out whether or not the comparison should be >+ * case sensitive. >+ * <br> >+ * <br> >+ * For example: >+ * <ol> >+ * <li><pre> >+ * prefix = { 'a' , 'B' } >+ * name = { 'c', 'd', 'a' , 'b', 'b', 'a', 'b', 'a' } >+ * startIndex = 2 >+ * isCaseSensitive = false >+ * result => true >+ * </pre> >+ * </li> >+ * <li><pre> >+ * prefix = { 'a' , 'B' } >+ * name = { 'c', 'd', 'a' , 'b', 'b', 'a', 'b', 'a' } >+ * startIndex = 2 >+ * isCaseSensitive = true >+ * result => false >+ * </pre> >+ * </li> >+ * </ol> >+ * >+ * @param prefix the given prefix >+ * @param name the given name >+ * @param isCaseSensitive to find out whether or not the comparison should be case sensitive >+ * @param startIndex index from which the prefix should be searched in the name >+ * @return true if the given name starts with the given prefix, false otherwise >+ * @throws NullPointerException if the given name is null or if the given prefix is null >+ */ >+ public static final boolean prefixEquals( >+ char[] prefix, >+ char[] name, >+ boolean isCaseSensitive, >+ int startIndex) { >+ >+ int max = prefix.length; >+ if (name.length - startIndex < max) >+ return false; >+ if (isCaseSensitive) { >+ for (int i = max; --i >= 0;) // assumes the prefix is not larger than the name >+ if (prefix[i] != name[startIndex + i]) >+ return false; >+ return true; >+ } >+ >+ for (int i = max; --i >= 0;) // assumes the prefix is not larger than the name >+ if (ScannerHelper.toLowerCase(prefix[i]) >+ != ScannerHelper.toLowerCase(name[startIndex + i])) >+ return false; >+ return true; >+ } > } >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java,v >retrieving revision 1.37 >diff -u -r1.37 UtilTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java 27 Jun 2008 16:04:45 -0000 1.37 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java 17 Jan 2011 10:02:34 -0000 >@@ -15,6 +15,7 @@ > //import org.apache.tools.ant.types.selectors.SelectorUtils; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.jdt.core.compiler.CharOperation; >+import org.eclipse.jdt.internal.core.util.Util; > > //import junit.framework.AssertionFailedError; > import junit.framework.Test; >@@ -738,6 +739,20 @@ > // Verify that there were no unexpected results > assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0); > } >+ >+// test org.eclipse.jdt.internal.compiler.util.Util.prefixEquals(char[], char[], boolean, int) >+public void test010() { >+ char[] name = new char[] { 'a' , 'b', 'c', 'a', 'a' }; >+ char[] prefix = new char[] { 'c', 'a', 'a' }; >+ assertTrue(Util.prefixEquals(prefix, name, false, 2)); >+ prefix = new char[] { 'c', 'a', 'a', 'a' }; >+ assertFalse(Util.prefixEquals(prefix, name, false, 2)); >+ prefix = new char[] { 'c', 'a', 'A' }; >+ assertFalse(Util.prefixEquals(prefix, name, true, 2)); >+ prefix = new char[] { 'b', 'c' }; >+ assertFalse(Util.prefixEquals(prefix, name, false, 2)); >+ assertTrue(Util.prefixEquals(prefix, name, false, 1)); >+} > public static Class testClass() { > return UtilTest.class; > }
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 329288
:
182229
|
182230
|
182237
|
182238
|
182239
|
182241
|
182242
|
182244
|
182438
|
182439
|
182731
|
183264
|
183385
| 186898