ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1056065 - /ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/DelegetingHandler.java
Date Thu, 06 Jan 2011 20:40:47 GMT
Author: hibou
Date: Thu Jan  6 20:40:47 2011
New Revision: 1056065

URL: http://svn.apache.org/viewvc?rev=1056065&view=rev
Log:
cleanup

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/DelegetingHandler.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/DelegetingHandler.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/DelegetingHandler.java?rev=1056065&r1=1056064&r2=1056065&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/DelegetingHandler.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/DelegetingHandler.java Thu Jan  6
20:40:47 2011
@@ -31,10 +31,9 @@ import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.helpers.DefaultHandler;
-import com.sun.xml.internal.rngom.ast.util.LocatorImpl;
 
-
-public class DelegetingHandler implements DTDHandler, ContentHandler, ErrorHandler {
+public class DelegetingHandler extends DefaultHandler implements DTDHandler, ContentHandler,
+        ErrorHandler {
 
     private DelegetingHandler/* <?> */delegate = null;
 
@@ -147,14 +146,7 @@ public class DelegetingHandler implement
         } catch (SAXException e) {
             if (skipOnError) {
                 skip();
-                Locator locator;
-                if (e instanceof SAXParseException) {
-                    locator = new LocatorImpl(null, ((SAXParseException) e).getLineNumber(),
-                            ((SAXParseException) e).getColumnNumber());
-                } else {
-                    locator = getLocator();
-                }
-                log(Message.MSG_ERR, locator, e.getMessage());
+                log(Message.MSG_ERR, e.getMessage());
             } else {
                 throw e;
             }
@@ -519,11 +511,7 @@ public class DelegetingHandler implement
     // //////////////////////
 
     protected void log(int logLevel, String message) {
-        log(logLevel, getLocator(), message);
-    }
-
-    protected void log(int logLevel, Locator/* <?> */locator, String message) {
-        Message.log(logLevel, getLocation(locator) + message);
+        Message.log(logLevel, getLocation(getLocator()) + message);
     }
 
     protected static String getLocation(Locator locator) {
@@ -542,8 +530,8 @@ public class DelegetingHandler implement
         while (!(handlerClassToSkip.isAssignableFrom(handlerToSkip.getClass()))) {
             handlerToSkip = handlerToSkip.getParent();
         }
-        log(Message.MSG_ERR, getLocator(), message + ". The '" + handlerToSkip.getName()
-                + "' element " + getCurrentElementIdentifier() + " is then ignored.");
+        log(Message.MSG_ERR, message + ". The '" + handlerToSkip.getName() + "' element "
+                + getCurrentElementIdentifier() + " is then ignored.");
         handlerToSkip.skip();
     }
 
@@ -578,7 +566,7 @@ public class DelegetingHandler implement
         if (value == null) {
             return defaultValue;
         }
-        return Integer.valueOf(parseInt(name, value));
+        return new Integer(parseInt(name, value));
     }
 
     private int parseInt(String name, String value) throws SAXParseException {
@@ -601,7 +589,7 @@ public class DelegetingHandler implement
         if (value == null) {
             return defaultValue;
         }
-        return Long.valueOf(parseLong(name, value));
+        return new Long(parseLong(name, value));
     }
 
     private long parseLong(String name, String value) throws SAXParseException {



Mime
View raw message