JetBrains / JetBrains/junie

[2735.1] StringIndexOutOfBoundsException in JunieStructureServiceImpl on PyCharm 2026.2

Open
#94 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
437
Forks
32
Avg merge
4h 43m
Merged PRs (30d)
7

Description

**Environment**
- Plugin version: 2735.1
- IDE: PyCharm 2026.2 (build PY-262.8665.369)
- OS: Linux (CachyOS / Arch-based)

**Description**
After updating to PyCharm 2026.*, Junie plugin produces repeated errors every few seconds in the log, spamming STDERR with `StringIndexOutOfBoundsException` and EDT threading errors.

**Error 1 - StringIndexOutOfBoundsException (repeated every ~5s)**
```
java.lang.StringIndexOutOfBoundsException: Range [49, 16) out of bounds for length 16
```
Triggered by `JunieStructureServiceImpl` when analyzing Python files (e.g. `settings.py`, `test_views.py`). The plugin tries to extract a character range that does not exist in the source string.

**Error 2 - EDT threading violation**
```
Service error on JunieStructureService.getFileStructure: Error in getFileStructure: Access is allowed from Event Dispatch Thread (EDT) only
Service error on JunieStructureService.getFileImports: Error in getFileImports: Access is allowed from Event Dispatch Thread (EDT) only
```
Junie calls file structure/import operations from a non-EDT thread.

**Impact**
The errors repeat every few seconds and may block the code editing thread. Uninstall/reinstall of the plugin does not resolve the issue.

**Steps to reproduce**
1. Open a Python project in PyCharm 2026.2 with Junie installed (v2735.1)
2. Open any Python file that has imports or structure
3. Observe repeated errors in the log every few seconds

**Expected behavior**
Junie should analyze file structure without exceptions and respect EDT threading rules.

**Actual behavior**
Repeated `StringIndexOutOfBoundsException` and EDT violations spam the log.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with JunieStructureServiceImpl and reproduce the errors by opening a Python file with imports or structure in PyCharm 2026.2. Trace the invalid character-range extraction and the calls to getFileStructure and getFileImports. Done means the repeated StringIndexOutOfBoundsException and EDT threading violations no longer appear in the log.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, python
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.