mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
notnull
This commit is contained in:
@@ -17,11 +17,15 @@ package com.intellij.psi.search;
|
||||
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface TodoItem {
|
||||
@NotNull
|
||||
PsiFile getFile();
|
||||
|
||||
@NotNull
|
||||
TextRange getTextRange();
|
||||
|
||||
@NotNull
|
||||
TodoPattern getPattern();
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.search.TodoItem;
|
||||
import com.intellij.psi.search.TodoPattern;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class TodoItemImpl implements TodoItem {
|
||||
private final PsiFile myFile;
|
||||
@@ -28,23 +29,26 @@ public class TodoItemImpl implements TodoItem {
|
||||
private final int myEndOffset;
|
||||
private final TodoPattern myPattern;
|
||||
|
||||
public TodoItemImpl(PsiFile file, int startOffset, int endOffset, TodoPattern pattern) {
|
||||
public TodoItemImpl(@NotNull PsiFile file, int startOffset, int endOffset, @NotNull TodoPattern pattern) {
|
||||
myFile = file;
|
||||
myStartOffset = startOffset;
|
||||
myEndOffset = endOffset;
|
||||
myPattern = pattern;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiFile getFile() {
|
||||
return myFile;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public TextRange getTextRange() {
|
||||
return new TextRange(myStartOffset, myEndOffset);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public TodoPattern getPattern() {
|
||||
return myPattern;
|
||||
@@ -59,14 +63,9 @@ public class TodoItemImpl implements TodoItem {
|
||||
return false;
|
||||
}
|
||||
TodoItemImpl todoItem=(TodoItemImpl)obj;
|
||||
if(
|
||||
!myFile.equals(todoItem.myFile)||
|
||||
myStartOffset!=todoItem.myStartOffset||
|
||||
myEndOffset!=todoItem.myEndOffset||
|
||||
!myPattern.equals(todoItem.myPattern)
|
||||
){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return myFile.equals(todoItem.myFile) &&
|
||||
myStartOffset == todoItem.myStartOffset &&
|
||||
myEndOffset == todoItem.myEndOffset &&
|
||||
myPattern.equals(todoItem.myPattern);
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import com.intellij.psi.search.IndexPattern;
|
||||
import com.intellij.psi.search.IndexPatternOccurrence;
|
||||
import com.intellij.psi.search.TodoItem;
|
||||
import com.intellij.psi.search.TodoPattern;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author irengrig
|
||||
@@ -30,7 +31,7 @@ import com.intellij.psi.search.TodoPattern;
|
||||
* Time: 10:47 AM
|
||||
*/
|
||||
public class TodoItemsCreator {
|
||||
private final static Logger LOG = Logger.getInstance("#com.intellij.psi.impl.search.TodoItemsCreator");
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.search.TodoItemsCreator");
|
||||
private final TodoPattern[] myTodoPatterns;
|
||||
|
||||
public TodoItemsCreator() {
|
||||
@@ -43,7 +44,8 @@ public class TodoItemsCreator {
|
||||
mapPattern(occurrence.getPattern()));
|
||||
}
|
||||
|
||||
private TodoPattern mapPattern(final IndexPattern pattern) {
|
||||
@NotNull
|
||||
private TodoPattern mapPattern(@NotNull IndexPattern pattern) {
|
||||
for(TodoPattern todoPattern: myTodoPatterns) {
|
||||
if (todoPattern.getIndexPattern() == pattern) {
|
||||
return todoPattern;
|
||||
|
||||
Reference in New Issue
Block a user