Skip to content

Commit 224505d

Browse files
committed
Merge some string literals
1 parent 4797d6b commit 224505d

File tree

13 files changed

+32
-32
lines changed

13 files changed

+32
-32
lines changed

src/main/java/org/apache/commons/jxpath/JXPathContext.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ public NodeSet getNodeSetByKey(final String key, final Object value) {
655655
if (manager != null) {
656656
return KeyManagerUtils.getExtendedKeyManager(manager).getNodeSetByKey(this, key, value);
657657
}
658-
throw new JXPathException("Cannot find an element by key - " + "no KeyManager has been specified");
658+
throw new JXPathException("Cannot find an element by key - no KeyManager has been specified");
659659
}
660660

661661
/**
@@ -695,7 +695,7 @@ public Pointer getPointerByID(final String id) {
695695
if (manager != null) {
696696
return manager.getPointerByID(this, id);
697697
}
698-
throw new JXPathException("Cannot find an element by ID - " + "no IdentityManager has been specified");
698+
throw new JXPathException("Cannot find an element by ID - no IdentityManager has been specified");
699699
}
700700

701701
/**
@@ -710,7 +710,7 @@ public Pointer getPointerByKey(final String key, final String value) {
710710
if (manager != null) {
711711
return manager.getPointerByKey(this, key, value);
712712
}
713-
throw new JXPathException("Cannot find an element by key - " + "no KeyManager has been specified");
713+
throw new JXPathException("Cannot find an element by key - no KeyManager has been specified");
714714
}
715715

716716
/**

src/main/java/org/apache/commons/jxpath/ri/EvalContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public JXPathContext getJXPathContext() {
153153
*/
154154
public NodeSet getNodeSet() {
155155
if (position != 0) {
156-
throw new JXPathException("Simultaneous operations: " + "should not request pointer list while " + "iterating over an EvalContext");
156+
throw new JXPathException("Simultaneous operations: should not request pointer list while iterating over an EvalContext");
157157
}
158158
final BasicNodeSet set = new BasicNodeSet();
159159
while (nextSet()) {

src/main/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public class JXPathContextReferenceImpl extends JXPathContext {
9090
}
9191
// DynaBean factory is only registered if BeanUtils are on the classpath
9292
final NodePointerFactory dynaBeanFactory = (NodePointerFactory) allocateConditionally(
93-
"org.apache.commons.jxpath.ri.model.dynabeans." + "DynaBeanPointerFactory", "org.apache.commons.beanutils.DynaBean");
93+
"org.apache.commons.jxpath.ri.model.dynabeans.DynaBeanPointerFactory", "org.apache.commons.beanutils.DynaBean");
9494
if (dynaBeanFactory != null) {
9595
nodeFactories.add(dynaBeanFactory);
9696
}
@@ -219,7 +219,7 @@ public JXPathContextReferenceImpl(final JXPathContext parentContext, final Objec
219219
private void checkSimplePath(final Expression expr) {
220220
if (!(expr instanceof LocationPath) || !((LocationPath) expr).isSimplePath()) {
221221
throw new JXPathInvalidSyntaxException(
222-
"JXPath can only create a path if it uses exclusively " + "the child:: and attribute:: axes and has " + "no context-dependent predicates");
222+
"JXPath can only create a path if it uses exclusively the child:: and attribute:: axes and has no context-dependent predicates");
223223
}
224224
}
225225

src/main/java/org/apache/commons/jxpath/ri/model/NodePointer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ public NodePointer createAttribute(final JXPathContext context, final QName qNam
354354
*/
355355
public NodePointer createChild(final JXPathContext context, final QName qName, final int index) {
356356
throw new JXPathException(
357-
"Cannot create an object for path " + asPath() + "/" + qName + "[" + (index + 1) + "]" + ", operation is not allowed for this type of node");
357+
"Cannot create an object for path " + asPath() + "/" + qName + "[" + (index + 1) + "], operation is not allowed for this type of node");
358358
}
359359

360360
/**
@@ -369,7 +369,7 @@ public NodePointer createChild(final JXPathContext context, final QName qName, f
369369
*/
370370
public NodePointer createChild(final JXPathContext context, final QName qName, final int index, final Object value) {
371371
throw new JXPathException(
372-
"Cannot create an object for path " + asPath() + "/" + qName + "[" + (index + 1) + "]" + ", operation is not allowed for this type of node");
372+
"Cannot create an object for path " + asPath() + "/" + qName + "[" + (index + 1) + "], operation is not allowed for this type of node");
373373
}
374374

375375
/**

src/main/java/org/apache/commons/jxpath/ri/model/beans/PropertyIterator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public PropertyIterator(final PropertyOwnerPointer pointer, final String name, f
5959
startWith = startWith.getImmediateParentPointer();
6060
}
6161
if (startWith == null) {
62-
throw new JXPathException("PropertyIerator startWith parameter is " + "not a child of the supplied parent");
62+
throw new JXPathException("PropertyIerator startWith parameter is not a child of the supplied parent");
6363
}
6464
this.startPropertyIndex = ((PropertyPointer) startWith).getPropertyIndex();
6565
this.startIndex = startWith.getIndex();

src/main/java/org/apache/commons/jxpath/ri/model/beans/PropertyOwnerPointer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public boolean isValidProperty(final QName qName) {
147147
public void remove() {
148148
this.value = null;
149149
if (parent == null) {
150-
throw new UnsupportedOperationException("Cannot remove an object that is not " + "some other object's property or a collection element");
150+
throw new UnsupportedOperationException("Cannot remove an object that is not some other object's property or a collection element");
151151
}
152152
parent.remove();
153153
}
@@ -173,7 +173,7 @@ public void setValue(final Object value) {
173173
}
174174
if (!parent.isContainer()) {
175175
if (index == WHOLE_COLLECTION) {
176-
throw new UnsupportedOperationException("Cannot setValue of an object that is not " + "some other object's property");
176+
throw new UnsupportedOperationException("Cannot setValue of an object that is not some other object's property");
177177
}
178178
throw new JXPathInvalidAccessException("The specified collection element does not exist: " + this);
179179
}

src/main/java/org/apache/commons/jxpath/ri/parser/TokenMgrError.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public static final String addEscapes(final String str) {
113113
protected static String LexicalError(final boolean EOFSeen, final int lexState, final int errorLine, final int errorColumn, final String errorAfter,
114114
final char curChar) {
115115
return "Lexical error at line " + errorLine + ", column " + errorColumn + ". Encountered: "
116-
+ (EOFSeen ? "<EOF> " : "\"" + addEscapes(String.valueOf(curChar)) + "\"" + " (" + (int) curChar + "), ") + "after : \""
116+
+ (EOFSeen ? "<EOF> " : "\"" + addEscapes(String.valueOf(curChar)) + "\" (" + (int) curChar + "), ") + "after : \""
117117
+ addEscapes(errorAfter) + "\"";
118118
}
119119

src/main/java/org/apache/commons/jxpath/servlet/HttpSessionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void setProperty(final Object bean, final String property, final Object v
6767
final HttpSessionAndServletContext handle = (HttpSessionAndServletContext) bean;
6868
final HttpSession session = handle.getSession();
6969
if (session == null) {
70-
throw new JXPathException("Cannot set session attribute: " + "there is no session");
70+
throw new JXPathException("Cannot set session attribute: there is no session");
7171
}
7272
session.setAttribute(property, value);
7373
}

src/main/java/org/apache/commons/jxpath/xml/JDOMParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public JDOMParser() {
3737
@Override
3838
public Object parseXML(final InputStream stream) {
3939
if (!isNamespaceAware()) {
40-
throw new JXPathException("JDOM parser configuration error. JDOM " + "does not support the namespaceAware=false setting.");
40+
throw new JXPathException("JDOM parser configuration error. JDOM does not support the namespaceAware=false setting.");
4141
}
4242
try {
4343
final SAXBuilder builder = new SAXBuilder();

src/test/java/org/apache/commons/jxpath/ri/compiler/VariableTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void testCreateAndSetValuePathDeclareVariableSetCollectionElement() {
5858
// The factory needs to create a collection
5959
assertXPathCreatePathAndSetValue(context, "$stringArray[2]", "Value2", "$stringArray[2]");
6060
// See if the factory populated the first element as well
61-
assertEquals("Value1", context.getValue("$stringArray[1]"), "Created <" + "$stringArray[1]" + ">");
61+
assertEquals("Value1", context.getValue("$stringArray[1]"), "Created <$stringArray[1]>");
6262
}
6363

6464
@Test
@@ -90,7 +90,7 @@ void testCreatePathAndSetValueExpandCollection() {
9090
// Does not involve factory at all - just expands the collection
9191
assertXPathCreatePathAndSetValue(context, "$array[2]", "Value2", "$array[2]");
9292
// Make sure it is still the same array
93-
assertEquals("Value1", context.getValue("$array[1]"), "Created <" + "$array[1]" + ">");
93+
assertEquals("Value1", context.getValue("$array[1]"), "Created <$array[1]>");
9494
}
9595

9696
@Test
@@ -105,7 +105,7 @@ void testCreatePathDeclareVariableSetCollectionElement() {
105105
// The factory needs to create a collection
106106
assertXPathCreatePath(context, "$stringArray[2]", "", "$stringArray[2]");
107107
// See if the factory populated the first element as well
108-
assertEquals("Value1", context.getValue("$stringArray[1]"), "Created <" + "$stringArray[1]" + ">");
108+
assertEquals("Value1", context.getValue("$stringArray[1]"), "Created <$stringArray[1]>");
109109
}
110110

111111
@Test
@@ -131,7 +131,7 @@ void testCreatePathExpandCollection() {
131131
// Does not involve factory at all - just expands the collection
132132
assertXPathCreatePath(context, "$array[2]", "", "$array[2]");
133133
// Make sure it is still the same array
134-
assertEquals("Value1", context.getValue("$array[1]"), "Created <" + "$array[1]" + ">");
134+
assertEquals("Value1", context.getValue("$array[1]"), "Created <$array[1]>");
135135
}
136136

137137
@Test

0 commit comments

Comments
 (0)