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 11367 - NPE in ExternalCompiler
Summary: NPE in ExternalCompiler
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: Other Other
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 11375 11530 (view as bug list)
Depends on: 11436
Blocks: 11036
  Show dependency tree
 
Reported: 2001-04-12 17:57 UTC by Svata Dedic
Modified: 2008-12-22 17:58 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch which fixes the openide side of it (4.37 KB, patch)
2001-04-15 00:45 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Svata Dedic 2001-04-12 17:57:19 UTC
To reproduce: set an external compiler as default, mount a CVS filesystem. 
Remove one of CVS-managed sources locally. Try to compile the file or its 
package.
I remember that something was adjusted in NbClassPath when it was about to 
return a File from a FileObject although the file didn't exist in OS' 
filesystem. It seems that now toFile() returns null from such requests.

The stacktrace is short, I'm puttin it right here:

java.lang.NullPointerException 
	at 
org.openide.compiler.ExternalCompiler$4.getFileName(ExternalCompiler.java:310)
        at 
org.openide.compiler.ExternalCompiler.getFileName(ExternalCompiler.java:362)
        at 
org.openide.compiler.ExternalCompilerGroup.start(ExternalCompilerGroup.java:228)
        at 
org.netbeans.modules.java.JExternalCompilerGroup.start(JExternalCompilerGroup.java:134)
[catch] at 
org.netbeans.core.compiler.CompilationEngineImpl$CompilerThread$GroupCompiler.run(CompilationEngineImpl.java:257)
Comment 1 Jesse Glick 2001-04-13 12:32:04 UTC
It seems that the old behavior was wrong: if the file was not checked out to
disk, you would not want to include it in an external compiler command, as the
command would not work. (Do you want to get an error from the compiler? Probably
so; this would be a bigger change to the external compiler.) I believe the new
behavior of NbClassPath.toFile is correct; ExternalCompiler should return "" as
the java.io.File name in this case, and the compiler group will quietly skip
that entry. I will prepare a fix this way.
Comment 2 Jesse Glick 2001-04-15 00:45:30 UTC
Created attachment 1118 [details]
Patch which fixes the openide side of it
Comment 3 Svata Dedic 2001-04-15 08:40:17 UTC
I will adjust the JavaExternalCompiler(Group) implementation so it prints out 
some meaningful error message in this case. Ideally, the message will be from 
the exception thrown from FileObject.getInputStream() so - in case of vcs 
filesystem - the user get a clue about what she should do.
Comment 4 Svata Dedic 2001-04-17 13:50:06 UTC
In the cast that NbClassPath.toFile() returns null, would it be possible to 
call fileobject.getInputStream() to obtain a specific message(s) from the VCS ?

Comment 5 Jesse Glick 2001-04-17 20:58:55 UTC
Fixed in the trunk, will merge to release32 (after #11436 however).

To Svata: yes, it would be better to try to get the input stream and check for
messages that way. I will try to do this in the trunk version, not for 3.2 (too
complicated, not important enough).

openide/src/org/openide/compiler/Bundle.properties 1.13
openide/src/org/openide/compiler/ExternalCompiler.java 1.33
Comment 6 Jesse Glick 2001-04-17 22:34:45 UTC
*** Issue 11375 has been marked as a duplicate of this issue. ***
Comment 7 Jesse Glick 2001-04-18 17:33:48 UTC
Fixed in release32.
Comment 8 Svata Dedic 2001-04-18 18:56:11 UTC
*** Issue 11530 has been marked as a duplicate of this issue. ***
Comment 9 Jan Chalupa 2001-05-06 08:21:29 UTC
Target milestone -> 3.2
Comment 10 Quality Engineering 2003-07-01 16:03:35 UTC
Resolved for 3.4.x or earlier, no new info since then -> verified
Comment 11 Quality Engineering 2003-07-01 16:23:27 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.