Re: How to find field is transient using ASM
Dilanka Muthukumarana <[email protected]> Tue, 18 Dec 2018 14:49:42 +0530
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <CANLbWWvXuTvPPRuPOGwi6Umu9QqqKgJWSnd3goXOxJcN9KvGMw@mail.gmail.com> |
This is a multi-part message in MIME format... ------------=_1545124799-30465-5 Content-Type: multipart/alternative; boundary="0000000000008e4603057d4866a6" --0000000000008e4603057d4866a6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Eunsu/Keith It works for me. Thanks for your help. much appreciated. Regards, Dilanka On Tue, Dec 18, 2018 at 1:49 PM Eunsu Kim <[email protected]> wrote: > You can check this. > (access & ACC_TRANSIENT) !=3D 0 > > > On 18 Dec 2018, at 5:10 PM, Dilanka Muthukumarana <[email protected]> > wrote: > > Hi Keith, > > Thank you for the quick response. but if the field is private transient, > access value coming as 130, but Opcodes.ACC_TRANSIENT value is 128. > > Seems if there is slight difference with the combinations of modifiers > such as public transient / private transient. > > any idea about this? > > <image.png> > =C3=97 > > > Regards, > Dilanka > > On Tue, Dec 18, 2018 at 1:24 PM Keith Chapman <[email protected]> > wrote: > >> Hi Dilanka, >> >> You can check the access field of the object and check if the bit for >> TRANSIENT is set. You can look at [1] as a reference, they do it in there >> using a Class Visitor, >> >> Regards, >> Keith. >> >> http://keith-chapman.com >> >> [1] >> https://github.com/consulo/objectweb-asm/blob/master/asm-commons/src/mai= n/java/org/objectweb/asm/commons/SerialVersionUIDAdder.java >> >> >> On Mon, Dec 17, 2018 at 10:55 PM Dilanka Muthukumarana < >> [email protected]> wrote: >> >>> >>> I am using asm library to find scan jars and find any class is >>> serializable or not. But when scanning via ClassVisitor, I couldn't fig= ure >>> out that how I can ignore transient field which not intends to serializ= e. >>> >>> Could you please give me a suggestion? Much appreciated your effort. >>> >>> On Tue, Dec 18, 2018 at 12:10 PM Dilanka Muthukumarana < >>> [email protected]> wrote: >>> >>>> >>>> Hi All, >>>> >>>> Anyone knows how could I find if the field is transient or not using >>>> asm library. >>>> >>>> >>>> >>>> ~~~~~~~~ >>>> Regards, >>>> Dilanka Muthukumarana >>>> >>>> >>>> >>> >>> >>> -- >>> >>> ~~~~~~~~ >>> Regards, >>> Dilanka Muthukumarana >>> >>> >>> >>> -- >>> You receive this message as a subscriber of the [email protected] list. >>> To unsubscribe: mailto:[email protected] >>> For general help: mailto:[email protected]?subject=3Dhelp >>> OW2 mailing lists service home page: http://www.ow2.org/wws >>> >> > > -- > > ~~~~~~~~ > Regards, > Dilanka Muthukumarana > > > -- > You receive this message as a subscriber of the [email protected] mailing list. > To unsubscribe: mailto:[email protected] <[email protected]> > For general help: mailto:[email protected]?subject=3Dhelp > <[email protected]?subject=3Dhelp> > OW2 mailing lists service home page: http://www.ow2.org/wws > > > --=20 ~~~~~~~~ Regards, Dilanka Muthukumarana --0000000000008e4603057d4866a6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Hi Eunsu/Keith<div><br></div><div>It works for me. Thanks = for your help. much appreciated.</div><div><br></div><div>Regards,</div><di= v>Dilanka</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue= , Dec 18, 2018 at 1:49 PM Eunsu Kim <<a href=3D"mailto:eunsu.bill23@gmai= l.com">[email protected]</a>> wrote:<br></div><blockquote class=3D"= gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(20= 4,204,204);padding-left:1ex"><div style=3D"overflow-wrap: break-word;">You = can check this.<div>=C2=A0<span style=3D"font-family:"Bitstream Vera S= ans Mono";font-size:13.5pt;background-color:rgb(38,50,56);color:rgb(24= 7,140,108)">(access </span><span style=3D"font-family:"Bitstream Vera = Sans Mono";font-size:13.5pt;background-color:rgb(38,50,56);color:rgb(1= 37,221,255)">& </span><span style=3D"font-family:"Bitstream Vera S= ans Mono";font-size:13.5pt;background-color:rgb(38,50,56);color:rgb(24= 7,140,108)">ACC_TRANSIENT) </span><span style=3D"font-family:"Bitstrea= m Vera Sans Mono";font-size:13.5pt;background-color:rgb(38,50,56);colo= r:rgb(137,221,255)">!=3D </span><span style=3D"font-family:"Bitstream = Vera Sans Mono";font-size:13.5pt;background-color:rgb(38,50,56);color:= rgb(247,140,108)">0</span></div><div><div><br></div><div><br><blockquote ty= pe=3D"cite"><div>On 18 Dec 2018, at 5:10 PM, Dilanka Muthukumarana <<a h= ref=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a= >> wrote:</div><br class=3D"gmail-m_-2390539846319731034Apple-interchang= e-newline"><div><div dir=3D"ltr" style=3D"font-family:Helvetica;font-size:4= 8px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-sp= acing:normal;text-align:start;text-indent:0px;text-transform:none;white-spa= ce:normal;word-spacing:0px;text-decoration:none"><div dir=3D"ltr">Hi Keith,= <div><br></div><div>Thank you for the quick response. but if the field is p= rivate transient, access value coming as 130, but=C2=A0Opcodes.ACC_TRANSIEN= T value is 128.</div><div><br></div><div>Seems if there is slight differenc= e with the combinations of modifiers such as public transient / private tra= nsient.</div><div><br></div><div>any idea about this?</div><div><br></div><= div><div><span id=3D"gmail-m_-2390539846319731034cid:ii_jptgwy8v0"><imag= e.png></span><div id=3D"gmail-m_-2390539846319731034eFrame-d92b6e3393c53= b743a92a504" class=3D"gmail-m_-2390539846319731034m-encrypt-frame" style=3D= "display:block"><a class=3D"gmail-m_-2390539846319731034m-frame-close">=C3= =97</a><button id=3D"gmail-m_-2390539846319731034editorBtn" class=3D"gmail-= m_-2390539846319731034m-btn gmail-m_-2390539846319731034m-encrypt-button" t= ype=3D"button"><i class=3D"gmail-m_-2390539846319731034m-icon gmail-m_-2390= 539846319731034m-icon-editor"></i></button></div><br></div></div><div><br><= /div><div>Regards,</div><div>Dilanka=C2=A0</div></div></div><br style=3D"fo= nt-family:Helvetica;font-size:48px;font-style:normal;font-variant-caps:norm= al;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0p= x;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:n= one"><div class=3D"gmail_quote" style=3D"font-family:Helvetica;font-size:48= px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spa= cing:normal;text-align:start;text-indent:0px;text-transform:none;white-spac= e:normal;word-spacing:0px;text-decoration:none"><div dir=3D"ltr">On Tue, De= c 18, 2018 at 1:24 PM Keith Chapman <<a href=3D"mailto:keithgchapman@gma= il.com" target=3D"_blank">[email protected]</a>> wrote:<br></div><= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div dir= =3D"ltr"><div dir=3D"ltr">Hi Dilanka,<div><br></div><div>You can check the = access field of the object and check if the bit for TRANSIENT is set. You c= an look at [1] as a reference, they do it in there using a Class Visitor,</= div><div><br></div><div><div><div dir=3D"ltr" class=3D"gmail-m_-23905398463= 19731034gmail-m_3638424142984411971gmail_signature"><div dir=3D"ltr">Regard= s,<div>Keith.</div><div><br></div><div><a href=3D"http://keith-chapman.com/= " target=3D"_blank">http://keith-chapman.com</a><br></div><div><br></div><d= iv>[1]=C2=A0<a href=3D"https://github.com/consulo/objectweb-asm/blob/master= /asm-commons/src/main/java/org/objectweb/asm/commons/SerialVersionUIDAdder.= java" target=3D"_blank">https://github.com/consulo/objectweb-asm/blob/maste= r/asm-commons/src/main/java/org/objectweb/asm/commons/SerialVersionUIDAdder= .java</a></div></div></div></div><br></div></div></div></div><br><div class= =3D"gmail_quote"><div dir=3D"ltr">On Mon, Dec 17, 2018 at 10:55 PM Dilanka = Muthukumarana <<a href=3D"mailto:[email protected]" target=3D"_blank">= [email protected]</a>> wrote:<br></div><blockquote class=3D"gmail_quot= e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)= ;padding-left:1ex"><div dir=3D"ltr"><br><div><div>I am using asm library to= find scan=C2=A0jars and find any class is serializable or not. But when sc= anning via ClassVisitor, I couldn't figure out that how I can ignore tr= ansient field which not intends to serialize.</div><div><br></div><div>Coul= d you please give me a suggestion? Much appreciated your effort.</div></div= ></div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue, Dec 18, 2018= at 12:10 PM Dilanka Muthukumarana <<a href=3D"mailto:[email protected]= m" target=3D"_blank">[email protected]</a>> wrote:<br></div><blockquot= e class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px s= olid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><br clear=3D"all">= <div>Hi All,</div><div><br></div><div>Anyone knows how could I find if the = field is transient or not using asm library.</div><div><br></div><div><br><= /div><div dir=3D"ltr" class=3D"gmail-m_-2390539846319731034gmail-m_36384241= 42984411971gmail-m_3803305906339499819gmail-m_-1603449129760279831gmail_sig= nature"><div dir=3D"ltr">=C2=A0=C2=A0<div>~~~~~~~~</div><div>Regards, =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0<br>Dilanka Muthukumarana=C2=A0=C2=A0 =C2=A0=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0<br><div>=C2=A0 =C2=A0 =C2=A0=C2=A0</div></div>= </div></div></div></blockquote></div><br clear=3D"all"><div><br></div>--<sp= an class=3D"gmail-m_-2390539846319731034Apple-converted-space">=C2=A0</span= ><br><div dir=3D"ltr" class=3D"gmail-m_-2390539846319731034gmail-m_36384241= 42984411971gmail-m_3803305906339499819gmail_signature"><div dir=3D"ltr">=C2= =A0=C2=A0<div>~~~~~~~~</div><div>Regards, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<b= r>Dilanka Muthukumarana=C2=A0=C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= <br><div>=C2=A0 =C2=A0 =C2=A0=C2=A0</div></div></div></div><br>--<span clas= s=3D"gmail-m_-2390539846319731034Apple-converted-space">=C2=A0</span><br>Yo= u receive this message as a subscriber of the<span class=3D"gmail-m_-239053= 9846319731034Apple-converted-space">=C2=A0</span><a href=3D"mailto:asm@ow2.= org" target=3D"_blank">[email protected]</a>mailing list.<br>To unsubscribe: mail= to:<a href=3D"mailto:[email protected]" target=3D"_blank">asm-unsubsc= [email protected]</a><br>For general help: mailto:<a href=3D"mailto:[email protected]= g" target=3D"_blank">[email protected]</a>?subject=3Dhelp<br>OW2 mailing lists = service home page:<span class=3D"gmail-m_-2390539846319731034Apple-converte= d-space">=C2=A0</span><a href=3D"http://www.ow2.org/wws" rel=3D"noreferrer"= target=3D"_blank">http://www.ow2.org/wws</a><br></blockquote></div></block= quote></div><br clear=3D"all" style=3D"font-family:Helvetica;font-size:48px= ;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spaci= ng:normal;text-align:start;text-indent:0px;text-transform:none;white-space:= normal;word-spacing:0px;text-decoration:none"><div style=3D"font-family:Hel= vetica;font-size:48px;font-style:normal;font-variant-caps:normal;font-weigh= t:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transf= orm:none;white-space:normal;word-spacing:0px;text-decoration:none"><br></di= v><span style=3D"font-family:Helvetica;font-size:48px;font-style:normal;fon= t-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:s= tart;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0p= x;text-decoration:none;float:none;display:inline">--<span class=3D"gmail-m_= -2390539846319731034Apple-converted-space">=C2=A0</span></span><br style=3D= "font-family:Helvetica;font-size:48px;font-style:normal;font-variant-caps:n= ormal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent= :0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoratio= n:none"><div dir=3D"ltr" class=3D"gmail-m_-2390539846319731034gmail_signatu= re" style=3D"font-family:Helvetica;font-size:48px;font-style:normal;font-va= riant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start= ;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;te= xt-decoration:none"><div dir=3D"ltr">=C2=A0=C2=A0<div>~~~~~~~~</div><div>Re= gards, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<br>Dilanka Muthukumarana=C2=A0=C2=A0= =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<br><div>=C2=A0 =C2=A0 =C2=A0=C2= =A0</div></div></div></div><br style=3D"font-family:Helvetica;font-size:48p= x;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spac= ing:normal;text-align:start;text-indent:0px;text-transform:none;white-space= :normal;word-spacing:0px;text-decoration:none"><span style=3D"font-family:H= elvetica;font-size:48px;font-style:normal;font-variant-caps:normal;font-wei= ght:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-tran= sform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:n= one;display:inline">--<span class=3D"gmail-m_-2390539846319731034Apple-conv= erted-space">=C2=A0</span></span><br style=3D"font-family:Helvetica;font-si= ze:48px;font-style:normal;font-variant-caps:normal;font-weight:normal;lette= r-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white= -space:normal;word-spacing:0px;text-decoration:none"><span style=3D"font-fa= mily:Helvetica;font-size:48px;font-style:normal;font-variant-caps:normal;fo= nt-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;tex= t-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;f= loat:none;display:inline">You receive this message as a subscriber of the<s= pan class=3D"gmail-m_-2390539846319731034Apple-converted-space">=C2=A0</spa= n></span><a href=3D"mailto:[email protected]" style=3D"font-family:Helvetica;font= -size:48px;font-style:normal;font-variant-caps:normal;font-weight:normal;le= tter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;wh= ite-space:normal;word-spacing:0px" target=3D"_blank">[email protected]</a><span s= tyle=3D"font-family:Helvetica;font-size:48px;font-style:normal;font-variant= -caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text= -indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-de= coration:none;float:none;display:inline"><span class=3D"gmail-m_-2390539846= 319731034Apple-converted-space">=C2=A0</span>mailing list.</span><br style= =3D"font-family:Helvetica;font-size:48px;font-style:normal;font-variant-cap= s:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-ind= ent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decora= tion:none"><span style=3D"font-family:Helvetica;font-size:48px;font-style:n= ormal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;tex= t-align:start;text-indent:0px;text-transform:none;white-space:normal;word-s= pacing:0px;text-decoration:none;float:none;display:inline">To unsubscribe:<= span class=3D"gmail-m_-2390539846319731034Apple-converted-space">=C2=A0</sp= an></span><a href=3D"mailto:[email protected]" style=3D"font-family:H= elvetica;font-size:48px;font-style:normal;font-variant-caps:normal;font-wei= ght:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-tran= sform:none;white-space:normal;word-spacing:0px" target=3D"_blank">mailto:as= [email protected]</a><br style=3D"font-family:Helvetica;font-size:48px;= font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacin= g:normal;text-align:start;text-indent:0px;text-transform:none;white-space:n= ormal;word-spacing:0px;text-decoration:none"><span style=3D"font-family:Hel= vetica;font-size:48px;font-style:normal;font-variant-caps:normal;font-weigh= t:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transf= orm:none;white-space:normal;word-spacing:0px;text-decoration:none;float:non= e;display:inline">For general help:<span class=3D"gmail-m_-2390539846319731= 034Apple-converted-space">=C2=A0</span></span><a href=3D"mailto:[email protected]= rg?subject=3Dhelp" style=3D"font-family:Helvetica;font-size:48px;font-style= :normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;t= ext-align:start;text-indent:0px;text-transform:none;white-space:normal;word= -spacing:0px" target=3D"_blank">mailto:[email protected]?subject=3Dhelp</a><br = style=3D"font-family:Helvetica;font-size:48px;font-style:normal;font-varian= t-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;tex= t-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-d= ecoration:none"><span style=3D"font-family:Helvetica;font-size:48px;font-st= yle:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:norma= l;text-align:start;text-indent:0px;text-transform:none;white-space:normal;w= ord-spacing:0px;text-decoration:none;float:none;display:inline">OW2 mailing= lists service home page:<span class=3D"gmail-m_-2390539846319731034Apple-c= onverted-space">=C2=A0</span></span><a href=3D"http://www.ow2.org/wws" styl= e=3D"font-family:Helvetica;font-size:48px;font-style:normal;font-variant-ca= ps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-in= dent:0px;text-transform:none;white-space:normal;word-spacing:0px" target=3D= "_blank">http://www.ow2.org/wws</a></div></blockquote></div><br></div></div= ></blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr= " class=3D"gmail_signature"><div dir=3D"ltr">=C2=A0=C2=A0<div>~~~~~~~~</div= ><div>Regards, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<br>Dilanka Muthukumarana=C2= =A0=C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<br><div>=C2=A0 =C2=A0 =C2= =A0=C2=A0 </div></div></div></div> --0000000000008e4603057d4866a6-- ------------=_1545124799-30465-5 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit -- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws ------------=_1545124799-30465-5--