Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Java 8 regarding the library/API usage #1154

Closed
1 of 4 tasks
simonharrer opened this issue Apr 9, 2016 · 10 comments
Closed
1 of 4 tasks

Update to Java 8 regarding the library/API usage #1154

simonharrer opened this issue Apr 9, 2016 · 10 comments
Labels
status: help wanted type: code-quality Issues related to code or architecture decisions

Comments

@simonharrer
Copy link
Contributor

simonharrer commented Apr 9, 2016

  • Java IO with Java NIO (File -> Path) (available since Java 7)
    • Reason: more type checking instead of String parsing, more exceptions instead of indicating failure through a boolean return type
  • Date/Calendar with java.time (available since Java 8)
    • Reason: java.time uses immutable constructs, whereas Date/Calendar has state and is probably the worst Java api ever
  • Use prepared statements instead of simple Strings (available since quite a long time) of the JDBC API
  • Use Optional instead of returning null
@simonharrer simonharrer added cleanup-ops type: code-quality Issues related to code or architecture decisions labels Apr 9, 2016
@Siedlerchr
Copy link
Member

Refs: #1146

@oscargus
Copy link
Contributor

@Siedlerchr are there thing in #1146 that should be fixed or is that an example of Java 8 features being used? Just so I do not merge it with issues.

@simonharrer
Copy link
Contributor Author

I do not think the PR is really related as the contains key method has existed for a long time.

@Siedlerchr
Copy link
Member

@oscargus @simonharrer Noo, your PR is alright 👍 I just thought this issue will be a more general "Things to use / don't use", not only limited to Java 8

@simonharrer
Copy link
Contributor Author

I think this is something we can try to work on towards the next JabRef release.

@simonharrer simonharrer added this to the v3.4 milestone Apr 21, 2016
@Siedlerchr
Copy link
Member

I also noticed some other things regarding BufferedWriter etc.
There are some new handy methods in the Files class which could be used. (e.g. Files.newBufferedReader/Writer/Stream...

@simonharrer
Copy link
Contributor Author

Yes, this is part of the NIO.

Basically, all of this is technical debt we should pay back instead of paying the interest rates. :)

@oscargus
Copy link
Contributor

There is a Java 8 (java.time) date picker at https://github.com/LGoodDatePicker/LGoodDatePicker

@koppor
Copy link
Member

koppor commented Jul 29, 2016

Usage of prepared statements should be solved by #1451.

@stefan-kolb stefan-kolb removed this from the v3.6 milestone Aug 3, 2016
@lenhard
Copy link
Member

lenhard commented Dec 9, 2016

I'll close this for now. We pay attention to this all the time whenever we change a feature or add something.

However, we will not go to the entire code to replace every feature. Therefore, we do not need an issue to track the progress of this.

@lenhard lenhard closed this as completed Dec 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted type: code-quality Issues related to code or architecture decisions
Projects
None yet
Development

No branches or pull requests

7 participants