Bug 57419 - GB18030: Can not search the expression via Menu "Search"->"Read Access"->"Workspace" correctly.
Summary: GB18030: Can not search the expression via Menu "Search"->"Read Access"->"Wor...
Status: CLOSED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 57861 61481 63878 64076 65769 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-04-05 01:42 EDT by Cheng xu CLA
Modified: 2004-06-07 13:32 EDT (History)
8 users (show)

See Also:


Attachments
error log (1.41 KB, application/octet-stream)
2004-04-21 01:37 EDT, Cheng xu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cheng xu CLA 2004-04-05 01:42:52 EDT
OS:		SLES 9 Beta2
Language:	Simplified Chinese
Build level:	200403261517
JDK version:	IBM JDK 1.4.2 Beta
Test case #:	WB30PFSH010

Summary: GB18030: Can not search the expression via Menu "Search"->"Read 
Access"->"Workspace" correctly.

Steps to recreate problem:
1-Start Eclipse;
2-Click menu "File"->"New"->"Project";
3-Select Java Project , press "Next>" button;
4-Input "JavaTest" in Project Name field, press "Finish" button;
5-"Confirm Perspective Switch" window shows up, press "Yes" button;
6-Create two classes, A class name contains GB18030 character. The B inherit 
from A. Following is the source code of CLASS A and Bīŧš
/*****************************************************/
/*A.java*/
class A {
	static int counter;
	int
}
/*****************************************************/

/*****************************************************/
/*B.java*/
class B extends A{
	int readCounter(){
		return counter;
	}
}
/*****************************************************/

7-Double click the A class to open it from Java Editor;
8-Select the variable "counter";
9-Click menu "Search"->"Read Access"->"Workspace";You will get one item found 
in "Search" View.
10-Add an int Variable into Class A named with character "0x6d4b"(using Unicode 
ime to input);
11-Select the variable "counter";
12-Click menu "Search"->"Read Access"->"Workspace";You will get one item found 
in "Search" View;
13-Add an int Variable into Class A named with "temp";
14-Select the variable "counter";
15-Click menu "Search"->"Read Access"->"Workspace";You will get nothing found 
in "Search" View;
   I think Searching result should like the result in step 9 & 12.

Error:  Can not correctly search the "Read Access".

Expected Result: Show what you input, search the expression correctly and 
switch correctly.

Remark:  This problem does occur in RHEL 3 WS and Window 2003 too.
Comment 1 Thomas M??der CLA 2004-04-14 07:14:53 EDT
A couple of questions here:

1) The class a is syntactically incorrect ("int" after definition of the
"counter" variable.
2) Is there anything in the .log file?
Comment 2 Jonathan Simpson CLA 2004-04-20 11:31:18 EDT
I am unable to reproduce this on Windows 2000 with build wswb-I20040413-
200404191247.

Also, creating the variable with the 0x6d4b character results in a syntax 
error, "invalid variableDeclarator".  Is this a bug?
Comment 3 Cheng xu CLA 2004-04-21 01:35:06 EDT
I've  tried with Build level 200404131323 on Windows XP, following is the 
detail steps:

Steps to recreate problem:
1-Start Eclipse;
2-Click menu "File"->"New"->"Project";
3-Select Java Project , press "Next>" button;
4-Input "JavaTest" in Project Name field, press "Finish" button;
5-"Confirm Perspective Switch" window shows up, press "Yes" button;
6-Click menu "File"->"New"->"Class";
7-input "A" in "Name" field and select the "default" option in Modifiers group;
8-Click "Finish" button.
9-Click menu "File"->"New"->"Class";
10-input "B" in "Name" field and select the "default" option in Modifiers group;
11-Click "Finish" button.
12-double click "A.java" in the "Package Explore View" to open it from Java 
Editor.
13-Copy and paste the following contents to replace file "A.java".
/*****************************************************/
class A {
	static int counter;
}
/*****************************************************/
14-Press "Ctrl + S" to save file "A.java"
15-double click "B.java" in the "Package Explore View" to open it from Java 
Editor.
16-Copy and paste the following contents to replace file "B.java".
/*****************************************************/
class B extends A{
	int readCounter()	{return counter;}
}
/*****************************************************/
17-Press "Ctrl + S" to save file "B.java".
18-double click "A.java" in the "Package Explore View" to open it from Java 
Editor.
19-Select the variable "counter";
20-Click menu "Search"->"Read Access"->"Workspace";You will get nothing found 
in "Search" View.

Error:  Can not correctly search the "Read Access".

Expected Result: Show what you input, search the expression correctly and 
switch correctly.

Remark:
It cause error log.
Comment 4 Cheng xu CLA 2004-04-21 01:37:10 EDT
Created attachment 9744 [details]
error log

error log
Comment 5 Thomas M??der CLA 2004-04-21 04:00:11 EDT
I have not been able to reproduce the problem (on my machine, the reference is
correctly reported). Looking at the stack trace, I suspect a JDT Core problem.
Moving to JDT Core.
Comment 6 Thomas M??der CLA 2004-04-21 05:01:24 EDT
We tried the original scenario (with Chinese characters) on Dirks machine (with
build 2004-04-20), but it works there, too.
Comment 7 Philipe Mulet CLA 2004-04-21 06:34:22 EDT
Kent - could indexing be affected by encoding ?
Comment 8 Kent Johnson CLA 2004-04-21 11:45:52 EDT
*** Bug 57861 has been marked as a duplicate of this bug. ***
Comment 9 Kent Johnson CLA 2004-04-21 11:46:17 EDT
Was NOT able to reproduce the problem on a Windows XP Chinese machine running 
build M8.

I have been told that several DBCS problems were fixed recently in SWT.

Could you please try again on the latest integration build?
Comment 10 Kent Johnson CLA 2004-04-21 12:50:19 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 
negative? Its initialized as:

    private static int defaultBufferSize = 2048;

Can you run a simple example that uses a BufferedInputStream on your VM?
Comment 11 Cheng xu CLA 2004-04-22 02:23:13 EDT
I've tested BufferedInputStream on my VM and there is no error, following is my 
testing code.

/*IOStreamDemo.java*/
import java.io.*;

public class IOStreamDemo {
  // Throw exceptions to console:
  public static void main(String[] args) 
  throws IOException {
    // Storing & recovering data
    try {
      DataOutputStream out1 =
        new DataOutputStream(
          new BufferedOutputStream(
            new FileOutputStream("Data.txt")));
      out1.writeDouble(3.14159);
      out1.writeUTF("That was pi");
      out1.writeDouble(1.41413);
      out1.writeUTF("Square root of 2");
      out1.close();
      DataInputStream in1 =
        new DataInputStream(
          new BufferedInputStream(
            new FileInputStream("Data.txt")));
      // Must use DataInputStream for data:
      System.out.println(in1.readDouble());
      // Only readUTF() will recover the 
      // Java-UTF String properly:
      System.out.println(in1.readUTF());
      // Read the following double and String:
      System.out.println(in1.readDouble());
      System.out.println(in1.readUTF());
    } catch(EOFException e) {
      System.err.println("End of stream");
    }
  }
}

/*output result:
3.14159
That was pi
1.41413
Square root of 2
*/
Comment 12 Cheng xu CLA 2004-04-22 02:49:54 EDT
The build level which I used is 200404131323.
Comment 13 Philipe Mulet CLA 2004-04-22 06:06:25 EDT
Cheng : can you still reproduce the original problem on latest build ?

Comment 14 Cheng xu CLA 2004-04-22 21:06:26 EDT
I have not found new build on ftp server(ott4f). I am using build 200404131323 
now and the problem exists in that build.
If I get new build I'll verify this problem ASAP.
Comment 15 Kent Johnson CLA 2004-04-23 15:35:27 EDT
Do you have access to other 1.4.x VMs (Sun, IBM... doesn't matter)?

If so can you try to reproduce the problem on those VMs.
Comment 16 Masayuki Fuse CLA 2004-04-26 02:33:47 EDT
I've looked at this with the bscenario of bug 57861 on I20040422. It seems that 
newer version of IBM JVM 1.4.2 and Sun's JVM 1.4.2_03 don't have the error of 
57861.
Comment 17 Cheng xu CLA 2004-04-26 04:27:17 EDT
I've replaced JRE with Sun JRE and this problem does not occur, following is 
the version information of Sun JRE:
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
Comment 18 Kent Johnson CLA 2004-04-26 11:26:21 EDT
We're going to close this since it is confirmed as a VM problem with IBM JDK 
1.4.2 Beta.
Comment 19 Cheng xu CLA 2004-04-26 21:25:30 EDT
Yes, It's a VM problem with IBM JDK 1.4.2 Beta.
Comment 20 Kent Johnson CLA 2004-05-11 10:43:48 EDT
*** Bug 61481 has been marked as a duplicate of this bug. ***
Comment 21 Dan Kehn CLA 2004-05-19 13:58:57 EDT
I tried this on the 5/19 M9 candidate.  This exception occurs with this JVM 
(not beta):

java.vendor=IBM Corporation
java.version=1.4.1
java.vm.info=J2RE 1.4.1 IBM Windows 32 build cn1411-20030930 (JIT enabled: 
jitc)
java.vm.name=Classic VM

Here is the stack trace:


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:444)
	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 22 Kent Johnson CLA 2004-05-25 11:53:53 EDT
*** Bug 63878 has been marked as a duplicate of this bug. ***
Comment 23 Kent Johnson CLA 2004-05-26 09:53:59 EDT
*** Bug 64076 has been marked as a duplicate of this bug. ***
Comment 24 Kent Johnson CLA 2004-06-07 13:32:21 EDT
*** Bug 65769 has been marked as a duplicate of this bug. ***