Fix warnings in eclipse #1432

Merged
merged 1 commit into from May 9, 2015

Projects

None yet

3 participants

@TheJulianJES
Contributor

This fixes warnings in eclipse, yes some people are still using eclipse :)
If the review is accepted I will also create a PR for rv2 if wanted.

@thatsIch
Member
thatsIch commented May 9, 2015

What errors are they fixing?

@plumpudding
Contributor

Yup I was getting that too. There is an error because the resources are included twice in the Eclipse classpath.

@thatsIch
Member
thatsIch commented May 9, 2015

What does eclipse consider a resource?

@TheJulianJES
Contributor

This PR fixes: http://imgur.com/Fqltju1

@thatsIch
Member
thatsIch commented May 9, 2015

There are no resources? Tell eclipse its drunk!

@thatsIch
Member
thatsIch commented May 9, 2015

nvm its probably about the Scanner usage.

The proper fix here is to use .close() and not hide the warning.

@plumpudding
Contributor

My Eclipse even showed an error (not a warning). I can reproduce it if you want.

@TheJulianJES
Contributor

@plumpudding Yeah, that link fixes the error. This PR fixes warnings I had in my two eclipse instances.

@thatsIch
Member
thatsIch commented May 9, 2015

@TheJulianJES it does not fix them, you just hide them, which is bad. Warnings are a good thing, cause they can detect potential errors and bugs.

@TheJulianJES
Contributor

@thatsIch I thought they are just issues in a eclipse (1. and 2.) and not in idea.

@thatsIch
Member
thatsIch commented May 9, 2015

Generally its not bad, since this object will be cleaned up anyways after the code block is executed.
Also here it is applied to a String, so no external resources like files are in use, so it is actually eclipse messing up.

@TheJulianJES
Contributor

Okay, now I'm messed up... So what is the problem currently?

@thatsIch
Member
thatsIch commented May 9, 2015

I accept the all fix, the resource is just wrong here, since there are no resources in the first place. But closing the Scanner is still a good thing, if you do not want to do it, I can do it.

@TheJulianJES
Contributor

@thatsIch Is it okay?

@thatsIch
Member
thatsIch commented May 9, 2015

Make the Scanner final and you are done :)

@TheJulianJES TheJulianJES Fix warnings in eclipse
Close scanner instead of doing it with a warning

Make the scanner final..
82efa15
@TheJulianJES
Contributor

I usually make things never final..

@thatsIch
Member
thatsIch commented May 9, 2015

Good practice, prevents you from modifying code without your consent

@thatsIch thatsIch merged commit 35997d5 into AppliedEnergistics:master May 9, 2015

1 check passed

default Finished TeamCity Build Applied Energistics :: Pull Requests : Tests passed: 35
Details
@TheJulianJES
Contributor

@thatsIch Should I also pull this to rv2 or is it not necessary?

@thatsIch
Member
thatsIch commented May 9, 2015

please do

@TheJulianJES
Contributor

Will do tomorrow

@TheJulianJES TheJulianJES deleted the TheJulianJES:errorEclipse branch May 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment