JavaDoc: discourage using of methods which don't support scopes

This commit is contained in:
Tagir Valeev
2018-03-14 17:44:46 +07:00
parent 867f6bb287
commit 285da6d208
2 changed files with 15 additions and 1 deletions
@@ -341,11 +341,19 @@ public class InspectionProfileImpl extends NewInspectionProfile {
});
}
/**
* Warning: Usage of this method is discouraged as if separate tool options are defined for different scopes, it just returns
* the options for the first scope which may lead to unexpected results. Consider using {@link #getInspectionTool(String, PsiElement)} instead.
*
* @param shortName an inspection short name
* @param project a project
* @return an InspectionToolWrapper associated with this tool.
*/
@Override
@Nullable
public InspectionToolWrapper getInspectionTool(@NotNull String shortName, Project project) {
final ToolsImpl tools = getToolsOrNull(shortName, project);
return tools != null? tools.getTool() : null;
return tools != null ? tools.getTool() : null;
}
public InspectionToolWrapper getToolById(@NotNull String id, @NotNull PsiElement element) {
@@ -229,6 +229,12 @@ public class ToolsImpl implements Tools {
myEnabled = isEnabled;
}
/**
* Warning: Usage of this method is discouraged as if separate tool options are defined for different scopes, it just returns
* the options for the first scope which may lead to unexpected results. Consider using {@link #getInspectionTool(PsiElement)} instead.
*
* @return an InspectionToolWrapper associated with this tool.
*/
@NotNull
@Override
public InspectionToolWrapper getTool() {