Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 716002 - app-portage/java-ebuilder-0.4.1: Exception in thread "main" java.lang.NullPointerException
Summary: app-portage/java-ebuilder-0.4.1: Exception in thread "main" java.lang.NullPoi...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Benda Xu
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-03 08:45 UTC by Fabio Rossi
Modified: 2020-04-03 18:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Rossi 2020-04-03 08:45:16 UTC
When running the tool as normal user, I get the following exception:

$ java-ebuilder -c
Parsing portage tree @ /usr/portage ...
Exception in thread "main" java.lang.NullPointerException
	at org.gentoo.java.ebuilder.portage.PortageParser.parseCategory(PortageParser.java:236)
	at org.gentoo.java.ebuilder.portage.PortageParser.parseCategories(PortageParser.java:222)
	at org.gentoo.java.ebuilder.portage.PortageParser.parseTree(PortageParser.java:143)
	at org.gentoo.java.ebuilder.Main.refreshCache(Main.java:345)
	at org.gentoo.java.ebuilder.Main.main(Main.java:47)

This is due to the fact the array passed to the for loop is not empty list but a NULL pointer, on my system it happens when trying to inspect /usr/portage/packages which has the following mode bits: 

drwx------ 106 portage portage 4096  3 apr 10.08 /usr/portage/packages/

If the user is thought to be run as root the tool should check for the user id otherwise the array iteration should be fixed