ApexEditorParameters has a URI that sonar does not like, hard coding the leading forward slash removes the complaint
ApexEditorMain was receiving args and a print stream in the form of System.err and then System.out, both of these were null values, while Sonar sees System.out or err as a bug as it should be a logger, simply passing null in its place is not an issue to sonar
BeanBase.java Removed an if statement that always asserted to be true, as it is inside an if statement that confirmed that condition.
removed an accessibility change as sonar sees this as a violation
Issue-ID: POLICY-3095
Signed-off-by: mkidd <michael.kidd@est.tech>
Change-Id: I1bbdfe9cc6db085195e95da3dbfbc8b29d9a5ff5
Signed-off-by: mkidd <michael.kidd@est.tech>
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
*/
public static void main(final String[] args) {
try {
- final ApexEditorMain editorMain = new ApexEditorMain(args, System.out);
+ final ApexEditorMain editorMain = new ApexEditorMain(args, null);
editorMain.init();
} catch (final Exception e) {
LOGGER.error("start failed", e);
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020-2021 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
private static final String DEFAULT_SERVER_URI_PREFIX = "http://";
/** The server listens on localhost by default. */
public static final String DEFAULT_SERVER_URI_ROOT = "localhost";
- private static final String DEFAULT_REST_PATH = "/apexservices/";
+ private static final String DEFAULT_REST_PATH = "apexservices/";
private static final String DEFAULT_STATIC_PATH = "/";
// Constants for port checks
* @return the base URI
*/
public URI getBaseUri() {
- return URI.create(DEFAULT_SERVER_URI_PREFIX + listenAddress + ':' + restPort + DEFAULT_REST_PATH);
+ return URI.create(DEFAULT_SERVER_URI_PREFIX + listenAddress + ':' + restPort + "/" + DEFAULT_REST_PATH);
}
/**
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020-2021 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
if (field != null) {
try {
final Field f = this.getClass().getDeclaredField(field);
- if (f != null) {
- f.setAccessible(true);
- return (String) (f.get(this));
- }
+ f.trySetAccessible();
+ return (String) (f.get(this));
} catch (final Exception e) {
throw new IllegalArgumentException(PROBLEM_RETRIEVING_FIELD_PREFIX + field + JSON_BEAN_SUFFIX + this,
e);