Skip to content

Commit

Permalink
small refactor: define/use a constant to clarify its usage
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/pivot/trunk@1623361 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Sandro Martini committed Sep 8, 2014
1 parent d571981 commit 39c3200
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/org/apache/pivot/beans/BXMLSerializer.java
Expand Up @@ -243,6 +243,7 @@ public Object evaluate(final Object value) {
public static final char URL_PREFIX = '@';
public static final char RESOURCE_KEY_PREFIX = '%';
public static final char OBJECT_REFERENCE_PREFIX = '$';
public static final char SLASH_PREFIX = '/';

public static final String NAMESPACE_BINDING_PREFIX = OBJECT_REFERENCE_PREFIX + "{";
public static final String NAMESPACE_BINDING_SUFFIX = "}";
Expand Down Expand Up @@ -855,7 +856,7 @@ private void processStartElement() throws IOException, SerializationException {

// Determine location from src attribute
URL locationLocal;
if (src.charAt(0) == '/') {
if (src.charAt(0) == SLASH_PREFIX) {
locationLocal = classLoader.getResource(src.substring(1));
} else {
locationLocal = new URL(this.location, src);
Expand Down Expand Up @@ -1327,7 +1328,7 @@ private void processEndElement() throws SerializationException {

try {
URL scriptLocation;
if (src.charAt(0) == '/') {
if (src.charAt(0) == SLASH_PREFIX) {
scriptLocation = classLoader.getResource(src.substring(1));
} else {
scriptLocation = new URL(location, src);
Expand Down

0 comments on commit 39c3200

Please sign in to comment.