|
@@ -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();
|
|
|
}
|
|
|
}
|