-
Notifications
You must be signed in to change notification settings - Fork 95
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
Explicitencoding cleanup #1631
base: master
Are you sure you want to change the base?
Explicitencoding cleanup #1631
Conversation
@jjohnstn would it be acceptable to have a separat test project to hold junit5 based tests until they can be backported to the junit 4 standard jdt.ui complies to? |
Note that if you have separate project it would not be automatically executed by Ibuilds unless you do the extra work to register it like done in eclipse-platform/eclipse.platform.releng.aggregator#2322 . |
Ok, what is your advice, @akurtakov ? |
JUnit 5 can run junit 4 tests so migrating the suites to junit 5 suites should allow migrating tests to junit 5 one by one while in the same bundle. |
Ok, so you mean moving the tests to the usual test folder and add it to a suite? It is a pity that this approach does not allow to add code coverage computation and clear splitting of test and supporting code. Fine with me. I need help for parts of the implementation anyway: |
0f1d64f
to
3a8140c
Compare
Hi @carstenartur The Java 18 stubs are something I have meant to look into. The recipe for stubs did not work for me and I need to get some help from the IBM folks or Stephanne. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General comments.
- new plug-ins need about.html files (added to sources as well) - won't matter if you move them to existing plug-ins
- new plug-ins should be 1.0.0 rather than match platform 4.34 (jdt.ui and jdt.ui.tests for example are lower versions) - again moot if you move into existing test plug-ins
- nearly all files including test sources and property files should have licensing headers (see other JDT plug-ins if in doubt)
- plug-in name and provider name should be supplied by plugin.properties file - moot when moved
- remove commented out code bits unless they will be added at a later date
- not sure about how this is added to Java Feature tab - there are Java 10 and 18 specific items but you only add Java 6 options and this appears after Java 5 and not between 5 and 7 (should it just be on or off in a different tab like code style?)
- last encoding option has no preview changes (as far as I can see - single constant) and isn't very clear (is it needed or should it be defaulted)?
- perhaps a little more description in feature option could help users to understanding what it is doing
@akurtakov I have copied the tests to the usual project without backporting them to junit 4. They can be executed now if you start them explicitly but do not run as part of the junit 4 based jdt test suites. |
1725922
to
a170e61
Compare
Hi @carstenartur You should never do a merge commit in a PR. You need to instead do a rebase on up to date master. You need to locally do a hard reset to the commit before the merge, then do a rebase on top of up to date master, then do a force push to fix this. |
Hi @jjohnstn, thanks for hint but I think I can simply solve it by choosing a "rebase update" in the web interface after the next change is merged to master. Dunno why it is not configured as default in jdts github setup. I would have done that beforehand but the webinterface of github does not allow it in case of a conflict it seems. So to solve one conflict that showed up with the libraries in one manifest file I had no choice at least as long as I solve the conflict in the web interface of github. |
|
|
Hi @carstenartur There has been discussion about why the merge is offered and I don't believe it can be done. I am guessing it is due to some github lack of function (I also preferred gerrit). If the rebase fixes it great, otherwise, you will have to do stuff on your local system because github lacks a lot of git functionality. |
1725922
to
c01dca4
Compare
I removed the extra plugin projects. So this time I do not try to port the code coverage computation from my sandbox project.
so this is no longer needed.
have to check that…
no longer needed
sure
Yes, I agree. Maybe on the tab for cleanups that might chane behavior - not really sure about this.
I have to find out how to consolidate all occurences of the encodings inserted into one constant per project. That was what I wanted because in my use cases that was what I needed most of the time.
yes, thats true. I‘ll try to improve that but don‘t hold your breath:) |
f1a22fc
to
bd56b08
Compare
5488280
to
4e60dfa
Compare
Hi Jeff, The code for PrintWriter,FileReader should be reimplemented in the way the other cleanups do it. The current implementation was made with former java apis in mind. Besides there are changes in a unrelated test that was constantly failing I had to change to get it run through. So - unfortunately not ready, sorry. |
ecd4a56
to
324ffca
Compare
324ffca
to
90cf24c
Compare
Port of "explicit encoding" cleanup from https://github.com/carstenartur/sandbox to eclipse
What it does
Some java api has been designed originally without a strong focus on safety on usage of different charsets. Because of that apis have simple string parameters to determine the encoding to use or even a default encoding that is based on the environment settings. The situation has improved a lot and you should explicitly set the charset. In doing so for type safety better switch to Charset class.
For an example what the result looks similar to look at
58ae341
That is what this cleanup is trying to support.
Starting with Java 10
Starting with Java 10
Starting with Java 10
Starting with Java 18
Currently, jdt.ui supports test environments only up to Java 17, which means tests cannot be executed for this version.
Starting with Java 5
Starting with Java 5
Starting with Java 5
Starting with Java 5
Starting with Java 10
Starting with Java 10
Starting with Java 10
Starting with Java 5
Starting with Java 10
There are still some missing parts:
KEEP means that the current behavior of the code is not changed
USE_UTF-8 means that in all cases where there is no fixed encoding we add a charset UTF-8
USE_UTF-8_AGGREGATE means the same as USE_UTF-8 but additionally add a constant to the class and refers to it
How to test
Use the cleanup on one of the affected java apis.
Author checklist