PMD optimization.
This commit is contained in:
parent
8767f5239c
commit
e872c226e8
3 changed files with 7 additions and 5 deletions
|
@ -63,7 +63,7 @@ public class Reasons
|
||||||
*
|
*
|
||||||
* @return The reason phrase, or <code>null</code>.
|
* @return The reason phrase, or <code>null</code>.
|
||||||
*/
|
*/
|
||||||
public static String getReasonPhrase(int statusCode)
|
public static String getReasonPhrase(final int statusCode)
|
||||||
{
|
{
|
||||||
return getReasonPhrase(Integer.toString(statusCode));
|
return getReasonPhrase(Integer.toString(statusCode));
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ public class Reasons
|
||||||
*
|
*
|
||||||
* @return The reason phrase, or <code>null</code>.
|
* @return The reason phrase, or <code>null</code>.
|
||||||
*/
|
*/
|
||||||
public static String getReasonPhrase(String statusCode)
|
public static String getReasonPhrase(final String statusCode)
|
||||||
{
|
{
|
||||||
return REASON_PHRASES.get(statusCode);
|
return REASON_PHRASES.get(statusCode);
|
||||||
}
|
}
|
||||||
|
@ -85,12 +85,14 @@ public class Reasons
|
||||||
*
|
*
|
||||||
* @param args The command line arguments.
|
* @param args The command line arguments.
|
||||||
*/
|
*/
|
||||||
public static void main(String[] args)
|
public static void main(final String... args)
|
||||||
{
|
{
|
||||||
for (final Map.Entry<String, String> entry : REASON_PHRASES.entrySet())
|
for (final Map.Entry<String, String> entry : REASON_PHRASES.entrySet())
|
||||||
{
|
{
|
||||||
System.out.println(entry.getKey() + ": " + entry.getValue());
|
System.out.println(entry.getKey() + ": " + entry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.println("Total: " + REASON_PHRASES.entrySet().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -43,7 +43,7 @@ import java.io.Writer;
|
||||||
* @created 2015-12-03
|
* @created 2015-12-03
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class Utils
|
public final class Utils
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class ReasonTag extends XmlSupport
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (statusCode > 0)
|
if (statusCode >= 0)
|
||||||
{
|
{
|
||||||
Utils.outWrite(out, Reasons.getReasonPhrase(statusCode), defaultValue, escapeXml);
|
Utils.outWrite(out, Reasons.getReasonPhrase(statusCode), defaultValue, escapeXml);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue