Bug 63878 - Background Indexer Crash Recovery
Summary: Background Indexer Crash Recovery
Status: RESOLVED DUPLICATE of bug 57419
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.0 RC1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-25 11:07 EDT by Cherie Wong CLA
Modified: 2004-05-25 11:53 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cherie Wong CLA 2004-05-25 11:07:16 EDT
M9 GTK Build

I decided to do a "CVS Replace" on a project I had in my workspace.  It asked if
I wanted to overwrite my local changes.  I said "yes please!".  Then the error
below appeared 4 times in my Error Log... 

Everything still works but I'm not sure what this is :(


Error May 25, 2004 10:39:10.901 Background Indexer Crash Recovery
java.lang.IllegalArgumentException: Buffer size <= 0
	at java.io.BufferedInputStream.<init>(BufferedInputStream.java(Inlined Compiled
Code))
	at java.io.BufferedInputStream.<init>(BufferedInputStream.java(Inlined Compiled
Code))
	at
org.eclipse.jdt.internal.core.index.DiskIndex.readCategoryTable(DiskIndex.java(Compiled
Code))
	at org.eclipse.jdt.internal.core.index.DiskIndex.mergeCategory(DiskIndex.java:360)
	at
org.eclipse.jdt.internal.core.index.DiskIndex.mergeCategories(DiskIndex.java:352)
	at
org.eclipse.jdt.internal.core.index.DiskIndex.mergeWith(DiskIndex.java(Compiled
Code))
	at org.eclipse.jdt.internal.core.index.Index.save(Index.java:171)
	at
org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndex(IndexManager.java:491)
	at
org.eclipse.jdt.internal.core.search.indexing.SaveIndex.execute(SaveIndex.java:40)
	at
org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:367)
	at java.lang.Thread.run(Thread.java:568)
Comment 1 Kent Johnson CLA 2004-05-25 11:53:52 EDT
From the stack trace, this is the call we are making in DiskIndex:

DataInputStream stream = new DataInputStream(new BufferedInputStream(new 
FileInputStream(getIndexFile())));

The constructor in BufferedInputStream is:

public BufferedInputStream(InputStream in) {
  this(in, defaultBufferSize);
}

which calls:

public BufferedInputStream(InputStream in, int size) {
  super(in);
  if (size <= 0) {
    throw new IllegalArgumentException("Buffer size <= 0");
  }
  buf = new byte[size];
}

We do NOT pass in the buffer size (we use the default) so how can it be <= 0?

Its initialized as:

    private static int defaultBufferSize = 2048;

*** This bug has been marked as a duplicate of 57419 ***