int lastParenCloseIndex = name.lastIndexOf(')'); if ( lastParenCloseIndex != -1 ) { int lastParenOpenIndex = name.lastIndexOf('('); String parenContents = name.substring(lastParenOpenIndex, lastParenCloseIndex); if ( parenContents.indexOf('.') == -1 && parenContents.indexOf('<') == -1 && parenContents.indexOf(':') == -1 ) { name = name.substring(0, lastParenOpenIndex); } }
	public static String getShortName(String name)	{		int parens = 0;		int dotCount = 0;		StringBuffer sb = new StringBuffer();		for ( int i = name.length() - 1; i >= 0; --i )		{			char c = name.charAt(i);			if ( c == ')' )				++parens;			else if ( c == '(' )				--parens;						if ( parens == 0 && ( c == '.' || c == '\\' || c == '/' ) )				++dotCount;			// The second dot encountered will be the dot after the last token in the package name			if ( dotCount == 2 )				break;			sb.append(c);		}		return sb.reverse().toString();	}