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 232004 - NullPointerException at org.eclipse.jgit.transport.RefSpec.<init>
Summary: NullPointerException at org.eclipse.jgit.transport.RefSpec.<init>
Status: RESOLVED WONTFIX
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-28 16:20 UTC by misterm
Modified: 2013-07-01 14:52 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 201776


Attachments
stacktrace (2.58 KB, text/plain)
2013-06-28 16:20 UTC, misterm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description misterm 2013-06-28 16:20:41 UTC
Build: NetBeans IDE Dev (Build 20130628-216d1bc31969)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.3-b01, Java(TM) SE Runtime Environment, 1.7.0_07-b11
OS: Windows 7

User Comments:
misterm: Git -> Pull from Upstream...

misterm: .




Stacktrace: 
java.lang.NullPointerException
   at org.eclipse.jgit.transport.RefSpec.<init>(RefSpec.java:125)
   at org.eclipse.jgit.transport.RemoteConfig.<init>(RemoteConfig.java:186)
   at org.eclipse.jgit.transport.RemoteConfig.getAllRemoteConfigs(RemoteConfig.java:124)
   at org.netbeans.libs.git.jgit.commands.GetRemotesCommand.run(GetRemotesCommand.java:72)
   at org.netbeans.libs.git.jgit.commands.GitCommand.execute(GitCommand.java:72)
   at org.netbeans.libs.git.GitClient.getRemotes(GitClient.java:678)
Comment 1 misterm 2013-06-28 16:20:42 UTC
Created attachment 136474 [details]
stacktrace
Comment 2 misterm 2013-06-28 16:22:51 UTC
I've figured out I had a line with:

fetch = 

but still the IDE is not supposed to throw a NPE.
Comment 3 Ondrej Vrabec 2013-06-28 16:26:43 UTC
Any steps to reproduce? Did you make any manual changes to .git/config file? What did you select in both pull wizard's panels?
Comment 4 Ondrej Vrabec 2013-06-28 16:27:41 UTC
(In reply to comment #2)
> I've figured out I had a line with:
> fetch = 
ok, thanks
Comment 5 Ondrej Vrabec 2013-07-01 08:29:02 UTC
Sorry, wontfix. The exception does not come from NetBeans but from the JGit library we use as a client implementation, it does not expect "fetch=" in .git/config. I could catch the exception and show some pretty user-friendly dialog but i don't think it's a good idea. This way i could pollute our code in many places where a NPE could occur and in time it would become unmaintainable. Besides i don't think catching a NPE is a good practice.
You manually edited the config file, be prepared for unexpected situations. If you still think it should be fixed you can file a bug to JGit itself, but honestly i doubt they will be eager to change their parsing algorithm to avoid this. The relevant code is: http://git.eclipse.org/c/jgit/jgit.git/tree/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java?id=v2.3.1.201302201838-r#n1239 where "null" is returned when the read value is empty
Comment 6 misterm 2013-07-01 14:52:08 UTC
(In reply to comment #5)
> You manually edited the config file, be prepared for unexpected situations. 

Fair enough, I will file a bug for the reason I had to edit the config file, which makes more sense.