Repository navigation
Fixing compilation errors after platform localization. Some refactoring - #2
Conversation
8ecba02 to
c84aa27
Compare
|
@claude review pr with inline comments |
|
Claude finished @unv-unv's task in 1m 1s —— View job PR #2 review
Summary: The compilation fix looks correct. The changes to
|
| } | ||
|
|
||
| @Nullable | ||
|
|
There was a problem hiding this comment.
Nit: removing @Nullable left two blank lines here.
| @RequiredReadAction | ||
| public String getAlphaSortKey() { | ||
| return myElement instanceof PsiNamedElement ? ((PsiNamedElement) myElement).getName() : null; | ||
| return myElement instanceof PsiNamedElement namedElem ? namedElem.getName() : null; |
There was a problem hiding this comment.
This existed before the PR: CSV fields aren't PsiNamedElement, so this always returns null, but SortableTreeElement#getAlphaSortKey is expected to be non-null. It's harmless today because CsvStructureViewModel.getSorters() returns Sorter.EMPTY_ARRAY, but adding Sorter.ALPHA later would cause an NPE. A non-null fallback avoids that:
| return myElement instanceof PsiNamedElement namedElem ? namedElem.getName() : null; | |
| return myElement instanceof PsiNamedElement namedElem && namedElem.getName() != null ? namedElem.getName() : ""; |
| import net.seesharpsoft.intellij.plugins.csv.settings.CsvEditorSettings; | ||
| import org.jetbrains.annotations.NotNull; | ||
| import org.jetbrains.annotations.Nullable; | ||
| import org.jspecify.annotations.Nullable; |
There was a problem hiding this comment.
This switches to jspecify @Nullable but keeps org.jetbrains.annotations.NotNull (line 21, used on Header.getChildren() and Field.getChildren()), so the file now mixes two nullability systems. To use jspecify consistently, mark the package @NullMarked (as editor/table/package-info.java already does) and then drop the JetBrains @NotNull annotations and import.
| @Override | ||
| public String getLocationString() { | ||
| public @Nullable String getLocationString() { | ||
| return String.format("Header (%s entries)", getNumberOfChildren()); |
There was a problem hiding this comment.
Minor: Header.getLocationString(), Header.getIcon() and Field.getLocationString() never return null, so the overrides could drop @Nullable (a non-null return can narrow a nullable one).
Also, "Header (%s entries)" is a user-visible hard-coded string. Since this PR follows the platform localization change, consider moving it to the plugin's localize YAML and a LocalizeValue, either here or in a follow-up.
c84aa27 to
18af998
Compare
|
@claude review pr with inline comments |
|
Claude finished @unv-unv's task in 40s —— View job PR #2 review (second pass)
I re-reviewed the current head, Status of the first review's threads:
Checked this pass, no problems found:
Verdict: the compilation fix looks correct and safe to merge. The three open threads are optional cleanups. As before, I didn't build the project; this review is from reading the code only. |
No description provided.