diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/GroovyBundle.properties b/plugins/groovy/src/org/jetbrains/plugins/groovy/GroovyBundle.properties index 8b7b70e6c566..8b6b797ae88d 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/GroovyBundle.properties +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/GroovyBundle.properties @@ -260,7 +260,7 @@ class.is.not.expected.here=Class is not expected here fix.package.name=Fix package name #dynamic properties -add.dynamic.property=Add dynamic property ''{0}'' +add.dynamic.property=Add Dynamic Property ''{0}'' duplicate.element.in.the.map=Duplicate element in the map dynamic.toolwindow.search.elements=Search dynamic element dynamic.toolwindow.property.filter=Property Filter @@ -271,16 +271,16 @@ create.field.from.usage=Create Field ''{0}'' create.method.from.usage=Create Method ''{0}'' create.variable.from.usage=Create Variable ''{0}'' add.dynamic.element=Add dynamic element -add.dynamic.method=Add dynamic method +add.dynamic.method=Add Dynamic Method dynamic.type=Type dynamic.name=Name dynamic.properties.table.name=Method arguments dynamic.method.return.type=Return type dynamic.method.property.type=Property type are.you.sure.to.delete.dynamic.property=Are you sure to delete ''{0}''? -dynamic.property.deletion=Deletion dynamic property +dynamic.property.deletion=Deletion Dynamic Property are.you.sure.to.delete.elements=Are you sure to delete ''{0}'' elements? -dynamic.element.deletion=Dynamic element deletion +dynamic.element.deletion=Dynamic Element Deletion dynamic.window=Dynamic window dynamic.properties.table.no.arguments=Arguments list is empty. assignment.expected='=' expected @@ -304,7 +304,7 @@ break.outside.loop=The break statement with named labels is only allowed inside Constructor=Constructor Getter=Getter Setter=Setter -groovy.like.library.found=Groovy library found +groovy.like.library.found=Groovy Library Found groovy.like.library.found.text=Do you want to set up Groovy for module ''{0}'' \n\ with found library ''{1}'' (Groovy version {2})? compile.groovy.files=&Compile Groovy files diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/actions/generate/GroovyCodeInsightBundle.properties b/plugins/groovy/src/org/jetbrains/plugins/groovy/actions/generate/GroovyCodeInsightBundle.properties index 9b5b7606bac5..f42faeabcaac 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/actions/generate/GroovyCodeInsightBundle.properties +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/actions/generate/GroovyCodeInsightBundle.properties @@ -1,5 +1,5 @@ generate.equals.and.hashcode.already.defined.warning.anonymous=equals() and hashCode() already defined generate.equals.and.hashcode.already.defined.warning=equals() and hashCode() already defined -generate.equals.and.hashcode.already.defined.title=equals() and hashCode() already defined +generate.equals.and.hashcode.already.defined.title=equals() and hashCode() Already Defined generate.equals.compare.nested.arrays.comment= // Compare nested arrays - values of {0} here generate.equals.compare.arrays.comment= // Probably incorrect - comparing Object[] arrays with Arrays.equals \ No newline at end of file diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/DynamicToolWindowWrapper.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/DynamicToolWindowWrapper.java index 46d8dd4b7372..512e00e1dc75 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/DynamicToolWindowWrapper.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/DynamicToolWindowWrapper.java @@ -40,14 +40,15 @@ import com.intellij.ui.treeStructure.treetable.ListTreeTableModelOnColumns; import com.intellij.ui.treeStructure.treetable.TreeTable; import com.intellij.ui.treeStructure.treetable.TreeTableModel; import com.intellij.ui.treeStructure.treetable.TreeTableTree; -import com.intellij.util.Function; import com.intellij.util.IncorrectOperationException; +import com.intellij.util.NullableFunction; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.ui.AbstractTableCellEditor; import com.intellij.util.ui.ColumnInfo; import com.intellij.util.ui.UIUtil; import com.intellij.util.ui.tree.TreeUtil; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.GroovyBundle; import org.jetbrains.plugins.groovy.GroovyFileType; @@ -66,6 +67,7 @@ import javax.swing.tree.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.util.ArrayList; import java.util.Collection; @@ -247,7 +249,7 @@ public class DynamicToolWindowWrapper { myTreeTable.setTreeCellRenderer(treeCellRenderer); myTreeTable.setRootVisible(false); - myTreeTable.setSelectionMode(DefaultTreeSelectionModel.CONTIGUOUS_TREE_SELECTION); + myTreeTable.setSelectionMode(TreeSelectionModel.CONTIGUOUS_TREE_SELECTION); final MyPropertyTypeCellEditor typeCellEditor = new MyPropertyTypeCellEditor(); @@ -318,11 +320,11 @@ public class DynamicToolWindowWrapper { final String qualifiedName = ((PsiClass)element).getQualifiedName(); return new RefactoringElementListener() { - public void elementMoved(PsiElement newElement) { + public void elementMoved(@NotNull PsiElement newElement) { renameElement(qualifiedName, newElement); } - public void elementRenamed(PsiElement newElement) { + public void elementRenamed(@NotNull PsiElement newElement) { renameElement(qualifiedName, newElement); } @@ -358,7 +360,7 @@ public class DynamicToolWindowWrapper { final int selectionRow = myTreeTable.getTree().getLeadSelectionRow(); myTreeTable.editCellAt(selectionRow, TYPE_COLUMN, event); } - }, KeyStroke.getKeyStroke(KeyEvent.VK_F2, KeyEvent.CTRL_MASK), JComponent.WHEN_FOCUSED); + }, KeyStroke.getKeyStroke(KeyEvent.VK_F2, InputEvent.CTRL_MASK), JComponent.WHEN_FOCUSED); // todo use "myTreeTable.setAutoCreateRowSorter(true);" since 1.6 @@ -510,7 +512,7 @@ public class DynamicToolWindowWrapper { } } - class ClassColumnInfo extends ColumnInfo { + static class ClassColumnInfo extends ColumnInfo { public ClassColumnInfo(String name) { super(name); } @@ -565,7 +567,7 @@ public class DynamicToolWindowWrapper { if (!(childObject instanceof DItemElement)) break; filterText = getFilter(); - if (filterText == null || "".equals(filterText)) { + if (filterText == null || filterText.isEmpty()) { ((DItemElement)childObject).setHightlightedText(""); dynamicNodes.add(dynamicNode); @@ -689,7 +691,8 @@ public class DynamicToolWindowWrapper { } private static String[] mapToUnqualified(final String[] argumentsNames) { - return ContainerUtil.map2Array(argumentsNames, String.class, new Function() { + return ContainerUtil.map2Array(argumentsNames, String.class, new NullableFunction() { + @Nullable public String fun(final String s) { if (s == null) return null; int index = s.lastIndexOf("."); @@ -741,7 +744,7 @@ public class DynamicToolWindowWrapper { if (element == null) return null; return element.getContainingFile(); - } else if (LangDataKeys.DELETE_ELEMENT_PROVIDER.is(dataId)) { + } else if (PlatformDataKeys.DELETE_ELEMENT_PROVIDER.is(dataId)) { return new DeleteProvider() { @Override public void deleteElement(DataContext dataContext) { diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/ui/DynamicDialog.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/ui/DynamicDialog.java index 42b165d1c77d..2d6746084924 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/ui/DynamicDialog.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/ui/DynamicDialog.java @@ -148,7 +148,7 @@ public abstract class DynamicDialog extends DialogWrapper { setStatusTextAndIcon(null, ""); } - private void setStatusTextAndIcon(final Icon icon, final String text) { + private void setStatusTextAndIcon(@Nullable final Icon icon, final String text) { myTypeStatusLabel.setIcon(icon); myTypeStatusLabel.setText(text); pack(); @@ -177,7 +177,7 @@ public abstract class DynamicDialog extends DialogWrapper { public void actionPerformed(ActionEvent e) { myClassComboBox.requestFocus(); } - }, KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.ALT_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW); + }, KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.ALT_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW); } @Nullable @@ -191,7 +191,7 @@ public abstract class DynamicDialog extends DialogWrapper { final EditorComboBoxEditor comboEditor = new EditorComboBoxEditor(myProject, GroovyFileType.GROOVY_FILE_TYPE); final Document document = createDocument(""); - assert document != null; + LOG.assertTrue(document != null); comboEditor.setItem(document); @@ -213,7 +213,7 @@ public abstract class DynamicDialog extends DialogWrapper { public void actionPerformed(ActionEvent e) { myTypeComboBox.requestFocus(); } - }, KeyStroke.getKeyStroke(KeyEvent.VK_T, KeyEvent.ALT_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW); + }, KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.ALT_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW); final EditorTextField editorTextField = (EditorTextField) myTypeComboBox.getEditor().getEditorComponent(); @@ -228,9 +228,6 @@ public abstract class DynamicDialog extends DialogWrapper { }); PsiType type = typeConstraints.length == 1 ? typeConstraints[0].getDefaultType() : TypesUtil.getJavaLangObject(myContext); - if (type == null) { - type = TypesUtil.getJavaLangObject(myContext); - } myTypeComboBox.getEditor().setItem(createDocument(type.getCanonicalText())); } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/BaseInspection.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/BaseInspection.java index 7a030222512d..a7d6f5302f2c 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/BaseInspection.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/BaseInspection.java @@ -95,9 +95,6 @@ public abstract class BaseInspection extends GroovySuppressableInspectionTool { final BaseInspectionVisitor visitor = buildGroovyVisitor(problemsHolder, isOnTheFly); groovyFile.accept(visitor); final List problems = problemsHolder.getResults(); - if (problems == null) { - return null; - } return problems.toArray(new ProblemDescriptor[problems.size()]); } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/GroovyInspectionBundle.properties b/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/GroovyInspectionBundle.properties index cc1890234c9f..e89d06c35cff 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/GroovyInspectionBundle.properties +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/GroovyInspectionBundle.properties @@ -46,7 +46,7 @@ dynamic.property=Dynamic property unresolved.type.status=Type ''{0}'' is not resolved resolved.type.status=Type ''{0}'' is resolved no.type.specified=No type specified -dynamic.element=Dynamic element +dynamic.element=Dynamic Element ######################################################################################################################## # InpectorGroovy properties @@ -57,7 +57,7 @@ pointless.boolean.display.name=Pointless boolean expression pointless.boolean.quickfix=Simplify Cannot.perform.undo.operation=Cannot perform undo operation -Undo.disable=Undo disabled +Undo.disable=Undo Disabled field.already.defined=Variables with field names access.to.inaccessible.element=Access to inaccessible element diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompiler.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompiler.java index 4dc37f8f06f6..4f20b2256506 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompiler.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompiler.java @@ -138,7 +138,8 @@ public class GroovyCompiler extends GroovyCompilerBase { "You seem to have global Groovy AST transformations defined in your project,\n" + "but they won't be applied to your code because they are not marked as compiler resources.\n" + "Do you want to add them to compiler resource list?\n" + - "(you can do it yourself later in Settings | Compiler | Resource patterns)", "AST Transformations found", + "(you can do it yourself later in Settings | Compiler | Resource patterns)", + "AST Transformations Found", GroovyIcons.GROOVY_ICON_32x32); if (result == 0) { CompilerConfiguration.getInstance(myProject).addResourceFilePattern(AST_TRANSFORM_FILE_NAME); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/grape/GrabDependencies.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/grape/GrabDependencies.java index d19dce534bf8..609d1db536bc 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/grape/GrabDependencies.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/grape/GrabDependencies.java @@ -103,7 +103,8 @@ public class GrabDependencies implements IntentionAction { assert vfile != null; if (JavaPsiFacade.getInstance(project).findClass("org.apache.ivy.core.report.ResolveReport", file.getResolveScope()) == null) { - Messages.showErrorDialog("Sorry, but IDEA cannot @Grab the dependencies without Ivy. Please add Ivy to your module dependencies and re-run the action.", "Ivy missing"); + Messages.showErrorDialog("Sorry, but IDEA cannot @Grab the dependencies without Ivy. Please add Ivy to your module dependencies and re-run the action.", + "Ivy Missing"); return; } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/GroovyIntentionsBundle.properties b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/GroovyIntentionsBundle.properties index 17988f9cecce..23bda96924da 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/GroovyIntentionsBundle.properties +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/GroovyIntentionsBundle.properties @@ -90,7 +90,7 @@ do.not.create.first.new=Use &existing first parameter as map for named arguments convert.cannot.itself=Refactoring is not available for map parameter itself perform.refactoring=Performing refactoring map.param.name=Map parameter &name: -convert.param.to.map.entry=Convert parameter to map entry +convert.param.to.map.entry=Convert Parameter to Map Entry convert.java.style.array.intention.name=Convert java-style array creation convert.java.style.array.intention.family.name=Convert Java-Style Array Creation to Groovy Syntax @@ -102,7 +102,7 @@ create.parameter.for.field=Add parameter for field ''{0}'' create.parameter.for.fields=Add parameter for field... closure.used.as.variable=Closure is passed as argument. Refactoring can break semantic. -convert.map.to.class.intention.name=Convert to class +convert.map.to.class.intention.name=Convert to Class convert.map.to.class.intention.family.name=Convert Groovy native map to class instances do.you.want.to.change.method.return.type=Do you want to change return type of ''{0}'' method do.you.want.to.change.variable.type=Do you want to change type of ''{0}'' diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/parameterToEntry/GroovyMapParameterDialog.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/parameterToEntry/GroovyMapParameterDialog.java index cbec4da4b9e5..996026fa150a 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/parameterToEntry/GroovyMapParameterDialog.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/parameterToEntry/GroovyMapParameterDialog.java @@ -161,7 +161,7 @@ public class GroovyMapParameterDialog extends DialogWrapper { public void actionPerformed(ActionEvent e) { myNameComboBox.requestFocus(); } - }, KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.ALT_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW); + }, KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.ALT_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW); for (String possibleName : possibleNames) { myNameComboBox.addItem(possibleName); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcConsole.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcConsole.java index 883140d6cb76..a0af4d23a3d1 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcConsole.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcConsole.java @@ -294,7 +294,7 @@ public class MvcConsole implements Disposable { catch (final IOException e) { ApplicationManager.getApplication().invokeLater(new Runnable() { public void run() { - Messages.showErrorDialog(e.getMessage(), "Cannot start process"); + Messages.showErrorDialog(e.getMessage(), "Cannot Start Process"); try { if (onDone != null && !module.isDisposed()) onDone.run(); @@ -359,7 +359,7 @@ public class MvcConsole implements Disposable { super("Kill process", "Kill process", KILL_PROCESS_ICON); } - public void setHandler(OSProcessHandler handler) { + public void setHandler(@Nullable OSProcessHandler handler) { myHandler = handler; }