/** * Returns a class name that is unique within the package in which the class is defined. * In case of nested classes, the names of parent classes will be included (e.g., OuterClass$InnerClass). * @returns the class name including the names of parent classes (if any) */ @Override public String getName() { if(this.declarationContext!=null) { if(!this.isNestedClass()) return this.className; else return this.declarationContext.getName() + "$" + this.className; } else { return this.className; } }
/** * Returns a class name that is unique within the package in which the class is defined. * In case of nested classes, the names of parent classes will be included (e.g., OuterClass$InnerClass). * @returns the class name including the names of parent classes (if any) */ @Override public String getName() { if(this.declarationContext!=null) { if(!this.isNested()) return this.interfaceName; else return this.declarationContext.getName() + "$" + this.interfaceName; } else { return this.interfaceName; } }
/** * Returns a class name that is unique within the package in which the class is defined. * In case of nested classes, the names of parent classes will be included (e.g., OuterClass$InnerClass). * @returns the class name including the names of parent classes (if any) */ @Override public String getName() { if(this.declarationContext!=null) { if(!this.isNested()) return this.enumName; else return this.declarationContext.getName() + "$" + this.enumName; } else { return this.enumName; } }
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()));