Help need to write custom rules

View: New views
1 Messages — Rating Filter:   Alert me  

Help need to write custom rules

by Gaurav Thakur-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi All,

 

 

I`m trying to write some custom FindBugs rules.

I need some help as to figure out how to get the value as highlighted below,

I`m able to get the correct OPCODE value in side the sawopcode method but when I try to call the super class methods to get operand or other information

I always get an exception “xxxmethod called but value not available”;

 

I need to get the value like the value being pushed on to the stack using bipush or sipush.

 

Code::Code(max_stack = 2, max_locals = 2, code_length = 23)

0:    ldc               "AES" (3)

2:    invokestatic      javax.crypto.KeyGenerator.getInstance (Ljava/lang/String

;)Ljavax/crypto/KeyGenerator; (4)

5:    astore_1

6:    aload_1

7:    bipush            127        

9:    invokevirtual     javax.crypto.KeyGenerator.init (I)V (5)

12:   aload_0

13:   getfield          com.symcor.pmd.test.KeyTooShort.k1 Ljavax/crypto/KeyGenerator; (2)

16:   sipush            128

19:   invokevirtual     javax.crypto.KeyGenerator.init (I)V (5)

22:   return

 

Please help me out.

 

Thanks & Regards

Gaurav Thakur

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are not 
to copy, disclose, or distribute this e-mail or its contents to any other person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken 
every reasonable precaution to minimize this risk, but is not liable for any damage 
you may sustain as a result of any virus in this e-mail. You should carry out your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

_______________________________________________
Findbugs-discuss mailing list
Findbugs-discuss@...
https://mailman.cs.umd.edu/mailman/listinfo/findbugs-discuss