Commit c8f3486e by Jason Song

fix coverity bug

parent a80159f3
......@@ -11,6 +11,7 @@
<name>Apollo Demo</name>
<packaging>jar</packaging>
<properties>
<java.version>1.7</java.version>
<github.path>${project.artifactId}</github.path>
<!-- apollo spring integration requires Spring 3.1.1+ -->
<spring-demo.version>3.1.1.RELEASE</spring-demo.version>
......
......@@ -2,7 +2,7 @@ package com.ctrip.framework.apollo.demo.spring;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import java.io.IOException;
import java.util.Scanner;
/**
* @author Jason Song(song_s@ctrip.com)
......@@ -12,12 +12,9 @@ public class AnnotationApplication {
new AnnotationConfigApplicationContext(AnnotationApplication.class.getPackage().getName());
onKeyExit();
}
private static void onKeyExit() {
System.out.println("Press any key to exit...");
try {
System.in.read();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("Press Enter to exit...");
new Scanner(System.in).nextLine();
}
}
......@@ -2,7 +2,7 @@ package com.ctrip.framework.apollo.demo.spring;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.io.IOException;
import java.util.Scanner;
/**
* @author Jason Song(song_s@ctrip.com)
......@@ -14,11 +14,7 @@ public class XmlApplication {
}
private static void onKeyExit() {
System.out.println("Press any key to exit...");
try {
System.in.read();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("Press Enter to exit...");
new Scanner(System.in).nextLine();
}
}
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