vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
619 stars 167 forks source link

Remove dead codes. #16668

Open czp13 opened 1 year ago

czp13 commented 1 year ago

Description of the bug

I believe there are some opportunities to remove unused codes.

Similar to this PR (removed dead codes which I have observed accidentally)

This dead code was blocking to update to the newest 4.9.0 selenium (and to any new selenium versions after this). Tests can be a low-hanging fruit, but maybe there are some other utils or other classes which are easier to remove dead code.

Short analysis executed shown 562 opportunities:

image

Probably not all of them can be removed as some of them are part of abstract classes which used elsewhere, but these methods for example could be removed:


GwtEventHandlerTest.assertPolymerMethods

JsonUtilsTest
.createNumberStreamForNull()
.createObjectStreamForNull()
.createStreamForNull()

And so on...

Expected behavior

The repository could contain fewer unused code lines, which makes:

Minimal reproducible example

In IntelliJ: Analyze | Run Inspection by Name... | Unused declaration. (Potentially worth to add Test regexp or Util regexp, as there will be more false positives otherwise)

Versions

czp13 commented 1 year ago

Only private methods, and more investigation is needed before removing methods.