This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jelly.git
The following commit(s) were added to refs/heads/master by this push:
new 5a56b2f4 Flip null test
5a56b2f4 is described below
commit 5a56b2f4c21c828fe8e243b14efbe22ee76963f1
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Jul 5 09:58:49 2026 -0400
Flip null test
---
.../java/org/apache/commons/jelly/tags/core/ArgTag.java | 14 +++++++-------
.../java/org/apache/commons/jelly/tags/core/CaseTag.java | 6 +++---
.../org/apache/commons/jelly/tags/core/DefaultTag.java | 2 +-
.../apache/commons/jelly/tags/core/InvokeStaticTag.java | 4 ++--
.../java/org/apache/commons/jelly/tags/core/InvokeTag.java | 6 +++---
.../java/org/apache/commons/jelly/tags/core/NewTag.java | 2 +-
.../java/org/apache/commons/jelly/tags/core/SwitchTag.java | 2 +-
.../java/org/apache/commons/jelly/test/BaseJellyTest.java | 2 +-
.../apache/commons/jelly/core/TestNamespacePrefixes.java | 2 +-
.../commons/jelly/tags/jetty/JellyResourceHttpHandler.java | 2 +-
.../java/org/apache/commons/jelly/tags/jetty/RealmTag.java | 2 +-
.../apache/commons/jelly/tags/jetty/ResponseBodyTag.java | 2 +-
.../apache/commons/jelly/tags/jetty/ResponseCodeTag.java | 2 +-
.../apache/commons/jelly/tags/jetty/ResponseHeaderTag.java | 4 ++--
.../java/org/apache/commons/jelly/core/BaseJellyTest.java | 2 +-
.../org/apache/commons/jelly/tags/xml/TransformTag.java | 10 +++++-----
16 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/core/src/main/java/org/apache/commons/jelly/tags/core/ArgTag.java
b/core/src/main/java/org/apache/commons/jelly/tags/core/ArgTag.java
index f8fdd835..f6c376e8 100644
--- a/core/src/main/java/org/apache/commons/jelly/tags/core/ArgTag.java
+++ b/core/src/main/java/org/apache/commons/jelly/tags/core/ArgTag.java
@@ -153,14 +153,14 @@ public class ArgTag extends BaseClassLoaderTag {
}
private static Object convert(final Class klass, final Object value)
throws JellyTagException {
- if (null == value) {
+ if (value == null) {
return null;
}
if (klass.isInstance(value)) {
return value;
}
final Converter converter = (Converter) converterMap.get(klass);
- if (null == converter) {
+ if (converter == null) {
throw new JellyTagException("Can't convert " + value + " to " +
klass);
}
try {
@@ -191,7 +191,7 @@ public class ArgTag extends BaseClassLoaderTag {
//-------------------------------------------------------------------------
private void assertNotNull(final Object value) throws JellyTagException {
- if (null == value) {
+ if (value == null) {
throw new JellyTagException("A " + typeString + " instance cannot
be null.");
}
}
@@ -244,7 +244,7 @@ public class ArgTag extends BaseClassLoaderTag {
} catch (final ClassNotFoundException e) {
throw new JellyTagException(e);
}
- } else if (null == value) { // and (by construction) null ==
typeString
+ } else if (value == null) { // and (by construction)
typeString == null
klass = Object.class;
} else {
klass = value.getClass();
@@ -259,7 +259,7 @@ public class ArgTag extends BaseClassLoaderTag {
} catch (final ClassNotFoundException e) {
throw new JellyTagException(e);
}
- } else if (null == value) { // and (by construction) null == typeString
+ } else if (value == null) { // and (by construction) typeString == null
klass = Object.class;
} else {
klass = value.getClass();
@@ -280,7 +280,7 @@ public class ArgTag extends BaseClassLoaderTag {
}
final ArgTagParent parent =
(ArgTagParent)findAncestorWithClass(ArgTagParent.class);
- if (null == parent) {
+ if (parent == null) {
throw new JellyTagException("This tag must be enclosed inside an
ArgTagParent implementation (for example, <new> or <invoke>)");
}
parent.addArgument(klass, value);
@@ -290,7 +290,7 @@ public class ArgTag extends BaseClassLoaderTag {
//-------------------------------------------------------------------------
private boolean isInstanceOf(final Class klass, final Object value) {
- return null == value || klass.isInstance(value);
+ return value == null || klass.isInstance(value);
}
/**
diff --git a/core/src/main/java/org/apache/commons/jelly/tags/core/CaseTag.java
b/core/src/main/java/org/apache/commons/jelly/tags/core/CaseTag.java
index 8a4f5552..0f3273e9 100644
--- a/core/src/main/java/org/apache/commons/jelly/tags/core/CaseTag.java
+++ b/core/src/main/java/org/apache/commons/jelly/tags/core/CaseTag.java
@@ -46,11 +46,11 @@ public class CaseTag extends TagSupport {
@Override
public void doTag(final XMLOutput output) throws
MissingAttributeException, JellyTagException {
- if (null == this.valueExpression) {
+ if (this.valueExpression == null) {
throw new MissingAttributeException("value");
}
final SwitchTag tag =
(SwitchTag)findAncestorWithClass(SwitchTag.class);
- if (null == tag) {
+ if (tag == null) {
throw new JellyTagException("This tag must be enclosed inside a
<switch> tag" );
}
if (tag.hasDefaultBeenEncountered()) {
@@ -58,7 +58,7 @@ public class CaseTag extends TagSupport {
}
final Object value = valueExpression.evaluate(context);
if (tag.isFallingThru() ||
- null == tag.getValue() && null == value ||
+ tag.getValue() == null && value == null ||
tag.getValue() != null && tag.getValue().equals(value)) {
tag.caseMatched();
tag.setFallingThru(fallThru);
diff --git
a/core/src/main/java/org/apache/commons/jelly/tags/core/DefaultTag.java
b/core/src/main/java/org/apache/commons/jelly/tags/core/DefaultTag.java
index eec715b8..032a0b01 100644
--- a/core/src/main/java/org/apache/commons/jelly/tags/core/DefaultTag.java
+++ b/core/src/main/java/org/apache/commons/jelly/tags/core/DefaultTag.java
@@ -45,7 +45,7 @@ public class DefaultTag extends TagSupport {
@Override
public void doTag(final XMLOutput output) throws JellyTagException {
final SwitchTag tag =
(SwitchTag)findAncestorWithClass(SwitchTag.class);
- if (null == tag) {
+ if (tag == null) {
throw new JellyTagException("This tag must be enclosed inside a
<switch> tag" );
}
if (tag.hasDefaultBeenEncountered()) {
diff --git
a/core/src/main/java/org/apache/commons/jelly/tags/core/InvokeStaticTag.java
b/core/src/main/java/org/apache/commons/jelly/tags/core/InvokeStaticTag.java
index 1b9946ed..88947d05 100644
--- a/core/src/main/java/org/apache/commons/jelly/tags/core/InvokeStaticTag.java
+++ b/core/src/main/java/org/apache/commons/jelly/tags/core/InvokeStaticTag.java
@@ -92,7 +92,7 @@ public class InvokeStaticTag extends TagSupport implements
ArgTagParent {
@Override
public void doTag(final XMLOutput output) throws JellyTagException {
try {
- if ( null == methodName) {
+ if ( methodName == null) {
throw new MissingAttributeException( "method" );
}
invokeBody(output);
@@ -114,7 +114,7 @@ public class InvokeStaticTag extends TagSupport implements
ArgTagParent {
throw createLoadClassFailedException(e);
}
catch (final InvocationTargetException e) {
- if (null == exceptionVar) {
+ if (exceptionVar == null) {
throw new JellyTagException("method " + methodName +
" threw exception: "+ e.getTargetException().getMessage(),
e.getTargetException() );
diff --git
a/core/src/main/java/org/apache/commons/jelly/tags/core/InvokeTag.java
b/core/src/main/java/org/apache/commons/jelly/tags/core/InvokeTag.java
index 20b2cd51..b02cdd9d 100644
--- a/core/src/main/java/org/apache/commons/jelly/tags/core/InvokeTag.java
+++ b/core/src/main/java/org/apache/commons/jelly/tags/core/InvokeTag.java
@@ -60,10 +60,10 @@ public class InvokeTag extends TagSupport implements
ArgTagParent {
//-------------------------------------------------------------------------
@Override
public void doTag(final XMLOutput output) throws
MissingAttributeException, JellyTagException {
- if ( null == methodName) {
+ if ( methodName == null) {
throw new MissingAttributeException( "method" );
}
- if ( null == onInstance ) {
+ if ( onInstance == null ) {
throw new MissingAttributeException( "on" );
}
@@ -80,7 +80,7 @@ public class InvokeTag extends TagSupport implements
ArgTagParent {
throw new JellyTagException(e);
}
catch (final InvocationTargetException e) {
- if (null == exceptionVar) {
+ if (exceptionVar == null) {
throw new JellyTagException("method " + methodName + " threw
exception: " + e.getTargetException().getMessage(), e.getTargetException());
}
context.setVariable(exceptionVar,e.getTargetException());
diff --git a/core/src/main/java/org/apache/commons/jelly/tags/core/NewTag.java
b/core/src/main/java/org/apache/commons/jelly/tags/core/NewTag.java
index ad6c7707..2bfa2c85 100644
--- a/core/src/main/java/org/apache/commons/jelly/tags/core/NewTag.java
+++ b/core/src/main/java/org/apache/commons/jelly/tags/core/NewTag.java
@@ -54,7 +54,7 @@ public class NewTag extends BaseClassLoaderTag implements
ArgTagParent {
ArgTag parentArg = null;
if ( var == null ) {
parentArg = (ArgTag)findAncestorWithClass(ArgTag.class);
- if (null == parentArg) {
+ if (parentArg == null) {
throw new MissingAttributeException( "var" );
}
}
diff --git
a/core/src/main/java/org/apache/commons/jelly/tags/core/SwitchTag.java
b/core/src/main/java/org/apache/commons/jelly/tags/core/SwitchTag.java
index c3d87277..3e9058a7 100644
--- a/core/src/main/java/org/apache/commons/jelly/tags/core/SwitchTag.java
+++ b/core/src/main/java/org/apache/commons/jelly/tags/core/SwitchTag.java
@@ -64,7 +64,7 @@ public class SwitchTag extends TagSupport {
this.someCaseMatched = false;
this.fallingThru = false;
- if (null == on) {
+ if (on == null) {
throw new MissingAttributeException("on");
}
value = on.evaluate(context);
diff --git
a/core/src/main/java/org/apache/commons/jelly/test/BaseJellyTest.java
b/core/src/main/java/org/apache/commons/jelly/test/BaseJellyTest.java
index b09cedec..b9927e75 100644
--- a/core/src/main/java/org/apache/commons/jelly/test/BaseJellyTest.java
+++ b/core/src/main/java/org/apache/commons/jelly/test/BaseJellyTest.java
@@ -70,7 +70,7 @@ public abstract class BaseJellyTest extends TestCase {
}
protected void setUpScript(final String scriptname) throws Exception {
final URL url = this.getClass().getResource(scriptname);
- if (null == url) {
+ if (url == null) {
throw new Exception("Could not find Jelly script: " + scriptname +
" in package of class: " + getClass().getName());
}
jelly.setUrl(url);
diff --git
a/core/src/test/java/org/apache/commons/jelly/core/TestNamespacePrefixes.java
b/core/src/test/java/org/apache/commons/jelly/core/TestNamespacePrefixes.java
index 2c2ca7b2..ea1cc404 100644
---
a/core/src/test/java/org/apache/commons/jelly/core/TestNamespacePrefixes.java
+++
b/core/src/test/java/org/apache/commons/jelly/core/TestNamespacePrefixes.java
@@ -65,7 +65,7 @@ public class TestNamespacePrefixes extends BaseJellyTest {
reader = parser.getXMLReader();
final URL url =
this.getClass().getResource("testNamespacePrefixes.xml");
- if (null == url) {
+ if (url == null) {
throw new Exception("Could not find Jelly script:
testNamespacePrefixes.xml in package of class: " + getClass().getName());
}
final InputSource inSrc = new InputSource(new FileReader(new
File(url.getPath())));
diff --git
a/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/JellyResourceHttpHandler.java
b/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/JellyResourceHttpHandler.java
index 2962a987..b2b95e32 100644
---
a/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/JellyResourceHttpHandler.java
+++
b/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/JellyResourceHttpHandler.java
@@ -109,7 +109,7 @@ final class JellyResourceHttpHandler extends
AbstractHttpHandler {
handlerTag.invokeBody(_xmlOutput);
// only call set handled if tag has not requested an override
// if it has requested an override then reset the request
- if (null ==
jellyContext.getVariable(OVERRIDE_SET_HANDLED_VAR)) {
+ if (jellyContext.getVariable(OVERRIDE_SET_HANDLED_VAR) ==
null) {
request.setHandled(true);
response.commit();
} else {
diff --git
a/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/RealmTag.java
b/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/RealmTag.java
index 8dc3a605..bdec5112 100644
---
a/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/RealmTag.java
+++
b/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/RealmTag.java
@@ -55,7 +55,7 @@ public class RealmTag extends TagSupport {
if ( httpserver == null ) {
throw new JellyTagException( "<realm> tag must be enclosed inside
a <server> tag" );
}
- if (null == getName() || null == getConfig()) {
+ if (getName() == null || getConfig() == null) {
throw new JellyTagException( "<realm> tag must have a name and a
config" );
}
diff --git
a/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/ResponseBodyTag.java
b/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/ResponseBodyTag.java
index 6f5bfac2..a395b265 100644
---
a/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/ResponseBodyTag.java
+++
b/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/ResponseBodyTag.java
@@ -42,7 +42,7 @@ public class ResponseBodyTag extends TagSupport {
// get the response from the context
final HttpResponse httpResponse = (HttpResponse)
getContext().getVariable("response");
- if (null == httpResponse) {
+ if (httpResponse == null) {
throw new JellyTagException("HttpResponse variable not available
in Jelly context");
}
diff --git
a/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/ResponseCodeTag.java
b/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/ResponseCodeTag.java
index 7d56c540..83a69e31 100644
---
a/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/ResponseCodeTag.java
+++
b/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/ResponseCodeTag.java
@@ -46,7 +46,7 @@ public class ResponseCodeTag extends TagSupport {
// get the response from the context
final HttpResponse httpResponse = (HttpResponse)
getContext().getVariable("response");
- if (null == httpResponse) {
+ if (httpResponse == null) {
throw new JellyTagException("HttpResponse variable not available
in Jelly context");
}
diff --git
a/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/ResponseHeaderTag.java
b/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/ResponseHeaderTag.java
index 28a3a936..41a59204 100644
---
a/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/ResponseHeaderTag.java
+++
b/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/ResponseHeaderTag.java
@@ -43,13 +43,13 @@ public class ResponseHeaderTag extends TagSupport {
@Override
public void doTag(final XMLOutput xmlOutput) throws JellyTagException {
- if (null == getName()) {
+ if (getName() == null) {
throw new JellyTagException("<responseHeader> tag must have a
name");
}
// get the response from the context
final HttpResponse httpResponse = (HttpResponse)
getContext().getVariable("response");
- if (null == httpResponse) {
+ if (httpResponse == null) {
throw new JellyTagException("HttpResponse variable not available
in Jelly context");
}
diff --git
a/jelly-tags/swing/src/test/java/org/apache/commons/jelly/core/BaseJellyTest.java
b/jelly-tags/swing/src/test/java/org/apache/commons/jelly/core/BaseJellyTest.java
index f4fbd533..5ed4a3dd 100644
---
a/jelly-tags/swing/src/test/java/org/apache/commons/jelly/core/BaseJellyTest.java
+++
b/jelly-tags/swing/src/test/java/org/apache/commons/jelly/core/BaseJellyTest.java
@@ -58,7 +58,7 @@ public abstract class BaseJellyTest extends TestCase {
}
protected void setUpScript(final String scriptname) throws Exception {
final URL url = this.getClass().getResource(scriptname);
- if (null == url) {
+ if (url == null) {
throw new Exception(
"Could not find Jelly script: " + scriptname
+ " in package of class: " + getClass().getName()
diff --git
a/jelly-tags/xml/src/main/java/org/apache/commons/jelly/tags/xml/TransformTag.java
b/jelly-tags/xml/src/main/java/org/apache/commons/jelly/tags/xml/TransformTag.java
index d4ea982f..745e7901 100644
---
a/jelly-tags/xml/src/main/java/org/apache/commons/jelly/tags/xml/TransformTag.java
+++
b/jelly-tags/xml/src/main/java/org/apache/commons/jelly/tags/xml/TransformTag.java
@@ -439,7 +439,7 @@ public class TransformTag extends ParseTag {
}
// pass if we don't have a systemId
- if (null == href) {
+ if (href == null) {
return null;
}
@@ -470,7 +470,7 @@ public class TransformTag extends ParseTag {
final Object xmlReaderSourceObj = this.getXml();
// if no XML source specified then get from body
// otherwise convert it to a SAX source
- if (null == xmlReaderSourceObj) {
+ if (xmlReaderSourceObj == null) {
xmlReader = new TagBodyXMLReader(this);
}
else {
@@ -521,7 +521,7 @@ public class TransformTag extends ParseTag {
@Override
public void doTag(final XMLOutput output) throws
MissingAttributeException, JellyTagException {
- if (null == this.getXslt()) {
+ if (this.getXslt() == null) {
throw new MissingAttributeException("The xslt attribute cannot be
null");
}
@@ -547,7 +547,7 @@ public class TransformTag extends ParseTag {
// handle result differently, depending on if var is specified
final String varName = this.getVar();
- if (null == varName) {
+ if (varName == null) {
// pass the result of the transform out as SAX events
this.transformerHandler.setResult(this.createSAXResult(output));
xmlReader.parse(this.getXMLInputSource());
@@ -647,7 +647,7 @@ public class TransformTag extends ParseTag {
final Object xmlInputSourceObj = this.getXml();
// if no XML source specified then get from tag body
// otherwise convert it to an input source
- if (null == xmlInputSourceObj) {
+ if (xmlInputSourceObj == null) {
xmlInputSource = new TagBodyInputSource();
} else {
xmlInputSource = this.getInputSourceFromObj(xmlInputSourceObj);