Skip to content

Commit 0e0f6d0

Browse files
committed
Fix scanner
1 parent 769d19c commit 0e0f6d0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

brevo-java-client-demo/src/main/java/software/xdev/Application.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public final class Application
2323
{
2424
private static final Logger LOG = LoggerFactory.getLogger(Application.class);
2525

26+
static Scanner scanner = new Scanner(System.in);
27+
2628
// Tries to add an email/contact to a list
2729
public static void main(final String[] args)
2830
{
@@ -70,10 +72,7 @@ private static <T> T getProperty(final String identifier, final Function<String,
7072
LOG.error("Required {} not set in environment variables or system properties", identifier);
7173

7274
LOG.info("Please provide {} over console:", identifier);
73-
try(final Scanner scanner = new Scanner(System.in))
74-
{
75-
value = scanner.nextLine();
76-
}
75+
value = scanner.nextLine();
7776

7877
if(value == null || value.isBlank())
7978
{

0 commit comments

Comments
 (0)