Tabnine Logo
StringStuff
Code IndexAdd Tabnine to your IDE (free)

How to use
StringStuff
in
com.ibm.wala.util.strings

Best Java code snippets using com.ibm.wala.util.strings.StringStuff (Showing top 20 results out of 315)

origin: wala/WALA

public static MethodReference makeMethodReference(Language l, String methodSig) throws IllegalArgumentException {
 if (methodSig == null) {
  throw new IllegalArgumentException("methodSig is null");
 }
 if (methodSig.lastIndexOf('.') < 0) {
  throw new IllegalArgumentException("ill-formed sig " + methodSig);
 }
 String type = methodSig.substring(0, methodSig.lastIndexOf('.'));
 type = deployment2CanonicalTypeString(type);
 TypeReference t = TypeReference.findOrCreate(ClassLoaderReference.Application, type);
 String methodName = methodSig.substring(methodSig.lastIndexOf('.') + 1, methodSig.indexOf('('));
 String desc = methodSig.substring(methodSig.indexOf('('));
 return MethodReference.findOrCreate(l, t, methodName, desc);
}
origin: com.ibm.wala/com.ibm.wala.core

/**
 * @param methodSig something like "java_cup.lexer.advance()V"
 * @throws IllegalArgumentException if methodSig is null
 */
public static MethodReference makeMethodReference(String methodSig) throws IllegalArgumentException {
 return makeMethodReference(Language.JAVA, methodSig);
}
origin: wala/WALA

public static TypeName findOrCreate(ImmutableByteArray name, int start, int length) throws IllegalArgumentException {
 Atom className = Atom.findOrCreate(StringStuff.parseForClass(name, start, length));
 ImmutableByteArray p = StringStuff.parseForPackage(name, start, length);
 Atom packageName = (p == null) ? null : Atom.findOrCreate(p);
 int dim = StringStuff.parseForArrayDimensionality(name, start, length);
 boolean innermostPrimitive = StringStuff.classIsPrimitive(name, start, length);
 if (innermostPrimitive) {
  if (dim == 0) {
   dim = -1;
  } else {
   dim <<= ElementBits;
   dim |= PrimitiveMask;
  }
 }
 TypeNameKey t = new TypeNameKey(packageName, className, dim);
 return findOrCreate(t);
}
origin: wala/WALA

readable = new StringBuilder(slashToDot(readable.toString()));
readable = new StringBuilder(dollarToDot(readable.toString()));
origin: com.ibm.wala/com.ibm.wala.core

if (parseForPackage(name, start, length) == null) {
 while (isTypeCodeChar(name, start)) {
  start++;
  length--;
origin: com.ibm.wala/com.ibm.wala.core

int code = 0;
for (int i = start; i < start + length; ++i) {
 if (isTypeCodeChar(b, i)) {
   code <<= ElementBits;
   switch (b.b[i]) {
origin: com.ibm.wala/com.ibm.wala.core

if (instructions[j] != null) {
 StringBuilder x = new StringBuilder(j + "   " + instructions[j].toString(ir.getSymbolTable()));
 StringStuff.padWithSpaces(x, 35);
 result.append(x);
 result.append("\\l");
origin: wala/WALA

/**
 * Given that name[start:start+length] is a Type name in JVM format, strip the package and return the "package-free" class name
 * 
 * @return an ImmutableByteArray that represents the package, or null if it's the unnamed package
 * @throws IllegalArgumentException if name is null
 */
public static ImmutableByteArray parseForClass(ImmutableByteArray name) throws IllegalArgumentException {
 if (name == null) {
  throw new IllegalArgumentException("name is null");
 }
 return parseForClass(name, 0, name.length());
}
origin: wala/WALA

/**
 * Parse an array descriptor to obtain number of dimensions in corresponding array type. b: descriptor - something like
 * "[Ljava/lang/String;" or "[[I"
 * 
 * @return dimensionality - something like "Ljava/lang/String;" or "I"
 * @throws IllegalArgumentException if a is null
 */
public static ImmutableByteArray parseForInnermostArrayElementDescriptor(Atom a) {
 if (a == null) {
  throw new IllegalArgumentException("a is null");
 }
 ImmutableByteArray b = new ImmutableByteArray(a.getValArray());
 return parseForInnermostArrayElementDescriptor(b, 0, b.length());
}
origin: com.ibm.wala/com.ibm.wala.core

String baseType = dString.substring(0, arrayIndex);
int dim = (dString.length() - arrayIndex) / 2;
baseType = deployment2CanonicalDescriptorTypeString(baseType);
StringBuilder result = new StringBuilder("[");
for (int i = 1; i < dim; i++) {
origin: wala/WALA

int code = 0;
for (int i = start; i < start + length; ++i) {
 if (isTypeCodeChar(b, i)) {
   code <<= ElementBits;
   switch (b.b[i]) {
origin: wala/WALA

if (parseForPackage(name, start, length) == null) {
 while (isTypeCodeChar(name, start)) {
  start++;
  length--;
origin: com.ibm.wala/com.ibm.wala.core

readable = new StringBuilder(slashToDot(readable.toString()));
readable = new StringBuilder(dollarToDot(readable.toString()));
origin: wala/WALA

if (instructions[j] != null) {
 StringBuilder x = new StringBuilder(j + "   " + instructions[j].toString(ir.getSymbolTable()));
 StringStuff.padWithSpaces(x, 35);
 result.append(x);
 result.append("\\l");
origin: com.ibm.wala/com.ibm.wala.core

/**
 * Given that name[start:start+length] is a Type name in JVM format, strip the package and return the "package-free" class name
 * 
 * @return an ImmutableByteArray that represents the package, or null if it's the unnamed package
 * @throws IllegalArgumentException if name is null
 */
public static ImmutableByteArray parseForClass(ImmutableByteArray name) throws IllegalArgumentException {
 if (name == null) {
  throw new IllegalArgumentException("name is null");
 }
 return parseForClass(name, 0, name.length());
}
origin: com.ibm.wala/com.ibm.wala.core

/**
 * Parse an array descriptor to obtain number of dimensions in corresponding array type. b: descriptor - something like
 * "[Ljava/lang/String;" or "[[I"
 * 
 * @return dimensionality - something like "Ljava/lang/String;" or "I"
 * @throws IllegalArgumentException if a is null
 */
public static ImmutableByteArray parseForInnermostArrayElementDescriptor(Atom a) {
 if (a == null) {
  throw new IllegalArgumentException("a is null");
 }
 ImmutableByteArray b = new ImmutableByteArray(a.getValArray());
 return parseForInnermostArrayElementDescriptor(b, 0, b.length());
}
origin: wala/WALA

String baseType = dString.substring(0, arrayIndex);
int dim = (dString.length() - arrayIndex) / 2;
baseType = deployment2CanonicalDescriptorTypeString(baseType);
StringBuilder result = new StringBuilder("[");
for (int i = 1; i < dim; i++) {
origin: wala/WALA

/**
 * @param methodSig something like "java_cup.lexer.advance()V"
 * @throws IllegalArgumentException if methodSig is null
 */
public static MethodReference makeMethodReference(String methodSig) throws IllegalArgumentException {
 return makeMethodReference(Language.JAVA, methodSig);
}
origin: com.ibm.wala/com.ibm.wala.core

public static MethodReference makeMethodReference(Language l, String methodSig) throws IllegalArgumentException {
 if (methodSig == null) {
  throw new IllegalArgumentException("methodSig is null");
 }
 if (methodSig.lastIndexOf('.') < 0) {
  throw new IllegalArgumentException("ill-formed sig " + methodSig);
 }
 String type = methodSig.substring(0, methodSig.lastIndexOf('.'));
 type = deployment2CanonicalTypeString(type);
 TypeReference t = TypeReference.findOrCreate(ClassLoaderReference.Application, type);
 String methodName = methodSig.substring(methodSig.lastIndexOf('.') + 1, methodSig.indexOf('('));
 String desc = methodSig.substring(methodSig.indexOf('('));
 return MethodReference.findOrCreate(l, t, methodName, desc);
}
origin: com.ibm.wala/com.ibm.wala.core

public static TypeName findOrCreate(ImmutableByteArray name, int start, int length) throws IllegalArgumentException {
 Atom className = Atom.findOrCreate(StringStuff.parseForClass(name, start, length));
 ImmutableByteArray p = StringStuff.parseForPackage(name, start, length);
 Atom packageName = (p == null) ? null : Atom.findOrCreate(p);
 int dim = StringStuff.parseForArrayDimensionality(name, start, length);
 boolean innermostPrimitive = StringStuff.classIsPrimitive(name, start, length);
 if (innermostPrimitive) {
  if (dim == 0) {
   dim = -1;
  } else {
   dim <<= ElementBits;
   dim |= PrimitiveMask;
  }
 }
 TypeNameKey t = new TypeNameKey(packageName, className, dim);
 return findOrCreate(t);
}
com.ibm.wala.util.stringsStringStuff

Javadoc

Some simple utilities used to manipulate Strings

Most used methods

  • deployment2CanonicalTypeString
    Translate a type from a deployment descriptor string into the internal JVM format eg. [[java/lang/St
  • makeMethodReference
  • classIsPrimitive
  • deployment2CanonicalDescriptorTypeString
    Translate a type from a deployment descriptor string into the type expected for use in a method desc
  • dollarToDot
    Convert '$' to '.' in names.
  • isTypeCodeChar
  • padWithSpaces
  • parseForArrayDimensionality
    Parse an array descriptor to obtain number of dimensions in corresponding array type. b: descriptor
  • parseForClass
    Given that name[start:start+length] is a Type name in JVM format, strip the package and return the "
  • parseForInnermostArrayElementDescriptor
    Parse an array descriptor to obtain number of dimensions in corresponding array type. b: descriptor
  • parseForPackage
    Given that name[start:start+length] is a Type name in JVM format, parse it for the package
  • parseForParameterNames
  • parseForPackage,
  • parseForParameterNames,
  • parseForReturnTypeName,
  • slashToDot

Popular in Java

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • putExtra (Intent)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now