INTSAMPLES-143: Fix Package Tangles

JIRA: https://jira.spring.io/browse/INTSAMPLES-143

Add Sonar support to build.gradle.

Fix critical violations.
This commit is contained in:
Gary Russell
2015-07-29 12:33:50 -04:00
committed by Artem Bilan
parent 70b4d12870
commit 61603c2437
36 changed files with 197 additions and 122 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.Scanner;
import org.springframework.context.support.GenericXmlApplicationContext;
import org.springframework.integration.samples.jpa.domain.Person;
import org.springframework.integration.samples.jpa.service.PersonService;
import org.springframework.util.StringUtils;
@@ -28,6 +29,7 @@ import org.springframework.util.StringUtils;
*
* @author Gunnar Hillert
* @author Amol Nayak
* @author Gary Russell
* @version 1.0
*
*/
@@ -104,13 +106,16 @@ public final class Main {
while (true) {
final String input = scanner.nextLine();
if("1".equals(input.trim())) {
if ("1".equals(input.trim())) {
findPeople(personService);
} else if("2".equals(input.trim())) {
createPersonDetails(scanner,personService);
} else if("q".equals(input.trim())) {
}
else if ("2".equals(input.trim())) {
createPersonDetails(scanner, personService);
}
else if ("q".equals(input.trim())) {
break;
} else {
}
else {
System.out.println("Invalid choice\n\n");
}
@@ -122,6 +127,7 @@ public final class Main {
}
System.out.println("Exiting application...bye.");
context.close();
System.exit(0);
}
@@ -169,7 +175,7 @@ public final class Main {
if(people != null && !people.isEmpty()) {
for(Person person : people) {
System.out.print(String.format("%d, %s, ", person.getId(), person.getName()));
System.out.println(DATE_FORMAT.format(person.getCreatedDateTime()));
System.out.println(DATE_FORMAT.format(person.getCreatedDateTime()));//NOSONAR
}
} else {
System.out.println(

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.samples.jpa;
package org.springframework.integration.samples.jpa.domain;
import java.util.Date;

View File

@@ -18,7 +18,7 @@ package org.springframework.integration.samples.jpa.service;
import java.util.List;
import org.springframework.integration.samples.jpa.Person;
import org.springframework.integration.samples.jpa.domain.Person;
import org.springframework.messaging.handler.annotation.Payload;
/**

View File

@@ -22,6 +22,7 @@ import org.junit.Assert;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.samples.jpa.domain.Person;
import org.springframework.integration.samples.jpa.service.PersonService;
/**