Hello my fellow programmers.

I have some code which the spring tool suite editor responds differently too, maybe some of you smart people know why.

```
File inputFile = new File(System.getProperty("user.home") + "/Desktop/Input.txt");
    Scanner sc = null;
    double payment=0;
    try {
        sc = new Scanner(inputFile).useLocale(Locale.ENGLISH);
        //sc = new Scanner(inputFile)
        //sc.useLocale(Locale.ENGLISH);
        payment = sc.nextDouble();
    } catch (Exception e) {
    } finally {
        if (sc != null) {
            sc.close();
        }
    }

```

Can someone tell me why this is not possible:

```
Scanner sc = new Scanner(inputFile).useLocale(Locale.ENGLISH);

```

but this is!?

```
Scanner sc = new Scanner(inputFile);
sc.useLocale(Locale.ENGLISH)

```

the first line up code gives me a warning "Resource leak: unassigned closeable value is never closed", and as you can see i've in my try/catch used a finally which should always close my object if it's not null.

Thank you in advance.