[ 
https://issues.apache.org/jira/browse/LUCENE-5551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13944157#comment-13944157
 ] 

Shawn Heisey commented on LUCENE-5551:
--------------------------------------

This specific example needs suppressing, because your preferred form will 
change the result.  Reducing the specific multiplication example you provided 
from MonotonicAppendingLongBuffer to a compact test case:

{code}
  int i = 5;
  float f = 3.4F;

  final long long1 = (long) (f * (long) i); // original
  final long long2 = (long) (f * i); // what Eclipse wants
  final long long3 = ((long) f * i); // Your form
  System.out.println(long1); // prints 17
  System.out.println(long2); // prints 17
  System.out.println(long3); // prints 15
{code}

I think the chance of these warnings pointing to existing subtle bugs is very 
small, but it's possible.  My thought at this point is that I should just 
suppress almost all of them that involve primitive types, and probably those 
involving things objects like Float as well.  I will review each one again and 
ask questions if it becomes ambiguous.


> Fix warnings in the ant build
> -----------------------------
>
>                 Key: LUCENE-5551
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5551
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: general/build
>    Affects Versions: 4.8
>            Reporter: Shawn Heisey
>             Fix For: 5.0
>
>         Attachments: LUCENE-5551-fix-fallthrough.patch, 
> LUCENE-5551-redundant-casts.patch
>
>
> The build produces a lot of warnings.  LUCENE-5130 aims to fail the build on 
> certain warnings, but until we actually eliminate those warnings from the 
> code, failing the build is premature.
> This issue is concerned with fixing or suppressing warnings reported by the 
> ant build, anything further than that may need one or more separate issues.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to