-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: emptyControlStatement in DefaultModelInterpolator
#2373
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
Conversation
DefaultModelInterpolator Rule:EmptyControlStatement - Empty if statement.DefaultModelInterpolator Rule:EmptyControlStatement - Empty if statement
DefaultModelInterpolator Rule:EmptyControlStatement - Empty if statementDefaultModelInterpolator Rule:EmptyControlStatement - Empty if statement
9b863a7 to
fed3b09
Compare
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelInterpolator.java
Show resolved
Hide resolved
DefaultModelInterpolator Rule:EmptyControlStatement - Empty if statementDefaultModelInterpolator Rule:EmptyControlStatement - Empty if statement
fed3b09 to
4cef735
Compare
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelInterpolator.java
Outdated
Show resolved
Hide resolved
DefaultModelInterpolator Rule:EmptyControlStatement - Empty if statementDefaultModelInterpolator PMD-Rule: EmptyControlStatement
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelInterpolator.java
Outdated
Show resolved
Hide resolved
Pankraz76
left a comment
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.
SOC
4cef735 to
99ff878
Compare
99ff878 to
7f0c819
Compare
impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultModelInterpolatorTest.java
Outdated
Show resolved
Hide resolved
7f0c819 to
88f6192
Compare
hopefully the real impl. works now. |
|
still: Error: DefaultModelInterpolatorTest.testProjectPropertyExtraction:619 expected: </test/path> but was: <D:\test\path> |
|
might try https://stackoverflow.com/questions/23410738/run-unit-tests-only-on-windows |
0cdc48c to
13b1981
Compare
impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultModelInterpolatorTest.java
Show resolved
Hide resolved
impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultModelInterpolatorTest.java
Outdated
Show resolved
Hide resolved
impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultModelInterpolatorTest.java
Outdated
Show resolved
Hide resolved
impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultModelInterpolatorTest.java
Show resolved
Hide resolved
13b1981 to
f0ec7f8
Compare
impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultModelInterpolatorTest.java
Outdated
Show resolved
Hide resolved
| String result = (String) postProcess.invoke(interpolator, projectDir, request, nonUrlExpression, nonUrlValue); | ||
|
|
||
| // Verify normalization was NOT called | ||
| verify(mockUrlNormalizer, never()).normalize(nonUrlValue); |
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.
Why do we care whether the normalize method was called? This appears to test implementation. I can imagine that the normalize method would be called and that would recognize that it doesn't have to change anything. That would not be wrong.
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.
idk if its any good, but its seems to be reflection of current coding, therefore should be frozen with test, to be changed afterwards.
DefaultModelInterpolator PMD-Rule: EmptyControlStatementemptyControlStatement in DefaultModelInterpolator
9d0a319 to
2b7607a
Compare
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelInterpolator.java
Show resolved
Hide resolved
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelInterpolator.java
Show resolved
Hide resolved
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelInterpolator.java
Show resolved
Hide resolved
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelInterpolator.java
Outdated
Show resolved
Hide resolved
impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultModelInterpolatorTest.java
Outdated
Show resolved
Hide resolved
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelInterpolator.java
Show resolved
Hide resolved
b8727f2 to
658b4e5
Compare
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelInterpolator.java
Outdated
Show resolved
Hide resolved
658b4e5 to
862198a
Compare
| .next() | ||
| .getDirectory(); | ||
| assertEquals(model.getBuild().getSourceDirectory(), sourceDirectory); | ||
| assertCollectorState(0, 0, 0, collector); |
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.
this is now actually second assertion. Why does not change after test ramp-up?
| @Test | ||
| public void shouldInterpolateSourceDirectoryReferencedFromResourceDirectoryCorrectly() throws Exception { | ||
| final SimpleProblemCollector collector = new SimpleProblemCollector(); | ||
| assertCollectorState(0, 0, 0, collector); |
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.
init state empty okay, thats fine.
elharo
left a comment
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.
Again, there''s just too much going on here to understand what's changing. Most of it doesn't seem to have anything to do with the PR title. In fact, I can't even find where that is fixed, or tell if it is. If you don't send more focused PRs they aren't going to be reviewed or merged.
|
yes im sorry, extracted again. Its too much going on. |
862198a to
4e6ce50
Compare
|
focus restored. |

this looks like bug, or unused code. test is green meaning blindspot, better use or loose.
https://checkstyle.sourceforge.io/checks/coding/emptystatement.html
tc;