Skip to content

Commit

Permalink
Use primitives where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
kinow committed May 23, 2020
1 parent f093661 commit 1c2ddfc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ class MiscService extends BaseService {
}

protected Boolean checkDevKey(String devKey) throws TestLinkAPIException {
Boolean statusOk;
boolean statusOk;

try {
Map<String, Object> executionData = new HashMap<>();
executionData.put(TestLinkParams.DEV_KEY.toString(), devKey);
Object response = this.executeXmlRpcCall(TestLinkMethods.CHECK_DEV_KEY.toString(), executionData);
statusOk = Boolean.valueOf(response.toString());
statusOk = Boolean.parseBoolean(response.toString());
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error verifying developer key: " + xmlrpcex.getMessage(), xmlrpcex);
}
Expand All @@ -75,13 +75,13 @@ protected Boolean checkDevKey(String devKey) throws TestLinkAPIException {
* @throws TestLinkAPIException
*/
protected Boolean doesUserExist(String user) throws TestLinkAPIException {
Boolean userExist;
boolean userExist;

try {
Map<String, Object> executionData = new HashMap<>();
executionData.put(TestLinkParams.USER.toString(), user);
Object response = this.executeXmlRpcCall(TestLinkMethods.DOES_USER_EXIST.toString(), executionData);
userExist = Boolean.valueOf(response.toString());
userExist = Boolean.parseBoolean(response.toString());
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error verifying if user exists: " + xmlrpcex.getMessage(), xmlrpcex);
}
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/br/eti/kinoshita/testlinkjavaapi/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public static TestProject getTestProject(Map<String, Object> map) {
if (map != null && map.size() > 0) {
Object o = map.get(TestLinkResponseParams.ID.toString());
if (o != null) {
Integer id = Integer.parseInt(o.toString());
int id = Integer.parseInt(o.toString());

if (id > 0) {
testProject = new TestProject();
Expand Down Expand Up @@ -218,7 +218,7 @@ public static TestPlan getTestPlan(Map<String, Object> map) {
if (map != null && map.size() > 0) {
Object o = map.get(TestLinkResponseParams.ID.toString());
if (o != null) {
Integer id = Integer.parseInt(o.toString());
int id = Integer.parseInt(o.toString());

if (id > 0) {
testPlan = new TestPlan();
Expand Down Expand Up @@ -246,7 +246,7 @@ public static Platform getPlatform(Map<String, Object> map) {
if (map != null && map.size() > 0) {
Object o = map.get(TestLinkResponseParams.ID.toString());
if (o != null) {
Integer id = Integer.parseInt(o.toString());
int id = Integer.parseInt(o.toString());

if (id > 0) {
platform = new Platform();
Expand Down Expand Up @@ -350,7 +350,7 @@ public static TestCaseStep getTestCaseStep(Map<String, Object> map) {
if (map != null && map.size() > 0) {
Object o = map.get(TestLinkResponseParams.ID.toString());
if (o != null) {
Integer id = Integer.parseInt(o.toString());
int id = Integer.parseInt(o.toString());

if (id > 0) {
step = new TestCaseStep();
Expand Down Expand Up @@ -445,7 +445,7 @@ public static TestSuite getTestSuite(Map<String, Object> map) {
if (map != null && map.size() > 0) {
Object o = map.get(TestLinkResponseParams.ID.toString());
if (o != null) {
Integer id = Integer.parseInt(o.toString());
int id = Integer.parseInt(o.toString());

if (id > 0) {
testSuite = new TestSuite();
Expand Down Expand Up @@ -479,7 +479,7 @@ public static TestCase getTestCase(Map<String, Object> map) {
}

if (o != null) {
Integer id = Integer.parseInt(o.toString());
int id = Integer.parseInt(o.toString());

if (id > 0) {
testCase = new TestCase();
Expand Down Expand Up @@ -772,7 +772,7 @@ public static Attachment getAttachment(Map<String, Object> map) {
if (map != null && map.size() > 0) {
Object o = map.get(TestLinkResponseParams.ID.toString());
if (o != null) {
Integer id = Integer.parseInt(o.toString());
int id = Integer.parseInt(o.toString());

if (id > 0) {
attachment = new Attachment();
Expand Down Expand Up @@ -834,7 +834,7 @@ public static Execution getExecution(Map<String, Object> map) {
if (map != null && map.size() > 0) {
Object o = map.get(TestLinkResponseParams.ID.toString());
if (o != null) {
Integer id = Integer.parseInt(o.toString());
int id = Integer.parseInt(o.toString());

if (id > 0) {
execution = new Execution();
Expand Down Expand Up @@ -880,7 +880,7 @@ public static Build getBuild(Map<String, Object> map) {
if (map != null && map.size() > 0) {
Object o = map.get(TestLinkResponseParams.ID.toString());
if (o != null) {
Integer id = Integer.parseInt(o.toString());
int id = Integer.parseInt(o.toString());

if (id > 0) {
build = new Build();
Expand Down Expand Up @@ -909,7 +909,7 @@ public static ReportTCResultResponse getReportTCResultResponse(Map<String, Objec
if (map != null && map.size() > 0) {
Object o = map.get(TestLinkResponseParams.ID.toString());
if (o != null) {
Integer id = Integer.parseInt(o.toString());
int id = Integer.parseInt(o.toString());

if (id > 0) {
reportTCResultResponse = new ReportTCResultResponse();
Expand Down Expand Up @@ -1014,7 +1014,7 @@ public static User getUser(Map<String, Object> map) {
if (map != null && map.size() > 0) {
Object o = map.get(TestLinkResponseParams.DB_ID.toString());
if (o != null) {
Integer dbID = Integer.parseInt(o.toString());
int dbID = Integer.parseInt(o.toString());
if (dbID > 0) {
user = new User(dbID);
user.setLogin(getString(map, TestLinkResponseParams.LOGIN.toString()));
Expand Down Expand Up @@ -1048,7 +1048,7 @@ public static Role getRole(Map<String, Object> map) {
if (map != null && map.size() > 0) {
Object o = map.get(TestLinkResponseParams.DB_ID.toString());
if (o != null) {
Integer dbID = Integer.parseInt(o.toString());
int dbID = Integer.parseInt(o.toString());
if (dbID > 0) {
role = new Role(dbID);
role.setDescription(getString(map, TestLinkResponseParams.DESCRIPTION.toString()));
Expand Down

0 comments on commit 1c2ddfc

Please sign in to comment.