<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<html><head><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
p.xmsonormal, li.xmsonormal, div.xmsonormal
{mso-style-name:x_msonormal;
margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle23
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word"><div class="WordSection1"><p class="MsoNormal">Sorry – typo: ‘constant()’</p><p class="MsoNormal"> </p><div><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b>From:</b> Chen Liang <<a href="mailto:chen.l.liang@oracle.com">chen.l.liang@oracle.com</a>> <br><b>Sent:</b> Monday, November 25, 2024 2:35 PM<br><b>To:</b> Mark Roberts <<a href="mailto:markro@cs.washington.edu">markro@cs.washington.edu</a>>; <a href="mailto:classfile-api-dev@openjdk.org">classfile-api-dev@openjdk.org</a><br><b>Subject:</b> Re: [External] : how does one get value of ConstantValueAttribute?</p></div></div><p class="MsoNormal"> </p><div><p class="MsoNormal"><span style="font-size:12.0pt;font-family:Aptos;color:black">Hi Mark,</span></p></div><div><p class="MsoNormal"><span style="font-size:12.0pt;font-family:Aptos;color:black">I don't understand your question. Nowhere in any document mentions there's a "const" in ConstantValueAttribute. Its Javadoc is available here:</span></p></div><div><p class="MsoNormal"><span style="font-size:12.0pt;font-family:Aptos;color:black"><a href="https://download.java.net/java/early_access/jdk24/docs/api/java.base/java/lang/classfile/attribute/ConstantValueAttribute.html">https://download.java.net/java/early_access/jdk24/docs/api/java.base/java/lang/classfile/attribute/ConstantValueAttribute.html</a></span></p></div><div><p class="MsoNormal"><span style="font-size:12.0pt;font-family:Aptos;color:black">So once you get a ConstantValueAttribute from a field, you can check its constant() accessor, and pattern match to check if it is an IntegerEntry/StringEntry etc.</span></p></div><div><p class="MsoNormal"><span style="font-size:12.0pt;font-family:Aptos;color:black"> </span></p></div><div><p class="MsoNormal"><span style="font-size:12.0pt;font-family:Aptos;color:black">Regards,</span></p></div><div><p class="MsoNormal"><span style="font-size:12.0pt;font-family:Aptos;color:black">Chen Liang</span></p></div><div class="MsoNormal" align="center" style="text-align:center"><hr size="2" width="98%" align="center"></div><div id="divRplyFwdMsg"><p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Mark Roberts <<a href="mailto:markro@cs.washington.edu">markro@cs.washington.edu</a>><br><b>Sent:</b> Monday, November 25, 2024 4:17 PM<br><b>To:</b> Chen Liang <<a href="mailto:chen.l.liang@oracle.com">chen.l.liang@oracle.com</a>>; <a href="mailto:classfile-api-dev@openjdk.org">classfile-api-dev@openjdk.org</a> <<a href="mailto:classfile-api-dev@openjdk.org">classfile-api-dev@openjdk.org</a>><br><b>Subject:</b> [External] : how does one get value of ConstantValueAttribute?</span> </p><div><p class="MsoNormal"> </p></div></div><div><div><p class="xmsonormal">ConstantValueAttribute:const() is not public. The documentation implies it is. How do you get the value?</p><p class="xmsonormal"> </p><p class="xmsonormal">Thanks,</p><p class="xmsonormal">Mark</p><p class="xmsonormal"> </p></div></div></div></body></html>