Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-3915 SonarQube - Using Wrapper.parseWrapper() when converting String to primitive #4030

Merged
merged 1 commit into from Jun 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -304,7 +304,7 @@ private ContextServiceImpl createContextService(
String contextInfoEnabled,
boolean cleanupTransaction) {

boolean isContextInfoEnabled = Boolean.valueOf(contextInfoEnabled);
boolean isContextInfoEnabled = Boolean.parseBoolean(contextInfoEnabled);

ContextSetupProviderImpl.CONTEXT_TYPE[] contextTypes
= parseContextInfo(contextInfo, isContextInfoEnabled);
Expand Down
Expand Up @@ -63,7 +63,7 @@ public RAWriterAdapter(Logger logger) {

private void initializeAutoFlush() {
String autoFlushValue = System.getProperty("com.sun.enterprise.connectors.LogWriterAutoFlush", "true");
autoFlush = Boolean.valueOf(autoFlushValue);
autoFlush = Boolean.parseBoolean(autoFlushValue);
}

public void write(char cbuf[], int off, int len) {
Expand Down
Expand Up @@ -1017,7 +1017,7 @@ public void setFullFlag(boolean flag) {
* @param value the full attribute
*/
public void setFullAttribute(String value) {
fullAttribute = Boolean.valueOf(value);
fullAttribute = Boolean.parseBoolean(value);
}

/**
Expand Down
Expand Up @@ -279,7 +279,7 @@ public void setAuthMethodRequired(boolean val) {
* @param val the value (true or false).
*/
public void setAuthMethodRequired(String val) {
required = Boolean.valueOf(val).booleanValue();
required = Boolean.parseBoolean(val);
}

/**
Expand Down
Expand Up @@ -1283,7 +1283,7 @@ protected void initializeHome()
} else {
String disableInServer = ejbContainerUtilImpl.getEjbContainer().
getPropertyValue(RuntimeTagNames.DISABLE_NONPORTABLE_JNDI_NAMES);
disableNonPortableJndiName = Boolean.valueOf(disableInServer);
disableNonPortableJndiName = Boolean.parseBoolean(disableInServer);
}

String glassfishSpecificJndiName = null;
Expand Down
Expand Up @@ -337,7 +337,7 @@ private boolean getDBReadBeforeTimeoutProperty() {
try{
String str=System.getProperty( strDBReadBeforeTimeout );
if( null != str) {
performDBReadBeforeTimeout = Boolean.valueOf(str).booleanValue();
performDBReadBeforeTimeout = Boolean.parseBoolean(str);

if( logger.isLoggable(Level.FINE) ) {
logger.log(Level.FINE, "EJB Timer Service property : " +
Expand Down
Expand Up @@ -1202,7 +1202,7 @@ public void setSqlTraceListeners(String sqlTraceListeners) {

public void setSlowQueryThresholdInSeconds(String seconds) {
spec.setDetail(DataSourceSpec.SLOWSQLLOGTHRESHOLD, seconds);
double threshold = Double.valueOf(seconds);
double threshold = Double.parseDouble(seconds);
if (threshold > 0) {
if (sqlTraceDelegator == null) {
sqlTraceDelegator = new SQLTraceDelegator(getPoolName(), getApplicationName(), getModuleName());
Expand Down Expand Up @@ -1434,7 +1434,7 @@ protected void computeStatementWrappingStatus() {
boolean poolProperty = false;
String statementWrappingString = getStatementWrapping();
if (statementWrappingString != null)
poolProperty = Boolean.valueOf(statementWrappingString);
poolProperty = Boolean.parseBoolean(statementWrappingString);

if (wrapStatement == JVM_OPTION_STATEMENT_WRAPPING_ON ||
(wrapStatement == JVM_OPTION_STATEMENT_WRAPPING_NOT_SET && poolProperty)) {
Expand Down Expand Up @@ -1565,7 +1565,7 @@ private void detectStatementLeakSupport() {
String stmtLeakReclaim = getStatementLeakReclaim();
if (stmtLeakTimeout != null) {
statementLeakTimeout = Integer.parseInt(stmtLeakTimeout) * 1000L;
statementLeakReclaim = Boolean.valueOf(stmtLeakReclaim);
statementLeakReclaim = Boolean.parseBoolean(stmtLeakReclaim);
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "StatementLeakTimeout in seconds: "
+ statementLeakTimeout + " & StatementLeakReclaim: "
Expand Down
Expand Up @@ -700,8 +700,7 @@ public void setUserPolicy(Properties props) {

if (name.equals(USE_UNIQUE_TABLE_NAMES)) {
if (! StringHelper.isEmpty(value)) {
uniqueTableName =
Boolean.valueOf(value).booleanValue();
uniqueTableName = Boolean.parseBoolean(value);
}
continue;
}
Expand Down Expand Up @@ -749,7 +748,7 @@ public String getSQLTypeName(int jdbcType) {

// The name is in sqlInfo if it was loaded from one of our
// vendor-specific properties files.
Object o = sqlInfo.get(new Integer(jdbcType));
Object o = sqlInfo.get(Integer.valueOf(jdbcType));
if (null != o) {
rc = (String) o;
} else {
Expand Down Expand Up @@ -977,7 +976,7 @@ public static String getOverrideForType(
*/
public static String getJdbcTypeName(int type) throws
IllegalArgumentException {
String rc = (String) jdbcTypeNames.get(new Integer(type));
String rc = (String) jdbcTypeNames.get(Integer.valueOf(type));
if (null == rc) {
throw new IllegalArgumentException();
}
Expand Down
Expand Up @@ -107,7 +107,7 @@ public static boolean isJavaToDatabase(Properties prop) {
if (! StringHelper.isEmpty(value)) {
if (logger.isLoggable(Logger.FINE))
logger.fine(DatabaseConstants.JAVA_TO_DB_FLAG + " property is set."); // NOI18N
return Boolean.valueOf(value).booleanValue();
return Boolean.parseBoolean(value);
}
}
return false;
Expand Down
Expand Up @@ -187,7 +187,7 @@ protected void configureFileHandler(LoggerJDK14 logger) {
boolean defaultAppend = false;
String append = logManager.getProperty(baseName + ".append"); //NOI18N
if(append != null) {
defaultAppend = Boolean.valueOf(append).booleanValue();
defaultAppend = Boolean.parseBoolean(append);
}

FileHandler fileHandler = null;
Expand Down
Expand Up @@ -203,7 +203,7 @@ public void refresh() {
// Will enable permission caching of container, unless REUSE
// property is set, and its value is not "true".
String propValue = System.getProperty(REUSE);
boolean supportsReuse = propValue == null ? true : Boolean.valueOf(propValue);
boolean supportsReuse = propValue == null ? true : Boolean.parseBoolean(propValue);
if (supportsReuse) {
if (PolicyContext.getHandlerKeys().contains(REUSE)) {
PolicyContext.getContext(REUSE);
Expand Down
Expand Up @@ -580,7 +580,7 @@ protected void read(InputStream input) throws XMLStreamException {
}

if ("ignoreHiddenJarFiles".equals(propName)) {
ignoreHiddenJarFiles = Boolean.valueOf(value);
ignoreHiddenJarFiles = Boolean.parseBoolean(value);
} else {
Object[] params = { propName, value };
if (logger.isLoggable(Level.WARNING)) {
Expand All @@ -607,9 +607,9 @@ protected void read(InputStream input) throws XMLStreamException {
}

if("useMyFaces".equalsIgnoreCase(propName)) {
useBundledJSF = Boolean.valueOf(value);
useBundledJSF = Boolean.parseBoolean(value);
} else if("useBundledJsf".equalsIgnoreCase(propName)) {
useBundledJSF = Boolean.valueOf(value);
useBundledJSF = Boolean.parseBoolean(value);
}
} else if ("version-identifier".equals(name)) {
versionIdentifier = parser.getElementText();
Expand Down
Expand Up @@ -1625,7 +1625,7 @@ public boolean getClientAuth() {

String prop = getProperty("clientauth");
if (prop != null) {
ret = Boolean.valueOf(prop).booleanValue();
ret = Boolean.parseBoolean(prop);
} else {
ServerSocketFactory factory = this.getFactory();
if (factory instanceof CoyoteServerSocketFactory) {
Expand Down
Expand Up @@ -365,7 +365,7 @@ public static boolean invariantMBeanInfo(final MBeanInfo info) {
final Descriptor d = info.getDescriptor();

final String value = "" + d.getFieldValue(DESC_STD_IMMUTABLE_INFO);
return Boolean.valueOf(value);
return Boolean.parseBoolean(value);
}

/**
Expand Down
Expand Up @@ -317,7 +317,7 @@ public boolean isStartedInDebugMode()
{
final String value = opt.substring( prefix.length() ).toLowerCase(Locale.ENGLISH);
//System.out.println( "RuntimeRootImpl.isRunningInDebugMode(): found: " + prefix + value );
inDebugMode = Boolean.valueOf(value );
inDebugMode = Boolean.parseBoolean(value);
break;
}
}
Expand Down
Expand Up @@ -123,7 +123,7 @@ public void createResourceRef(String jndiName, String enabled, String target) th
*/
public String computeEnabledValueForResourceBasedOnTarget(String enabledValue, String target) {
String result = enabledValue;
boolean enabled = Boolean.valueOf(enabledValue);
boolean enabled = Boolean.parseBoolean(enabledValue);
if(!isNonResourceRefTarget(target) && !enabled ){
result = Boolean.toString(!enabled);
}
Expand Down