Re: How to find field is transient using ASM

Keith Chapman <[email protected]> Mon, 17 Dec 2018 23:53:55 -0800
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <CAKVtN-53YX9mKTkmN+8KewbEWJDfqp8v9j9hynvrBiJ75V55zw@mail.gmail.com>
This is a multi-part message in MIME format...

------------=_1545119651-30465-2
Content-Type: multipart/alternative; boundary="000000000000a8a39f057d4733a0"

--000000000000a8a39f057d4733a0
Content-Type: text/plain; charset="UTF-8"

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/main/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 figure
> out that how I can ignore transient field which not intends to serialize.
>
> 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] 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
>

--000000000000a8a39f057d4733a0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr">Hi Dilanka,<div><br></di=
v><div>You can check the access field of the object and check if the bit fo=
r TRANSIENT is set. You can 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" clas=
s=3D"gmail_signature"><div dir=3D"ltr">Regards,<div>Keith.</div><div><br></=
div><div><a href=3D"http://keith-chapman.com" target=3D"_blank">http://keit=
h-chapman.com</a><br></div><div><br></div><div>[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">https://github.com/consul=
o/objectweb-asm/blob/master/asm-commons/src/main/java/org/objectweb/asm/com=
mons/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 &lt;<a href=3D"mailto:dilanka85@gma=
il.com">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gm=
ail_quote" 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 li=
brary to find scan=C2=A0jars and find any class is serializable or not. But=
 when scanning via ClassVisitor, I couldn&#39;t figure out that how I can i=
gnore transient field which not intends to serialize.</div><div><br></div><=
div>Could you please give me a suggestion? Much appreciated your effort.</d=
iv></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue, Dec =
18, 2018 at 12:10 PM Dilanka Muthukumarana &lt;<a href=3D"mailto:dilanka85@=
gmail.com" target=3D"_blank">[email protected]</a>&gt; wrote:<br></div><b=
lockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-le=
ft:1px solid 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 fin=
d 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_3803305906339499819gmail-m_=
-1603449129760279831gmail_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 Muthukum=
arana=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>-- <br><div dir=3D"ltr"=
 class=3D"gmail-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>
-- <br>
You receive this message as a subscriber of the <a href=3D"mailto:[email protected]=
rg" target=3D"_blank">[email protected]</a> mailing list.<br>
To unsubscribe: mailto:<a href=3D"mailto:[email protected]" target=3D=
"_blank">[email protected]</a><br>
For general help: mailto:<a href=3D"mailto:[email protected]" target=3D"_blank"=
>[email protected]</a>?subject=3Dhelp<br>
OW2 mailing lists service home page: <a href=3D"http://www.ow2.org/wws" rel=
=3D"noreferrer" target=3D"_blank">http://www.ow2.org/wws</a><br>
</blockquote></div>

--000000000000a8a39f057d4733a0--

------------=_1545119651-30465-2
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

------------=_1545119651-30465-2--