You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2013/06/01 03:20:02 UTC

[5/7] git commit: Use the common Problem base interface for reporting Less compilation errors

Use the common Problem base interface for reporting Less compilation errors


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/795c38f1
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/795c38f1
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/795c38f1

Branch: refs/heads/master
Commit: 795c38f17e858caa39567ae3fa54be3039247e49
Parents: 650ddd5
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Fri May 31 17:35:40 2013 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Fri May 31 17:35:40 2013 -0700

----------------------------------------------------------------------
 .../tapestry5/wro4j/modules/WRO4JModule.java       |   19 ++++++++-------
 1 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/795c38f1/tapestry-wro4j/src/main/java/org/apache/tapestry5/wro4j/modules/WRO4JModule.java
----------------------------------------------------------------------
diff --git a/tapestry-wro4j/src/main/java/org/apache/tapestry5/wro4j/modules/WRO4JModule.java b/tapestry-wro4j/src/main/java/org/apache/tapestry5/wro4j/modules/WRO4JModule.java
index fa286ee..ac02015 100644
--- a/tapestry-wro4j/src/main/java/org/apache/tapestry5/wro4j/modules/WRO4JModule.java
+++ b/tapestry-wro4j/src/main/java/org/apache/tapestry5/wro4j/modules/WRO4JModule.java
@@ -14,6 +14,7 @@
 
 package org.apache.tapestry5.wro4j.modules;
 
+import com.github.sommeri.less4j.LessCompiler;
 import com.github.sommeri.less4j.core.parser.AntlrException;
 import org.apache.tapestry5.MarkupWriter;
 import org.apache.tapestry5.SymbolConstants;
@@ -110,31 +111,31 @@ public class WRO4JModule
      */
     @Contribute(ObjectRenderer.class)
     @Primary
-    public static void provideLessErrorRenderers(MappedConfiguration<Class, ObjectRenderer> configuration)
+    public static void provideLessCompilerProblemRenderer(MappedConfiguration<Class, ObjectRenderer> configuration)
     {
-        configuration.add(AntlrException.class, new ObjectRenderer<AntlrException>()
+        configuration.add(LessCompiler.Problem.class, new ObjectRenderer<LessCompiler.Problem>()
         {
-            public void render(AntlrException e, MarkupWriter writer)
+            public void render(LessCompiler.Problem problem, MarkupWriter writer)
             {
                 List<String> strings = CollectionFactory.newList();
 
-                if (InternalUtils.isNonBlank(e.getMessage()))
+                if (InternalUtils.isNonBlank(problem.getMessage()))
                 {
-                    strings.add(e.getMessage());
+                    strings.add(problem.getMessage());
                 }
 
                 // Inside WRO4J we see that the LessSource is a StringSource with no useful toString(), so
                 // it is omitted. We may need to create our own processors, stripping away a couple of layers of
                 // WRO4J to get proper exception reporting!
 
-                if (e.getLine() > 0)
+                if (problem.getLine() > 0)
                 {
-                    strings.add("line " + e.getLine());
+                    strings.add("line " + problem.getLine());
                 }
 
-                if (e.getCharacter() > 0)
+                if (problem.getCharacter() > 0)
                 {
-                    strings.add("position " + e.getCharacter());
+                    strings.add("position " + problem.getCharacter());
                 }
 
                 writer.write(InternalUtils.join(strings, " - "));