You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MNG-6444] Internal code should prefer Path over File #7402
Quite some interfaces use File, which would mean transforming Path to File (pass it to a method) to Path (and include null-checks). So removing all new File appearances seems too ambitious. With default methods such transformations might become easier. But I agree, let's do a first sweep and replace the obvious improvements.
Not sure if users or developers of external plugins would notice a change in internal Maven code with this improvement. Does it include changing e.g. the returned type of the call Artifact.getFile()? Because this would be benefit in the development of external plugins.
Changing the returnType for getFile() would break a a lot of plugins. Since it is an interface, we should add a default method getPath(), but that requires Java 8. That's out of scope for this ticket.
Activity
jira-importer commentedon Jul 15, 2018
Robert Scholte commented
If we don't want to break too much, we'd better require Java 8 so we can use default methods on interfaces
jira-importer commentedon Jul 18, 2018
Michael Osipov commented
This will fix a lot of issues [email protected] and me recently dicovered. I wouldn't mix Java 8 features with NIO2 because they aren't related.
jira-importer commentedon Jul 18, 2018
Robert Scholte commented
Quite some interfaces use File, which would mean transforming Path to File (pass it to a method) to Path (and include null-checks). So removing all
new Fileappearances seems too ambitious. With default methods such transformations might become easier. But I agree, let's do a first sweep and replace the obvious improvements.jira-importer commentedon Jul 18, 2018
Michael Osipov commented
We can wire all
Filesaway with Maven 4 and maintain minimal necesary compat for a certain release. WDYT?jira-importer commentedon Jul 18, 2018
Robert Scholte commented
First things first. Replace most inner File creations, leave public and protected methods/fields as is.
jira-importer commentedon Jul 18, 2018
Michael Osipov commented
Agreed.
jira-importer commentedon Nov 4, 2018
Tibor Digana commented
Not sure if users or developers of external plugins would notice a change in internal Maven code with this improvement. Does it include changing e.g. the returned type of the call
Artifact.getFile()? Because this would be benefit in the development of external plugins.jira-importer commentedon Nov 5, 2018
Robert Scholte commented
Changing the returnType for getFile() would break a a lot of plugins. Since it is an interface, we should add a default method getPath(), but that requires Java 8. That's out of scope for this ticket.