[Fb-contrib-commit] SF.net SVN: fb-contrib:[1319] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/u
Brought to you by:
dbrosius
From: <dbr...@us...> - 2009-09-26 19:07:35
|
Revision: 1319 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1319&view=rev Author: dbrosius Date: 2009-09-26 19:07:24 +0000 (Sat, 26 Sep 2009) Log Message: ----------- switch getParameterSignatures to return a map Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java 2009-09-26 19:05:22 UTC (rev 1318) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java 2009-09-26 19:07:24 UTC (rev 1319) @@ -18,8 +18,8 @@ */ package com.mebigfatguy.fbcontrib.utils; -import java.util.ArrayList; -import java.util.List; +import java.util.LinkedHashMap; +import java.util.Map; import org.apache.bcel.Constants; import org.apache.bcel.classfile.JavaClass; @@ -146,22 +146,20 @@ } /** - * returns a List that represents the type of the parameter in slot x + * returns a Map that represents the type of the parameter in slot x * * @param m the method for which you want the parameters - * @return a list of parameter types (expect empty slots when doubles/longs are used + * @return a map of parameter types (expect empty slots when doubles/longs are used */ - public List<String> getParameterSignatures(Method m) { + public Map<Integer, String> getParameterSignatures(Method m) { Type[] parms = m.getArgumentTypes(); - List<String> parmSigs = new ArrayList<String>(); + Map<Integer, String> parmSigs = new LinkedHashMap<Integer, String>(); int slot = m.isStatic() ? 0 : 1; for (Type t : parms) { String signature = t.getSignature(); - while (parmSigs.size() <= slot) - parmSigs.add(null); - parmSigs.set(slot, signature); + parmSigs.put(Integer14.valueOf(slot), signature); slot += ("L".equals(signature) || "D".equals(signature)) ? 2 : 1; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |