Merge branch 'bug-1449'

This commit is contained in:
Andreas Dangel
2016-01-24 17:40:35 +01:00
3 changed files with 16 additions and 1 deletions
@@ -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>