This is an automated email from the git hooks/post-receive script. New commit to branch feature/3880-java8-api-scan in repository i18n. See http://git.nuiton.org/i18n.git commit b0a494e027d1ec67e1a9dc29f4505ec03a8d27bf Author: Eric Chatellier <chatellier@codelutin.com> Date: Mon Feb 22 15:09:30 2016 +0100 refs #3880: Fix file where method FQN can't be determined --- .../i18n/plugin/parser/impl/ParserGWTJavaMojo.java | 1 - .../i18n/plugin/parser/impl/ParserJavaMojo.java | 54 ++++++++++++---------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserGWTJavaMojo.java b/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserGWTJavaMojo.java index f2faf0d..7b86245 100644 --- a/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserGWTJavaMojo.java +++ b/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserGWTJavaMojo.java @@ -234,7 +234,6 @@ public class ParserGWTJavaMojo extends AbstractI18nParserMojo { boolean match = false; TypeNameContext typeName = ctx.typeName(); - System.out.println("typeName " + typeName); String childText = typeName.getText(); if (annotationPrefix.contains(childText)) { // key is argument 1 of child 2 diff --git a/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserJavaMojo.java b/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserJavaMojo.java index 763a2df..7eeb533 100755 --- a/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserJavaMojo.java +++ b/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserJavaMojo.java @@ -216,7 +216,7 @@ public class ParserJavaMojo extends AbstractI18nParserMojo { MethodNameContext mnc = ctx.methodName(); TerminalNode tn = ctx.Identifier(); TypeNameContext tnc = ctx.typeName(); - + Void aVoid = null; if (!visitMethod(list, mnc, tn, tnc)) { // continue visit @@ -226,34 +226,38 @@ public class ParserJavaMojo extends AbstractI18nParserMojo { } protected boolean visitMethod(ArgumentListContext list, MethodNameContext mnc, TerminalNode tn, TypeNameContext tnc) { - String methodName = mnc != null ? mnc.getText() : - tnc.getText() + "." + tn.getText(); boolean match = false; - if (simpleI18nMethodPrefix.contains(methodName)) { - // key is argument 1 of child 2 - ExpressionContext argument = list.expression(0); - String firstArgs = argument.getText(); - if (firstArgs.matches("^\"[^\"]+\"$")) { - String key = firstArgs.substring(1).substring(0, firstArgs.length() - 2); - if (getLog().isDebugEnabled()) { - getLog().debug(file.getName() + " detected key = " + key); + + if (mnc != null || (tnc != null && tn != null)) { + String methodName = mnc != null ? mnc.getText() : + tnc.getText() + "." + tn.getText(); + + if (simpleI18nMethodPrefix.contains(methodName)) { + // key is argument 1 of child 2 + ExpressionContext argument = list.expression(0); + String firstArgs = argument.getText(); + if (firstArgs.matches("^\"[^\"]+\"$")) { + String key = firstArgs.substring(1).substring(0, firstArgs.length() - 2); + if (getLog().isDebugEnabled()) { + getLog().debug(file.getName() + " detected key = " + key); + } + ParserJavaMojo.JavaFileParser.this.registerKey(key); + match = true; } - ParserJavaMojo.JavaFileParser.this.registerKey(key); - match = true; - } - - } else if (complexI18nMethodPrefix.contains(methodName)) { - // key is argument 2 of child 2 - ExpressionContext argument = list.expression(1); - String firstArgs = argument.getText(); - if (firstArgs.matches("^\"[^\"]+\"$")) { - String key = firstArgs.substring(1).substring(0, firstArgs.length() - 2); - if (getLog().isDebugEnabled()) { - getLog().debug(file.getName() + " detected key = " + key); + + } else if (complexI18nMethodPrefix.contains(methodName)) { + // key is argument 2 of child 2 + ExpressionContext argument = list.expression(1); + String firstArgs = argument.getText(); + if (firstArgs.matches("^\"[^\"]+\"$")) { + String key = firstArgs.substring(1).substring(0, firstArgs.length() - 2); + if (getLog().isDebugEnabled()) { + getLog().debug(file.getName() + " detected key = " + key); + } + ParserJavaMojo.JavaFileParser.this.registerKey(key); + match = true; } - ParserJavaMojo.JavaFileParser.this.registerKey(key); - match = true; } } -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.