INRIA / INRIA/spoon

[Bug]: Cannot compute access path to type

Open
#5,130 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
2k
Forks
392
Avg merge
11h 24m
Merged PRs (30d)
36

Description

### Describe the bug

Exception:
![image](https://user-images.githubusercontent.com/4835023/222101463-39689db7-0bbf-4446-ba41-c10d0ce7c597.png)
1. ClueTrackActionServiceImpl is in project source
2. com.shuidihuzhu.sdb.broker.enums.ActionStatus is in jar
3. MavenLauncher.Environment.noclasspath is true

### Source code you are trying to analyze/transform

```Java
import static com.shuidihuzhu.sdb.broker.enums.ActionStatus.MEET_CONSULT;

@Service
@Slf4j
public class ClueTrackActionServiceImpl {

public String getTitle(TrackAction trackAction, TrackStatus trackStatus) {

if (MEET_CONSULT.equals(trackAction.getStatus())) {
return String.format("%s%s", ACTION_TITLE_PREFIX, trackAction.getStatus().getTrackProgress().getMsg());
}

return trackAction.getStatus().getMsg();
}
}
```

### Source code for your Spoon processing

```Java
String projectPath = codePath + "/" + projectName;
log.info("加载工程[{}] projectPath[{}] begin", projectName, projectPath);

MavenLauncher launcher = null;
if (isLocalDebug) {
launcher = new MavenLauncher(projectPath, MavenLauncher.SOURCE_TYPE.APP_SOURCE);
} else {
launcher = new MavenLauncher(projectPath, MavenLauncher.SOURCE_TYPE.APP_SOURCE, Constant.MVN_FILE);
}
launcher.getEnvironment().setAutoImports(true);
launcher.getEnvironment().disableConsistencyChecks();
launcher.getEnvironment().setIgnoreDuplicateDeclarations(true);
launcher.getEnvironment().setNoClasspath(true);
//launcher.getEnvironment().setLevel(Level.DEBUG.name());
//launcher.getEnvironment().setIgnoreSyntaxErrors(true);
launcher.setSourceOutputDirectory(codePath + "/" + projectName + "transformed");
launcher.run();
```

### Actual output

_No response_

### Expected output

_No response_

### Spoon Version

10.3.0

### JVM Version

11

### What operating system are you using?

macos 12.3.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.