/** * Sets the active body for this method. */ public synchronized void setActiveBody(Body body) { if ((declaringClass != null) && declaringClass.isPhantomClass()) { throw new RuntimeException("cannot set active body for phantom class! " + this); } // If someone sets a body for a phantom method, this method then is no // longer phantom setPhantom(false); if (!isConcrete()) { throw new RuntimeException("cannot set body for non-concrete method! " + this); } if (body != null && body.getMethod() != this) { body.setMethod(this); } this.activeBody = body; }
declaringClass.checkLevel(SootClass.BODIES); if ((declaringClass != null && declaringClass.isPhantomClass()) || isPhantom()) { throw new RuntimeException("cannot get active body for phantom method: " + getSignature());
private void constantForName(String cls, SootMethod src, Stmt srcUnit) { if (cls.length() > 0 && cls.charAt(0) == '[') { if (cls.length() > 1 && cls.charAt(1) == 'L' && cls.charAt(cls.length() - 1) == ';') { cls = cls.substring(2, cls.length() - 1); constantForName(cls, src, srcUnit); } } else { if (!Scene.v().containsClass(cls)) { if (options.verbose()) { logger.warn("Class " + cls + " is" + " a dynamic class, and you did not specify" + " it as such; graph will be incomplete!"); } } else { SootClass sootcls = Scene.v().getSootClass(cls); if (!sootcls.isPhantomClass()) { if (!sootcls.isApplicationClass()) { sootcls.setLibraryClass(); } for (SootMethod clinit : EntryPoints.v().clinitsOf(sootcls)) { addEdge(src, srcUnit, clinit, Kind.CLINIT); } } } } }
Chain<SootClass> getContainingChain(SootClass c) { if (c.isApplicationClass()) { return getApplicationClasses(); } else if (c.isLibraryClass()) { return getLibraryClasses(); } else if (c.isPhantomClass()) { return getPhantomClasses(); } return null; }
throw new RuntimeException("Oops, forgot to load " + type); if (sClass.isPhantomClass()) { throw new RuntimeException("Jimplification requires " + sClass + ", but it is a phantom ref.");
declaringClass.checkLevel(SootClass.BODIES); if ((declaringClass != null && declaringClass.isPhantomClass()) || isPhantom()) { throw new RuntimeException("cannot get resident body for phantom method : " + this);
public void removeClass(SootClass c) { if (!c.isInScene()) { throw new RuntimeException(); } classes.remove(c); if (c.isLibraryClass()) { libraryClasses.remove(c); } else if (c.isPhantomClass()) { phantomClasses.remove(c); } else if (c.isApplicationClass()) { applicationClasses.remove(c); } c.getType().setSootClass(null); c.setInScene(false); modifyHierarchy(); }
/** Retrieves the active body for this method. */ public Body getActiveBody() { if (declaringClass!=null && declaringClass.isPhantomClass()) throw new RuntimeException( "cannot get active body for phantom class: " + getSignature()); // ignore empty body exceptions if we are just computing coffi metrics if (!hasActiveBody()) throw new RuntimeException( "no active body present for method " + getSignature()); return activeBody; }
/** Retrieves the active body for this method. */ public Body getActiveBody() { if (declaringClass!=null && declaringClass.isPhantomClass()) throw new RuntimeException( "cannot get active body for phantom class: " + getSignature()); // ignore empty body exceptions if we are just computing coffi metrics if (!hasActiveBody()) throw new RuntimeException( "no active body present for method " + getSignature()); return activeBody; }
/** Sets the active body for this method. */ public void setActiveBody(Body body) { if ((declaringClass != null) && declaringClass.isPhantomClass()) throw new RuntimeException( "cannot set active body for phantom class! " + this); if (!isConcrete()) throw new RuntimeException( "cannot set body for non-concrete method! " + this); if (body!= null && body.getMethod() != this) body.setMethod(this); activeBody = body; }
/** Sets the active body for this method. */ public void setActiveBody(Body body) { if ((declaringClass != null) && declaringClass.isPhantomClass()) throw new RuntimeException( "cannot set active body for phantom class! " + this); if (!isConcrete()) throw new RuntimeException( "cannot set body for non-concrete method! " + this); if (body!= null && body.getMethod() != this) body.setMethod(this); activeBody = body; }
Chain<SootClass> getContainingChain(SootClass c) { if (c.isApplicationClass()) return getApplicationClasses(); else if (c.isLibraryClass()) return getLibraryClasses(); else if (c.isPhantomClass()) return getPhantomClasses(); return null; }
Chain<SootClass> getContainingChain(SootClass c) { if (c.isApplicationClass()) return getApplicationClasses(); else if (c.isLibraryClass()) return getLibraryClasses(); else if (c.isPhantomClass()) return getPhantomClasses(); return null; }
if(sClass.isPhantomClass()) throw new RuntimeException("Jimplification requires "+sClass+", but it is a phantom ref."); List plist = new LinkedList();
if(sClass.isPhantomClass()) throw new RuntimeException("Jimplification requires "+sClass+", but it is a phantom ref."); List plist = new LinkedList();
/** * Returns the active body if present, else constructs an active body and returns that. * * If you called Scene.v().loadClassAndSupport() for a class yourself, it will * not be an application class, so you cannot get retrieve its active body. * Please call setApplicationClass() on the relevant class. */ public Body retrieveActiveBody() { declaringClass.checkLevel(SootClass.BODIES); if (declaringClass.isPhantomClass()) throw new RuntimeException( "cannot get resident body for phantom class : " + getSignature() + "; maybe you want to call c.setApplicationClass() on this class!"); if (!hasActiveBody()) { // G.v().out.println("Retrieving "+this.getSignature()); setActiveBody(this.getBodyFromMethodSource("jb")); ms = null; } return getActiveBody(); }
/** * Returns the active body if present, else constructs an active body and returns that. * * If you called Scene.v().loadClassAndSupport() for a class yourself, it will * not be an application class, so you cannot get retrieve its active body. * Please call setApplicationClass() on the relevant class. */ public Body retrieveActiveBody() { declaringClass.checkLevel(SootClass.BODIES); if (declaringClass.isPhantomClass()) throw new RuntimeException( "cannot get resident body for phantom class : " + getSignature() + "; maybe you want to call c.setApplicationClass() on this class!"); if (!hasActiveBody()) { // G.v().out.println("Retrieving "+this.getSignature()); setActiveBody(this.getBodyFromMethodSource("jb")); ms = null; } return getActiveBody(); }
public void removeClass(SootClass c) { if(!c.isInScene()) throw new RuntimeException(); classes.remove(c); if(c.isLibraryClass()) { libraryClasses.remove(c); } else if(c.isPhantomClass()) { phantomClasses.remove(c); } else if(c.isApplicationClass()) { applicationClasses.remove(c); } c.getType().setSootClass(null); c.setInScene(false); modifyHierarchy(); }
public void removeClass(SootClass c) { if(!c.isInScene()) throw new RuntimeException(); classes.remove(c); if(c.isLibraryClass()) { libraryClasses.remove(c); } else if(c.isPhantomClass()) { phantomClasses.remove(c); } else if(c.isApplicationClass()) { applicationClasses.remove(c); } c.getType().setSootClass(null); c.setInScene(false); modifyHierarchy(); }
if (c != null) { c.setApplicationClass(); if (!c.isPhantomClass() && !c.isPhantom()) hasClasses = true;