Bug 484566 - NPE in BaseBuilder.abortOnBadSetup
Summary: NPE in BaseBuilder.abortOnBadSetup
Status: RESOLVED FIXED
Alias: None
Product: andmore
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 normal with 1 vote (vote)
Target Milestone: 0.5.1   Edit
Assignee: Kaloyan Raev CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-17 08:07 EST by Andreas Sewe CLA
Modified: 2017-01-25 11:21 EST (History)
1 user (show)

See Also:


Attachments
Unreadable error dialog (18.18 KB, image/png)
2015-12-17 08:07 EST, Andreas Sewe CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Sewe CLA 2015-12-17 08:07:21 EST
Created attachment 258759 [details]
Unreadable error dialog

This happens after a "Failed to load properties file for project 'Foo'" entry in the Error Log. I tried to create an Android Project 'Foo', but the wizard finishes with an unreadable error message (see screenshot). Thereafter I get a (readable) "Problem Occured" dialog for the following error:

java.lang.NullPointerException
	at org.eclipse.andmore.internal.build.builders.BaseBuilder.abortOnBadSetup(BaseBuilder.java:325)
	at org.eclipse.andmore.internal.build.builders.ResourceManagerBuilder.build(ResourceManagerBuilder.java:92)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 David Carver CLA 2015-12-21 14:04:54 EST
Kaloyan when you get a chance can you take a look at this.
Comment 2 Kaloyan Raev CLA 2016-01-04 10:14:49 EST
The problem happens when using the Android Project wizard from MOTODEV.

The empty error dialog appears because of a NPE on this line: https://github.com/eclipse/andmore/blob/develop/andmore-core/plugins/android/src/org/eclipse/andmore/android/utilities/DictionaryUtils.java#L130

The locSchema variable is null, because LocalizationManager.getInstance().getLocalizationSchema(project) return null. This happens because the Android Localization Schema is contributed for the com.android.ide.eclipse.adt.AndroidNature instead for the org.eclipse.andmore.AndroidNature. This contribution is done in the org.eclipse.sequoyah.localization.android plugin.

It seems that when the ADT -> Andmore refactoring was done, the Sequoyah plugins were skipped...

There are several possible ways to fix this problem:

1. Fix the org.eclipse.sequoyah.localization.android plugin to have a correct localization schema contribution for org.eclipse.andmore.AndroidNature. This is an easy code change, but requires a new service version of Sequoyah to be released. I am not sure if there is anyone available to do the releng - the last release is from 2012.

2. Duplicate the org.eclipse.sequoyah.localization.android.AndroidLocalizationSchema class in the Andmore plugins and have the correct contribution from there. Duplicated code means more headaches in future.

3. Reimplement the DictionaryUtils to not use Sequoyah Localization. Perhaps, the cleanest approach, but requires more efforts.

Dave, what's your opinion?
Comment 3 David Carver CLA 2016-01-06 11:05:38 EST
If it is the MOTODev project wizard.  I'd say we remove the Motodev project wizard as it duplicates the functionality of the ADT project wizard.  I didn't see anything in there that was giving anything that the ADT project wizard wasn't doing.

The MOTODev plugins need to be reviewed as several of the wizards overlap. If there are features in them that would be nice to have we should look at migrating that functionality into the existing ADT wizards.
Comment 4 David Carver CLA 2016-01-06 11:07:55 EST
This is probably related to:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=484566

My recommendation is to review the functionality of the Motodev wizards, and if they duplciate what the ADT provided, we go with the ADT wizards.  Sequoyah needs to be reviewed as well, and see if we need it still or can be removed eventually.
Comment 5 David Carver CLA 2016-01-06 11:08:26 EST
Well, crap, that comment went on the wrong bug. :)
Comment 6 Eclipse Genie CLA 2016-12-23 04:03:08 EST
GitHub Pull Request 117 created by [locosmac]
https://github.com/eclipse/andmore/pull/117
Comment 7 David Carver CLA 2017-01-18 13:46:17 EST
Targeting for 0.5.1

PR verfication: https://hudson.eclipse.org/andmore/job/Andmore-Develop-PullRequests/168/
Comment 8 David Carver CLA 2017-01-18 13:47:06 EST
Kaloyan, I'm merging the PR assoicated with this.  If you want to do verification on it after it is merged that would be appreciated.