This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 212752 - Error when there is string bigged than 65534 bytes
Summary: Error when there is string bigged than 65534 bytes
Status: RESOLVED INVALID
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.1.2
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-20 20:45 UTC by seslavlazarov
Modified: 2012-06-01 08:26 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description seslavlazarov 2012-05-20 20:45:01 UTC
Product Version = NetBeans IDE 7.1.2 (Build 201204101705)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.7.0_03
Runtime = Java HotSpot(TM) Client VM 22.1-b02

If I have string with size is more than 65534 bytes the file is marked as it has error,  and when i start the program i receive the following error - "Error: Could not find or load main class...";

The project is Java Application

Regards,
Seslav
Comment 1 Tomas Zezula 2012-05-23 12:03:59 UTC
The Java string literal size has to be less than 0xFFFF.
See: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4.7
Comment 2 seslavlazarov 2012-05-31 18:44:48 UTC
Can you add proper error message?

Regards,
Seslav Lazarov
Comment 4 seslavlazarov 2012-05-31 20:26:06 UTC
On the file in the project tree there is an error message that says: "Error parsing file";

The other message appears when I run the program here is quotation:
"run:
Error: Could not find or load main class ..............
Java Result: 1
BUILD SUCCESSFUL (total time: 4 seconds)"


There is no error message in the editor.

Is it possible to put an error message in the editor?
Comment 5 Tomas Zezula 2012-05-31 21:03:35 UTC
The "Error parsing file" in the Project's View  is a generic mark that the file contains 1 or more errors.
The detailed list of these errors can be seen in Task List (Action Items).

The "Could not find or load main class javaapplication4.JavaApplication4" probably can be changed by repair by throwing RuntimeException containing the "constant string too long" as it's in the Task List.

Unfortunately editor cannot show the message, at least without performance penalty. The error is reported in generate phase of the compiler (assembling of class file) the editor ends in flow phase it does not try to generate the file. The "class" file is generated when you save the source file and it updates the Task List.
Comment 6 seslavlazarov 2012-05-31 21:38:25 UTC
I saw the error in the Task List, I'm not using that feature very often that is why I didn't saw it earlier.

I think would be good if you can change that error message (Could not find or load main class javaapplication4.JavaApplication4) because it does not tells you what the problem is or how to fix it or even on which line the problem is.

Thanks for the information.

Regards,
Seslav.
Comment 7 Tomas Zezula 2012-06-01 08:26:18 UTC
>I think would be good if you can change that error message (Could not find or load main class javaapplication4.JavaApplication4)
OK, filled as http://netbeans.org/bugzilla/show_bug.cgi?id=213359