<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>I think the danger of regressions from fixing such warnings is
incredibly low. Fixing raw types finds potential casting
problems, ie:</p>
<p> List list = List.of("Hi");<br>
</p>
<p> Integer x = (Integer) list.get(0); // Runtime CCE</p>
<p>With the type for List specified, it would be a compile error
instead.<br>
</p>
<p>It was deemed so important to the Java platform that it
introduced generics in 1.5, but kept raw types as a backwards
compatiblity mechanism (not as a "convenience" mechanism to avoid
having to specify the generic parameters -- all code after 1.5
should specify generics, and never use raw types).</p>
<p>The PR uncovered a few incorrectly specified generics, although
it was unlikely there were any resulting bugs, as the incorrect
generics were in the CSS subsystem which ignores them all
everywhere anyway. <br>
</p>
<p>The generics in the CSS subsystem were used without thinking if
they were useful or needed, with ParsedValue being the main
offender. It offers zero benefits to have this one generic as
you're always dealing with parsed input that won't have a compile
time type known in advance (all type checking is done in the
parser, manually). Unfortunately, the class is public API, but
causes raw type warnings throughout the whole CSS subsystem. If
there had been an attempt to fill in reasonable generic types for
this class everywhere, one would have realized the generic
parameters on this type was not very useful, and could have been
dropped from the definition (instead of dropping it on every use
site using a raw type -- if you find yourself doing that a lot,
the problem might be in the generic definition itself...).</p>
<p>There were a few other classes like that which were not public
API that had problematic generic parameters (`PartitionKey` for
example, as it added nothing).</p>
<p>--John</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 05/12/2023 23:45, Andy Goryachev
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:DM5PR1001MB217269C90BED99C226D454D5E585A@DM5PR1001MB2172.namprd10.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:"Yu Gothic";
panose-1:2 11 4 0 0 0 0 0 0 0;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:"Iosevka Fixed SS16";
panose-1:2 0 5 9 3 0 0 0 0 4;}@font-face
{font-family:"Times New Roman \(Body CS\)";
panose-1:2 11 6 4 2 2 2 2 2 4;}@font-face
{font-family:"\@Yu Gothic";
panose-1:2 11 4 0 0 0 0 0 0 0;}@font-face
{font-family:"Iosevka Fixed SS16 ";
panose-1:2 0 5 9 3 0 0 0 0 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;}span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Iosevka Fixed SS16";
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}div.WordSection1
{page:WordSection1;}ol
{margin-bottom:0in;}ul
{margin-bottom:0in;}</style>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16"">Yeah, that one. Probably for the better -
very little probability of uncovering any bugs, and too high
of a probability of introducing a regression.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16"">Same with "unnecessary cast or instanceof"
and "redundant null check". "potential null pointer access"
- there is probably some non-zero value in having the
warning, but very few people would welcom @SuppressWarning
where it isn't an issue.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16"">You are right though - there are more
important issues to be resolved - 3,876 to be exact, see<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16""><a
href="https://bugs.openjdk.org/issues/?jql=component%20in%20(javafx)%20and%20status%20in%20(open%2C%20new%2C%20%22In%20Progress%22)%20and%20labels%20not%20in%20(okToLeaveInJI)"
moz-do-not-send="true" class="moz-txt-link-freetext">https://bugs.openjdk.org/issues/?jql=component%20in%20(javafx)%20and%20status%20in%20(open%2C%20new%2C%20%22In%20Progress%22)%20and%20labels%20not%20in%20(okToLeaveInJI)</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16"">-andy<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16""><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span
style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">John
Hendrikx <a class="moz-txt-link-rfc2396E" href="mailto:john.hendrikx@gmail.com"><john.hendrikx@gmail.com></a><br>
<b>Date: </b>Tuesday, December 5, 2023 at 14:17<br>
<b>To: </b>Andy Goryachev
<a class="moz-txt-link-rfc2396E" href="mailto:andy.goryachev@oracle.com"><andy.goryachev@oracle.com></a>, <a class="moz-txt-link-abbreviated" href="mailto:openjfx-dev@openjdk.org">openjfx-dev@openjdk.org</a>
<a class="moz-txt-link-rfc2396E" href="mailto:openjfx-dev@openjdk.org"><openjfx-dev@openjdk.org></a><br>
<b>Subject: </b>[External] : Re: eclipse warnings</span><span
style="font-size:12.0pt;color:black;mso-ligatures:none"><o:p></o:p></span></p>
</div>
<p>This one for example: <a
href="https://urldefense.com/v3/__https:/github.com/openjdk/jfx/pull/1095__;!!ACWV5N9M2RV99hQ!NRHVOIJ65hopuPgetAT7stNzW3jh1BY4ZqHVTLuY3XHIQ72la7gG7TGgT_j0R9q_Gf3_l8RDUswG6IZijoq5ZLvZ3DXl$"
moz-do-not-send="true">
https://github.com/openjdk/jfx/pull/1095</a><o:p></o:p></p>
<p>It was auto closed, and at this point probably has many merge
conflicts, which is why I let it go closed.<o:p></o:p></p>
<p>--John<o:p></o:p></p>
<div>
<p class="MsoNormal">On 05/12/2023 20:27, Andy Goryachev
wrote:<o:p></o:p></p>
</div>
<p><span style="font-family:"Iosevka Fixed SS16"">>
</span>I did many warning fixes, and there are PR's
outstanding with warning fixes, but they're not getting
reviewed.<o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 "">Are they still in Draft?</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 ""> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 ""><a
href="https://urldefense.com/v3/__https:/github.com/openjdk/jfx/pulls?q=is*3Aopen*is*3Apr*label*3Arfr__;JSslKyU!!ACWV5N9M2RV99hQ!NRHVOIJ65hopuPgetAT7stNzW3jh1BY4ZqHVTLuY3XHIQ72la7gG7TGgT_j0R9q_Gf3_l8RDUswG6IZijoq5ZP_iqZdL$"
moz-do-not-send="true">https://github.com/openjdk/jfx/pulls?q=is%3Aopen+is%3Apr+label%3Arfr</a></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 ""> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 "">-andy</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 ""> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 ""> </span><o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span
style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">openjfx-dev
<a href="mailto:openjfx-dev-retn@openjdk.org"
moz-do-not-send="true">
<openjfx-dev-retn@openjdk.org></a> on behalf of
John Hendrikx <a href="mailto:john.hendrikx@gmail.com"
moz-do-not-send="true">
<john.hendrikx@gmail.com></a><br>
<b>Date: </b>Tuesday, December 5, 2023 at 03:16<br>
<b>To: </b><a href="mailto:openjfx-dev@openjdk.org"
moz-do-not-send="true" class="moz-txt-link-freetext">openjfx-dev@openjdk.org</a>
<a href="mailto:openjfx-dev@openjdk.org"
moz-do-not-send="true">
<openjfx-dev@openjdk.org></a><br>
<b>Subject: </b>Re: eclipse warnings</span><o:p></o:p></p>
</div>
<p>IMHO, there is no capacity for this.<o:p></o:p></p>
<p>I did many warning fixes, and there are PR's outstanding with
warning fixes, but they're not getting reviewed.<o:p></o:p></p>
<p>There are other PR's outstanding that are more valuable, but
are not getting reviewed.<o:p></o:p></p>
<p>I feel we need to fix that first before we can endulge in
warning fixes.<o:p></o:p></p>
<p>As for the potential null pointer access, it's often a false
positive; static analyzers have a hard time determining if a
loop is entered at least once (or an if in that loop) and so
will warn that a local can maybe be null if it was initalized
inside a loop.<o:p></o:p></p>
<p>--John<o:p></o:p></p>
<p class="MsoNormal">On 04/12/2023 17:34, Andy Goryachev wrote:<br>
<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 "">Dear colleagues:</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 ""> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 "">Imported the openjfx project into another
workspace with a more stringent error checking and
discovered a few issues:</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 ""> </span><o:p></o:p></p>
<ol style="margin-top:0in" type="1" start="1">
<li class="MsoListParagraph"
style="margin-left:0in;mso-list:l0 level1 lfo4"><span
style="font-family:"Iosevka Fixed SS16"">potential
null pointer access: 295</span><o:p></o:p></li>
<li class="MsoListParagraph"
style="margin-left:0in;mso-list:l0 level1 lfo4"><span
style="font-family:"Iosevka Fixed SS16"">unnecessary
cast or instanceof: 190</span><o:p></o:p></li>
<li class="MsoListParagraph"
style="margin-left:0in;mso-list:l0 level1 lfo4"><span
style="font-family:"Iosevka Fixed SS16"">redundant
null check: 61</span><o:p></o:p></li>
</ol>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 ""> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 "">Do we want to clean these up?</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 ""> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 "">-andy</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka
Fixed SS16 ""> </span><o:p></o:p></p>
</div>
</blockquote>
</body>
</html>