mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-21 22:02:06 +01:00
Add checkstyle rule for "Boolean.valueOf()" usages
This commit is contained in:
parent
dbfc123e5e
commit
fa7297019d
4 changed files with 11 additions and 0 deletions
|
@ -89,6 +89,11 @@
|
|||
<property name="message" value="Usage of println"/>
|
||||
<property name="ignoreComments" value="true"/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="Boolean\.valueOf\("/>
|
||||
<property name="message" value="Usage Boolean.valueOf(), consider using ParserUtils.parseXmlBoolean() instead (if you want to parse xs:boolean values)"/>
|
||||
<property name="ignoreComments" value="true"/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="^\t+"/>
|
||||
<property name="message" value="Indent must not use tab characters. Use space instead."/>
|
||||
|
|
|
@ -123,7 +123,9 @@ public class IntrospectionProvider{
|
|||
case "java.lang.String":
|
||||
return value;
|
||||
case "boolean":
|
||||
// CHECKSTYLE:OFF
|
||||
return Boolean.valueOf(value);
|
||||
// CHECKSTYLE:ON
|
||||
case "int":
|
||||
return Integer.valueOf(value);
|
||||
case "long":
|
||||
|
|
|
@ -92,7 +92,9 @@ public class JivePropertiesExtensionProvider extends ExtensionElementProvider<Ji
|
|||
value = Double.valueOf(valueText);
|
||||
}
|
||||
else if ("boolean".equals(type)) {
|
||||
// CHECKSTYLE:OFF
|
||||
value = Boolean.valueOf(valueText);
|
||||
// CHECKSTYLE:ON
|
||||
}
|
||||
else if ("string".equals(type)) {
|
||||
value = valueText;
|
||||
|
|
|
@ -104,7 +104,9 @@ public class WorkgroupProperties extends IQ {
|
|||
while (!done) {
|
||||
int eventType = parser.next();
|
||||
if ((eventType == XmlPullParser.START_TAG) && ("authRequired".equals(parser.getName()))) {
|
||||
// CHECKSTYLE:OFF
|
||||
props.setAuthRequired(Boolean.valueOf(parser.nextText()).booleanValue());
|
||||
// CHECKSTYLE:ON
|
||||
}
|
||||
else if ((eventType == XmlPullParser.START_TAG) && ("email".equals(parser.getName()))) {
|
||||
props.setEmail(parser.nextText());
|
||||
|
|
Loading…
Reference in a new issue