Re: How to find field is transient using ASM
Eunsu Kim <[email protected]> Tue, 18 Dec 2018 17:19:06 +0900
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format... ------------=_1545121155-30465-4 Content-Type: multipart/alternative; boundary="Apple-Mail=_85FF6609-A019-4D98-A789-B645148310F2" --Apple-Mail=_85FF6609-A019-4D98-A789-B645148310F2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 You can check this. (access & ACC_TRANSIENT) !=3D 0 > On 18 Dec 2018, at 5:10 PM, Dilanka Muthukumarana <[email protected]> w= rote: >=20 > Hi Keith, >=20 > 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. >=20 > Seems if there is slight difference with the combinations of modifiers su= ch as public transient / private transient. >=20 > any idea about this? >=20 > <image.png> > =C3=97 <> >=20 > Regards, > Dilanka=20 >=20 > On Tue, Dec 18, 2018 at 1:24 PM Keith Chapman <[email protected] <m= ailto:[email protected]>> wrote: > Hi Dilanka, >=20 > You can check the access field of the object and check if the bit for TRA= NSIENT is set. You can look at [1] as a reference, they do it in there usin= g a Class Visitor, >=20 > Regards, > Keith. >=20 > http://keith-chapman.com <http://keith-chapman.com/> >=20 > [1] https://github.com/consulo/objectweb-asm/blob/master/asm-commons/src/= main/java/org/objectweb/asm/commons/SerialVersionUIDAdder.java <https://git= hub.com/consulo/objectweb-asm/blob/master/asm-commons/src/main/java/org/obj= ectweb/asm/commons/SerialVersionUIDAdder.java> >=20 > On Mon, Dec 17, 2018 at 10:55 PM Dilanka Muthukumarana <[email protected]= om <mailto:[email protected]>> wrote: >=20 > I am using asm library to find scan jars and find any class is serializab= le or not. But when scanning via ClassVisitor, I couldn't figure out that h= ow I can ignore transient field which not intends to serialize. >=20 > Could you please give me a suggestion? Much appreciated your effort. >=20 > On Tue, Dec 18, 2018 at 12:10 PM Dilanka Muthukumarana <[email protected]= om <mailto:[email protected]>> wrote: >=20 > Hi All, >=20 > Anyone knows how could I find if the field is transient or not using asm = library. >=20 >=20 >=20=20=20 > ~~~~~~~~ > Regards,=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20 > Dilanka Muthukumarana=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 >=20=20=20=20=20=20=20 >=20 >=20 > --=20 >=20=20=20 > ~~~~~~~~ > Regards,=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20 > Dilanka Muthukumarana=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 >=20=20=20=20=20=20=20 >=20 > --=20 > You receive this message as a subscriber of the [email protected] <mailto:asm@o= w2.org>mailing list. > To unsubscribe: mailto:[email protected] <mailto:asm-unsubscribe@ow= 2.org> > For general help: mailto:[email protected] <mailto:[email protected]>?subject=3Dh= elp > OW2 mailing lists service home page: http://www.ow2.org/wws <http://www.o= w2.org/wws> >=20 >=20 > --=20 >=20=20=20 > ~~~~~~~~ > Regards,=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20 > Dilanka Muthukumarana=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 >=20=20=20=20=20=20=20 >=20 > --=20 > You receive this message as a subscriber of the [email protected] <mailto:asm@o= w2.org> mailing list. > To unsubscribe: mailto:[email protected] <mailto:asm-unsubscribe@ow= 2.org> > For general help: mailto:[email protected]?subject=3Dhelp <mailto:[email protected]= rg?subject=3Dhelp> > OW2 mailing lists service home page: http://www.ow2.org/wws <http://www.o= w2.org/wws> --Apple-Mail=_85FF6609-A019-4D98-A789-B645148310F2 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset= =3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s= pace; line-break: after-white-space;" class=3D"">You can check this.<div cl= ass=3D""> <span style=3D"font-family: "Bitstream Vera Sans Mono&q= uot;; font-size: 13.5pt; background-color: rgb(38, 50, 56); color: rgb(247,= 140, 108);" class=3D"">(access </span><span style=3D"font-family: "Bi= tstream Vera Sans Mono"; font-size: 13.5pt; background-color: rgb(38, = 50, 56); color: rgb(137, 221, 255);" class=3D"">& </span><span style=3D= "font-family: "Bitstream Vera Sans Mono"; font-size: 13.5pt; back= ground-color: rgb(38, 50, 56); color: rgb(247, 140, 108);" class=3D"">ACC_T= RANSIENT) </span><span style=3D"font-family: "Bitstream Vera Sans Mono= "; font-size: 13.5pt; background-color: rgb(38, 50, 56); color: rgb(13= 7, 221, 255);" class=3D"">!=3D </span><span style=3D"font-family: "Bit= stream Vera Sans Mono"; font-size: 13.5pt; background-color: rgb(38, 5= 0, 56); color: rgb(247, 140, 108);" class=3D"">0</span></div><div class=3D"= "><div class=3D""><br class=3D""></div><div><br class=3D""><blockquote type= =3D"cite" class=3D""><div class=3D"">On 18 Dec 2018, at 5:10 PM, Dilanka Mu= thukumarana <<a href=3D"mailto:[email protected]" class=3D"">dilanka85= @gmail.com</a>> wrote:</div><br class=3D"Apple-interchange-newline"><div= class=3D""><div dir=3D"ltr" style=3D"caret-color: rgb(0, 0, 0); font-famil= y: Helvetica; font-size: 48px; font-style: normal; font-variant-caps: norma= l; font-weight: normal; letter-spacing: normal; text-align: start; text-ind= ent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -we= bkit-text-stroke-width: 0px; text-decoration: none;" class=3D""><div dir=3D= "ltr" class=3D"">Hi Keith,<div class=3D""><br class=3D""></div><div class= =3D"">Thank you for the quick response. but if the field is private transie= nt, access value coming as 130, but Opcodes.ACC_TRANSIENT value is 128= .</div><div class=3D""><br class=3D""></div><div class=3D"">Seems if there = is slight difference with the combinations of modifiers such as public tran= sient / private transient.</div><div class=3D""><br class=3D""></div><div c= lass=3D"">any idea about this?</div><div class=3D""><br class=3D""></div><d= iv class=3D""><div class=3D""><span id=3D"cid:ii_jptgwy8v0"><image.png&g= t;</span><div id=3D"eFrame-d92b6e3393c53b743a92a504" class=3D"m-encrypt-fra= me" style=3D"display: block;"><a class=3D"m-frame-close">=C3=97</a><button = id=3D"editorBtn" class=3D"m-btn m-encrypt-button" type=3D"button"><i class= =3D"m-icon m-icon-editor"></i></button></div><br class=3D""></div></div><di= v class=3D""><br class=3D""></div><div class=3D"">Regards,</div><div class= =3D"">Dilanka </div></div></div><br style=3D"caret-color: rgb(0, 0, 0)= ; font-family: Helvetica; font-size: 48px; font-style: normal; font-variant= -caps: normal; font-weight: normal; letter-spacing: normal; text-align: sta= rt; text-indent: 0px; text-transform: none; white-space: normal; word-spaci= ng: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=3D""= ><div class=3D"gmail_quote" style=3D"caret-color: rgb(0, 0, 0); font-family= : Helvetica; font-size: 48px; font-style: normal; font-variant-caps: normal= ; font-weight: normal; letter-spacing: normal; text-align: start; text-inde= nt: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -web= kit-text-stroke-width: 0px; text-decoration: none;"><div dir=3D"ltr" class= =3D"">On Tue, Dec 18, 2018 at 1:24 PM Keith Chapman <<a href=3D"mailto:k= [email protected]" class=3D"">[email protected]</a>> wrote:<b= r class=3D""></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0= px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left= -color: rgb(204, 204, 204); padding-left: 1ex;"><div dir=3D"ltr" class=3D""= ><div dir=3D"ltr" class=3D""><div dir=3D"ltr" class=3D"">Hi Dilanka,<div cl= ass=3D""><br class=3D""></div><div class=3D"">You can check the access fiel= d 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,</div><div cl= ass=3D""><br class=3D""></div><div class=3D""><div class=3D""><div dir=3D"l= tr" class=3D"gmail-m_3638424142984411971gmail_signature"><div dir=3D"ltr" c= lass=3D"">Regards,<div class=3D"">Keith.</div><div class=3D""><br class=3D"= "></div><div class=3D""><a href=3D"http://keith-chapman.com/" target=3D"_bl= ank" class=3D"">http://keith-chapman.com</a><br class=3D""></div><div class= =3D""><br class=3D""></div><div class=3D"">[1] <a href=3D"https://gith= ub.com/consulo/objectweb-asm/blob/master/asm-commons/src/main/java/org/obje= ctweb/asm/commons/SerialVersionUIDAdder.java" target=3D"_blank" class=3D"">= https://github.com/consulo/objectweb-asm/blob/master/asm-commons/src/main/j= ava/org/objectweb/asm/commons/SerialVersionUIDAdder.java</a></div></div></d= iv></div><br class=3D""></div></div></div></div><br class=3D""><div class= =3D"gmail_quote"><div dir=3D"ltr" class=3D"">On Mon, Dec 17, 2018 at 10:55 = PM Dilanka Muthukumarana <<a href=3D"mailto:[email protected]" target= =3D"_blank" class=3D"">[email protected]</a>> wrote:<br class=3D""></d= iv><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; bo= rder-left-width: 1px; border-left-style: solid; border-left-color: rgb(204,= 204, 204); padding-left: 1ex;"><div dir=3D"ltr" class=3D""><br class=3D"">= <div class=3D""><div class=3D"">I am using asm library to find scan ja= rs and find any class is serializable or not. But when scanning via ClassVi= sitor, I couldn't figure out that how I can ignore transient field which no= t intends to serialize.</div><div class=3D""><br class=3D""></div><div clas= s=3D"">Could you please give me a suggestion? Much appreciated your effort.= </div></div></div><br class=3D""><div class=3D"gmail_quote"><div dir=3D"ltr= " class=3D"">On Tue, Dec 18, 2018 at 12:10 PM Dilanka Muthukumarana <<a = href=3D"mailto:[email protected]" target=3D"_blank" class=3D"">dilanka85@= gmail.com</a>> wrote:<br class=3D""></div><blockquote class=3D"gmail_quo= te" style=3D"margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left= -style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><= div dir=3D"ltr" class=3D""><br clear=3D"all" class=3D""><div class=3D"">Hi = All,</div><div class=3D""><br class=3D""></div><div class=3D"">Anyone knows= how could I find if the field is transient or not using asm library.</div>= <div class=3D""><br class=3D""></div><div class=3D""><br class=3D""></div><= div dir=3D"ltr" class=3D"gmail-m_3638424142984411971gmail-m_380330590633949= 9819gmail-m_-1603449129760279831gmail_signature"><div dir=3D"ltr" class=3D"= "> <div class=3D"">~~~~~~~~</div><div class=3D"">Regards, = &nbs= p; <br class=3D"">Dilanka Muthukumarana &nb= sp; &n= bsp; &= nbsp; <br class=3D""><div class=3D""> &nbs= p; </div></div></div></div></div></blockquote></div><br clear= =3D"all" class=3D""><div class=3D""><br class=3D""></div>--<span class=3D"A= pple-converted-space"> </span><br class=3D""><div dir=3D"ltr" class=3D= "gmail-m_3638424142984411971gmail-m_3803305906339499819gmail_signature"><di= v dir=3D"ltr" class=3D""> <div class=3D"">~~~~~~~~</div><div cla= ss=3D"">Regards, &n= bsp; <br class=3D"">Dilanka Muthuk= umarana = = <br class=3D""><div= class=3D""> </div></div></div></div><br class=3D"= ">--<span class=3D"Apple-converted-space"> </span><br class=3D"">You r= eceive this message as a subscriber of the<span class=3D"Apple-converted-sp= ace"> </span><a href=3D"mailto:[email protected]" target=3D"_blank" class=3D= "">[email protected]</a>mailing list.<br class=3D"">To unsubscribe: mailto:<a hre= f=3D"mailto:[email protected]" target=3D"_blank" class=3D"">asm-unsub= [email protected]</a><br class=3D"">For general help: mailto:<a href=3D"mailto= :[email protected]" target=3D"_blank" class=3D"">[email protected]</a>?subject=3Dhe= lp<br class=3D"">OW2 mailing lists service home page:<span class=3D"Apple-c= onverted-space"> </span><a href=3D"http://www.ow2.org/wws" rel=3D"nore= ferrer" target=3D"_blank" class=3D"">http://www.ow2.org/wws</a><br class=3D= ""></blockquote></div></blockquote></div><br clear=3D"all" style=3D"caret-c= olor: rgb(0, 0, 0); font-family: Helvetica; font-size: 48px; font-style: no= rmal; font-variant-caps: normal; font-weight: normal; letter-spacing: norma= l; text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration:= none;" class=3D""><div style=3D"caret-color: rgb(0, 0, 0); font-family: He= lvetica; font-size: 48px; font-style: normal; font-variant-caps: normal; fo= nt-weight: normal; letter-spacing: normal; text-align: start; text-indent: = 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-= text-stroke-width: 0px; text-decoration: none;" class=3D""><br class=3D""><= /div><span style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font= -size: 48px; font-style: normal; font-variant-caps: normal; font-weight: no= rmal; letter-spacing: normal; text-align: start; text-indent: 0px; text-tra= nsform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-w= idth: 0px; text-decoration: none; float: none; display: inline !important;"= class=3D"">--<span class=3D"Apple-converted-space"> </span></span><br= style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 48p= x; font-style: normal; font-variant-caps: normal; font-weight: normal; lett= er-spacing: normal; text-align: start; text-indent: 0px; text-transform: no= ne; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;= text-decoration: none;" class=3D""><div dir=3D"ltr" class=3D"gmail_signatu= re" style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 48px; font-style: normal; font-variant-caps: normal; font-weight: normal; l= etter-spacing: normal; text-align: start; text-indent: 0px; text-transform:= none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0= px; text-decoration: none;"><div dir=3D"ltr" class=3D""> <div cl= ass=3D"">~~~~~~~~</div><div class=3D"">Regards, = &nbs= p;<br class=3D"">Dilanka Muthukumarana &nbs= p; &n= bsp; &= nbsp; <br class=3D""><div class=3D""> </div>= </div></div></div><br style=3D"caret-color: rgb(0, 0, 0); font-family: Helv= etica; font-size: 48px; font-style: normal; font-variant-caps: normal; font= -weight: normal; letter-spacing: normal; text-align: start; text-indent: 0p= x; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-te= xt-stroke-width: 0px; text-decoration: none;" class=3D""><span style=3D"car= et-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 48px; font-style= : normal; font-variant-caps: normal; font-weight: normal; letter-spacing: n= ormal; text-align: start; text-indent: 0px; text-transform: none; white-spa= ce: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decorat= ion: none; float: none; display: inline !important;" class=3D"">--<span cla= ss=3D"Apple-converted-space"> </span></span><br style=3D"caret-color: = rgb(0, 0, 0); font-family: Helvetica; font-size: 48px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; tex= t-align: start; text-indent: 0px; text-transform: none; white-space: normal= ; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;= " class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: Helveti= ca; font-size: 48px; font-style: normal; font-variant-caps: normal; font-we= ight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-= stroke-width: 0px; text-decoration: none; float: none; display: inline !imp= ortant;" class=3D"">You receive this message as a subscriber of the<span cl= ass=3D"Apple-converted-space"> </span></span><a href=3D"mailto:asm@ow2= .org" style=3D"font-family: Helvetica; font-size: 48px; font-style: normal;= font-variant-caps: normal; font-weight: normal; letter-spacing: normal; or= phans: auto; text-align: start; text-indent: 0px; text-transform: none; whi= te-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust= : auto; -webkit-text-stroke-width: 0px;" class=3D"">[email protected]</a><span st= yle=3D"caret-color: rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; te= xt-decoration: none; float: none; display: inline !important;" class=3D""><= span class=3D"Apple-converted-space"> </span>mailing list.</span><br s= tyle=3D"caret-color: rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; t= ext-decoration: none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0);= font-family: Helvetica; font-size: 48px; font-style: normal; font-variant-= caps: normal; font-weight: normal; letter-spacing: normal; text-align: star= t; text-indent: 0px; text-transform: none; white-space: normal; word-spacin= g: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none;= display: inline !important;" class=3D"">To unsubscribe:<span class=3D"Appl= e-converted-space"> </span></span><a href=3D"mailto:asm-unsubscribe@ow= 2.org" style=3D"font-family: Helvetica; font-size: 48px; font-style: normal= ; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; o= rphans: auto; text-align: start; text-indent: 0px; text-transform: none; wh= ite-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjus= t: auto; -webkit-text-stroke-width: 0px;" class=3D"">mailto:asm-unsubscribe= @ow2.org</a><br style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica;= font-size: 48px; font-style: normal; font-variant-caps: normal; font-weigh= t: normal; letter-spacing: normal; text-align: start; text-indent: 0px; tex= t-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-str= oke-width: 0px; text-decoration: none;" class=3D""><span style=3D"caret-col= or: rgb(0, 0, 0); font-family: Helvetica; font-size: 48px; font-style: norm= al; font-variant-caps: normal; font-weight: normal; letter-spacing: normal;= text-align: start; text-indent: 0px; text-transform: none; white-space: no= rmal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: n= one; float: none; display: inline !important;" class=3D"">For general help:= <span class=3D"Apple-converted-space"> </span></span><a href=3D"mailto= :[email protected]?subject=3Dhelp" style=3D"font-family: Helvetica; font-size: = 48px; font-style: normal; font-variant-caps: normal; font-weight: normal; l= etter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;= -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=3D"= ">mailto:[email protected]?subject=3Dhelp</a><br style=3D"caret-color: rgb(0, 0= , 0); font-family: Helvetica; font-size: 48px; font-style: normal; font-var= iant-caps: normal; font-weight: normal; letter-spacing: normal; text-align:= start; text-indent: 0px; text-transform: none; white-space: normal; word-s= pacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class= =3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; fon= t-size: 48px; font-style: normal; font-variant-caps: normal; font-weight: n= ormal; letter-spacing: normal; text-align: start; text-indent: 0px; text-tr= ansform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-= width: 0px; text-decoration: none; float: none; display: inline !important;= " class=3D"">OW2 mailing lists service home page:<span class=3D"Apple-conve= rted-space"> </span></span><a href=3D"http://www.ow2.org/wws" style=3D= "font-family: Helvetica; font-size: 48px; font-style: normal; font-variant-= caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; t= ext-align: start; text-indent: 0px; text-transform: none; white-space: norm= al; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webki= t-text-stroke-width: 0px;" class=3D"">http://www.ow2.org/wws</a></div></blo= ckquote></div><br class=3D""></div></body></html>= --Apple-Mail=_85FF6609-A019-4D98-A789-B645148310F2-- ------------=_1545121155-30465-4 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 ------------=_1545121155-30465-4--