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 177329 Details for
Bug 317264
[search] Refactoring is impossible with commons.lang added to project
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch on HEAD
patch3.txt (text/plain), 21.34 KB, created by
Satyam Kandula
on 2010-08-24 11:19:50 EDT
(
hide
)
Description:
Proposed patch on HEAD
Filename:
MIME Type:
Creator:
Satyam Kandula
Created:
2010-08-24 11:19:50 EDT
Size:
21.34 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v >retrieving revision 1.417 >diff -u -r1.417 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 18 Aug 2010 14:13:55 -0000 1.417 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 24 Aug 2010 13:44:56 -0000 >@@ -68,6 +68,7 @@ > import org.eclipse.jdt.internal.core.SearchableEnvironment; > import org.eclipse.jdt.internal.core.SourceTypeElementInfo; > import org.eclipse.jdt.internal.core.search.matching.JavaSearchNameEnvironment; >+import org.eclipse.jdt.internal.core.search.matching.MatchLocator; > import org.eclipse.jdt.internal.core.util.Messages; > > /** >@@ -498,6 +499,8 @@ > private final static int SUPERTYPE = 1; > private final static int SUBTYPE = 2; > >+ private final static char[] DOT_ENUM = "enum".toCharArray(); //$NON-NLS-1$ >+ > int expectedTypesPtr = -1; > TypeBinding[] expectedTypes = new TypeBinding[1]; > int expectedTypesFilter; >@@ -11820,6 +11823,14 @@ > } > } > } >+ >+ // filter packages ending with enum for projects above 1.5 >+ // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=317264 >+ if (MatchLocator.mayHaveEnum && this.compilerOptions.sourceLevel >= ClassFileConstants.JDK1_5 && >+ CharOperation.endsWith(givenPkgName, DOT_ENUM)) { //note: it should be .enum and not just enum >+ return true; >+ } >+ > return false; > } > >Index: search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java,v >retrieving revision 1.52 >diff -u -r1.52 PatternSearchJob.java >--- search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java 27 Jun 2008 16:04:09 -0000 1.52 >+++ search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java 24 Aug 2010 13:44:56 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 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 >@@ -88,7 +88,9 @@ > public boolean search(Index index, IProgressMonitor progressMonitor) { > if (index == null) return COMPLETE; > if (progressMonitor != null && progressMonitor.isCanceled()) throw new OperationCanceledException(); >- >+ if (!MatchLocator.mayHaveEnum && index.containerPath.indexOf("org.apache.commons.lang_2") != -1) { //$NON-NLS-1$ >+ MatchLocator.mayHaveEnum = true; >+ } > ReadWriteMonitor monitor = index.monitor; > if (monitor == null) return COMPLETE; // index got deleted since acquired > try { >Index: search/org/eclipse/jdt/internal/core/search/TypeNameMatchRequestorWrapper.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/TypeNameMatchRequestorWrapper.java,v >retrieving revision 1.17 >diff -u -r1.17 TypeNameMatchRequestorWrapper.java >--- search/org/eclipse/jdt/internal/core/search/TypeNameMatchRequestorWrapper.java 20 Aug 2010 14:34:14 -0000 1.17 >+++ search/org/eclipse/jdt/internal/core/search/TypeNameMatchRequestorWrapper.java 24 Aug 2010 13:44:56 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 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 >@@ -16,6 +16,7 @@ > import org.eclipse.jdt.core.IClassFile; > import org.eclipse.jdt.core.ICompilationUnit; > import org.eclipse.jdt.core.IJavaElement; >+import org.eclipse.jdt.core.IJavaProject; > import org.eclipse.jdt.core.IPackageFragment; > import org.eclipse.jdt.core.IPackageFragmentRoot; > import org.eclipse.jdt.core.IType; >@@ -25,9 +26,12 @@ > import org.eclipse.jdt.core.search.IJavaSearchScope; > import org.eclipse.jdt.core.search.TypeNameMatchRequestor; > import org.eclipse.jdt.core.search.TypeNameRequestor; >+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.env.AccessRestriction; >+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; > import org.eclipse.jdt.internal.core.Openable; > import org.eclipse.jdt.internal.core.PackageFragmentRoot; >+import org.eclipse.jdt.internal.core.search.matching.MatchLocator; > import org.eclipse.jdt.internal.core.util.HandleFactory; > import org.eclipse.jdt.internal.core.util.HashtableOfArrayToObject; > >@@ -69,6 +73,8 @@ > * Cache package handles to optimize memory. > */ > private HashtableOfArrayToObject packageHandles; >+ private Object lastProject; >+ private long complianceValue; > > public TypeNameMatchRequestorWrapper(TypeNameMatchRequestor requestor, IJavaSearchScope scope) { > this.requestor = requestor; >@@ -168,6 +174,18 @@ > IPackageFragment pkgFragment= (IPackageFragment) this.packageHandles.get(pkgName); > if (pkgFragment == null) { > pkgFragment= ((PackageFragmentRoot) this.lastPkgFragmentRoot).getPackageFragment(pkgName); >+ // filter org.apache.commons.lang.enum package for projects above 1.5 >+ // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=317264 >+ if (MatchLocator.mayHaveEnum && length == 5 && pkgName[4].equals("enum")) { //$NON-NLS-1$ >+ IJavaProject proj = (IJavaProject)pkgFragment.getAncestor(IJavaElement.JAVA_PROJECT); >+ if (!proj.equals(this.lastProject)) { >+ String complianceStr = proj.getOption(CompilerOptions.OPTION_Source, true); >+ this.complianceValue = CompilerOptions.versionToJdkLevel(complianceStr); >+ this.lastProject = proj; >+ } >+ if (this.complianceValue >= ClassFileConstants.JDK1_5) >+ return null; >+ } > this.packageHandles.put(pkgName, pkgFragment); > } > return pkgFragment.getClassFile(simpleNames[length]).getType(); >Index: search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java,v >retrieving revision 1.334 >diff -u -r1.334 MatchLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 20 Aug 2010 14:34:14 -0000 1.334 >+++ search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 24 Aug 2010 13:44:58 -0000 >@@ -79,6 +79,7 @@ > public class MatchLocator implements ITypeRequestor { > > public static final int MAX_AT_ONCE; >+public static boolean mayHaveEnum = false; > static { > long maxMemory = Runtime.getRuntime().maxMemory(); > int ratio = (int) Math.round(((double) maxMemory) / (64 * 0x100000)); >@@ -733,6 +734,32 @@ > } > return false; > } >+private boolean filterMatch(SearchMatch match) { >+ >+ // filter org.apache.commons.lang.enum package for projects above 1.5 >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=317264 >+ if (MatchLocator.mayHaveEnum) { >+ IJavaElement element = (IJavaElement)match.getElement(); >+ PackageFragment pkg = (PackageFragment)element.getAncestor(IJavaElement.PACKAGE_FRAGMENT); >+ if (pkg != null) { >+ String[] names = pkg.names; >+ int len = names.length; >+ // enum was found in org.apache.commons.lang.enum at index 5 >+ if (len == 5 && names[4].equals("enum")) { //$NON-NLS-1$ >+ if (this.options == null) { >+ IJavaProject proj = (IJavaProject)pkg.getAncestor(IJavaElement.JAVA_PROJECT); >+ String complianceStr = proj.getOption(CompilerOptions.OPTION_Source, true); >+ if (CompilerOptions.versionToJdkLevel(complianceStr) >= ClassFileConstants.JDK1_5) >+ return true; >+ } else if (this.options.sourceLevel >= ClassFileConstants.JDK1_5) { >+ return true; >+ } >+ } >+ } >+ } >+ return false; >+} >+ > /* (non-Javadoc) > * Return info about last type argument of a parameterized type reference. > * These info are made of concatenation of 2 int values which are respectively >@@ -1702,6 +1729,8 @@ > } > return; > } >+ if (filterMatch(match)) >+ return; > long start = -1; > if (BasicSearchEngine.VERBOSE) { > start = System.currentTimeMillis(); >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/CompletionTests2.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests2.java,v >retrieving revision 1.49 >diff -u -r1.49 CompletionTests2.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests2.java 7 Jul 2010 13:38:50 -0000 1.49 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests2.java 24 Aug 2010 13:45:07 -0000 >@@ -5462,4 +5462,133 @@ > deleteProject("P"); > } > } >+// types in enum package of org.apache.commons.lang.jar should not be proposed for >+// 1.5 projects. see https://bugs.eclipse.org/bugs/show_bug.cgi?id=317264 >+public void testBug317264a() throws CoreException { >+ IJavaProject project = null; >+ try >+ { >+ project = createJavaProject("P2", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5"); >+ addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/Completion/b317264/org.apache.commons.lang_2.modified.jar"), null, null)); >+ >+ createFile( >+ "/P2/X.java", >+ "import org.apache.commons.lang.*;\n"+ >+ "public class X {\n"+ >+ " public void foo() {\n"+ >+ " enu\n"+ >+ " }\n"+ >+ "}"); >+ waitUntilIndexesReady(); >+ >+ ICompilationUnit cu= getCompilationUnit("P2", "", "", "X.java"); >+ >+ String str = cu.getSource(); >+ String completeBehind = "enu"; >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ cu.codeComplete(cursorLocation, requestor); >+ assertResults( >+ "Enum[TYPE_REF]{Enum, java.lang, Ljava.lang.Enum;, null, null, 17}", >+ requestor.getResults()); >+ >+ } finally { >+ deleteProject(project); >+ } >+} >+// types in enum package of org.apache.commons.lang.jar should be proposed for 1.4 projects >+public void testBug317264b() throws CoreException { >+ IJavaProject project = null; >+ try >+ { >+ project = createJavaProject("P2"); >+ addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/Completion/b317264/org.apache.commons.lang_2.modified.jar"), null, null)); >+ >+ createFile( >+ "/P2/X.java", >+ "import org.apache.commons.lang.*;\n"+ >+ "public class X {\n"+ >+ " public void foo() {\n"+ >+ " enu\n"+ >+ " }\n"+ >+ "}"); >+ waitUntilIndexesReady(); >+ >+ ICompilationUnit cu= getCompilationUnit("P2", "", "", "X.java"); >+ >+ String str = cu.getSource(); >+ String completeBehind = "enu"; >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ cu.codeComplete(cursorLocation, requestor); >+ assertResults( >+ "Enum[TYPE_REF]{org.apache.commons.lang.enum.Enum, org.apache.commons.lang.enum, Lorg.apache.commons.lang.enum.Enum;, null, null, 14}", >+ requestor.getResults()); >+ >+ } finally { >+ deleteProject(project); >+ } >+} >+// enum package of org.apache.commons.lang.jar should not be proposed for 1.5 projects >+public void testBug317264c() throws CoreException { >+ IJavaProject project = null; >+ try >+ { >+ project = createJavaProject("P2", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5"); >+ addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/Completion/b317264/org.apache.commons.lang_2.modified.jar"), null, null)); >+ >+ createFile( >+ "/P2/X.java", >+ "import org.apache.commons.lang.enu;\n"+ >+ "public class X {\n"+ >+ " public void foo() {\n"+ >+ " }\n"+ >+ "}"); >+ waitUntilIndexesReady(); >+ >+ ICompilationUnit cu= getCompilationUnit("P2", "", "", "X.java"); >+ >+ String str = cu.getSource(); >+ String completeBehind = "lang.enu"; >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ cu.codeComplete(cursorLocation, requestor); >+ assertResults("", requestor.getResults()); >+ >+ } finally { >+ deleteProject(project); >+ } >+} >+// enum package of org.apache.commons.lang.jar should be proposed for 1.4 projects >+public void testBug317264d() throws CoreException { >+ IJavaProject project = null; >+ try >+ { >+ project = createJavaProject("P2"); >+ addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/Completion/b317264/org.apache.commons.lang_2.modified.jar"), null, null)); >+ >+ createFile( >+ "/P2/X.java", >+ "import org.apache.commons.lang.enu;\n"+ >+ "public class X {\n"+ >+ " public void foo() {\n"+ >+ " }\n"+ >+ "}"); >+ waitUntilIndexesReady(); >+ >+ ICompilationUnit cu= getCompilationUnit("P2", "", "", "X.java"); >+ >+ String str = cu.getSource(); >+ String completeBehind = "lang.enu"; >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, true, true); >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ cu.codeComplete(cursorLocation, requestor); >+ assertResults( >+ "org.apache.commons.lang.enum[PACKAGE_REF]{org.apache.commons.lang.enum.*;, org.apache.commons.lang.enum, null, null, null, 24}", >+ requestor.getResults()); >+ >+ } finally { >+ deleteProject(project); >+ } >+} > } >Index: src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java,v >retrieving revision 1.202 >diff -u -r1.202 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 20 Aug 2010 14:34:09 -0000 1.202 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 24 Aug 2010 13:45:16 -0000 >@@ -61,7 +61,7 @@ > // Debug > static { > // org.eclipse.jdt.internal.core.search.BasicSearchEngine.VERBOSE = true; >-// TESTS_NAMES = new String[] {"testBug306223"}; >+ TESTS_NAMES = new String[] {"testBug317264"}; > } > > public JavaSearchBugsTests(String name) { >@@ -8782,6 +8782,7 @@ > "lib/b166348.jar [No source]\n" + > "lib/b166348.jar pack [No source]\n" + > "lib/b166348.jar test [No source]\n" + >+ "lib/b317264 b317264\n" + > "lib/b86293.jar [No source]\n" + > "lib/b87627.jar [No source]\n" + > "lib/b87627.jar b87627 [No source]\n" + >@@ -11946,4 +11947,129 @@ > deleteProject(serverProject); > } > } >+/** >+ * @bug 317264: Refactoring is impossible with commons.lang added to project >+ * @test types in enum package of org.apache.commons.lang.jar should not be reported for 1.5 projects >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=317264" >+ */ >+public void testBug317264a() throws CoreException { >+ IJavaProject project = null; >+ try >+ { >+ project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5"); >+ addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/JavaSearchBugs/lib/b317264/org.apache.commons.lang_2.modified.jar"), null, null)); >+ int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES | IJavaSearchScope.REFERENCED_PROJECTS; >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask); >+ >+ waitUntilIndexesReady(); >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ new SearchEngine().searchAllTypeNames( >+ "org.apache.commons.lang.enum".toCharArray(), >+ SearchPattern.R_EXACT_MATCH, >+ "".toCharArray(), >+ SearchPattern.R_PREFIX_MATCH, >+ IJavaSearchConstants.TYPE, >+ scope, >+ collector, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ null); >+ assertSearchResults("Unexpected search results!", "", collector); >+ } finally { >+ deleteProject(project); >+ } >+} >+// types in enum package of org.apache.commons.lang.jar should be reported for 1.4 projects >+public void testBug317264b() throws CoreException { >+ IJavaProject project = null; >+ try >+ { >+ project = createJavaProject("P"); >+ addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/JavaSearchBugs/lib/b317264/org.apache.commons.lang_2.modified.jar"), null, null)); >+ int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES | IJavaSearchScope.REFERENCED_PROJECTS; >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask); >+ >+ waitUntilIndexesReady(); >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ new SearchEngine().searchAllTypeNames( >+ "org.apache.commons.lang.enum".toCharArray(), >+ SearchPattern.R_EXACT_MATCH, >+ "".toCharArray(), >+ SearchPattern.R_PREFIX_MATCH, >+ IJavaSearchConstants.TYPE, >+ scope, >+ collector, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ null); >+ assertSearchResults("Unexpected search results!", >+ "Enum (not open) [in Enum.class [in org.apache.commons.lang.enum [in /JavaSearchBugs/lib/b317264/org.apache.commons.lang_2.modified.jar [in P]]]]", >+ collector); >+ } finally { >+ deleteProject(project); >+ } >+} >+ >+// types in enum package of org.apache.commons.lang.jar should not be reported for 1.5 projects >+public void testBug317264c() throws CoreException { >+ try >+ { >+ IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5"); >+ addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/JavaSearchBugs/lib/b317264/org.apache.commons.lang_2.modified.jar"), null, null)); >+ int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES ; >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask); >+ search("org.apache.commons.lang.enum*", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, scope, this.resultCollector); >+ assertSearchResults("Unexpected search results!", "", this.resultCollector); >+ } finally { >+ deleteProject("P"); >+ } >+} >+ >+// types in enum package of org.apache.commons.lang.jar should be reported for 1.4 projects >+public void testBug317264d() throws CoreException { >+ try >+ { >+ IJavaProject project = createJavaProject("P"); >+ addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/JavaSearchBugs/lib/b317264/org.apache.commons.lang_2.modified.jar"), null, null)); >+ int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES ; >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask); >+ search("org.apache.commons.lang.enum.*", IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, scope, this.resultCollector); >+ assertSearchResults("Unexpected search results!", >+ "lib/b317264/org.apache.commons.lang_2.modified.jar org.apache.commons.lang.enum.Enum EXACT_MATCH", >+ this.resultCollector); >+ } finally { >+ deleteProject("P"); >+ } >+} >+ >+// enum package of org.apache.commons.lang.jar should not be reported for 1.5 projects >+public void testBug317264e() throws CoreException { >+ try >+ { >+ IJavaProject project = createJavaProject("P", new String[] {""}, new String[] {"JCL15_LIB"}, "", "1.5"); >+ addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/JavaSearchBugs/lib/b317264/org.apache.commons.lang_2.modified.jar"), null, null)); >+ int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES ; >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask); >+ search("org.apache.commons.lang.enum*", IJavaSearchConstants.PACKAGE, IJavaSearchConstants.DECLARATIONS, scope, this.resultCollector); >+ assertSearchResults("Unexpected search results!", "", this.resultCollector); >+ } finally { >+ deleteProject("P"); >+ } >+} >+ >+//enum package of org.apache.commons.lang.jar should be reported for 1.4 projects >+public void testBug317264f() throws CoreException { >+ try >+ { >+ IJavaProject project = createJavaProject("P"); >+ project.setOption(CompilerOptions.OPTION_Source, "1.4"); >+ addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/JavaSearchBugs/lib/b317264/org.apache.commons.lang_2.modified.jar"), null, null)); >+ int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES ; >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask); >+ search("org.apache.commons.lang.enum*", IJavaSearchConstants.PACKAGE, IJavaSearchConstants.DECLARATIONS, scope, this.resultCollector); >+ assertSearchResults("Unexpected search results!", >+ "lib/b317264/org.apache.commons.lang_2.modified.jar org.apache.commons.lang.enum [No source] EXACT_MATCH", >+ this.resultCollector); >+ } finally { >+ deleteProject("P"); >+ } >+} > } >\ No newline at end of file
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 317264
:
172186
|
175371
|
175372
|
177329
|
177332
|
177381