getappmap / getappmap/appmap-java
crash when the project's git repo doesn't have any remotes
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 88
- Forks
- 17
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 1
Description
ajp@Alans-MacBook-Pro java % git remote -v
main 20240519 135907
ajp@Alans-MacBook-Pro java % java -Dappmap.recording.auto=true -javaagent:$HOME/.appmap/lib/java/appmap.jar com/example/hw/HelloWorld.java
Hello World!
Exception in thread "Thread-3" java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.get(ArrayList.java:459)
at com.appland.appmap.util.GitUtil.getRepositoryURL(GitUtil.java:103)
at com.appland.appmap.record.AppMapSerializer.writeMetadata(AppMapSerializer.java:186)
at com.appland.appmap.record.AppMapSerializer.write(AppMapSerializer.java:73)
at com.appland.appmap.record.RecordingSession.stop(RecordingSession.java:127)
at com.appland.appmap.record.Recorder.stop(Recorder.java:270)
at com.appland.appmap.Agent.lambda$startAutoRecording$2(Agent.java:151)
at java.base/java.lang.Thread.run(Thread.java:829)
main 20240519 135911
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with com.appland.appmap.util.GitUtil.getRepositoryURL at GitUtil.java:103 and its call from AppMapSerializer.writeMetadata. Reproduce the Java agent run in a repository with no remotes, then verify recording stops without an IndexOutOfBoundsException and metadata writing completes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, java
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100