Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 716002 - app-portage/java-ebuilder-0.5.1-r1: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
Summary: app-portage/java-ebuilder-0.5.1-r1: Exception in thread "main" java.lang.Arra...
Status: RESOLVED DUPLICATE of bug 906665
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: 2023-05-20 08:01 UTC (History)
1 user (show)

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


Attachments
emerge-info.bz2 (emerge-info.bz2,8.66 KB, application/x-bzip)
2023-05-19 07:18 UTC, Fabio Rossi
Details

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
Comment 1 Volkmar W. Pogatzki 2023-05-18 09:02:19 UTC
Version 0.4.1 is gone. Closing.
Comment 2 Fabio Rossi 2023-05-18 09:06:48 UTC
reopening because the last version is affected as well so the bug report is still valid, changing the title to update version info
Comment 3 Fabio Rossi 2023-05-18 09:08:14 UTC
$ java-ebuilder -c
WARNING: Keywords are used only when generating ebuild.
Parsing portage tree @ /usr/portage ...
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
        at org.gentoo.java.ebuilder.portage.PortageParser.parseEbuild(PortageParser.java:374)
        at org.gentoo.java.ebuilder.portage.PortageParser.parsePackage(PortageParser.java:396)
        at org.gentoo.java.ebuilder.portage.PortageParser.parseCategory(PortageParser.java:240)
        at org.gentoo.java.ebuilder.portage.PortageParser.parseCategories(PortageParser.java:225)
        at org.gentoo.java.ebuilder.portage.PortageParser.parseTree(PortageParser.java:145)
        at org.gentoo.java.ebuilder.Main.refreshCache(Main.java:377)
        at org.gentoo.java.ebuilder.Main.main(Main.java:48)
Comment 4 Volkmar W. Pogatzki 2023-05-19 07:07:58 UTC
Not reproducible here. 
Misisng "emerge --info"
Dupe of bug #906665?
Comment 5 Fabio Rossi 2023-05-19 07:18:03 UTC
Created attachment 861961 [details]
emerge-info.bz2
Comment 6 Volkmar W. Pogatzki 2023-05-20 08:01:08 UTC

*** This bug has been marked as a duplicate of bug 906665 ***