-
Notifications
You must be signed in to change notification settings - Fork 90
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
[MSHADE-364] drop duplicates handled by a transformer #48
Conversation
@@ -256,6 +256,10 @@ else if ( shadeRequest.isShadeSourcesContent() && name.endsWith( ".java" ) ) | |||
|
|||
addResource( resources, jos, mappedName, entry.getTime(), in ); | |||
} | |||
else | |||
{ | |||
duplicates.remove( name, jar ); |
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.
Could there be a test for this?
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.
"We have a duplicate META-INF/MANIFEST.MF in src/test/jars/plexus-utils-1.4.1.jar" )); | ||
} | ||
|
||
public void testOverlappingResourcesAreLoggedExceptATransformerHandlesIt() throws Exception { | ||
final TemporaryFolder temporaryFolder = new TemporaryFolder(); |
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.
IMHO not necessary to mark local variables final
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.
ok
} | ||
|
||
@Override | ||
public void debug( final String s, final Throwable throwable ) |
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.
don't need to mark arguments final
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.
fixed
private final List<String> debugMessages = new ArrayList<>(); | ||
private final List<String> warnMessages = new ArrayList<>(); | ||
|
||
public MockLogger() |
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.
doesn't need to be public as it's in a private class
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.
fixed
|
||
temporaryFolder.delete(); | ||
|
||
assertTrue(logWithTransformer.warnMessages.toString(), logWithTransformer.warnMessages.isEmpty()); |
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.
Is the purpose of this PR to add another warning to the log?
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.
to remove it
|
||
assertTrue(logWithTransformer.warnMessages.toString(), logWithTransformer.warnMessages.isEmpty()); | ||
assertTrue(logWithoutTransformer.warnMessages.toString(), logWithoutTransformer.warnMessages.containsAll( | ||
Arrays.<String>asList( "j1.jar, j2.jar define 1 overlapping resources:", "- foo.txt" ) ) ); |
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.
resources --> resource when it's singular
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.
fixed
CI is blue/green, any blocker to merge? |
overlaps.add( "classes" ); | ||
if ( resources.size() == 1 ) | ||
{ | ||
overlaps.add( "classe" ); |
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.
redundant e?
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.
I'd say french typo ;). Thanks for the catch, should be fixed now
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.
I assumed so...
…dled by a transformer
When a transformer handles a resource then the resource being duplicated is ok since the transformer will merge it so no need to log it (in particular as a warning).
Following this checklist to help us incorporate your
contribution quickly and easily:
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
[MSHADE-XXX] - Fixes bug in ApproximateQuantiles
,where you replace
MSHADE-XXX
with the appropriate JIRA issue. Best practiceis to use the JIRA issue title in the pull request title and in the first line of the
commit message.
mvn clean verify
to make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
mvn -Prun-its clean verify
).