Return-Path: X-Original-To: apmail-tapestry-dev-archive@www.apache.org Delivered-To: apmail-tapestry-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C2CE9F6E9 for ; Sat, 1 Jun 2013 01:19:59 +0000 (UTC) Received: (qmail 18170 invoked by uid 500); 1 Jun 2013 01:19:59 -0000 Delivered-To: apmail-tapestry-dev-archive@tapestry.apache.org Received: (qmail 18047 invoked by uid 500); 1 Jun 2013 01:19:59 -0000 Mailing-List: contact commits-help@tapestry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tapestry.apache.org Delivered-To: mailing list commits@tapestry.apache.org Received: (qmail 17707 invoked by uid 99); 1 Jun 2013 01:19:58 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Jun 2013 01:19:58 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 8079289F125; Sat, 1 Jun 2013 01:19:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hlship@apache.org To: commits@tapestry.apache.org Date: Sat, 01 Jun 2013 01:20:02 -0000 Message-Id: <62637d705c5b42158fb34381e8535cf3@git.apache.org> In-Reply-To: <7bc67bc0b3cd45c7b7165812f3b05bfd@git.apache.org> References: <7bc67bc0b3cd45c7b7165812f3b05bfd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [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 Authored: Fri May 31 17:35:40 2013 -0700 Committer: Howard M. Lewis Ship 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 configuration) + public static void provideLessCompilerProblemRenderer(MappedConfiguration configuration) { - configuration.add(AntlrException.class, new ObjectRenderer() + configuration.add(LessCompiler.Problem.class, new ObjectRenderer() { - public void render(AntlrException e, MarkupWriter writer) + public void render(LessCompiler.Problem problem, MarkupWriter writer) { List 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, " - "));