You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by st...@apache.org on 2011/08/22 23:10:13 UTC
svn commit: r1160438 -
/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/xpointer/ShorthandPart.java
Author: stevendolg
Date: Mon Aug 22 21:10:13 2011
New Revision: 1160438
URL: http://svn.apache.org/viewvc?rev=1160438&view=rev
Log:
Fixed modifier order and boolean expression complexity
Modified:
cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/xpointer/ShorthandPart.java
Modified: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/xpointer/ShorthandPart.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/xpointer/ShorthandPart.java?rev=1160438&r1=1160437&r2=1160438&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/xpointer/ShorthandPart.java (original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/xpointer/ShorthandPart.java Mon Aug 22 21:10:13 2011
@@ -34,11 +34,11 @@ import org.xml.sax.SAXException;
*/
public final class ShorthandPart extends AbstractPointerPart {
- private final static String XMLNS_NAMESPACE_98 = "http://www.w3.org/XML/1998/namespace";
+ private static final String XMLNS_NAMESPACE_98 = "http://www.w3.org/XML/1998/namespace";
- private final static String XMLNS_NAMESPACE_00 = "http://www.w3.org/2000/xmlns/";
+ private static final String XMLNS_NAMESPACE_00 = "http://www.w3.org/2000/xmlns/";
- private final static String ID = "id";
+ private static final String ID = "id";
private final String shorthand;
@@ -126,10 +126,12 @@ public final class ShorthandPart extends
String attributeName = atts.getLocalName(i);
String attributeValue = atts.getValue(i);
- if ((attributeURI == null
+ final boolean isCorrectNamespace = attributeURI == null
|| attributeURI.length() == 0
|| XMLNS_NAMESPACE_98.equals(attributeURI)
- || XMLNS_NAMESPACE_00.equals(attributeURI))
+ || XMLNS_NAMESPACE_00.equals(attributeURI);
+
+ if (isCorrectNamespace
&& ID.equalsIgnoreCase(attributeName)
&& this.shorthand.equals(attributeValue)) {
this.matching = true;