From 4ca68a076014211f6e6b7458582ec011c8750dbc Mon Sep 17 00:00:00 2001 From: Tako Schotanus Date: Sun, 10 Jul 2016 13:51:57 +0200 Subject: [PATCH] Fixed #6367 Deprecate maven imports without namespace --- .../ceylon/compiler/typechecker/analyzer/ModuleVisitor.java | 3 +++ .../redhat/ceylon/compiler/typechecker/analyzer/Warning.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/typechecker/src/com/redhat/ceylon/compiler/typechecker/analyzer/ModuleVisitor.java b/typechecker/src/com/redhat/ceylon/compiler/typechecker/analyzer/ModuleVisitor.java index e2a259e6b94..91755e402b4 100644 --- a/typechecker/src/com/redhat/ceylon/compiler/typechecker/analyzer/ModuleVisitor.java +++ b/typechecker/src/com/redhat/ceylon/compiler/typechecker/analyzer/ModuleVisitor.java @@ -333,6 +333,9 @@ else if (that.getQuotedLiteral()!=null) { namespace = ModuleUtil.getNamespaceFromUri(nameString); name = asList(ModuleUtil.getModuleNameFromUri(nameString).split("\\.")); node = that.getQuotedLiteral(); + if ("maven".equals(namespace) && !nameString.startsWith("maven:")) { + node.addUsageWarning(Warning.missingImportPrefix, "use of old style Maven imports is deprecated, prefix with 'maven:'"); + } } else { namespace = null; diff --git a/typechecker/src/com/redhat/ceylon/compiler/typechecker/analyzer/Warning.java b/typechecker/src/com/redhat/ceylon/compiler/typechecker/analyzer/Warning.java index 4257e0e24de..9dda4e554e9 100644 --- a/typechecker/src/com/redhat/ceylon/compiler/typechecker/analyzer/Warning.java +++ b/typechecker/src/com/redhat/ceylon/compiler/typechecker/analyzer/Warning.java @@ -24,5 +24,6 @@ public enum Warning { disjointEquals, disjointContainment, redundantNarrowing, - redundantIteration + redundantIteration, + missingImportPrefix } \ No newline at end of file