Commit c8f3486e by Jason Song

fix coverity bug

parent a80159f3
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<name>Apollo Demo</name> <name>Apollo Demo</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<java.version>1.7</java.version>
<github.path>${project.artifactId}</github.path> <github.path>${project.artifactId}</github.path>
<!-- apollo spring integration requires Spring 3.1.1+ --> <!-- apollo spring integration requires Spring 3.1.1+ -->
<spring-demo.version>3.1.1.RELEASE</spring-demo.version> <spring-demo.version>3.1.1.RELEASE</spring-demo.version>
......
...@@ -2,7 +2,7 @@ package com.ctrip.framework.apollo.demo.spring; ...@@ -2,7 +2,7 @@ package com.ctrip.framework.apollo.demo.spring;
import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import java.io.IOException; import java.util.Scanner;
/** /**
* @author Jason Song(song_s@ctrip.com) * @author Jason Song(song_s@ctrip.com)
...@@ -12,12 +12,9 @@ public class AnnotationApplication { ...@@ -12,12 +12,9 @@ public class AnnotationApplication {
new AnnotationConfigApplicationContext(AnnotationApplication.class.getPackage().getName()); new AnnotationConfigApplicationContext(AnnotationApplication.class.getPackage().getName());
onKeyExit(); onKeyExit();
} }
private static void onKeyExit() { private static void onKeyExit() {
System.out.println("Press any key to exit..."); System.out.println("Press Enter to exit...");
try { new Scanner(System.in).nextLine();
System.in.read();
} catch (IOException e) {
e.printStackTrace();
}
} }
} }
...@@ -2,7 +2,7 @@ package com.ctrip.framework.apollo.demo.spring; ...@@ -2,7 +2,7 @@ package com.ctrip.framework.apollo.demo.spring;
import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.io.IOException; import java.util.Scanner;
/** /**
* @author Jason Song(song_s@ctrip.com) * @author Jason Song(song_s@ctrip.com)
...@@ -14,11 +14,7 @@ public class XmlApplication { ...@@ -14,11 +14,7 @@ public class XmlApplication {
} }
private static void onKeyExit() { private static void onKeyExit() {
System.out.println("Press any key to exit..."); System.out.println("Press Enter to exit...");
try { new Scanner(System.in).nextLine();
System.in.read();
} catch (IOException e) {
e.printStackTrace();
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment