Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bricon2014-07-09 11:01:31 -0400
committerFred Bricon2014-07-09 11:02:09 -0400
commit9363ff10bf03606bbb50e3ea85a76df2bb192804 (patch)
tree50859ff558ebc104e242c63a3d7a998494cff9ac
parent5e88523e8378af0e34745589c9f18f08f60af44b (diff)
downloadm2e-core-9363ff10bf03606bbb50e3ea85a76df2bb192804.tar.gz
m2e-core-9363ff10bf03606bbb50e3ea85a76df2bb192804.tar.xz
m2e-core-9363ff10bf03606bbb50e3ea85a76df2bb192804.zip
439251 : fix NPE in content assist when MojoDescriptor has no parameters
Change-Id: I5d72aeef2b5dfdc2bfcb3065b2dc62f64c8f9041 Signed-off-by: Fred Bricon <fbricon@gmail.com>
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java5
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java3
2 files changed, 6 insertions, 2 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java
index da30c18a..6664ef46 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java
@@ -87,10 +87,11 @@ public class LocalProjectScanner extends AbstractProjectScanner<MavenProjectInfo
monitor.worked(1);
// Don't scan the .metadata folder
- if(!baseDir.exists() || !baseDir.isDirectory() || IMavenConstants.METADATA_FOLDER.equals(baseDir.getName())) {
+ if(!baseDir.exists() || !baseDir.isDirectory() || IMavenConstants.METADATA_FOLDER.equals(baseDir.getName())
+ || ".git".equals(rootRelPath)) {
return;
}
-
+ System.err.println(rootRelPath);
try {
if(scannedFolders.contains(baseDir.getCanonicalFile())) {
return;
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java
index 060ad8a6..9741b2f1 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java
@@ -125,6 +125,9 @@ public enum PomTemplateContext {
HashSet<String> params = new HashSet<String>();
for(MojoDescriptor mojo : mojos) {
List<Parameter> parameters = (List<Parameter>) mojo.getParameters();
+ if(parameters == null || parameters.isEmpty()) {
+ continue;
+ }
for(Parameter parameter : parameters) {
boolean editable = parameter.isEditable();
if(editable) {

Back to the top