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 184129 Details for
Bug 329671
Regression: arg0,1,2... parameter names are cached
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Same patch with updated test
bug_329671a.txt (text/plain), 5.57 KB, created by
Jay Arthanareeswaran
on 2010-11-30 09:04:42 EST
(
hide
)
Description:
Same patch with updated test
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2010-11-30 09:04:42 EST
Size:
5.57 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/BinaryMethod.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java,v >retrieving revision 1.109 >diff -u -r1.109 BinaryMethod.java >--- model/org/eclipse/jdt/internal/core/BinaryMethod.java 29 Nov 2010 05:24:37 -0000 1.109 >+++ model/org/eclipse/jdt/internal/core/BinaryMethod.java 30 Nov 2010 13:59:13 -0000 >@@ -222,8 +222,8 @@ > // ignore > } > if (timeOut == 0) { >- // don't try to fetch the values >- return this.parameterNames = getRawParameterNames(paramCount); >+ // don't try to fetch the values and don't cache either (https://bugs.eclipse.org/bugs/show_bug.cgi?id=329671) >+ return getRawParameterNames(paramCount); > } > final class ParametersNameCollector { > String javadoc; >@@ -304,8 +304,8 @@ > return this.parameterNames = names; > } > } >- // if still no parameter names, produce fake ones >- return this.parameterNames = getRawParameterNames(paramCount); >+ // If still no parameter names, produce fake ones, but don't cache them (https://bugs.eclipse.org/bugs/show_bug.cgi?id=329671) >+ return getRawParameterNames(paramCount); > } > private char[][] splitParameters(char[] parametersSource, int paramCount) { > // we have generic types as one of the parameter types >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/AttachedJavadocTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachedJavadocTests.java,v >retrieving revision 1.38 >diff -u -r1.38 AttachedJavadocTests.java >--- src/org/eclipse/jdt/core/tests/model/AttachedJavadocTests.java 9 Aug 2010 09:35:30 -0000 1.38 >+++ src/org/eclipse/jdt/core/tests/model/AttachedJavadocTests.java 30 Nov 2010 13:59:14 -0000 >@@ -22,6 +22,7 @@ > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.NullProgressMonitor; >+import org.eclipse.core.runtime.Path; > import org.eclipse.jdt.core.IClassFile; > import org.eclipse.jdt.core.IClasspathAttribute; > import org.eclipse.jdt.core.IClasspathEntry; >@@ -34,6 +35,9 @@ > import org.eclipse.jdt.core.IType; > import org.eclipse.jdt.core.JavaCore; > import org.eclipse.jdt.core.JavaModelException; >+import org.eclipse.jdt.internal.core.BinaryType; >+import org.eclipse.jdt.internal.core.JavaModelManager; >+import org.eclipse.jdt.internal.core.JavaModelManager.PerProjectInfo; > > public class AttachedJavadocTests extends ModifyingResourceTests { > private static final String DEFAULT_DOC_FOLDER = "doc"; >@@ -718,4 +722,65 @@ > setJavadocLocationAttribute(DEFAULT_DOC_FOLDER); > } > } >+ //https://bugs.eclipse.org/bugs/show_bug.cgi?id=329671 >+ public void testBug329671() throws CoreException, IOException { >+ Map options = this.project.getOptions(true); >+ Object timeout = options.get(JavaCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC); >+ options.put(JavaCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC, "0"); //$NON-NLS-1$ >+ this.project.setOptions(options); >+ IClasspathEntry[] entries = this.project.getRawClasspath(); >+ >+ try { >+ IClasspathAttribute attribute = >+ JavaCore.newClasspathAttribute( >+ IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, >+ "jar:platform:/resource/AttachedJavadocProject/bug329671_doc.zip!/"); >+ IClasspathEntry newEntry = JavaCore.newLibraryEntry(new Path("/AttachedJavadocProject/bug329671.jar"), null, null, null, new IClasspathAttribute[] { attribute}, false); >+ this.project.setRawClasspath(new IClasspathEntry[]{newEntry}, null); >+ this.project.getResolvedClasspath(false); >+ >+ IPackageFragmentRoot jarRoot = this.project.getPackageFragmentRoot(getFile("/AttachedJavadocProject/bug329671.jar")); >+ final IType type = jarRoot.getPackageFragment("bug").getClassFile("X.class").getType(); >+ IMethod method = type.getMethod("foo", new String[]{"Ljava.lang.Object;"}); >+ assertNotNull(method); >+ >+ String[] paramNames = method.getParameterNames(); >+ assertStringsEqual("Parameter names", new String[]{"arg0"}, paramNames); >+ final PerProjectInfo projectInfo = JavaModelManager.getJavaModelManager().getPerProjectInfoCheckExistence(this.project.getProject()); >+ final Object varThis = this; >+ Thread thread = new Thread(){ >+ public void run() { >+ Object javadocContent = projectInfo.javadocCache.get(type); >+ while(javadocContent == null || javadocContent == BinaryType.EMPTY_JAVADOC) { >+ try { >+ Thread.sleep(50); >+ javadocContent = projectInfo.javadocCache.get(type); >+ } catch (InterruptedException e) { >+ } >+ synchronized (varThis) { >+ varThis.notify(); >+ } >+ } >+ } >+ }; >+ thread.start(); >+ synchronized (varThis) { >+ try { >+ varThis.wait(5000); >+ } catch (InterruptedException e) { >+ e.printStackTrace(); >+ } >+ } >+ projectInfo.javadocCache.flush(); >+ options.put(JavaCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC, "5000"); //$NON-NLS-1$ >+ this.project.setOptions(options); >+ paramNames = method.getParameterNames(); >+ assertStringsEqual("Parameter names", new String[]{"param"}, paramNames); >+ } finally { >+ this.project.setRawClasspath(entries, null); >+ if (timeout != null) >+ options.put(JavaCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC, timeout); >+ this.project.setOptions(options); >+ } >+ } > }
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 329671
:
183576
|
183820
|
183821
|
183835
|
184103
|
184122
| 184129