adrninistrator / java-callgraph2 Goto Github PK
View Code? Open in Web Editor NEWPrograms for producing static call graphs for Java programs.
License: Apache License 2.0
Programs for producing static call graphs for Java programs.
License: Apache License 2.0
@autowire优先找到类型符合的bean。但是在下例中,会错误得找到LoginService
public class LoginNewController {
@Autowired
private LoginNewService loginService;
public void login() {
loginService.login();
}
}
@Service
public class LoginService {
public void login() {
}
}
@Service
public class LoginNewService {
public void login() {
}
}
作者您好,反射,异步,SDK调用等场景,能追到完整方法链路吗?
@service
public class StateManager {
@resource(name = "stateProcessor")
private StateProcessor processor;
public void setState(StateContext context, OrderStateEnum targetState) {
switch (targetState) {
case UNPAID:
processor.onUnpaid(context);
}
}
}
public class StateProcessorProxy implements StateProcessor {
@OverRide
public void onUnpaid(StateContext context) throws BizException {
StateProcessor processor = findProcessor(order);
processor.onUnpaid(context);
}
private StateProcessor findProcessor(GrabOrderVO order) {
return processorTable.get(ProcessorEnum.GRAB_PROC.name());
}
}
<bean id="stateProcessor" class="com.xxx.StateProcessorProxy">
<property name="processorTable">
<map>
<entry key="GRAB_PROC" value-ref="grabStateProcessor"/>
</map>
</property>
</bean>
public class GrabProcessor extends AbstractStateProcessor {
@OverRide
public void onUnpaid(StateContext context) {
}
}
public abstract class AbstractStateProcessor implements StateProcessor {
}
GrabProcessor 继承 AbstractStateProcessor 实现 StateProcessor
StateProcessorProxy 实现 StateProcessor
入口:StateManager,setState方法,case UNPAID:分支
预期调用链路:
1、StateManager-----setState方法--onUnpaid分支
2、StateProcessorProxy----onUnpaid方法
3、GrabProcessor----onUnpaid方法
实际调用链路:
1、StateManager-----setState方法--onUnpaid分支
2、StateProcessor----onUnpaid方法
3、StateProcessorProxy----onUnpaid方法
4、StateProcessor----onUnpaid方法
InternationalFlightItemOrderAgentV2:() 32 213
有什么需要的信息您可以和我说
如
2 org.apache.tools.ant.AntClassLoader$ResourceEnumeration:(org.apache.tools.ant.AntClassLoader,java.lang.String) (SPE)org.apache.tools.ant.AntClassLoader$ResourceEnumeration:findNextResource() 142 t void 1 1
缺少7 方法实际的返回类型
3 org.apache.tools.ant.AntClassLoader$ResourceEnumeration:nextElement() (SPE)java.util.NoSuchElementException:() 164 v void 1 -
缺少7 方法世纪的返回类型,而9被调用方,Jar包序号则显示为-
使用过程中发现,对于继承关系,如:
public class A {
public void exec() {}
}
public class B extends A {}
jacg_method_call
中记录了子类方法对父类方法的调用关系:
B.exec 调用 A.exec
但是对于实现关系,如:
public interface A {
default void exec() {}
}
public class B implements A {}
并没有记录子类方法对接口方法的调用关系。
是否可以添加这类调用关系?
特别地,对于多级实现关系,例如:
public interface A {
default void exec() {}
void test();
}
public interface B extends A {}
public class C implements B {
public void test() {}
}
如果可以增加调用关系的话,首先必定要记录的是:
B.exec 调用 A.exec
至于C
,建议记录:
C.exec 调用 B.exec
而不是:
C.exec 调用 A.exec
另外,目前的实现会生成两条调用关系:
B.test 调用 A.test(错误,应当是 A.test 调用 B.test)
B.test 调用 C.test
对于abstract class
多级继承是否存在类似的问题,我尚未进行测试。
你好,请问该项目是否有支持判断A函数调用B函数(非直接调用)的接口
@Data
public class LocaleProductMinPriceBO {
/**
* 产品id
*/
private Long productId;
/**
* 售卖价格
*/
private BigDecimal salePrice;
}
在method_info.txt中,是有这些方法的;但是在method_annotation.txt里却没有。
在packages.properties中可以指定需要处理的包名,但我想排除一部分不需要处理的包名,有这个功能吗?
您好,请问这个工具只能处理jar包吗?能直接以字节码文件所在的文件夹作为输入吗?
楼主好,刚接触这个项目,在使用过程中遇到了几点疑问,敬请方便的时候帮忙解答下,不胜感激:
When trying to generate a dynamic call graph for my spring boot project I got this error:
Error: Could not find or load main class :jar.batik-all.jar:jar.xml-apis-ext.jar
1- The command that I ran:
java -Xbootclasspath:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar:jar/batik-all.jar:jar/xml-apis-ext.jar -javaagent:target/javacg-0.1-SNAPSHOT-dycg-agent.jar="incl=org.apache.batik.,org.w3c.;" -jar dacapo-9.12-bach.jar batik -s small | tail -n 10
2- The example that I followed:
https://github.com/gousiosg/java-callgraph#examples
该场景下,UseSpringBeanByAnnotationHandler.doGetSpringBeanName 直接将类型作为 beanName(fieldSpringBeanType变量)返回,但后续 defineSpringBeanByAnnotationHandler.getSpringBeanTypeList() 仅根据 beanName 从 stringBeanNameAndTypeMap 中获取typeList, stringBeanNameAndTypeMap中没有将type作为key的数据。此时未获取到准确的type
如:
@service
public class Third1AuthService extends IAuthService {
}
@service
public class Third2AuthService extends IAuthService {
}
@service
public class Third3AuthService extends IAuthService {
}
@resource(type = Third1AuthService.class)
private IAuthService third01AuthService;
源码如下:
interface User{
public String getName();
public void setName(String name);
public void sayHello();
}
class Student implements User{
private String name;
public String getName(){
return name;
}
public void setName(String cname){
name = cname;
}
private void secret(){
System.out.println("secret");
}
public void sayHello(){
System.out.println("hello, " + name);
secret();
}
}
public class UrlArgParser {
public static void main(String args[]){
User a = new Student();
a.setName("great");
a.sayHello();
}
}
生成的调用链如下:
C:StudentStudent
C:Student User
C:Student java.io.PrintStream
C:Student java.lang.StringBuilder
C:Student java.lang.System
M:1 Student:<init>() (O)java.lang.Object:<init>() 12 1
M:2 Student:secret() (M)java.io.PrintStream:println(java.lang.String) 22 1
M:3 Student:sayHello() (O)java.lang.StringBuilder:<init>() 26 1
M:4 Student:sayHello() (M)java.lang.StringBuilder:append(java.lang.String) 26 1
M:5 Student:sayHello() (M)java.lang.StringBuilder:append(java.lang.String) 26 1
M:6 Student:sayHello() (M)java.lang.StringBuilder:toString() 26 1
M:7 Student:sayHello() (M)java.io.PrintStream:println(java.lang.String) 26 1
M:8 Student:sayHello() (O)Student:secret() 27 1
C:UrlArgParser Student
C:UrlArgParser UrlArgParser
C:UrlArgParser User
M:9 UrlArgParser:<init>() (O)java.lang.Object:<init>() 30 1
M:10 UrlArgParser:main(java.lang.String[]) (O)Student:<init>() 35 1
M:11 UrlArgParser:main(java.lang.String[]) (I)User:setName(java.lang.String) 36 1
M:12 UrlArgParser:main(java.lang.String[]) (I)User:sayHello() 37 1
main中调用的User接口的sayHello方法未关联到Student实现类的sayHello方法
版本1.0.11
public class AService extends BaseService{
public String handle() {
return baseHandle();
}
}
public class BaseService {
String baseHandle() {
return getStr();
}
private String getStr() {
return "123";
}
}
BaseService:baseHandle()在method_call中记录的是AService:baseHandle()
2 org.testcase2.service.AService:handle() (VIR)org.testcase2.service.AService:baseHandle() 5 t java.lang.String 1 1
BaseService:baseHandle()的后续路径会丢失
./run.sh ./android-23.jar
錯誤: 找不到或無法載入主要類別 com.adrninistrator.javacg.stat.JCallGraph
原因: java.lang.ClassNotFoundException: com.adrninistrator.javacg.stat.JCallGraph
目前在ubuntu下,有gradle环境和openjdk version "16.0.1"
但是第一步编译就把我拦下来了,
编译:
gradlew jar
出错:
Command 'gradlew' not found, did you mean:
command 'gradle' from deb gradle (4.4.1-13)
Try: apt install
我就用
./gradlew jar
然后就
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
Where:
Build file '/root/data/java-callgraph2/build.gradle'
What went wrong:
Could not compile build file '/root/data/java-callgraph2/build.gradle'.
startup failed:
General error during semantic analysis: Unsupported class file major version 60
java.lang.IllegalArgumentException: Unsupported class file major version 60
at groovyjarjarasm.asm.ClassReader.(ClassReader.java:196)
at groovyjarjarasm.asm.ClassReader.(ClassReader.java:177)
at groovyjarjarasm.asm.ClassReader.(ClassReader.java:163)
at groovyjarjarasm.asm.ClassReader.(ClassReader.java:284)
at org.codehaus.groovy.ast.decompiled.AsmDecompiler.parseClass(AsmDecompiler.java:81)
at org.codehaus.groovy.control.ClassNodeResolver.findDecompiled(ClassNodeResolver.java:251)
at org.codehaus.groovy.control.ClassNodeResolver.tryAsLoaderClassOrScript(ClassNodeResolver.java:189)
at org.codehaus.groovy.control.ClassNodeResolver.findClassNode(ClassNodeResolver.java:169)
at org.codehaus.groovy.control.ClassNodeResolver.resolveName(ClassNodeResolver.java:125)
at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveClassNullable(AsmReferenceResolver.java:57)
at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveClass(AsmReferenceResolver.java:44)
at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveNonArrayType(AsmReferenceResolver.java:79)
at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveType(AsmReferenceResolver.java:70)
at org.codehaus.groovy.ast.decompiled.MemberSignatureParser.createMethodNode(MemberSignatureParser.java:57)
at org.codehaus.groovy.ast.decompiled.DecompiledClassNode$2.get(DecompiledClassNode.java:234)
at org.codehaus.groovy.ast.decompiled.DecompiledClassNode$2.get(DecompiledClassNode.java:231)
at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.createMethodNode(DecompiledClassNode.java:242)
at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.lazyInitMembers(DecompiledClassNode.java:199)
at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.getDeclaredMethods(DecompiledClassNode.java:122)
at org.codehaus.groovy.ast.ClassNode.getMethods(ClassNode.java:912)
at org.codehaus.groovy.ast.ClassNode.tryFindPossibleMethod(ClassNode.java:1280)
at org.codehaus.groovy.control.StaticImportVisitor.transformMethodCallExpression(StaticImportVisitor.java:252)
at org.codehaus.groovy.control.StaticImportVisitor.transform(StaticImportVisitor.java:113)
at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitExpressionStatement(ClassCodeExpressionTransformer.java:142)
at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:110)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:121)
at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(ClassCodeExpressionTransformer.java:53)
at org.codehaus.groovy.control.StaticImportVisitor.visitConstructorOrMethod(StaticImportVisitor.java:89)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructor(ClassCodeVisitorSupport.java:128)
at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1099)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:54)
at org.codehaus.groovy.control.StaticImportVisitor.visitClass(StaticImportVisitor.java:83)
at org.codehaus.groovy.control.CompilationUnit$14.call(CompilationUnit.java:708)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1084)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:640)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:618)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:595)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:401)
at groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:89)
at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:341)
at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:338)
at org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:147)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:336)
at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler.compileScript(DefaultScriptCompilationHandler.java:142)
at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler.compileToDir(DefaultScriptCompilationHandler.java:98)
at org.gradle.groovy.scripts.internal.BuildOperationBackedScriptCompilationHandler$2.run(BuildOperationBackedScriptCompilationHandler.java:54)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.groovy.scripts.internal.BuildOperationBackedScriptCompilationHandler.compileToDir(BuildOperationBackedScriptCompilationHandler.java:51)
at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$CompileToCrossBuildCacheAction.execute(FileCacheBackedScriptClassCompiler.java:152)
at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$CompileToCrossBuildCacheAction.execute(FileCacheBackedScriptClassCompiler.java:132)
at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$ProgressReportingInitializer.execute(FileCacheBackedScriptClassCompiler.java:177)
at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$ProgressReportingInitializer.execute(FileCacheBackedScriptClassCompiler.java:156)
at org.gradle.cache.internal.DefaultPersistentDirectoryCache$Initializer.initialize(DefaultPersistentDirectoryCache.java:100)
at org.gradle.cache.internal.FixedSharedModeCrossProcessCacheAccess$1.run(FixedSharedModeCrossProcessCacheAccess.java:86)
at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.doWriteAction(DefaultFileLockManager.java:215)
at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.writeFile(DefaultFileLockManager.java:205)
at org.gradle.cache.internal.FixedSharedModeCrossProcessCacheAccess.open(FixedSharedModeCrossProcessCacheAccess.java:83)
at org.gradle.cache.internal.DefaultCacheAccess.open(DefaultCacheAccess.java:139)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:78)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:42)
at org.gradle.cache.internal.DefaultCacheFactory.doOpen(DefaultCacheFactory.java:95)
at org.gradle.cache.internal.DefaultCacheFactory.open(DefaultCacheFactory.java:68)
at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.open(DefaultCacheRepository.java:126)
at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$RemapBuildScriptsAction.execute(FileCacheBackedScriptClassCompiler.java:435)
at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$RemapBuildScriptsAction.execute(FileCacheBackedScriptClassCompiler.java:403)
at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$ProgressReportingInitializer.execute(FileCacheBackedScriptClassCompiler.java:177)
at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$ProgressReportingInitializer.execute(FileCacheBackedScriptClassCompiler.java:156)
at org.gradle.cache.internal.DefaultPersistentDirectoryCache$Initializer.initialize(DefaultPersistentDirectoryCache.java:100)
at org.gradle.cache.internal.FixedSharedModeCrossProcessCacheAccess$1.run(FixedSharedModeCrossProcessCacheAccess.java:86)
at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.doWriteAction(DefaultFileLockManager.java:215)
at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.writeFile(DefaultFileLockManager.java:205)
at org.gradle.cache.internal.FixedSharedModeCrossProcessCacheAccess.open(FixedSharedModeCrossProcessCacheAccess.java:83)
at org.gradle.cache.internal.DefaultCacheAccess.open(DefaultCacheAccess.java:139)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:78)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:42)
at org.gradle.cache.internal.DefaultCacheFactory.doOpen(DefaultCacheFactory.java:95)
at org.gradle.cache.internal.DefaultCacheFactory.open(DefaultCacheFactory.java:68)
at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.open(DefaultCacheRepository.java:126)
at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler.compile(FileCacheBackedScriptClassCompiler.java:105)
at org.gradle.groovy.scripts.internal.CrossBuildInMemoryCachingScriptClassCache.getOrCompile(CrossBuildInMemoryCachingScriptClassCache.java:50)
at org.gradle.groovy.scripts.internal.BuildScopeInMemoryCachingScriptClassCompiler.compile(BuildScopeInMemoryCachingScriptClassCompiler.java:50)
at org.gradle.groovy.scripts.DefaultScriptCompilerFactory$ScriptCompilerImpl.compile(DefaultScriptCompilerFactory.java:49)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:226)
at org.gradle.configuration.BuildOperationScriptPlugin$1$1.run(BuildOperationScriptPlugin.java:69)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:66)
at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:63)
at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:49)
at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:63)
at org.gradle.configuration.project.BuildScriptProcessor$1.run(BuildScriptProcessor.java:45)
at org.gradle.internal.Factories$1.create(Factories.java:26)
at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:245)
at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:226)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:42)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:35)
at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject$1.run(LifecycleProjectEvaluator.java:102)
at org.gradle.internal.Factories$1.create(Factories.java:26)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:189)
at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:271)
at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:265)
at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:226)
at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:91)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:63)
at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:707)
at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:143)
at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:36)
at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62)
at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:61)
at org.gradle.configuration.BuildOperatingFiringProjectsPreparer$ConfigureBuild.run(BuildOperatingFiringProjectsPreparer.java:52)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.configuration.BuildOperatingFiringProjectsPreparer.prepareProjects(BuildOperatingFiringProjectsPreparer.java:40)
at org.gradle.initialization.DefaultGradleLauncher.prepareProjects(DefaultGradleLauncher.java:218)
at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:155)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:140)
at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:120)
at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:74)
at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:67)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:189)
at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67)
at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:31)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:63)
at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:51)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:45)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:47)
at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:80)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)
at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:60)
at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:38)
at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:68)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.base/java.lang.Thread.run(Thread.java:831)
1 error
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
貌似是安装java环境的版本不支持,我换了11
sudo apt install openjdk-11-jdk
这个不行,所以我该怎么办啊?
求贴主,帮我解答一下
例如我想将函数abc.A:a(abc.B)表示成abc.A:a(Labc/B;),A:a(int) 表示成A:aa(I)
父类
public abstract class AbstractBaseHandler {
public final TResponse handle(TRequest request) {
try {
init(request);
preHandle();
validate();
doHandle();
postHandle();
} catch (RequestValidationFailureException e) {
handleValidationFailure(e.getMessage(), tags);
} catch (Exception e) {
handleError(e, tags);
} finally {
clear();
}
return response;
}
子类
childClass继承这个AbstractBaseHandler,
Code:
childClass.handle(request)
.
method_call:
childClass:handle(java.lang.Object)=> (_CCS)AbstractBaseHandler:handle(java.lang.Object)
父类
public abstract class AbstractBaseHandlerextends SoaRequestProcessor {
@Override
public SoaResponseT process(SoaRequestT soaRequest) throws Exception {
try {
return super.process(soaRequest);
} finally {
InvokeContext.remove();
}
}
}
子类
childClass继承这个AbstractBaseHandler,
Code:
childClass.process(request)
.
method_call:
childClass:handle(java.lang.Object)=> (_CCS)AbstractBaseHandler:handle(java.lang.Object)
如果一个函数调用了另一个类的静态field,method_call.txt中没有显示这种调用关系吗?
在output_dir 中 执行 sh run.sh ,遇到以下错误
通过文件路径获取文件 _javacg_config/jar_dir.properties
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
at com.adrninistrator.javacg.util.JavaCGFileUtil.readFile2List(JavaCGFileUtil.java:239)
at com.adrninistrator.javacg.util.JavaCGFileUtil.readFile2List(JavaCGFileUtil.java:225)
at com.adrninistrator.javacg.conf.JavaCGConfigureWrapper.getOtherConfigList(JavaCGConfigureWrapper.java:212)
at com.adrninistrator.javacg.conf.JavaCGConfManager.getConfInfo(JavaCGConfManager.java:66)
at com.adrninistrator.javacg.stat.JCallGraph.run(JCallGraph.java:87)
at com.adrninistrator.javacg.stat.JCallGraph.main(JCallGraph.java:77)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 6 more
有解决办法吗?求助
请问如何使用生成Java方法UML时序图的插件功能
如何进行源代码级的处理,假设我现在有如下.java文件,我想得到他的调用关系,但是我不想编译为.class或.jar,本项目是否支持?
public class Test { public static void main(String[] args) { String str = fun1(61, "asd"); System.out.println("str = " + str); } private static String fun1(int i, String asd) { if (i > 10){ return fun2(i * 10) + asd; } return fun3((int)(i * 0.1)) + asd; } private static String fun2(int i) { return fun3(i); } private static String fun3(int v) { return v * 10 + ""; } }
例如 list.forEach( e -> test(e) )可否获取到test这个方法名,而不是lambda$1这种
EG代码:
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
public class TestObject extends ObjectInputStream {
public TestObject(InputStream in) throws IOException {
super(in);
}
}
public class Test{
public void test() throws Exception{
TestObject testObject = new TestObject(null);
testObject.readObject();
}
}
Test:test() (SPE)TestObject:<init>(java.io.InputStream) 5 void v void 1 1
Test:test() (VIR)TestObject:readObject() 6 void v java.lang.Object 1 1
TestObject:<init>(java.io.InputStream) (SPE)java.io.ObjectInputStream:<init>(java.io.InputStream) 9 void t void 1 -
从结果中只能得出调用了父类方法,method_call里面能否加入一个TestObject:readObject() 调用java.io.ObjectInputStream:readObject()
再比如:
net.sf.jasperreports.engine.util.JRLoader:loadObject(java.io.File) (_ACT_C)net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream:readObject() 90 java.lang.Object v java.lang.Object 1 1
net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream:readObject() 在method_call中查不到调用了java.io.ObjectInputStream:readObject()
例如有三个类:
public interface BaseMapper<T> {}
public interface CommonMapper<S, T> extends BaseMapper<T> {}
public interface TestMapper extends CommonMapper<String, Integer> {}
按照当前的实现,jacg_class_signature_ei1
表中会记录TestMapper
的泛型参数:
seq | sign_class_name |
---|---|
0 | java.lang.String |
1 | java.lang.Integer |
我觉得可以加一张表,记录下CommonMapper
与BaseMapper
的泛型参数的关系:
seq | upward_seq |
---|---|
1 | 0 |
这样我们才能知道,TestMapper
是一个BaseMapper<Integer>
。
作者您好,我现在想直接生成某个maven项目的所有测试用例的静态调用图,不想通过命令行运行的方式获取txt文件,如何通过代码调用您这个工具的某个API,直接获取存储method call的数据结构呢?然后我可以直接从这个数据结构获取我想要的method call信息。
你好
在使用过程中,我看到工具可以在配置文件中填入一个jar包的地址或者一个目录,如果是一个jar包会生成一个结果文件夹(模式A),但如果是多行jar包地址或者是目录则会先合成一个jar包再生成结果文件(模式B)。当我输入相同的多个jar包时,模式A得到多个结果文件夹,我将其中的method_call.txt汇总后得到的数据和我输入一个目录(目录下是和模式A相同的jar包)输出一个method_call.txt的内容存在差异,即两种模式分析出来的结果不同。
想请问这两种模式下出现不同结果的原因,十分感谢!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.