[Fb-contrib-commit] SF.net SVN: fb-contrib: [614] trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/de
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-08-14 05:00:45
|
Revision: 614 Author: dbrosius Date: 2006-08-13 22:00:38 -0700 (Sun, 13 Aug 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=614&view=rev Log Message: ----------- if the localvariabletable attribute exists, use the lifetime of the catch exception variable as a determiner of when the catch block ends. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java 2006-08-12 17:18:40 UTC (rev 613) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java 2006-08-14 05:00:38 UTC (rev 614) @@ -32,6 +32,8 @@ import org.apache.bcel.classfile.Code; import org.apache.bcel.classfile.CodeException; import org.apache.bcel.classfile.JavaClass; +import org.apache.bcel.classfile.LocalVariable; +import org.apache.bcel.classfile.LocalVariableTable; import org.apache.bcel.classfile.Method; import com.mebigfatguy.fbcontrib.utils.Integer14; @@ -178,6 +180,13 @@ int reg = RegisterUtils.getAStoreReg(this, seen); catchInfo.setReg(reg); exReg.put(Integer14.valueOf(reg), Boolean.TRUE); + LocalVariableTable lvt = getMethod().getLocalVariableTable(); + if (lvt != null) { + LocalVariable lv = lvt.getLocalVariable(reg, pc); + int finish = lv.getStartPC() + lv.getLength(); + if (finish < catchInfo.getFinish()) + catchInfo.setFinish(finish); + } break; } } else if (pc > catchInfo.getFinish()) { @@ -280,6 +289,10 @@ return catchFinish; } + public void setFinish(int finish) { + catchFinish = finish; + } + public int getRegister() { return exReg; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |