Codota Logo
StringStuff.makeMethodReference
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
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

/**
 * @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

@Override
public SinkSpec[] getSinkSpecs() {		
  List<SinkSpec> specs = new ArrayList<>();
  Collection<IMethod> methods = cha.getPossibleTargets(StringStuff.makeMethodReference(methodSignature));
  for (IField field : fields) {
    if (!field.isFinal()) {
      for (IMethod method : methods) {
        specs.add(new StaticFieldSinkSpec(field, method));
      }
    }
  }
  return specs.toArray(new SinkSpec[] {});
}
origin: wala/WALA

  public void addTestEntry(ClassHierarchy cha) {
    String[] methodReferences = {
//                "Test.Apps.Outer$PrivateInnerClass.printNum()V",
        //"Test.Apps.Outer$PublicInnerClass.printNum()V"
        //"Test.Apps.Outer.<init>()V"
        //"Test.Apps.Outer.getNum()I"
        //"Test.Apps.FixpointSolver.someMethod(LTest/Apps/GenericSink;LTest/Apps/GenericSource;)V"
        //"Test.Apps.Outer$PrivateInnerClass.testParameters(LTest/Apps/GenericSink;LTest/Apps/GenericSource;)V"
        "android.view.View.setOnClickListener(Landroid/view/View$OnClickListener;)V",
    };

    for (String methodReference : methodReferences) {
      MethodReference mr =
          StringStuff.makeMethodReference(methodReference);

      for (IMethod im : cha.getPossibleTargets(mr)) {
        
        entries.add(new DefaultEntrypoint(im, cha));
      }
    }
  }
  
origin: wala/WALA

  @SuppressWarnings("unused")
  private void populateEntryPoints(ClassHierarchy cha) {
    String method = null;
    IMethod im = null;
    for (String[] intent: ActivityIntentList) {
      //method = IntentToMethod(intent[0]);
      method = "onCreate(Landroid/os/Bundle;)V";

      im = cha.resolveMethod(StringStuff.makeMethodReference(intent[1]+ '.' +method));
      if (im!=null)
        entries.add(new DefaultEntrypoint(im,cha));

    }
    for (String[] intent: ReceiverIntentList) {
      //Seems that every broadcast receiver can be an entrypoints?
//          method = IntentToMethod(intent[0]);
      method = "onReceive(Landroid/content/Context;Landroid/content/Intent;)V";

      im = cha.resolveMethod(StringStuff.makeMethodReference(intent[1]+ '.' +method));
      if (im!=null)
        entries.add(new DefaultEntrypoint(im,cha));
    }
    //IMethod im = cha.resolveMethod(StringStuff.makeMethodReference("android.app.Activity.onCreate(Landroid/os/Bundle;)V"));
    //entries.add(new DefaultEntrypoint(im, cha));
  }

origin: wala/WALA

public void listenerEntryPoints(ClassHierarchy cha) {
  ArrayList<MethodReference> entryPointMRs = new ArrayList<>();
  // onLocation
  entryPointMRs.add(StringStuff.makeMethodReference("android.location.LocationListener.onLocationChanged(Landroid/location/Location;)V"));
  for(MethodReference mr:entryPointMRs)
  for(IMethod im:cha.getPossibleTargets(mr))
  {
    
    // limit to functions defined within the application
    if(im.getReference().getDeclaringClass().getClassLoader().
              equals(ClassLoaderReference.Application)) {
      
      entries.add(new DefaultEntrypoint(im, cha));
    }
  }
}
origin: wala/WALA

@Test
public void testIfNoException() throws UnsoundGraphException, CancelException, WalaException {
 MethodReference mr = StringStuff.makeMethodReference("cfg.exc.inter.CallFieldAccess.callIfNoException()Lcfg/exc/intra/B");
 InterprocAnalysisResult<SSAInstruction, IExplodedBasicBlock> interExplodedCFG = 
   NullPointerAnalysis.computeInterprocAnalysis(cg, new NullProgressMonitor());
 Assert.assertEquals(1, cg.getNodes(mr).size());
 final CGNode callNode = cg.getNodes(mr).iterator().next();
 ExceptionPruningAnalysis<SSAInstruction, IExplodedBasicBlock> intraExplodedCFG = interExplodedCFG.getResult(callNode);
 Assert.assertFalse(intraExplodedCFG.hasExceptions());
}

origin: wala/WALA

@Test
public void testDynamicIf2Exception() throws UnsoundGraphException, CancelException, WalaException {
 MethodReference mr = StringStuff.makeMethodReference("cfg.exc.inter.CallFieldAccess.callDynamicIf2Exception()Lcfg/exc/intra/B");
 Assert.assertEquals(1, cg.getNodes(mr).size());
 final CGNode callNode = cg.getNodes(mr).iterator().next();
 InterprocAnalysisResult<SSAInstruction, IExplodedBasicBlock> interExplodedCFG = 
   NullPointerAnalysis.computeInterprocAnalysis(cg, new NullProgressMonitor());
 ExceptionPruningAnalysis<SSAInstruction, IExplodedBasicBlock> intraExplodedCFG = interExplodedCFG.getResult(callNode);
 Assert.assertTrue(intraExplodedCFG.hasExceptions());
}
origin: wala/WALA

@Test
public void testDynamicIfException() throws UnsoundGraphException, CancelException, WalaException {
 MethodReference mr = StringStuff.makeMethodReference("cfg.exc.inter.CallFieldAccess.callDynamicIfException()Lcfg/exc/intra/B");
 Assert.assertEquals(1, cg.getNodes(mr).size());
 final CGNode callNode = cg.getNodes(mr).iterator().next();
 InterprocAnalysisResult<SSAInstruction, IExplodedBasicBlock> interExplodedCFG = 
   NullPointerAnalysis.computeInterprocAnalysis(cg, new NullProgressMonitor());
 ExceptionPruningAnalysis<SSAInstruction, IExplodedBasicBlock> intraExplodedCFG = interExplodedCFG.getResult(callNode);
 Assert.assertTrue(intraExplodedCFG.hasExceptions());
}
origin: wala/WALA

@Test
public void testIf2NoException() throws UnsoundGraphException, CancelException, WalaException {
 MethodReference mr = StringStuff.makeMethodReference("cfg.exc.inter.CallFieldAccess.callIf2NoException()Lcfg/exc/intra/B");
 InterprocAnalysisResult<SSAInstruction, IExplodedBasicBlock> interExplodedCFG = 
   NullPointerAnalysis.computeInterprocAnalysis(cg, new NullProgressMonitor());
 Assert.assertEquals(1, cg.getNodes(mr).size());
 final CGNode callNode = cg.getNodes(mr).iterator().next();
 ExceptionPruningAnalysis<SSAInstruction, IExplodedBasicBlock> intraExplodedCFG = interExplodedCFG.getResult(callNode);
 Assert.assertFalse(intraExplodedCFG.hasExceptions());
}

origin: wala/WALA

@Test
public void testDynamicIf2NoException() throws UnsoundGraphException, CancelException, WalaException {
 MethodReference mr = StringStuff.makeMethodReference("cfg.exc.inter.CallFieldAccess.callDynamicIf2NoException()Lcfg/exc/intra/B");
 InterprocAnalysisResult<SSAInstruction, IExplodedBasicBlock> interExplodedCFG = 
   NullPointerAnalysis.computeInterprocAnalysis(cg, new NullProgressMonitor());
 Assert.assertEquals(1, cg.getNodes(mr).size());
 final CGNode callNode = cg.getNodes(mr).iterator().next();
 ExceptionPruningAnalysis<SSAInstruction, IExplodedBasicBlock> intraExplodedCFG = interExplodedCFG.getResult(callNode);
 Assert.assertFalse(intraExplodedCFG.hasExceptions());
}

origin: wala/WALA

 @Test
 public void testDynamicGetException() throws UnsoundGraphException, CancelException, WalaException {
  MethodReference mr = StringStuff.makeMethodReference("cfg.exc.inter.CallFieldAccess.callDynamicGetException()Lcfg/exc/intra/B");

  Assert.assertEquals(1, cg.getNodes(mr).size());
  final CGNode callNode = cg.getNodes(mr).iterator().next();

  InterprocAnalysisResult<SSAInstruction, IExplodedBasicBlock> interExplodedCFG = 
    NullPointerAnalysis.computeInterprocAnalysis(cg, new NullProgressMonitor());


  ExceptionPruningAnalysis<SSAInstruction, IExplodedBasicBlock> intraExplodedCFG = interExplodedCFG.getResult(callNode);

  Assert.assertTrue(intraExplodedCFG.hasExceptions());
 }
}
origin: wala/WALA

@Test
public void testIf2Exception() throws UnsoundGraphException, CancelException, WalaException {
 MethodReference mr = StringStuff.makeMethodReference("cfg.exc.inter.CallFieldAccess.callIf2Exception()Lcfg/exc/intra/B");
 InterprocAnalysisResult<SSAInstruction, IExplodedBasicBlock> interExplodedCFG = 
   NullPointerAnalysis.computeInterprocAnalysis(cg, new NullProgressMonitor());
 Assert.assertEquals(1, cg.getNodes(mr).size());
 final CGNode callNode = cg.getNodes(mr).iterator().next();
 ExceptionPruningAnalysis<SSAInstruction, IExplodedBasicBlock> intraExplodedCFG = interExplodedCFG.getResult(callNode);
 Assert.assertTrue(intraExplodedCFG.hasExceptions());
}

origin: wala/WALA

@Test
public void testDynamicIfNoException() throws UnsoundGraphException, CancelException, WalaException {
 MethodReference mr = StringStuff.makeMethodReference("cfg.exc.inter.CallFieldAccess.callDynamicIfNoException()Lcfg/exc/intra/B");
 InterprocAnalysisResult<SSAInstruction, IExplodedBasicBlock> interExplodedCFG = 
   NullPointerAnalysis.computeInterprocAnalysis(cg, new NullProgressMonitor());
 Assert.assertEquals(1, cg.getNodes(mr).size());
 final CGNode callNode = cg.getNodes(mr).iterator().next();
 ExceptionPruningAnalysis<SSAInstruction, IExplodedBasicBlock> intraExplodedCFG = interExplodedCFG.getResult(callNode);
 Assert.assertFalse(intraExplodedCFG.hasExceptions());
}

origin: wala/WALA

@Test
public void testGetException() throws UnsoundGraphException, CancelException, WalaException {
 MethodReference mr = StringStuff.makeMethodReference("cfg.exc.inter.CallFieldAccess.callGetException()Lcfg/exc/intra/B");
 InterprocAnalysisResult<SSAInstruction, IExplodedBasicBlock> interExplodedCFG = 
   NullPointerAnalysis.computeInterprocAnalysis(cg, new NullProgressMonitor());
 Assert.assertEquals(1, cg.getNodes(mr).size());
 final CGNode callNode = cg.getNodes(mr).iterator().next();
 ExceptionPruningAnalysis<SSAInstruction, IExplodedBasicBlock> intraExplodedCFG = interExplodedCFG.getResult(callNode);
 Assert.assertTrue(intraExplodedCFG.hasExceptions());
}

origin: wala/WALA

@Test
public void testIfException() throws UnsoundGraphException, CancelException, WalaException {
 MethodReference mr = StringStuff.makeMethodReference("cfg.exc.inter.CallFieldAccess.callIfException()Lcfg/exc/intra/B");
 InterprocAnalysisResult<SSAInstruction, IExplodedBasicBlock> interExplodedCFG = 
   NullPointerAnalysis.computeInterprocAnalysis(cg, new NullProgressMonitor());
 Assert.assertEquals(1, cg.getNodes(mr).size());
 final CGNode callNode = cg.getNodes(mr).iterator().next();
 ExceptionPruningAnalysis<SSAInstruction, IExplodedBasicBlock> intraExplodedCFG = interExplodedCFG.getResult(callNode);
 Assert.assertTrue(intraExplodedCFG.hasExceptions());
}

origin: wala/WALA

@Test
public void testSync1() {
 MethodReference mr = StringStuff.makeMethodReference("cfg.MonitorTest.sync1()V");
 IMethod m = cha.resolveMethod(mr);
 IAnalysisCacheView cache = makeAnalysisCache();
 IR ir = cache.getIR(m);
 System.out.println(ir);
 SSACFG controlFlowGraph = ir.getControlFlowGraph();
 Assert.assertEquals(1, controlFlowGraph.getSuccNodeCount(controlFlowGraph.getBlockForInstruction(21)));
}
origin: wala/WALA

@Test
public void testIRCacheIdempotence() {
 MethodReference mr = StringStuff.makeMethodReference("hello.Hello.main([Ljava/lang/String;)V");
 IMethod m = cha.resolveMethod(mr);
 IAnalysisCacheView cache = makeAnalysisCache();
 IR irBefore = cache.getIR(m);
 cache.clear(); 
 IR irAfter = cache.getIR(m);
 for (int i = 0; i < irBefore.getInstructions().length; i++) {
  System.out.println(irBefore.getInstructions()[i]);
  System.out.println(irAfter.getInstructions()[i]);
  Assert.assertEquals(irAfter.getInstructions()[i], irBefore.getInstructions()[i]);
 }
}
origin: wala/WALA

@Test
public void testSync3() {
 MethodReference mr = StringStuff.makeMethodReference("cfg.MonitorTest.sync3()V");
 IMethod m = cha.resolveMethod(mr);
 IAnalysisCacheView cache = makeAnalysisCache();
 IR ir = cache.getIR(m);
 SSACFG controlFlowGraph = ir.getControlFlowGraph();
 Assert.assertEquals(1, controlFlowGraph.getSuccNodeCount(controlFlowGraph.getBlockForInstruction(33)));
}
origin: wala/WALA

@Test
public void testSync2() {
 MethodReference mr = StringStuff.makeMethodReference("cfg.MonitorTest.sync2()V");
 IMethod m = cha.resolveMethod(mr);
 IAnalysisCacheView cache = makeAnalysisCache();
 IR ir = cache.getIR(m);
 System.out.println(ir);
 SSACFG controlFlowGraph = ir.getControlFlowGraph();
 IntSet succs = controlFlowGraph.getSuccNodeNumbers(controlFlowGraph.getBlockForInstruction(13));
 Assert.assertEquals(2, succs.size());
 Assert.assertTrue(succs.contains(6));
 Assert.assertTrue(succs.contains(7));
}

com.ibm.wala.util.stringsStringStuffmakeMethodReference

Popular methods of StringStuff

  • deployment2CanonicalTypeString
    Translate a type from a deployment descriptor string into the internal JVM format eg. [[java/lang/St
  • 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

  • Parsing JSON documents to java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • putExtra (Intent)
  • getSharedPreferences (Context)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Menu (java.awt)
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now