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

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

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

origin: com.ibm.wala/com.ibm.wala.dalvik

/**
 *  Set the package of the analyzed application.
 *
 *  Setting the package of the application is completely optional. However if you do it it helps
 *  determining whether an Intent has an internal target.
 *
 *  If a AndroidManifest.xml is read this getts set automaticly.
 *
 *  @param  pack    The package of the analyzed application
 *  @throws IllegalArgumentException if the package has already been set and the value of the
 *      packages differ. Or if the given package is null.
 */
public void setPackage(String pack) {
  if (pack == null) {
    throw new IllegalArgumentException("Setting the package to null is disallowed.");
  }
  if ((! pack.startsWith("L") || pack.contains("."))) {
    pack = StringStuff.deployment2CanonicalTypeString(pack);
  }
  if (this.pack == null) {
    logger.info("Setting the package to {}", pack);
    this.pack = pack;
  } else if (!(this.pack.equals(pack))) {
    throw new IllegalArgumentException("The already set package " + this.pack + " and " + pack +
        " differ. You can only set pack once.");
  }
}
origin: wala/WALA

/**
 *  Set the package of the analyzed application.
 *
 *  Setting the package of the application is completely optional. However if you do it it helps
 *  determining whether an Intent has an internal target.
 *
 *  If a AndroidManifest.xml is read this getts set automaticly.
 *
 *  @param  pack    The package of the analyzed application
 *  @throws IllegalArgumentException if the package has already been set and the value of the
 *      packages differ. Or if the given package is null.
 */
public void setPackage(String pack) {
  if (pack == null) {
    throw new IllegalArgumentException("Setting the package to null is disallowed.");
  }
  if ((! pack.startsWith("L") || pack.contains("."))) {
    pack = StringStuff.deployment2CanonicalTypeString(pack);
  }
  if (this.pack == null) {
    logger.info("Setting the package to {}", pack);
    this.pack = pack;
  } else if (!(this.pack.equals(pack))) {
    throw new IllegalArgumentException("The already set package " + this.pack + " and " + pack +
        " differ. You can only set pack once.");
  }
}
origin: wala/WALA

/**
 *  Returns the Element the type matches exactly the given type.
 *
 *  @return The Element if found or AndroidComponent.UNKNOWN if not
 */
public static AndroidComponent explicit(String type) {
  if (!(type.startsWith("L") || type.contains("/"))) {
    type = StringStuff.deployment2CanonicalTypeString(type);
  }
  return explicit(TypeName.findOrCreate(type));
}
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

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.dalvik

/**
 *  Returns the Element the type matches exactly the given type.
 *
 *  @return The Element if found or AndroidComponent.UNKNOWN if not
 */
public static AndroidComponent explicit(String type) {
  if (!(type.startsWith("L") || type.contains("/"))) {
    type = StringStuff.deployment2CanonicalTypeString(type);
  }
  return explicit(TypeName.findOrCreate(type));
}
origin: wala/WALA

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

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

name = StringStuff.deployment2CanonicalTypeString(name);
origin: com.ibm.wala/com.ibm.wala.dalvik

name = StringStuff.deployment2CanonicalTypeString(name);
origin: wala/WALA

  public Intent setAction(final InstanceKey key, final InstanceKey actionKey, boolean isExplicit) {
    if (actionKey == null) {
      
      return find(key);
    }
    final String action;
    {
      if (actionKey instanceof ConstantKey) {
        final Object actionO = ((ConstantKey<?>) actionKey).getValue();
        if (actionO instanceof String) {
          action = StringStuff.deployment2CanonicalTypeString((String) actionO);
        } else if (actionO instanceof IClass) {
          action = ((IClass) actionO).getName().toString();
        } else {
          throw new IllegalArgumentException("Wrong action type: " + actionO.getClass());
        }
      } else {
        
        unbind(key);
        return null;
      }
    }

    return setAction(key, action, isExplicit);
  }
}
origin: com.ibm.wala/com.ibm.wala.dalvik

  public Intent setAction(final InstanceKey key, final InstanceKey actionKey, boolean isExplicit) {
    if (actionKey == null) {
      
      return find(key);
    }
    final String action;
    {
      if (actionKey instanceof ConstantKey) {
        final Object actionO = ((ConstantKey<?>) actionKey).getValue();
        if (actionO instanceof String) {
          action = StringStuff.deployment2CanonicalTypeString((String) actionO);
        } else if (actionO instanceof IClass) {
          action = ((IClass) actionO).getName().toString();
        } else {
          throw new IllegalArgumentException("Wrong action type: " + actionO.getClass());
        }
      } else {
        
        unbind(key);
        return null;
      }
    }

    return setAction(key, action, isExplicit);
  }
}
origin: wala/WALA

 private static Iterable<Entrypoint> makePublicEntrypoints(IClassHierarchy cha, String entryClass) {
  Collection<Entrypoint> result = new ArrayList<>();
  IClass klass = cha.lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application,
    StringStuff.deployment2CanonicalTypeString(entryClass)));
  for (IMethod m : klass.getDeclaredMethods()) {
   if (m.isPublic()) {
    result.add(new DefaultEntrypoint(m, cha));
   }
  }
  return result;
 }
}
origin: wala/WALA

 @Test
 public void testExclusions() throws IOException {
  AnalysisScope scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider()).getFile("GUIExclusions.txt"),
    ExclusionsTest.class.getClassLoader());
  TypeReference buttonRef = TypeReference.findOrCreate(ClassLoaderReference.Application,
    StringStuff.deployment2CanonicalTypeString("java.awt.Button"));
  Assert.assertTrue(scope.getExclusions().contains(buttonRef.getName().toString().substring(1)));
 }
}
origin: wala/WALA

/**
 * returns the instance key corresponding to the single allocation site of
 * type FlowsToType
 */
private InstanceKey getFlowsToInstanceKey(CGNode mainMethod, HeapModel heapModel) {
 // TODO Auto-generated method stub
 TypeReference flowsToTypeRef = TypeReference.findOrCreate(ClassLoaderReference.Application,
   StringStuff.deployment2CanonicalTypeString("demandpa.FlowsToType"));
 final IR mainIR = mainMethod.getIR();
 if (debug) {
  System.err.println(mainIR);
 }
 for (NewSiteReference n : Iterator2Iterable.make(mainIR.iterateNewSites())) {
  if (n.getDeclaredType().equals(flowsToTypeRef)) {
   return heapModel.getInstanceKeyForAllocation(mainMethod, n);
  }
 }
 assert false : "could not find appropriate allocation";
 return null;
}
origin: wala/WALA

String className = StringStuff.deployment2CanonicalTypeString(symbolTable.getStringValue(use));
TypeReference t = TypeReference.findOrCreate(caller.getMethod().getDeclaringClass().getClassLoader().getReference(),
  className);
 ConstantKey ik = (ConstantKey) receiver[nameVn];
 if (ik.getConcreteType().getReference().equals(TypeReference.JavaLangString)) {
  String className = StringStuff.deployment2CanonicalTypeString(ik.getValue().toString());
  for(IClassLoader cl : caller.getClassHierarchy().getLoaders()) {
   TypeReference t = TypeReference.findOrCreate(cl.getReference(), className);
origin: com.ibm.wala/com.ibm.wala.core

String className = StringStuff.deployment2CanonicalTypeString(symbolTable.getStringValue(use));
TypeReference t = TypeReference.findOrCreate(caller.getMethod().getDeclaringClass().getClassLoader().getReference(),
  className);
 ConstantKey ik = (ConstantKey) receiver[nameVn];
 if (ik.getConcreteType().getReference().equals(TypeReference.JavaLangString)) {
  String className = StringStuff.deployment2CanonicalTypeString(ik.getValue().toString());
  for(IClassLoader cl : caller.getClassHierarchy().getLoaders()) {
   TypeReference t = TypeReference.findOrCreate(cl.getReference(), className);
com.ibm.wala.util.stringsStringStuffdeployment2CanonicalTypeString

Javadoc

Translate a type from a deployment descriptor string into the internal JVM format eg. [[java/lang/String

Popular methods of StringStuff

  • 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
  • parseForReturnTypeName
  • parseForParameterNames,
  • parseForReturnTypeName,
  • slashToDot

Popular in Java

  • Making http post requests using okhttp
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • getContentResolver (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Best IntelliJ 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