Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Tanasenko2015-11-24 23:00:08 +0000
committerAnton Tanasenko2015-11-24 23:00:08 +0000
commitf4e789af845f53d1e009b93633079f834dc408ab (patch)
tree795c776b387d61276d618cf341698daba9ab46c7
parent9acc56726e7f355981e93f9c9c145e6b16738921 (diff)
downloadm2e-core-f4e789af845f53d1e009b93633079f834dc408ab.tar.gz
m2e-core-f4e789af845f53d1e009b93633079f834dc408ab.tar.xz
m2e-core-f4e789af845f53d1e009b93633079f834dc408ab.zip
482943 : Fix AIOOBE in dependency scope templates
Change-Id: I9632a66fc033f99be73ef7a97a243fd9af1da072 Signed-off-by: Anton Tanasenko <atg.sleepless@gmail.com>
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java8
1 files changed, 4 insertions, 4 deletions
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 94ce031a..a700d5c6 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
@@ -222,8 +222,8 @@ public enum PomTemplateContext {
if(param.isMap()) {
if(prefix != null && !prefix.trim().isEmpty()) {
- proposals.add(new Template(NLS.bind(Messages.PomTemplateContext_insertParameter, prefix),
- "", getContextTypeId(), "<" + prefix + ">${cursor}</" + prefix + ">", true)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ proposals.add(new Template(NLS.bind(Messages.PomTemplateContext_insertParameter, prefix), "", //$NON-NLS-1$
+ getContextTypeId(), "<" + prefix + ">${cursor}</" + prefix + ">", true)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@@ -860,11 +860,11 @@ public enum PomTemplateContext {
protected static boolean checkAncestors(Node n, String... names) {
int i = 0;
- while(n != null) {
+ while(n != null && i < names.length) {
if(!names[i++ ].equals(n.getNodeName()))
return false;
n = n.getParentNode();
}
- return true;
+ return i == names.length;
}
}

Back to the top