Merge remote-tracking branch 'origin/master'

This commit is contained in:
Ekaterina Tuzova
2014-02-18 15:02:54 +04:00
497 changed files with 27497 additions and 1286 deletions
+11 -11
View File
@@ -1,20 +1,20 @@
<component name="libraryTable">
<library name="http-client">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/httpcore-4.3.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/httpclient-4.3.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/httpmime-4.3.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/fluent-hc-4.3.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/httpcore-4.3.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/httpmime-4.3.2.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/httpclient-4.3.2.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/fluent-hc-4.3.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/src/httpcomponents-client-4.3.1-src.zip!/httpcomponents-client-4.3.1/httpmime/src/main/java" />
<root url="jar://$PROJECT_DIR$/lib/src/httpcomponents-client-4.3.1-src.zip!/httpcomponents-client-4.3.1/httpmime/src/main/java-deprecated" />
<root url="jar://$PROJECT_DIR$/lib/src/httpcomponents-client-4.3.1-src.zip!/httpcomponents-client-4.3.1/httpclient/src/main/java" />
<root url="jar://$PROJECT_DIR$/lib/src/httpcomponents-client-4.3.1-src.zip!/httpcomponents-client-4.3.1/httpclient/src/main/java-deprecated" />
<root url="jar://$PROJECT_DIR$/lib/src/httpcomponents-core-4.3-src.zip!/httpcomponents-core-4.3/httpcore/src/main/java" />
<root url="jar://$PROJECT_DIR$/lib/src/httpcomponents-core-4.3-src.zip!/httpcomponents-core-4.3/httpcore/src/main/java-deprecated" />
<root url="jar://$PROJECT_DIR$/lib/src/httpcomponents-client-4.3.1-src.zip!/httpcomponents-client-4.3.1/fluent-hc/src/main/java" />
<root url="jar://$PROJECT_DIR$/lib/src/httpcomponents-client-4.3.2-src.zip!/httpcomponents-client-4.3.2/httpmime/src/main/java" />
<root url="jar://$PROJECT_DIR$/lib/src/httpcomponents-client-4.3.2-src.zip!/httpcomponents-client-4.3.2/httpmime/src/main/java-deprecated" />
<root url="jar://$PROJECT_DIR$/lib/src/httpcomponents-client-4.3.2-src.zip!/httpcomponents-client-4.3.2/fluent-hc/src/main/java" />
<root url="jar://$PROJECT_DIR$/lib/src/httpcomponents-client-4.3.2-src.zip!/httpcomponents-client-4.3.2/httpclient/src/main/java" />
<root url="jar://$PROJECT_DIR$/lib/src/httpcomponents-client-4.3.2-src.zip!/httpcomponents-client-4.3.2/httpclient/src/main/java-deprecated" />
<root url="jar://$PROJECT_DIR$/lib/src/httpcomponents-core-4.3.1-src.zip!/httpcomponents-core-4.3.1/httpcore/src/main/java" />
<root url="jar://$PROJECT_DIR$/lib/src/httpcomponents-core-4.3.1-src.zip!/httpcomponents-core-4.3.1/httpcore/src/main/java-deprecated" />
</SOURCES>
</library>
</component>
+1
View File
@@ -92,6 +92,7 @@
<module fileurl="file://$PROJECT_DIR$/java/compiler/javac2/javac2.iml" filepath="$PROJECT_DIR$/java/compiler/javac2/javac2.iml" group="java/compiler" />
<module fileurl="file://$PROJECT_DIR$/plugins/cvs/javacvs-src/javacvs-src.iml" filepath="$PROJECT_DIR$/plugins/cvs/javacvs-src/javacvs-src.iml" group="plugins/VCS/cvs" />
<module fileurl="file://$PROJECT_DIR$/plugins/groovy/jetgroovy.iml" filepath="$PROJECT_DIR$/plugins/groovy/jetgroovy.iml" group="plugins/Groovy" />
<module fileurl="file://$PROJECT_DIR$/plugins/tasks/tasks-core/jira/jira.iml" filepath="$PROJECT_DIR$/plugins/tasks/tasks-core/jira/jira.iml" group="plugins/tasks" />
<module fileurl="file://$PROJECT_DIR$/jps/jps-builders/jps-builders.iml" filepath="$PROJECT_DIR$/jps/jps-builders/jps-builders.iml" group="jps" />
<module fileurl="file://$PROJECT_DIR$/jps/jps-launcher/jps-launcher.iml" filepath="$PROJECT_DIR$/jps/jps-launcher/jps-launcher.iml" group="java" />
<module fileurl="file://$PROJECT_DIR$/jps/model-api/jps-model-api.iml" filepath="$PROJECT_DIR$/jps/model-api/jps-model-api.iml" group="jps" />
+1 -5
View File
@@ -165,7 +165,7 @@ libraryLicense(name: "Apache Commons Codec", libraryName: "commons-codec", versi
libraryLicense(name: "Apache Commons Compress", libraryName: "commons-compress", version: "1.0", license: "Apache 2.0", url: "http://commons.apache.org/proper/commons-compress/", licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0")
libraryLicense(name: "Apache Commons Discovery", libraryName: "commons-discovery-0.4.jar", version: "0.4", license: "Apache 2.0", url: "http://jakarta.apache.org/commons/discovery/", licenseUrl: "http://commons.apache.org/license.html")
libraryLicense(name: "Apache Commons HTTPClient", libraryName: "http-client-3.1", version: "3.1&nbsp; (with patch by JetBrains)", license: "Apache 2.0", url: "http://hc.apache.org/httpclient-3.x")
libraryLicense(name: "HttpComponents HttpClient", libraryName: "http-client", version: "4.3.1", license: "Apache 2.0", url: "http://hc.apache.org/httpcomponents-client-ga/index.html")
libraryLicense(name: "HttpComponents HttpClient", libraryName: "http-client", version: "4.3.2", license: "Apache 2.0", url: "http://hc.apache.org/httpcomponents-client-ga/index.html")
libraryLicense(name: "Apache Commons Net", libraryName: "commons-net", version: "3.1", license: "Apache 2.0", url: "http://commons.apache.org/net/")
libraryLicense(name: "Apache Commons Logging", libraryName: "commons-logging", version: "1.1.1", license: "Apache 2.0", url: "http://commons.apache.org/logging/")
libraryLicense(name: "Apache Commons IO", libraryName: "commons-io-1.4.jar", version: "1.4", license: "Apache 2.0", url: "http://commons.apache.org/io/", licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0.txt")
@@ -178,10 +178,6 @@ libraryLicense(name: "Ganymed", version: "bundled with SVNKit", libraryName: "sv
libraryLicense(name: "sqljet", version: "bundled with SVNKit", libraryName: "sqljet.jar", license: "link (commercial license)", url: "http://sqljet.com", licenseUrl: "http://svnkit.com/license.html")
libraryLicense(name: "svnkit-javahl", version: "bundled with SVNKit", libraryName: "svnkit-javahl.jar", license: "link (commercial license)", url: "http://www.svnkit.com/", licenseUrl: "http://svnkit.com/license.html")
libraryLicense(name: "javahl", version: "1.7.2", libraryName: "javahl.jar", license: "Apache", url: "http://subversion.apache.org", licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0")
libraryLicense(name: "Apache Commons HTTPClient", libraryName: "httpclient-4.1.1.jar", version:"4.1.1", license: "Apache 2.0",
url: "http://hc.apache.org/httpcomponents-client-ga/index.html", licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0")
libraryLicense(name: "Apache Commons HTTPCore", libraryName: "httpcore-4.1.jar", version: "4.1", license: "Apache 2.0",
url: "http://hc.apache.org/httpcomponents-core-ga/", licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0")
libraryLicense(name: "Antlr", libraryName: "antlr.jar", version: "3.1.3", license: "BSD", url: "http://www.antlr.org",
licenseUrl: "http://www.antlr.org/license.html")
libraryLicense(name: "Guava", version: "14.0.1", license: "Apache 2.0", url: "http://code.google.com/p/guava-libraries/", licenseUrl: "http://ant.apache.org/license.html")
+1
View File
@@ -96,6 +96,7 @@
<orderEntry type="module" module-name="ui-designer-jps-plugin" scope="TEST" />
<orderEntry type="module" module-name="java-tests" scope="TEST" />
<orderEntry type="module" module-name="community-tests" scope="TEST" />
<orderEntry type="module" module-name="jira" />
</component>
</module>
@@ -2,3 +2,4 @@
[DISABLED_TESTS]
org.jetbrains.idea.svn.*
org.jetbrains.idea.svn16.*
com.intellij.util.net.ssl.*
@@ -54,9 +54,7 @@ import com.intellij.platform.templates.ArchivedProjectTemplate;
import com.intellij.platform.templates.BuilderBasedTemplate;
import com.intellij.platform.templates.LocalArchivedTemplate;
import com.intellij.platform.templates.RemoteTemplatesFactory;
import com.intellij.ui.CollectionListModel;
import com.intellij.ui.ColoredListCellRenderer;
import com.intellij.ui.IdeBorderFactory;
import com.intellij.ui.*;
import com.intellij.ui.SingleSelectionModel;
import com.intellij.ui.components.JBList;
import com.intellij.util.Function;
@@ -150,6 +148,12 @@ public class ProjectTypeStep extends ModuleWizardStep implements Disposable {
append(value.getName());
}
});
new ListSpeedSearch(myProjectTypeList) {
@Override
protected String getElementText(Object element) {
return ((TemplatesGroup)element).getName();
}
};
myModulesProvider = modulesProvider;
Project project = context.getProject();
@@ -1,167 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.ide.util.newProjectWizard.ProjectNameWithTypeStep">
<grid id="807b" binding="myModulePanel" layout-manager="GridBagLayout">
<constraints>
<xy x="20" y="20" width="416" height="453"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="27dc6" binding="myInternalPanel" layout-manager="GridBagLayout">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<gridbag weightx="1.0" weighty="1.0"/>
</constraints>
<properties>
<maximumSize width="250" height="150"/>
<preferredSize width="250" height="150"/>
</properties>
<clientProperties>
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
</clientProperties>
<border type="none"/>
<children>
<scrollpane id="d8de8" class="com.intellij.ui.components.JBScrollPane" binding="myModuleTypeScrollPane">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<gridbag top="0" left="0" bottom="0" right="5" weightx="0.1" weighty="1.0"/>
</constraints>
<properties>
<horizontalScrollBarPolicy value="31"/>
<preferredSize width="125" height="128"/>
</properties>
<border type="none"/>
<children>
<component id="c263e" class="com.intellij.ui.components.JBList" binding="myTypesList">
<constraints/>
<properties/>
</component>
</children>
</scrollpane>
<component id="fb71" class="javax.swing.JLabel" binding="myModuleTypeLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<gridbag top="10" left="0" bottom="2" right="0" weightx="0.0" weighty="0.0"/>
</constraints>
<properties>
<text resource-bundle="messages/ProjectBundle" key="project.new.wizard.select.type.label"/>
</properties>
</component>
<component id="9073d" class="javax.swing.JLabel" binding="myDescriptionLabel">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<gridbag top="10" left="0" bottom="2" right="0" weightx="0.0" weighty="0.0"/>
</constraints>
<properties>
<text resource-bundle="messages/ProjectBundle" key="project.new.wizard.description.title"/>
</properties>
</component>
<scrollpane id="6260" class="com.intellij.ui.components.JBScrollPane" binding="myDescriptionScrollPane">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<gridbag weightx="0.8" weighty="0.0"/>
</constraints>
<properties>
<horizontalScrollBarPolicy value="30"/>
<preferredSize width="28" height="20"/>
</properties>
<border type="none"/>
<children>
<component id="6e12" class="javax.swing.JEditorPane" binding="myModuleDescriptionPane">
<constraints/>
<properties/>
</component>
</children>
</scrollpane>
<grid id="8a2b7" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<gridbag weightx="1.0" weighty="0.0"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="e6ad1" class="javax.swing.JTextField" binding="myModuleName">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="1f996" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<labelFor value="e6ad1"/>
<text resource-bundle="messages/ProjectBundle" key="project.new.wizard.module.name.title"/>
</properties>
</component>
<component id="4af6e" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myModuleContentRoot">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="c4851" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<labelFor value="4af6e"/>
<text resource-bundle="messages/ProjectBundle" key="project.new.wizard.module.root.title"/>
</properties>
</component>
<component id="83a50" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myModuleFileLocation">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<preferredSize width="280" height="20"/>
</properties>
</component>
<component id="a4319" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<labelFor value="83a50"/>
<text resource-bundle="messages/ProjectBundle" key="project.new.wizard.module.file.title"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
<grid id="fa640" binding="myHeader" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<gridbag weightx="0.0" weighty="0.0"/>
</constraints>
<properties>
<visible value="true"/>
</properties>
<border type="none"/>
<children>
<component id="63a74" class="javax.swing.JCheckBox" binding="myCreateModuleCb">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="&amp;Create module"/>
</properties>
</component>
<component id="d48cf" class="javax.swing.JSeparator">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
</children>
</grid>
</children>
</grid>
</form>
@@ -1,491 +0,0 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ide.util.newProjectWizard;
import com.intellij.ide.BrowserUtil;
import com.intellij.ide.IdeBundle;
import com.intellij.ide.highlighter.ModuleFileType;
import com.intellij.ide.util.BrowseFilesListener;
import com.intellij.ide.util.newProjectWizard.modes.CreateFromTemplateMode;
import com.intellij.ide.util.newProjectWizard.modes.WizardMode;
import com.intellij.ide.util.projectWizard.ModuleBuilder;
import com.intellij.ide.util.projectWizard.ProjectWizardUtil;
import com.intellij.ide.util.projectWizard.WizardContext;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CustomShortcutSet;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectBundle;
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.DocumentAdapter;
import com.intellij.ui.DoubleClickListener;
import com.intellij.ui.HyperlinkAdapter;
import com.intellij.ui.components.JBScrollPane;
import com.intellij.util.IJSwingUtilities;
import com.intellij.util.ui.UIUtil;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.io.File;
import java.util.List;
public class ProjectNameWithTypeStep extends ProjectNameStep {
private JEditorPane myModuleDescriptionPane;
private JList myTypesList;
protected JCheckBox myCreateModuleCb;
private JPanel myModulePanel;
private JPanel myInternalPanel;
private JTextField myModuleName;
private TextFieldWithBrowseButton myModuleContentRoot;
private TextFieldWithBrowseButton myModuleFileLocation;
private JPanel myHeader;
private JLabel myModuleTypeLabel;
private JLabel myDescriptionLabel;
private JBScrollPane myModuleTypeScrollPane;
private JBScrollPane myDescriptionScrollPane;
private boolean myModuleNameChangedByUser = false;
private boolean myModuleNameDocListenerEnabled = true;
private boolean myContentRootChangedByUser = false;
private boolean myContentRootDocListenerEnabled = true;
private boolean myImlLocationChangedByUser = false;
private boolean myImlLocationDocListenerEnabled = true;
private final StepSequence mySequence;
public ProjectNameWithTypeStep(final WizardContext wizardContext, StepSequence sequence, final WizardMode mode) {
super(wizardContext, mode);
mySequence = sequence;
myAdditionalContentPanel.add(myModulePanel,
new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 1, GridBagConstraints.NORTHWEST,
GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
myHeader.setVisible(myWizardContext.isCreatingNewProject() && !isCreateFromTemplateMode());
myCreateModuleCb.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
UIUtil.setEnabled(myInternalPanel, myCreateModuleCb.isSelected(), true);
fireStateChanged();
}
});
myCreateModuleCb.setSelected(true);
if (!myWizardContext.isCreatingNewProject()){
myInternalPanel.setBorder(null);
}
myModuleDescriptionPane.setContentType(UIUtil.HTML_MIME);
myModuleDescriptionPane.addHyperlinkListener(new HyperlinkAdapter() {
@Override
protected void hyperlinkActivated(HyperlinkEvent e) {
try {
BrowserUtil.browse(e.getURL());
}
catch (IllegalThreadStateException ex) {
// it's not a problem
}
}
});
myModuleDescriptionPane.setEditable(false);
final DefaultListModel defaultListModel = new DefaultListModel();
for (ModuleBuilder builder : ModuleBuilder.getAllBuilders()) {
defaultListModel.addElement(builder);
}
myTypesList.setModel(defaultListModel);
myTypesList.setSelectionModel(new PermanentSingleSelectionModel());
myTypesList.setCellRenderer(new DefaultListCellRenderer(){
public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) {
final Component rendererComponent = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
final ModuleBuilder builder = (ModuleBuilder)value;
setIcon(builder.getBigIcon());
setDisabledIcon(builder.getBigIcon());
setText(builder.getPresentableName());
return rendererComponent;
}
});
myTypesList.addListSelectionListener(new ListSelectionListener() {
@SuppressWarnings({"HardCodedStringLiteral"})
public void valueChanged(ListSelectionEvent e) {
if (e.getValueIsAdjusting()) {
return;
}
final ModuleBuilder typeSelected = (ModuleBuilder)myTypesList.getSelectedValue();
final StringBuilder sb = new StringBuilder("<html><body><font face=\"Verdana\" ");
sb.append(SystemInfo.isMac ? "" : "size=\"-1\"").append('>');
sb.append(typeSelected.getDescription()).append("</font></body></html>");
myModuleDescriptionPane.setText(sb.toString());
boolean focusOwner = myTypesList.isFocusOwner();
fireStateChanged();
if (focusOwner) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
myTypesList.requestFocusInWindow();
}
});
}
}
});
myTypesList.setSelectedIndex(0);
new DoubleClickListener() {
@Override
protected boolean onDoubleClick(MouseEvent e) {
myWizardContext.requestNextStep();
return true;
}
}.installOn(myTypesList);
final Dimension preferredSize = calcTypeListPreferredSize(ModuleBuilder.getAllBuilders());
final JBScrollPane pane = IJSwingUtilities.findParentOfType(myTypesList, JBScrollPane.class);
pane.setPreferredSize(preferredSize);
pane.setMinimumSize(preferredSize);
myNamePathComponent.getNameComponent().getDocument().addDocumentListener(new DocumentAdapter() {
protected void textChanged(final DocumentEvent e) {
if (!myModuleNameChangedByUser) {
setModuleName(myNamePathComponent.getNameValue());
}
}
});
myModuleContentRoot.addBrowseFolderListener(ProjectBundle.message("project.new.wizard.module.content.root.chooser.title"), ProjectBundle.message("project.new.wizard.module.content.root.chooser.description"),
myWizardContext.getProject(), BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR);
myNamePathComponent.getPathComponent().getDocument().addDocumentListener(new DocumentAdapter() {
protected void textChanged(final DocumentEvent e) {
if (!myContentRootChangedByUser) {
setModuleContentRoot(myNamePathComponent.getPath());
}
}
});
myModuleName.getDocument().addDocumentListener(new DocumentAdapter() {
protected void textChanged(final DocumentEvent e) {
if (myModuleNameDocListenerEnabled) {
myModuleNameChangedByUser = true;
}
String path = getDefaultBaseDir(wizardContext);
final String moduleName = getModuleName();
if (path.length() > 0 && !Comparing.strEqual(moduleName, myNamePathComponent.getNameValue())) {
path += "/" + moduleName;
}
if (!myContentRootChangedByUser) {
final boolean f = myModuleNameChangedByUser;
myModuleNameChangedByUser = true;
setModuleContentRoot(path);
myModuleNameChangedByUser = f;
}
if (!myImlLocationChangedByUser) {
setImlFileLocation(path);
}
}
});
myModuleContentRoot.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
protected void textChanged(final DocumentEvent e) {
if (myContentRootDocListenerEnabled) {
myContentRootChangedByUser = true;
}
if (!myImlLocationChangedByUser) {
setImlFileLocation(myModuleContentRoot.getText());
}
if (!myModuleNameChangedByUser) {
final String path = FileUtil.toSystemIndependentName(myModuleContentRoot.getText());
final int idx = path.lastIndexOf("/");
boolean f = myContentRootChangedByUser;
myContentRootChangedByUser = true;
boolean i = myImlLocationChangedByUser;
myImlLocationChangedByUser = true;
setModuleName(idx >= 0 ? path.substring(idx + 1) : "");
myContentRootChangedByUser = f;
myImlLocationChangedByUser = i;
}
}
});
myModuleFileLocation.addBrowseFolderListener(ProjectBundle.message("project.new.wizard.module.file.chooser.title"), ProjectBundle.message("project.new.wizard.module.file.description"),
myWizardContext.getProject(), BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR);
myModuleFileLocation.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
protected void textChanged(final DocumentEvent e) {
if (myImlLocationDocListenerEnabled) {
myImlLocationChangedByUser = true;
}
}
});
myNamePathComponent.getPathComponent().getDocument().addDocumentListener(new DocumentAdapter() {
protected void textChanged(final DocumentEvent e) {
if (!myImlLocationChangedByUser) {
setImlFileLocation(myNamePathComponent.getPath());
}
}
});
if (wizardContext.isCreatingNewProject()) {
setModuleName(myNamePathComponent.getNameValue());
setModuleContentRoot(myNamePathComponent.getPath());
setImlFileLocation(myNamePathComponent.getPath());
} else {
final Project project = wizardContext.getProject();
assert project != null;
VirtualFile baseDir = project.getBaseDir();
if (baseDir != null) { //e.g. was deleted
final String baseDirPath = baseDir.getPath();
String moduleName = ProjectWizardUtil.findNonExistingFileName(baseDirPath, "untitled", "");
String contentRoot = baseDirPath + "/" + moduleName;
if (!Comparing.strEqual(project.getName(), wizardContext.getProjectName()) && !wizardContext.isCreatingNewProject() && wizardContext.getProjectName() != null) {
moduleName = ProjectWizardUtil.findNonExistingFileName(wizardContext.getProjectFileDirectory(), wizardContext.getProjectName(), "");
contentRoot = wizardContext.getProjectFileDirectory();
}
setModuleName(moduleName);
setModuleContentRoot(contentRoot);
setImlFileLocation(contentRoot);
myModuleName.select(0, moduleName.length());
}
}
if (isCreateFromTemplateMode()) {
replaceModuleTypeOptions(new JPanel());
}
else {
final AnAction arrow = new AnAction() {
@Override
public void actionPerformed(AnActionEvent e) {
if (e.getInputEvent() instanceof KeyEvent) {
final int code = ((KeyEvent)e.getInputEvent()).getKeyCode();
if (!myCreateModuleCb.isSelected()) return;
int i = myTypesList.getSelectedIndex();
if (code == KeyEvent.VK_DOWN) {
if (++i == myTypesList.getModel().getSize()) return;
}
else if (code == KeyEvent.VK_UP) {
if (--i == -1) return;
}
myTypesList.setSelectedIndex(i);
}
}
};
CustomShortcutSet shortcutSet = new CustomShortcutSet(KeyEvent.VK_UP, KeyEvent.VK_DOWN);
arrow.registerCustomShortcutSet(shortcutSet, myNamePathComponent.getNameComponent());
arrow.registerCustomShortcutSet(shortcutSet, myModuleName);
}
}
private boolean isCreateFromTemplateMode() {
return myMode instanceof CreateFromTemplateMode;
}
private Dimension calcTypeListPreferredSize(final List<ModuleBuilder> allModuleTypes) {
int width = 0;
int height = 0;
final FontMetrics fontMetrics = myTypesList.getFontMetrics(myTypesList.getFont());
final int fontHeight = fontMetrics.getMaxAscent() + fontMetrics.getMaxDescent();
for (final ModuleBuilder type : allModuleTypes) {
final Icon icon = type.getBigIcon();
final int iconHeight = icon != null ? icon.getIconHeight() : 0;
final int iconWidth = icon != null ? icon.getIconWidth() : 0;
height += Math.max(iconHeight, fontHeight) + 6;
width = Math.max(width, iconWidth + fontMetrics.stringWidth(type.getPresentableName()) + 10);
}
return new Dimension(width, height);
}
private String getDefaultBaseDir(WizardContext wizardContext) {
if (wizardContext.isCreatingNewProject()) {
return myNamePathComponent.getPath();
} else {
final Project project = wizardContext.getProject();
assert project != null;
final VirtualFile baseDir = project.getBaseDir();
if (baseDir != null) {
return baseDir.getPath();
}
return "";
}
}
@Override
public boolean isStepVisible() {
return true;
}
public JComponent getPreferredFocusedComponent() {
return myWizardContext.isCreatingNewProject() ? super.getPreferredFocusedComponent() : myModuleName;
}
private void setImlFileLocation(final String path) {
myImlLocationDocListenerEnabled = false;
myModuleFileLocation.setText(FileUtil.toSystemDependentName(path));
myImlLocationDocListenerEnabled = true;
}
private void setModuleContentRoot(final String path) {
myContentRootDocListenerEnabled = false;
myModuleContentRoot.setText(FileUtil.toSystemDependentName(path));
myContentRootDocListenerEnabled = true;
}
private void setModuleName(String moduleName) {
myModuleNameDocListenerEnabled = false;
myModuleName.setText(moduleName);
myModuleNameDocListenerEnabled = true;
}
public void updateStep() {
super.updateStep();
if (!isCreateFromTemplateMode()) {
if (myCreateModuleCb.isSelected()) {
mySequence.setType(getSelectedBuilderId());
} else {
mySequence.setType(null);
}
}
}
public void updateDataModel() {
if (!isCreateFromTemplateMode()) {
mySequence.setType(myCreateModuleCb.isSelected() ? getSelectedBuilderId() : null);
}
super.updateDataModel();
if (!isCreateFromTemplateMode() && myCreateModuleCb.isSelected()) {
final ModuleBuilder builder = (ModuleBuilder)myMode.getModuleBuilder();
assert builder != null;
final String moduleName = getModuleName();
builder.setName(moduleName);
builder.setModuleFilePath(
FileUtil.toSystemIndependentName(myModuleFileLocation.getText()) + "/" + moduleName + ModuleFileType.DOT_DEFAULT_EXTENSION);
builder.setContentEntryPath(FileUtil.toSystemIndependentName(myModuleContentRoot.getText()));
}
}
protected String getSelectedBuilderId() {
return ((ModuleBuilder)myTypesList.getSelectedValue()).getBuilderId();
}
public boolean validate() throws ConfigurationException {
if (myCreateModuleCb.isSelected() || !myWizardContext.isCreatingNewProject()) {
if (validateModulePaths()) return false;
}
if (!myWizardContext.isCreatingNewProject()) {
validateExistingModuleName();
}
return !myWizardContext.isCreatingNewProject() || super.validate();
}
private void validateExistingModuleName() throws ConfigurationException {
final String moduleName = getModuleName();
final Module module;
final ProjectStructureConfigurable fromConfigurable = ProjectStructureConfigurable.getInstance(myWizardContext.getProject());
if (fromConfigurable != null) {
module = fromConfigurable.getModulesConfig().getModule(moduleName);
}
else {
module = ModuleManager.getInstance(myWizardContext.getProject()).findModuleByName(moduleName);
}
if (module != null) {
throw new ConfigurationException("Module \'" + moduleName + "\' already exist in project. Please, specify another name.");
}
}
private boolean validateModulePaths() throws ConfigurationException {
final String moduleName = getModuleName();
final String moduleFileDirectory = myModuleFileLocation.getText();
if (moduleFileDirectory.length() == 0) {
throw new ConfigurationException("Enter module file location");
}
if (moduleName.length() == 0) {
throw new ConfigurationException("Enter a module name");
}
if (!ProjectWizardUtil.createDirectoryIfNotExists(IdeBundle.message("directory.module.file"), moduleFileDirectory,
myImlLocationChangedByUser)) {
return true;
}
if (!ProjectWizardUtil.createDirectoryIfNotExists(IdeBundle.message("directory.module.content.root"), myModuleContentRoot.getText(),
myContentRootChangedByUser)) {
return true;
}
File moduleFile = new File(moduleFileDirectory, moduleName + ModuleFileType.DOT_DEFAULT_EXTENSION);
if (moduleFile.exists()) {
int answer = Messages.showYesNoDialog(IdeBundle.message("prompt.overwrite.project.file", moduleFile.getAbsolutePath(),
IdeBundle.message("project.new.wizard.module.identification")),
IdeBundle.message("title.file.already.exists"), Messages.getQuestionIcon());
if (answer != Messages.YES) {
return true;
}
}
return false;
}
private static class PermanentSingleSelectionModel extends DefaultListSelectionModel {
public PermanentSingleSelectionModel() {
super.setSelectionMode(SINGLE_SELECTION);
}
public final void setSelectionMode(int selectionMode) {
}
public final void removeSelectionInterval(int index0, int index1) {
}
}
public String getHelpId() {
return "reference.dialogs.new.project.fromScratch";
}
protected String getModuleName() {
return myModuleName.getText().trim();
}
protected void addModuleNameListener(final DocumentListener listener) {
myModuleName.getDocument().addDocumentListener(listener);
}
protected void replaceModuleTypeOptions(final Component component) {
myModuleTypeLabel.setVisible(false);
myDescriptionLabel.setVisible(false);
myModuleTypeScrollPane.setVisible(false);
myDescriptionScrollPane.setVisible(false);
myInternalPanel.add(component, new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(10, 0, 0, 0), 0, 0));
}
@Override
public String getName() {
return "Name and Type";
}
}
@@ -229,9 +229,6 @@ public class HighlightClassUtil {
@Nullable
static HighlightInfo checkPublicClassInRightFile(PsiClass aClass) {
// most test case classes are located in wrong files
if (ApplicationManager.getApplication().isUnitTestMode()) return null;
PsiFile containingFile = aClass.getContainingFile();
if (aClass.getParent() != containingFile || !aClass.hasModifierProperty(PsiModifier.PUBLIC) || !(containingFile instanceof PsiJavaFile)) return null;
PsiJavaFile file = (PsiJavaFile)containingFile;
@@ -1,4 +1,4 @@
public class MyChild {
public class IDEA118733 {
public void evaluate(Child child) {
Parent<String>.InnerBase i = child.foo();
}
@@ -1,4 +1,4 @@
public class MyChild extends Child<String> {
public class IDEA97887 extends Child<String> {
@Override
public void evaluate(InnerImpl impl) {
String s = impl.t;
@@ -1,5 +1,5 @@
// abstract methods
public class a {
class a {
<error descr="Missing method body, or declare abstract">void f();</error>
}
@@ -57,7 +57,7 @@ abstract class c8 {
//------- if only Bottom were in other package, it should have been abstract --------------------------
public abstract class AbstractTest {
abstract class AbstractTest {
abstract String getName();
@@ -53,3 +53,6 @@ class Class2 {
}
}
}
class Ax {
public interface B {}
}
@@ -1,4 +1,4 @@
public class QQQ {
class QQQ {
{
new Outer(){
void foo(){
@@ -1,5 +1,5 @@
// call to super must be first
public class a {
class a {
a() {}
a(int i) {}
}
@@ -1,7 +1,7 @@
import static <error descr="Cannot resolve symbol 'MyConstants'">MyConstants</error>.*;
import <error descr="Cannot resolve symbol 'MyConstants'">MyConstants</error>;
public class MyClient
class MyClient
{
private int field = MyConstants.CONSTANT;
}
@@ -24,7 +24,7 @@ class inner_holder {
class inner {}
}
public class C1_57 extends inner_holder {
class C1_57 extends inner_holder {
// inner instance available through inheritance
protected class c extends inner {
private class iii extends inner {}
@@ -88,7 +88,7 @@ class ABIllegal extends <error descr="No enclosing instance of type 'A' is in sc
}
public class A42 {
class A42 {
class B {}
}
@@ -61,7 +61,7 @@ class b1 extends a1 {
}
////////////////////////////////
public class FooThrow
class FooThrow
{
final Foo foo = new Foo(); // Can throw FooException
FooThrow() throws Foo {
@@ -3,7 +3,7 @@ import java.io.*;
import java.net.*;
import java.awt.event.*;
public class a {
class a {
/**
* javadoc should not be highlighted
*/
@@ -177,7 +177,7 @@ class a20Exotic {
int n2 = k==0 ? (k2=9) : (k2=0);
}
public class cX {
class cX {
final int i;
cX() {
this(1);
@@ -208,7 +208,7 @@ class correct {
}
}
public class X {
class X {
final int i;
X() {
try {
@@ -1,5 +1,5 @@
public class X extends Y {}
public class Y {
class X extends Y {}
class Y {
private static int x = 0;
@@ -10,7 +10,7 @@ abstract class CompileErrorTest implements ICompileErrorTest {
}
}
public class CompileErrorTestExtended extends CompileErrorTest {
class CompileErrorTestExtended extends CompileErrorTest {
public void foo() throws Exception {
try {
super.foo();
@@ -1,6 +1,6 @@
import java.io.*;
public class Main {
class Main {
static interface A
{
interface B { }
@@ -4,6 +4,6 @@ import java.io.IOException;
<warning descr="Unused import statement">import java.io.IOException;</warning>
public class c {
class c {
public IOException m;
}
@@ -8,4 +8,4 @@ import java.io.IOException;
import java.io.IOException;
public class c {}
class c {}
@@ -2,7 +2,7 @@
import java.io.*;
import java.net.*;
public class a extends a1 {
class a extends a1 {
<error descr="Static method 'f()' in 'a' cannot override instance method 'f()' in 'a1'">public static void f()</error> { }
<error descr="Instance method 'f1()' in 'a' cannot override static method 'f1()' in 'a1'">public void f1()</error> { }
}
@@ -75,13 +75,13 @@ class MyInterfaceImpl implements MyInterface
// Sun-style inheritance
public class Sunc {
class Sunc {
protected void f() {}
}
public class Suncc extends Sunc {
class Suncc extends Sunc {
public void f() {}
}
public interface Suni {
interface Suni {
public void f();
}
class Sunccc extends Suncc implements Suni {
@@ -103,7 +103,7 @@ class StB extends StA {
class Foo {
protected static void foo(String s) {}
}
public class Bar extends Foo{
class Bar extends Foo{
<error descr="'foo(String)' in 'Bar' clashes with 'foo(String)' in 'Foo'; attempting to assign weaker access privileges ('private'); was 'protected'">private</error> static void foo(String s) {}
}
@@ -1,7 +1,7 @@
// unhandled exceptions from superclases/etc
import java.io.*;
import java.net.*;
public class a {
class a {
a(int i) {}
}
@@ -1,4 +1,4 @@
public class a extends Exception {
class a extends Exception {
private <warning descr="Private constructor 'a(java.lang.String)' is never used">a</warning>(String s) {
super(s);
}
@@ -1,4 +1,4 @@
public class <warning descr="Class 'XXX' is never used">XXX</warning> {
class <warning descr="Class 'XXX' is never used">XXX</warning> {
void <warning descr="Method 'fffff()' is never used">fffff</warning>(){}
public void <warning descr="Method 'asdfaffffff()' is never used">asdfaffffff</warning>(){}
protected void <warning descr="Method 'dasklfjhsad()' is never used">dasklfjhsad</warning>(){}
@@ -1,4 +1,4 @@
public class WithMain {
class WithMain {
public static void main(String[] args){
@@ -1,3 +1,3 @@
public class <warning descr="Class 'XXX' is never used">XXX</warning> {
class <warning descr="Class 'XXX' is never used">XXX</warning> {
}
@@ -1,5 +1,5 @@
import java.io.*;
public class x {
class x {
static {int i;}
}
@@ -134,7 +134,7 @@ import <error descr="Cannot resolve symbol 'sun'">sun</error>.security.action.Ge
* @see java.lang.ClassLoader#resolveClass(java.lang.Class)
* @since JDK1.0
*/
public abstract class ClassLoader {
abstract class ClassLoader {
private static native void registerNatives();
static {
@@ -35,7 +35,7 @@ import java.util.*;
/**
*
*/
public class Thinlet extends Container //java
class Thinlet extends Container //java
implements Runnable, Serializable { //java
//midp public class Thinlet extends Canvas implements CommandListener {
@@ -0,0 +1,4 @@
package x;
public class X {
public interface B {}
}
@@ -0,0 +1,2 @@
package x;
<error descr="Class 'DD' is public, should be declared in a file named 'DD.java'">public class DD</error> {}
@@ -5,7 +5,7 @@ import x.n.X2;
import x.n.X3;
@Deprecated
public class Y {
class Y {
X1 x1;
x.n.Class s;
X2 x2;
@@ -5,7 +5,7 @@ import x.n.*;
import java.lang.Class;
@Deprecated
public class Y {
class Y {
X1 x1;
x.n.Class s;
X2 x2;
@@ -1,4 +1,4 @@
public class Foo {
class Foo {
public static void main(String[] args) {
final boolean b = false;
final Integer i = (<warning descr="Casting '3' to 'Integer' is redundant">Integer</warning>)3;
@@ -7,4 +7,4 @@ enum SomeEnumeration {
}
public class IllegalArgumentException extends Exception {}
class IllegalArgumentException extends Exception {}
@@ -1,4 +1,4 @@
public class Pos01<X> {
class Pos01<X> {
Pos01(X x) {}
@@ -1,4 +1,4 @@
public class Pos02 {
class Pos02 {
static class Foo<X> {
Foo(X x) {}
@@ -1,4 +1,4 @@
public class Pos03<U> {
class Pos03<U> {
class Foo<V> {
Foo(V x) {}
@@ -1,4 +1,4 @@
public class Pos4<U> {
class Pos4<U> {
void test() {
class Foo<V> {
@@ -1,4 +1,4 @@
public class Pos05 {
class Pos05 {
static class Foo<X> {
Foo(X x) {}
@@ -1,5 +1,4 @@
public class <warning descr="Class 'WithMain' is never used">WithMain</warning> {
class <warning descr="Class 'WithMain' is never used">WithMain</warning> {
@MyAnno
public void <warning descr="Method 'myTestMethod()' is never used">myTestMethod</warning>(){}
}
@@ -1,7 +1,7 @@
import java.lang.Character;
import java.util.List;
public class Test {
class Test {
public static void test() {
Character c1 = '1';
Character c2 = '2';
@@ -1,6 +1,6 @@
import java.util.*;
public class Test {
class Test {
static <E extends Exception, T> void foo(List<T> l, Class<E> ec) throws E {
}
@@ -15,7 +15,7 @@
*/
import java.lang.Override;
import java.util.List;
public class Test
class Test
{
public interface MyList<N extends Number> extends List<N>
{
@@ -1,6 +1,6 @@
import java.util.*;
public class Test {
class Test {
static <T> List<T> asList(T... tt) {
System.out.println(tt);
return null;
@@ -1,7 +1,6 @@
import java.util.Map;
public class MissingWarning {
class MissingWarning {
static final Map<String, String> VALID_VALUES_BY_KEY = <warning descr="Unchecked generics array creation for varargs parameter">newExceptionOnNullHashMap</warning>(
"Invalid key",
@@ -13,7 +13,7 @@ class D extends A {
}
public class Main {
class Main {
public static void test(Collection<? extends A> <warning descr="Parameter 'c' is never used">c</warning>) {}
public static void main(String[] args) {
@@ -13,7 +13,7 @@ class D {
static <T> String foo(List<List<T>> x) { return null; }
}
public class Main {
class Main {
public static void main(String[] args){
List<List<String>> x = null;
foo(x).toLowerCase();
@@ -13,7 +13,7 @@ class D {
static <T> String foo(List<T[]> x) { return null; }
}
public class Main {
class Main {
public static void main(String[] args){
List<String[]> x = null;
foo(x).toLowerCase();
@@ -2,7 +2,7 @@ package pck;
import static pck.D.foo;
import static pck.C.foo;
public class C {
class C {
public static <T extends Comparable<S>, S> void foo(T x){}
}
@@ -2,7 +2,7 @@ package pck;
import static pck.D.foo;
import static pck.C.foo;
public class C {
class C {
public static <T> String foo(Comparable<? extends Comparable<T>> x){
return null;
}
@@ -3,7 +3,7 @@ package pck;
import static pck.D.foo;
import static pck.C.foo;
public class C {
class C {
public static <T> void foo(Comparable<? extends Comparable<T>> x){}
}
@@ -6,7 +6,7 @@ import java.util.List;
import static pck.D.foo;
import static pck.C.foo;
public class C {
class C {
static <T extends Collection<S>, S> void foo(T x) { }
}
@@ -17,7 +17,7 @@ class D {
static <T extends List<?>, S> String foo1(List<T> x) { return null; }
}
public class Main {
class Main {
public static void main(String[] args){
List<List<String>> x = null;
foo(x).toCharArray();
@@ -17,7 +17,7 @@ package pck;
class Key<K>{}
public class C {
class C {
public <T> void putCopyableUserData(Key<T> key, T value) {
}
}
@@ -13,7 +13,7 @@ class D {
static <T extends List<?>> String foo(List<T> x) { return null; }
}
public class Main {
class Main {
public static void main(String[] args){
List<List<String>> x = null;
foo(x).toCharArray();
@@ -2,7 +2,7 @@ package pck;
import static pck.C.foo;
import static pck.D.foo;
public class C {
class C {
public static void foo(){}
}
class D {
@@ -2,7 +2,7 @@ package pck;
import static pck.D.foo;
import static pck.C.foo;
public class C {
class C {
public static <T> void foo(Comparable<T> x){}
}
@@ -1,10 +1,10 @@
public class CssPropertyValueImpl extends CssTableValueBase<CssPropertyValue, Object> implements CssPropertyValue {
class CssPropertyValueImpl extends CssTableValueBase<CssPropertyValue, Object> implements CssPropertyValue {
public CssPropertyValueImpl(final Type type) {
super(type);
}
}
public abstract class CssTableValueBase<V extends CssTableValue, T> implements CssTableValue<V, T> {
abstract class CssTableValueBase<V extends CssTableValue, T> implements CssTableValue<V, T> {
protected CssTableValueBase(final Type type) {
}
@@ -1,5 +1,5 @@
@Deprecated @SuppressWarnings("")
<error descr="Class 'Foo' must either be declared abstract or implement abstract method 'run()' in 'Runnable'">public class Foo implements Runnable</error> {
<error descr="Class 'Foo' must either be declared abstract or implement abstract method 'run()' in 'Runnable'">class Foo implements Runnable</error> {
}
@@ -1,4 +1,4 @@
public class Autoboxing {
class Autoboxing {
public boolean compare(short s, Integer i) {
return i == s; //OK, i is unboxed
}
@@ -1,4 +1,4 @@
public class Test {
class Test {
public Test(Object a) {
}
@@ -1,4 +1,4 @@
public class Autoboxing {
class Autoboxing {
void method(int i) {
System.out.println("i = " + i);
}
@@ -19,7 +19,7 @@ public class Autoboxing {
m2(new Integer(10));
}
}
public class Autoboxing1 {
class Autoboxing1 {
void method(String s, int i) {
System.out.println("i = " + i);
}
@@ -1,4 +1,4 @@
public class Main {
class Main {
public <T> T getAttribute() {return null;}
public <T> T getAttribute(T def) {return null;}
@@ -16,7 +16,7 @@
import java.util.*;
public class Test {
class Test {
public static void bar() {
<error descr="Incompatible types. Found: 'java.lang.Class<capture<? extends java.util.Iterator>>', required: 'java.lang.Class<? extends java.util.Iterator<?>>'">Class<? extends Iterator<?>> c = foo();</error>
}
@@ -12,7 +12,7 @@ abstract class CCC2<T> extends DT<T> implements I<T> {
}
class a extends b<d, c> implements c<d, c<c,c>>, d<b<c<c,c>,d>> {}
public class b<K,V> implements c<K, c<V,V>> { }
class b<K,V> implements c<K, c<V,V>> { }
interface c<K,V> extends d<b<V,K>> {}
interface d<K> {}
@@ -28,7 +28,7 @@ class GenericExtendItself<T, U extends T>
////////////////////
public abstract class ZZZZ<E> {
abstract class ZZZZ<E> {
public abstract E getElement();
}
abstract class Z<E> extends ZZZZ<E> {}
@@ -5,7 +5,7 @@ interface YO<<warning descr="Type parameter 'T' is never used">T</warning>> {}
interface YO1 extends YO<String> {}
interface YO2 extends YO<Integer> {}
public class ConvertibleTest {
class ConvertibleTest {
YO2 bar (YO1 s) {
return <error descr="Inconvertible types; cannot cast 'YO1' to 'YO2'">(YO2) s</error>;
@@ -19,7 +19,7 @@ interface Interface2 {}
class Implementation implements Interface1 {}
public class InconvertibleTypesTest <E extends Interface2>
class InconvertibleTypesTest <E extends Interface2>
{
E thing;
@@ -1,6 +1,6 @@
import java.util.List;
public class Test {
class Test {
interface P {
@@ -1,6 +1,6 @@
import java.util.Comparator;
public class Main2 {
class Main2 {
static class OfRef<T> {
public OfRef() {
this((Comparator<? super T>) naturalOrder());
@@ -5,7 +5,7 @@ interface EntityId<E extends BusinessEntity> {
E getEntity();
}
public class MyTest {
class MyTest {
<T extends BusinessEntity<T>> T getEntity(EntityId<T> defaultValue) {
return getEntityID(defaultValue).getEntity();
}
@@ -1,7 +1,7 @@
import java.util.*;
public class MyList extends ArrayList {}
class MyList extends ArrayList {}
public class Test {
class Test {
public void test() {
List<? super List> list = new ArrayList<List>();
list.add(new MyList());
@@ -1,4 +1,4 @@
public class TestGenericMap<A extends Comparable<A>, B extends Comparable<B>>
class TestGenericMap<A extends Comparable<A>, B extends Comparable<B>>
{
public TestGenericMap<B, A> inverse()
{
@@ -9,7 +9,7 @@ interface Bar {
<T extends FooObject, I extends FooId<? extends T>> Collection<T> get(Collection<I> keys);
}
public class Target {
class Target {
void foo(Bar bar) {
final Set<FooId<?>> keys = null;
final Collection<FooObject> values = bar.get(keys);
@@ -1,6 +1,6 @@
import java.util.Map;
public class Test {
class Test {
void bar(Prop p) {
Map<? extends String, ? extends String> map = <error descr="Inconvertible types; cannot cast 'Prop' to 'java.util.Map<? extends java.lang.String,? extends java.lang.String>'">(Map<? extends String, ? extends String>)p</error>;
}
@@ -1,6 +1,6 @@
import java.io.Serializable;
public abstract class Test {
abstract class Test {
abstract <T> T test(Class<T> cls);
@@ -1,4 +1,4 @@
public class Test {
class Test {
{
final <error descr="Incompatible types. Found: 'java.lang.Object', required: 'MyResult'">MyResult hello = parseXML(new Parser());</error>
}
@@ -1,7 +1,7 @@
import java.util.Collections;
import java.util.Set;
public class Test<Y> {
class Test<Y> {
public static <K> Test<K> doTest(K k){
return null;
@@ -1,6 +1,6 @@
import java.util.Collection;
public class IncorrectError extends NarrowClass {
class IncorrectError extends NarrowClass {
public Collection<String> bar() {
return super.doStuff();
}
@@ -1,6 +1,6 @@
import java.io.Serializable;
public class Test {
class Test {
public <T extends Serializable> void foo(byte[] data) {
T foo = (T) data;
}
@@ -1,6 +1,6 @@
import java.util.List;
public class MyTest {
class MyTest {
static void m(List<? extends List> c) {
List<? extends List<?>> d = <warning descr="Unchecked cast: 'java.util.List<capture<? extends java.util.List>>' to 'java.util.List<? extends java.util.List<?>>'">(List<? extends List<?>>)c</warning>;
@@ -1,7 +1,7 @@
import java.util.Comparator;
import java.util.List;
public class IdeaBugTest {
class IdeaBugTest {
public void foo(List<Base> base) {
MyCollection.fun<error descr="'fun(java.util.List<? extends Base>, java.util.Comparator<? super Base>)' in 'MyCollection' cannot be applied to '(java.util.List<Base>, SubComparator)'">(base, new SubComparator())</error>;
}
@@ -1,8 +1,7 @@
import java.util.Collection;
import java.util.List;
public class Testsss {
class Testsss {
public <TA, CA extends Iterable<TA>> void that(Iterable<TA> target) {}
@@ -1,4 +1,4 @@
public interface I<K> {
interface I<K> {
}
abstract class SpringHighlightingTestCase<T extends I>{
@@ -1,4 +1,4 @@
public abstract class BiFunction<A,B> {
abstract class BiFunction<A,B> {
public abstract B apply(A a);
public abstract A unapply(B b);
public BiFunction<B,A> flip() {
@@ -1,4 +1,4 @@
public class GoodCodeIsRed {
class GoodCodeIsRed {
public void test() {
FileIF file = new FileImpl();
@@ -1,7 +1,7 @@
import java.util.Collection;
import java.util.Collections;
public class IDEABug {
class IDEABug {
static class ClassA {
static <T> void sayHello(Collection<? extends T> msg) {}
@@ -1,7 +1,7 @@
import java.util.Collection;
import java.util.Collections;
public class IDEABug {
class IDEABug {
static class ClassA {
static <T> void sayHello(Collection<? extends T> msg) {}
@@ -1,6 +1,6 @@
import java.util.List;
public class SubClass extends BaseClass<String> {
class SubClass extends BaseClass<String> {
public static void main(String[] args) {
new SubClass().method(null);
}
@@ -1,4 +1,4 @@
public class IdeaBugTest {
class IdeaBugTest {
interface A<T> {
}
@@ -1,5 +1,5 @@
import java.util.*;
public class IdeaGenericsTest {
class IdeaGenericsTest {
interface Animal<T extends Animal<T>> {
List<T> getFriends();
}
@@ -1,7 +1,7 @@
import java.util.Comparator;
import java.util.Set;
public class CastError {
class CastError {
public void foo(Comparator<? super byte[]> comparator) throws Exception {
MyComparator comparator1 = (MyComparator) comparator;
}
@@ -7,7 +7,7 @@ class B<T> {
B(List<A<?>> list) {}
}
public class Bug {
class Bug {
private static B case1(A<?> a) {
return new B(Collections.singletonList(a));
@@ -1,4 +1,4 @@
public class C1<T extends C1<T>>{
class C1<T extends C1<T>>{
public static class C2<K extends C1<K>> extends C1<K>{}
public static class C3<Z> extends C2<<error descr="No wildcard expected">? extends C3<Z></error>>{}
}
@@ -1,6 +1,6 @@
import java.util.*;
public class Test<T>
class Test<T>
{
List<Collection<T>> getList ()
{
@@ -1,7 +1,7 @@
import java.util.Collections;
import java.util.Map;
public class IDEA74899 {
class IDEA74899 {
void foo() {
Map<String, String> m = Collections.emptyMap();
if (<error descr="Operator '==' cannot be applied to 'java.util.Map<java.lang.String,java.lang.String>', 'java.util.Map<java.lang.Object,java.lang.Object>'">m == Collections.emptyMap()</error>) {
@@ -1,5 +1,5 @@
import java.util.*;
public class IDEA76283 {
class IDEA76283 {
}
interface Parametrized<T extends Number> {

Some files were not shown because too many files have changed in this diff Show More