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 262787 - IllegalStateException is being logged unnecessarily
Summary: IllegalStateException is being logged unnecessarily
Status: STARTED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP Parser (show other bugs)
Version: 8.2
Hardware: PC Mac OS X
: P4 normal (vote)
Assignee: issues@javaee
URL:
Keywords: PATCH_AVAILABLE
Depends on:
Blocks:
 
Reported: 2016-07-13 07:26 UTC by brettryan
Modified: 2016-07-20 21:13 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch to correct not log exceptions (2.23 KB, patch)
2016-07-13 07:50 UTC, brettryan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description brettryan 2016-07-13 07:26:59 UTC
Illegal state exceptions are being logged (not thrown) unnecessarily during the JSP parsing phase. In this case it appears to be related to [1](issue:262780) where spaces in the path of the IDE installed taglib libraries cause java.net.URISyntaxException.


 [1]: https://netbeans.org/bugzilla/show_bug.cgi?id=262780
Comment 1 brettryan 2016-07-13 07:50:08 UTC
Created attachment 160361 [details]
Patch to correct not log exceptions

I've also removed the deprecated call deprecated DataObject#getCookie.
Comment 2 emi 2016-07-13 09:19:03 UTC
You mention the exception is not thrown but what you are actually doing is removing the log call and ignoring that null-null situation. (A minimal patch would just remove the Logger.getLogger line).

Why do you believe this is not important?

Aren't you hiding some potential relevant debugging info for an unknown situation?

I think what's interesting here is the underlying situation that is causing on your machine enough of these messages that you felt like providing a patch.

Is the fix for 262780 incomplete perhaps?

Also, should we lower the level perhaps?

If you don't want to see those messages, you could also edit your netbeans.conf and add -J-Dname.of.the.Logger.level=$LEVEL$
Comment 3 brettryan 2016-07-14 00:56:38 UTC
(In reply to emi from comment #2)
> You mention the exception is not thrown but what you are actually doing is
> removing the log call and ignoring that null-null situation. (A minimal
> patch would just remove the Logger.getLogger line).

That's correct, and effectively what I have done. As the null check contained a `return` statement this was simplified by adding an `else if` to (1) make the intent clearer and (2) preserve behaviour.

> Why do you believe this is not important?

It is simply unnecessary. As a point the logged error is informational, if anything it should be a debug message. There's no hint in the logged message as to the cause or any way of tracking this down in the first place. The question should be "what does the logged statement achieve?".

> Aren't you hiding some potential relevant debugging info for an unknown
> situation?

As it stands, there's not much the logged exception provides and gives the false impression there is something wrong, which; there probably is, but it's not traceable from this point. At present this is occurring every time I open a JSP in Build 20160712-16457b922100.

java.lang.IllegalStateException
	at org.netbeans.modules.web.core.jsploader.BaseJspEditorSupport$4.propertyChange(BaseJspEditorSupport.java:190)
	at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
	at org.openide.text.CloneableEditorSupport.firePropertyChange(CloneableEditorSupport.java:484)
	at org.openide.text.CloneableEditorSupport.fireDocumentChange(CloneableEditorSupport.java:1778)
	at org.openide.text.DocumentOpenClose$DocumentClose.run(DocumentOpenClose.java:999)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)


> I think what's interesting here is the underlying situation that is causing
> on your machine enough of these messages that you felt like providing a
> patch.

This occurs for opening any JSP file where a taglib is referenced int he JSP that points to the local jar within the NetBeans IDE installation. As default copies are installed in paths that contain spaces the exceptions do add up.

Yes, it's a simple and low priority patch, but I did think it helpful.

> Is the fix for 262780 incomplete perhaps?

Indeed, as no fix presently exists. I first submitted this one while I will soon be providing a patch for 262780. The fix for 262780 will correctly return the File object with spaces of the correct scheme (space for `file`, %20 for others).

> Also, should we lower the level perhaps?

My bad, I thought I raised as P4, didn't mean it to be any higher.

> If you don't want to see those messages, you could also edit your
> netbeans.conf and add -J-Dname.of.the.Logger.level=$LEVEL$

That's the point, this message is "info", if anything it should be "debug" if it absolutely must remain.
Comment 4 brettryan 2016-07-14 02:39:43 UTC
I have supplied a patch to [1] (issue: 262780) which I can confirm was the cause of this exception being thrown.

However, I still feel this issue is still valid as while related does not indicate within the logged info message of the relationship.

 [1]: https://netbeans.org/bugzilla/show_bug.cgi?id=262780