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 252787 - Inexplicable error prompt during coding.
Summary: Inexplicable error prompt during coding.
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-04 06:17 UTC by rickqin
Modified: 2015-08-04 12:01 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
<no description> (37.94 KB, image/png)
2015-06-04 06:19 UTC, rickqin
Details
<no description> (10.39 KB, image/png)
2015-06-04 06:19 UTC, rickqin
Details
<no description> (29.16 KB, image/png)
2015-06-04 06:19 UTC, rickqin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rickqin 2015-06-04 06:17:58 UTC
Product Version = NetBeans IDE 8.0.2 (Build 201411181905)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_45
Runtime = Java HotSpot(TM) 64-Bit Server VM 24.45-b08

There's a pure java class Utils.class, and I just added a snippet of code inside. Please refer to the screenshot.
In the code there're several obvious mistakes, and yes the IDE reports the error in Project perspective as the class Utils.class has a problem "ERROR parsing file".
But in the snippet of code, nothing comes out. I supposed that there should be some tips or prompt that would have given me the advice to correct mistakes.

I think that it is a problem due to the inconsistency between java code editor and other perspectives on processing error information.

Sorry for my bad English expression, I hope the screenshot will be more helpful than my bad description.

Best regards,
Rick
Comment 1 rickqin 2015-06-04 06:19:38 UTC
Created attachment 154043 [details]
<no description>
Comment 2 rickqin 2015-06-04 06:19:46 UTC
Created attachment 154044 [details]
<no description>
Comment 3 rickqin 2015-06-04 06:19:54 UTC
Created attachment 154045 [details]
<no description>
Comment 4 Svata Dedic 2015-06-04 11:02:09 UTC
Not a P2; does not block/prevent use of a major feature.

I looked at the screenshots - are you sure the source file really contains compile errors ? What do the white-marked areas mean (I couldn't see any errors in that portion of the source).

Why I am asking - similar errors are already reported, but so far the IDE always marked the source file although it i fact does NOT contain any errors. If unsure, hit Compile | Compile File, which should ultimately say whether the source is OK or not.
Comment 5 rickqin 2015-06-04 12:49:47 UTC
Hi Svata,

Thanks for correcting for Priority category.

Let me specify this problem a little bit.

This is a maven2 project, it is built by Maven.

I'm absolutely sure that there must be several compile errors contained in this method "openFolder()".

1. The statement "throw new FileNotFoundException(...)" is an explicit Exception throwing operation, the IDE would have HIGHLIGHTED the statement with RED and prompted me something like "unreported exception FileNotFoundException; must be caught or declared to be thrown". 

We usually need to add a piece of code like "throws FileNotFoundException" just like the following code:

      "public static void openFolder(File file) throws FileNotFoundException {"

2. The statement "Desktop.getDesktop().open(dir);" the situation should be the same as above. The method ".open(dir)" need a "try-catch" block surrounded.
The content below comes from the console during maven clean and build the whole project:
    ...unrelated information omitted...
    --- maven-compiler-plugin:2.3.2:compile (default-compile) @ LPTool ---
    Compiling 37 source files to C:\Workspace\Projects\LPToolBranches\1141-snapshot\target\classes
    -------------------------------------------------------------
    COMPILATION ERROR : 
    -------------------------------------------------------------
    lptool/util/Utils.java:[225,16] unreported exception java.io.FileNotFoundException;must be caught or declared to be thrown;
    lptool/util/Utils.java:[233,37] unreported exception java.io.IOException;must be caught or declared to be thrown;
    2 errors 
    -------------------------------------------------------------
    ------------------------------------------------------------------------
    BUILD FAILURE

This issue doesn't come very often. If you need more information about this issue, please let me know. I'd like always to help you guys with improving Netbeans.

Best regards,
Rick
Comment 6 Svata Dedic 2015-06-04 13:36:15 UTC
My bad; I didn't notice the undeclared checked exception. In that case, it's different from the other issues. I'll try to recreate the situation with a small maven project.
Comment 7 Svata Dedic 2015-08-04 12:01:19 UTC
Sorry, I recreated a snippet just like on the screenshot, but editor correctly reports exceptions thrown but not declared. Could you please extract some small part of your code, which still exhibits the defect ? Thanks.