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 76153 Details for
Bug 200064
[search] ResourceException while searching for method reference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 5.52 KB, created by
Frederic Fusier
on 2007-08-15 15:34:43 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2007-08-15 15:34:43 EDT
Size:
5.52 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: search/org/eclipse/jdt/internal/core/index/DiskIndex.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java,v >retrieving revision 1.63 >diff -u -r1.63 DiskIndex.java >--- search/org/eclipse/jdt/internal/core/index/DiskIndex.java 10 Aug 2007 08:14:17 -0000 1.63 >+++ search/org/eclipse/jdt/internal/core/index/DiskIndex.java 15 Aug 2007 18:44:50 -0000 >@@ -44,8 +44,9 @@ > private byte[] streamBuffer; > private int bufferIndex, bufferEnd; // used when reading from the file into the streamBuffer > private int streamEnd; // used when writing data from the streamBuffer to the file >+char separator = Index.DEFAULT_SEPARATOR; > >-public static final String SIGNATURE= "INDEX VERSION 1.122"; //$NON-NLS-1$ >+public static final String SIGNATURE= "INDEX VERSION 1.123"; //$NON-NLS-1$ > private static final char[] SIGNATURE_CHARS = SIGNATURE.toCharArray(); > public static boolean DEBUG = false; > >@@ -423,6 +424,7 @@ > this.categoryOffsets = new HashtableOfIntValues(size); > this.categoryEnds = new HashtableOfIntValues(size); > this.categoryTables = new HashtableOfObject(size); >+ this.separator = diskIndex.separator; > } > private void mergeCategories(DiskIndex onDisk, int[] positions, FileOutputStream stream) throws IOException { > // at this point, this.categoryTables contains the names -> wordsToDocs added in copyQueryResults() >@@ -770,6 +772,7 @@ > this.numberOfChunks = readStreamInt(stream); > this.sizeOfLastChunk = this.streamBuffer[this.bufferIndex++] & 0xFF; > this.documentReferenceSize = this.streamBuffer[this.bufferIndex++] & 0xFF; >+ this.separator = (char) (this.streamBuffer[this.bufferIndex++] & 0xFF); > > this.chunkOffsets = new int[this.numberOfChunks]; > for (int i = 0; i < this.numberOfChunks; i++) >@@ -1123,13 +1126,14 @@ > } > private void writeHeaderInfo(FileOutputStream stream) throws IOException { > writeStreamInt(stream, this.numberOfChunks); >- if ((this.bufferIndex + 2) >= BUFFER_WRITE_SIZE) { >+ if ((this.bufferIndex + 3) >= BUFFER_WRITE_SIZE) { > stream.write(this.streamBuffer, 0, this.bufferIndex); > this.bufferIndex = 0; > } > this.streamBuffer[this.bufferIndex++] = (byte) this.sizeOfLastChunk; > this.streamBuffer[this.bufferIndex++] = (byte) this.documentReferenceSize; >- this.streamEnd += 2; >+ this.streamBuffer[this.bufferIndex++] = (byte) this.separator; >+ this.streamEnd += 3; > > // apend the file with chunk offsets > for (int i = 0; i < this.numberOfChunks; i++) { >Index: search/org/eclipse/jdt/internal/core/index/Index.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/Index.java,v >retrieving revision 1.26 >diff -u -r1.26 Index.java >--- search/org/eclipse/jdt/internal/core/index/Index.java 10 Aug 2007 08:14:17 -0000 1.26 >+++ search/org/eclipse/jdt/internal/core/index/Index.java 15 Aug 2007 18:44:50 -0000 >@@ -32,7 +32,7 @@ > public ReadWriteMonitor monitor; > > // Separator to use after the container path >-private static final char DEFAULT_SEPARATOR = '/'; >+static final char DEFAULT_SEPARATOR = '/'; > public char separator = DEFAULT_SEPARATOR; > > protected DiskIndex diskIndex; >@@ -95,6 +95,7 @@ > this.memoryIndex = new MemoryIndex(); > this.diskIndex = new DiskIndex(fileName); > this.diskIndex.initialize(reuseExistingFile); >+ if (reuseExistingFile) this.separator = this.diskIndex.separator; > } > public void addIndexEntry(char[] category, char[] key, String containerRelativePath) { > this.memoryIndex.addIndexEntry(category, key, containerRelativePath); >@@ -177,6 +178,7 @@ > if (!hasChanged()) return; > > int numberOfChanges = this.memoryIndex.docsToReferences.elementSize; >+ this.diskIndex.separator = this.separator; > this.diskIndex = this.diskIndex.mergeWith(this.memoryIndex); > this.memoryIndex = new MemoryIndex(); > if (numberOfChanges > 1000) >#P org.eclipse.jdt.core.tests.model >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.115 >diff -u -r1.115 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 9 Aug 2007 10:20:29 -0000 1.115 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 15 Aug 2007 18:45:13 -0000 >@@ -8413,4 +8413,31 @@ > } > } > >+/** >+ * @bug 200064: [search] ResourceException while searching for method reference >+ * @test Ensure that indexing still works properly after close/restart >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=200064" >+ */ >+public void testBug200064() throws CoreException { >+ waitUntilIndexesReady(); >+ simulateExitRestart(); >+ waitUntilIndexesReady(); >+ // Search all type names with TypeNameMatchRequestor >+ TypeNameMatchCollector collector = new TypeNameMatchCollector(); >+ new SearchEngine().searchAllTypeNames( >+ null, >+ SearchPattern.R_EXACT_MATCH, >+ "Object".toCharArray(), >+ SearchPattern.R_PREFIX_MATCH, >+ IJavaSearchConstants.TYPE, >+ getJavaSearchScopeBugs(), >+ collector, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ null); >+ assertSearchResults( >+ "Object (not open) [in Object.class [in java.lang [in "+ getExternalJCLPathString("1.5") + "]]]", >+ collector >+ ); >+} >+ > } >\ 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 200064
: 76153