gaul / modernizer-maven-plugin

Detect uses of legacy Java APIs
Apache License 2.0
371 stars 53 forks source link

Apache Commons Collections #21

Open rdifrango opened 9 years ago

rdifrango commented 9 years ago

Should there be provisions in the configuration to look for usages from Apache Commons Collections, like functions, closures, etc.?

gaul commented 9 years ago

@rdifrango Definitely! Could you submit a pull request for more Apache Commons checks? I only have a little familiarity with commons-collections since I mostly use Guava.

rdifrango commented 9 years ago

@andrewgaul We use it sparingly as we've started to switch over to Guava, so I'll give it a shot.

gaul commented 9 years ago

@rdifrango Switching to Guava is another interesting use case -- Modernizer could provide a second optional resource file to suggest Commons replacements. Modernizer only supports a single resource file now but supporting more is easy to add.

Stephan202 commented 9 years ago

+1 for the idea of generalizing the plugin to facilitate migrations from old lib X to newer lib Y (where in this case X = Apache Commons and Y is Guava). I guess X and Y could even be different versions of the same library. (Though that's a less useful scenario, provided the library maintainers mark methods with a more suitable replacement @Deprecated.)

gaul commented 9 years ago

For example, suggest replacing org.apache.commons.io.input.BoundedInputStream with com.google.common.io.ByteStreams.limit