public static boolean isProcedureStackTraceElement ( String procedureName , StackTraceElement stel ) { int lastPeriodPos = stel . getClassName ( ) . lastIndexOf ( ' ' ) ; if ( lastPeriodPos == - 1 ) { lastPeriodPos = 0 ; } else { ++ lastPeriodPos ; } // Account for inner classes too. Inner classes names comprise of the parent // class path followed by a dollar sign String simpleName = stel . getClassName ( ) . substring ( lastPeriodPos ) ; return simpleName . equals ( procedureName ) || ( simpleName . startsWith ( procedureName ) && simpleName . charAt ( procedureName . length ( ) ) == ' ' ) ; }
Test whether or not the given stack frame is within a procedure invocation