int lastSlash = CharOperation.lastIndexOf(File.separatorChar, charName); if (lastSlash != -1) { char[] modulePath = CharOperation.subarray(charName, 0, lastSlash); lastSlash = CharOperation.lastIndexOf(File.separatorChar, modulePath); if (lastSlash == -1) { lastSlash = 0;
/** * Converts a java binary name to a simple name. */ public static char[] binaryNameToSimpleName(char[] binaryName) { int skipIndex = Math.max( Math.max(CharOperation.lastIndexOf('$', binaryName), CharOperation.lastIndexOf('.', binaryName)), CharOperation.lastIndexOf('/', binaryName)) + 1; return CharArrayUtils.subarray(binaryName, skipIndex); }
@Override public String getElementName() { if (m_fileName == null) { char[] array = m_astNode.getFileName(); int i = Math.max(CharOperation.lastIndexOf('/', array), CharOperation.lastIndexOf('\\', array)); m_fileName = i >= 0 ? new String(array, i + 1, array.length - i - 1) : new String(array); } return m_fileName; }
private char[] getReturnType(char[] methodSignature) { // skip type parameters int paren = CharOperation.lastIndexOf(')', methodSignature); // there could be thrown exceptions behind, thus scan one type exactly return CharOperation.subarray(methodSignature, paren + 1, methodSignature.length); }
private char[] getReturnType(char[] methodSignature) { // skip type parameters int paren = CharOperation.lastIndexOf(')', methodSignature); // there could be thrown exceptions behind, thus scan one type exactly return CharOperation.subarray(methodSignature, paren + 1, methodSignature.length); }
public char[][] getPackageName() { char[] typeName = this.initialTypeName.toCharArray(); int lastIndex = CharOperation.lastIndexOf('/', typeName); return CharOperation.splitOn('/', typeName, 0, lastIndex); } public int hashCode() {
private char[] getReturnType(char[] methodSignature) { // skip type parameters int paren = CharOperation.lastIndexOf(')', methodSignature); // there could be thrown exceptions behind, thus scan one type exactly return CharOperation.subarray(methodSignature, paren + 1, methodSignature.length); }
private char[] getReturnType(char[] methodSignature) { // skip type parameters int paren = CharOperation.lastIndexOf(')', methodSignature); // there could be thrown exceptions behind, thus scan one type exactly return CharOperation.subarray(methodSignature, paren + 1, methodSignature.length); }
public char[][] getPackageName() { char[] typeName = this.initialTypeName.toCharArray(); int lastIndex = CharOperation.lastIndexOf('/', typeName); return CharOperation.splitOn('/', typeName, 0, lastIndex); } public int hashCode() {
private char[] getReturnType(char[] methodSignature) { // skip type parameters int paren = CharOperation.lastIndexOf(')', methodSignature); // there could be thrown exceptions behind, thus scan one type exactly return CharOperation.subarray(methodSignature, paren + 1, methodSignature.length); }
public char[][] getPackageName() { char[] typeName = this.initialTypeName.toCharArray(); int lastIndex = CharOperation.lastIndexOf('/', typeName); return CharOperation.splitOn('/', typeName, 0, lastIndex); } public int hashCode() {
private char[] getReturnType(char[] methodSignature) { // skip type parameters int paren = CharOperation.lastIndexOf(')', methodSignature); // there could be thrown exceptions behind, thus scan one type exactly return CharOperation.subarray(methodSignature, paren + 1, methodSignature.length); }
public char[] getMainTypeName() { char[] typeName = this.initialTypeName.toCharArray(); int lastIndex = CharOperation.lastIndexOf('/', typeName); return CharOperation.subarray(typeName, lastIndex + 1, -1); }
private String returnClassName(char[] classInfoName) { if (classInfoName.length == 0) { return EMPTY_CLASS_NAME; } else if (isCompact()) { int lastIndexOfSlash = CharOperation.lastIndexOf('/', classInfoName); if (lastIndexOfSlash != -1) { return new String(classInfoName, lastIndexOfSlash + 1, classInfoName.length - lastIndexOfSlash - 1); } } CharOperation.replace(classInfoName, '/', '.'); return new String(classInfoName); }
private char[] returnClassName(char[] classInfoName, char separator, int mode) { if (classInfoName.length == 0) { return CharOperation.NO_CHAR; } else if (isCompact(mode)) { int lastIndexOfSlash = CharOperation.lastIndexOf(separator, classInfoName); if (lastIndexOfSlash != -1) { return CharOperation.subarray(classInfoName, lastIndexOfSlash + 1, classInfoName.length); } } return classInfoName; }
private char[] returnClassName(char[] classInfoName, char separator, int mode) { if (classInfoName.length == 0) { return CharOperation.NO_CHAR; } else if (isCompact(mode)) { int lastIndexOfSlash = CharOperation.lastIndexOf(separator, classInfoName); if (lastIndexOfSlash != -1) { return CharOperation.subarray(classInfoName, lastIndexOfSlash + 1, classInfoName.length); } } return classInfoName; }
public char[] normalizedPath() { if (this.normalizedPath == null) { String path2 = this.getPath(); char[] rawName = path2.toCharArray(); if (File.separatorChar == '\\') { CharOperation.replace(rawName, '\\', '/'); } this.normalizedPath = CharOperation.subarray(rawName, 0, CharOperation.lastIndexOf('.', rawName)); } return this.normalizedPath; } public String getPath() {
public char[] normalizedPath() { if (this.normalizedPath == null) { String path2 = this.getPath(); char[] rawName = path2.toCharArray(); if (File.separatorChar == '\\') { CharOperation.replace(rawName, '\\', '/'); } this.normalizedPath = CharOperation.subarray(rawName, 0, CharOperation.lastIndexOf('.', rawName)); } return this.normalizedPath; } public String getPath() {
@Override public char[] normalizedPath() { if (this.normalizedPath == null) { String path2 = this.getPath(); char[] rawName = path2.toCharArray(); if (File.separatorChar == '\\') { CharOperation.replace(rawName, '\\', '/'); } this.normalizedPath = CharOperation.subarray(rawName, 0, CharOperation.lastIndexOf('.', rawName)); } return this.normalizedPath; } @Override
public char[] normalizedPath() { if (this.normalizedPath == null) { String path2 = this.getPath(); char[] rawName = path2.toCharArray(); if (File.separatorChar == '\\') { CharOperation.replace(rawName, '\\', '/'); } this.normalizedPath = CharOperation.subarray(rawName, 0, CharOperation.lastIndexOf('.', rawName)); } return this.normalizedPath; } public String getPath() {