public JavaPackageId getJavaPackageId() { return this.context.getJavaPackageId(); }
public JavaPackageId getJavaPackageId() { return this.context.getJavaPackageId(); }
/** * Returns the Java package in the context of which the construct is defined. * @return */ @Override public JavaPackageId getJavaPackageId() { if(this.isNestedClass()) return this.declarationContext.getJavaPackageId(); else return (JavaPackageId)this.declarationContext; }
/** * Returns the Java package in the context of which the construct is defined. * @return */ @Override public JavaPackageId getJavaPackageId() { if(this.isNested()) return this.declarationContext.getJavaPackageId(); else return (JavaPackageId)this.declarationContext; } }
/** * Returns the Java package in the context of which the construct is defined. * @return */ @Override public JavaPackageId getJavaPackageId() { if(this.isNested()) return this.declarationContext.getJavaPackageId(); else return (JavaPackageId)this.declarationContext; } }
/** * Returns the {@link JavaPackageId} of a given {@link ConstructId}. * * @param _cid * @return */ public static JavaPackageId getPackageId (ConstructId _cid) { JavaPackageId pid = null; if(_cid instanceof com.sap.psr.vulas.java.JavaPackageId) pid = (JavaPackageId) _cid; else if(_cid instanceof com.sap.psr.vulas.java.JavaId) pid = ((JavaId)_cid).getJavaPackageId(); else Callgraph.log.error("Cannot find the package id for construct [" + _cid.getQualifiedName() + "]"); return pid; }
final JavaPackageId pid = _jcid.getJavaPackageId(); this.classesCount++;
/** * Returns a set with the {@link ConstructId}s of all constructs contained in the given Java class, i.e., * all methods, all constructors, the class or enumeration and the package (unless it is the default package, * i.e., no package). * * @return */ public Set<ConstructId> getConstructs() { if(this.constructs==null) { this.constructs = new TreeSet<ConstructId>(); this.constructs.add(this.javaId); // Do not add the default package (qualified name=="") // This makes the constructs obtained from java and class files more comparable if(!this.javaId.getJavaPackageId().getSimpleName().equals("")) this.constructs.add(this.javaId.getJavaPackageId()); try { this.constructs.addAll(this.visitConstructors(false)); this.constructs.addAll(this.visitMethods(false)); } catch (CannotCompileException e) { // Should never happen since we do not instrument in this case (argument is false) } } return this.constructs; }
Path p = null; try { p = Paths.get(VulasConfiguration.getGlobal().getTmpDir().toString(), this.javaId.getJavaPackageId().getQualifiedName().replace('.','/'), this.javaId.getName().replace('<', '_').replace('>','_') + ".class"); FileUtil.createDirectory(p.getParent()); FileUtil.writeToFile(p.toFile(), this.bytes);
Path p = null; try { p = Paths.get(VulasConfiguration.getGlobal().getTmpDir().toString(), _jid.getJavaPackageId().getQualifiedName().replace('.','/'), _jid.getDefinitionContext().getName() + "." + _jid.getName().replace('<', '_').replace('>','_') + ".java"); FileUtil.createDirectory(p.getParent()); FileUtil.writeToFile(p.toFile(), ClassVisitor.prettyPrint(source_code.toString()));