Adding missing @Override annotations (part 2). Adding RRA/RWA/RUI annotations. Some refactoring - #12
Conversation
…otations. Some refactoring.
|
@claude review pr with inline comments |
|
Claude finished @unv-unv's task in 3m 30s —— View job PR Review — @OverRide / RRA / RWA / RUI annotations + refactoringI reviewed all 50 changed files. This is a large, mostly-mechanical cleanup (adding
Findings (inline)
Minor (non-blocking, not left inline)
Nothing here is a correctness blocker — #1 is the only clear "should fix", and it's cosmetic. Nice work on the read/write-action annotations; they add real value for threading correctness. Note: I can't submit a formal GitHub review or approve — the notes above are posted as regular inline review comments. |
| @Nonnull | ||
| @NonNls | ||
| public String getId() { | ||
| public @Override | ||
| String getId() { |
There was a problem hiding this comment.
The @Override annotation ended up wedged into the middle of the modifiers here, producing public @Override String getId(). It compiles, but it's clearly a formatting slip — the annotation should sit above the public modifier like every other method in this class.
| @Nonnull | |
| @NonNls | |
| public String getId() { | |
| public @Override | |
| String getId() { | |
| @Nonnull | |
| @Override | |
| public String getId() { |
| } | ||
|
|
||
| public PointcutMatchDegree matches(PointcutContext context, PsiParameterList list, PairFunction<PsiType, AopReferenceTarget, PointcutMatchDegree> matcher) { | ||
| public PointcutMatchDegree matches(PointcutContext context, PsiParameterList list, BiFunction<PsiType, AopReferenceTarget, PointcutMatchDegree> matcher) { |
There was a problem hiding this comment.
With matches(...) now taking a java.util.function.BiFunction (and AopAbstractList.accepts migrated too), the import consulo.util.lang.function.PairFunction; at the top of this file is no longer used and can be removed.
| */ | ||
| public class AopPsiTypePatternsUtil { | ||
| private static final List<Pair<Pair<Class, Class>, PairFunction>> ourAnders = new ArrayList<Pair<Pair<Class, Class>, PairFunction>>(); | ||
| private static final List<Pair<Couple<Class>, BiFunction>> ourAnders = new ArrayList<>(); |
There was a problem hiding this comment.
All PairFunction usages in this file were replaced with BiFunction, so the import consulo.util.lang.function.PairFunction; near the top is now unused and can be removed.
|
|
||
| @Override | ||
| @RequiredReadAction | ||
| public String toString() { |
There was a problem hiding this comment.
Marking toString() as @RequiredReadAction is a bit risky: toString() is frequently invoked outside of a read action (logging, the debugger's variable view, assertion messages), and the contract here would now assert a read lock is held on every such call. Since the only thing needing the read action is getName(), consider dropping @RequiredReadAction from toString() to avoid spurious threading assertions.
| if (element == null) return Collections.emptyList(); | ||
|
|
||
| return AopModuleService.getAopModel(ModuleUtilCore.findModuleForPsiElement(element)).getPointcuts(); | ||
| return AopModuleService.getAopModel(element.getModule()).getPointcuts(); |
There was a problem hiding this comment.
This swaps ModuleUtilCore.findModuleForPsiElement(element) for element.getModule(). getAopModel(null) is handled safely (returns the empty model), so there's no NPE risk, but findModuleForPsiElement and PsiElement.getModule() don't always resolve the module the same way for elements sitting in libraries / injected contexts. Worth a quick check that pointcut resolution in <aop:*> tags still behaves the same after this change.
|
@claude review pr with inline comments |
|
Claude finished @unv-unv's task in 3m 9s —— View job PR Review — @OverRide / RRA / RWA / RUI annotations + refactoring
Re-reviewed the current head ( ✅ Already fixed since the last reviewThe
🔎 Still open — 2 fresh inline comments
Verified equivalences (no action needed)
Minor (non-blocking)
Nothing here is a correctness blocker. Nice work — the read/write-action annotations add real threading-correctness value. Note: I can't submit a formal GitHub review or approve — the notes above are posted as regular inline review comments. |
| @Override | ||
| @RequiredReadAction | ||
| public String toString() { |
There was a problem hiding this comment.
(still open from previous review) Marking toString() as @RequiredReadAction is risky. toString() is frequently invoked outside a read action — logging, the debugger's variable view, assertion messages — and this contract would now assert a read lock is held on every such call. The only member needing the read action is getName(). Consider dropping @RequiredReadAction here.
| @Override | |
| @RequiredReadAction | |
| public String toString() { | |
| @Override | |
| public String toString() { |
| if (element == null) return Collections.emptyList(); | ||
|
|
||
| return AopModuleService.getAopModel(ModuleUtilCore.findModuleForPsiElement(element)).getPointcuts(); | ||
| return AopModuleService.getAopModel(element.getModule()).getPointcuts(); |
There was a problem hiding this comment.
(still open from previous review) This swaps ModuleUtilCore.findModuleForPsiElement(element) for element.getModule(). getAopModel(null) returns the empty model, so there is no NPE risk, but findModuleForPsiElement and PsiElement.getModule() don't always resolve to the same module for elements sitting in libraries / injected contexts. Worth a quick check that pointcut resolution in <aop:*> tags still behaves the same after this change.
No description provided.