Skip to content

Commit

Permalink
Merge pull request #8146 from matthiasblaesing/csl-fix-3
Browse files Browse the repository at this point in the history
csl.api: Fix wrong @nonnull annotation in methods of Language
  • Loading branch information
matthiasblaesing authored Jan 15, 2025
2 parents e2bcf50 + ee838a7 commit 6a4ee5a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
8 changes: 4 additions & 4 deletions ide/csl.api/src/org/netbeans/modules/csl/core/Language.java
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ public boolean hasHints() {
/**
* Return the occurrences finder for this language
*/
@NonNull
@CheckForNull
public OccurrencesFinder getOccurrencesFinder() {
if (occurrences == null) {
if (occurrencesFile != null) {
Expand Down Expand Up @@ -653,7 +653,7 @@ public boolean hasOccurrencesFinder() {
/**
* Return the semantic analyzer for this language
*/
@NonNull
@CheckForNull
public SemanticAnalyzer getSemanticAnalyzer() {
if (semantic == null) {
if (semanticFile != null) {
Expand All @@ -679,7 +679,7 @@ void setSemanticAnalyzer(FileObject semanticFile) {
/**
* Return the semantic analyzer for this language
*/
@NonNull
@CheckForNull
public IndexSearcher getIndexSearcher() {
if (indexSearcher == null) {
if (indexSearcherFile != null) {
Expand Down Expand Up @@ -735,7 +735,7 @@ public Set<String> getBinaryLibraryPathIds() {
/**
* Return the overriding methods computer for this language
*/
@NonNull
@CheckForNull
public OverridingMethods getOverridingMethods() {
if (overridingMethods == null) {
if (overridingMethodsFile != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ public void run(ParserResult info, SchedulerEvent event) {
@NonNull
List<OffsetRange> processImpl(ParserResult info, Document doc, int caretPosition) {
OccurrencesFinder finder = language.getOccurrencesFinder();
assert finder != null;

if(finder == null) {
return List.of();
}

finder.setCaretPosition(caretPosition);
try {
finder.run(info, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ private void process(Language language, ParserResult result, Set<SequenceElement

ColoringManager manager = language.getColoringManager();
SemanticAnalyzer task = language.getSemanticAnalyzer();


if (task == null) {
return;
}

// Allow language plugins to do their own analysis too
try {
task.run(result, null);
Expand Down

0 comments on commit 6a4ee5a

Please sign in to comment.