forked from phoedos/pmd
Merge branch 'bug-1449'
This commit is contained in:
@ -379,7 +379,7 @@ adverse impacts on performance.
|
||||
<property name="xpath">
|
||||
<value>
|
||||
<![CDATA[
|
||||
//PrimitiveType[@Image = 'short']
|
||||
//PrimitiveType[@Image = 'short'][name(../..) != 'CastExpression']
|
||||
]]>
|
||||
</value>
|
||||
</property>
|
||||
|
@ -66,4 +66,17 @@ Short as method return type
|
||||
]]>
|
||||
</code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>#1449 false positive when casting a variable to short</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class CastToShort {
|
||||
public void testcase() {
|
||||
ByteBuffer buffer = ByteBuffer.allocate(2);
|
||||
buffer.putShort((short) "1111".getBytes().length);
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
</test-data>
|
||||
|
@ -47,6 +47,8 @@
|
||||
annotated with @VisibleForTesting
|
||||
* java-comments/CommentRequired
|
||||
* [#1434](https://sourceforge.net/p/pmd/bugs/1434/): CommentRequired raises violation on serialVersionUID field
|
||||
* java-controversial/AvoidUsingShortType:
|
||||
* [#1449](https://sourceforge.net/p/pmd/bugs/1449/): false positive when casting a variable to short
|
||||
* java-design/AccessorClassGeneration:
|
||||
* [#1452](https://sourceforge.net/p/pmd/bugs/1452/): ArrayIndexOutOfBoundsException with Annotations for AccessorClassGenerationRule
|
||||
* java-design/UseNotifyAllInsteadOfNotify
|
||||
|
Reference in New Issue
Block a user