Community
Participate
Working Groups
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.
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?
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?
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.
Created attachment 9744 [details] error log error log
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.
We tried the original scenario (with Chinese characters) on Dirks machine (with build 2004-04-20), but it works there, too.
Kent - could indexing be affected by encoding ?
*** Bug 57861 has been marked as a duplicate of this bug. ***
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?
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?
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 */
The build level which I used is 200404131323.
Cheng : can you still reproduce the original problem on latest build ?
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.
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.
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.
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)
We're going to close this since it is confirmed as a VM problem with IBM JDK 1.4.2 Beta.
Yes, It's a VM problem with IBM JDK 1.4.2 Beta.
*** Bug 61481 has been marked as a duplicate of this bug. ***
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)
*** Bug 63878 has been marked as a duplicate of this bug. ***
*** Bug 64076 has been marked as a duplicate of this bug. ***
*** Bug 65769 has been marked as a duplicate of this bug. ***