mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
+5
-16
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2016 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.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInsight.editorActions;
|
||||
|
||||
import com.intellij.codeInsight.FileModificationService;
|
||||
@@ -25,6 +11,7 @@ import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.CaretModel;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
@@ -38,6 +25,7 @@ import com.intellij.psi.codeStyle.CodeStyleManager;
|
||||
import com.intellij.util.text.CharArrayUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Creates documentation comment for the current context if it's not created yet (e.g. the caret is inside a method which
|
||||
@@ -60,7 +48,7 @@ public class FixDocCommentAction extends EditorAction {
|
||||
private static final class MyHandler extends EditorActionHandler {
|
||||
|
||||
@Override
|
||||
public void execute(@NotNull Editor editor, DataContext dataContext) {
|
||||
public void doExecute(@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) {
|
||||
Project project = CommonDataKeys.PROJECT.getData(dataContext);
|
||||
if (project == null) {
|
||||
return;
|
||||
@@ -223,6 +211,7 @@ public class FixDocCommentAction extends EditorAction {
|
||||
|
||||
if (caretOffsetToSet >= 0) {
|
||||
caretModel.moveToOffset(caretOffsetToSet);
|
||||
editor.getSelectionModel().removeSelection();
|
||||
}
|
||||
|
||||
if (pair == null || pair.second == null) {
|
||||
|
||||
@@ -394,7 +394,7 @@ public class RunAnythingAction extends AnAction implements CustomComponentAction
|
||||
myCurrentWorker.doWhenProcessed(() -> {
|
||||
myCalcThread = new CalcThread(project, pattern, true);
|
||||
myPopupActualWidth = 0;
|
||||
RunAnythingUtil.triggerMoreStatistics(group);
|
||||
RunAnythingUtil.triggerMoreStatistics(project, group);
|
||||
myCurrentWorker = myCalcThread.insert(index, group);
|
||||
});
|
||||
|
||||
@@ -416,7 +416,7 @@ public class RunAnythingAction extends AnAction implements CustomComponentAction
|
||||
return;
|
||||
}
|
||||
|
||||
RunAnythingUtil.triggerExecCategoryStatistics(index);
|
||||
RunAnythingUtil.triggerExecCategoryStatistics(project, index);
|
||||
|
||||
Runnable onDone = null;
|
||||
try {
|
||||
|
||||
+2
-2
@@ -52,8 +52,8 @@ public class RunAnythingRunConfigurationItem extends RunAnythingItem<ChooseRunCo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void triggerUsage() {
|
||||
RunAnythingUtil.triggerDebuggerStatistics();
|
||||
public void triggerUsage(@NotNull DataContext dataContext) {
|
||||
RunAnythingUtil.triggerDebuggerStatistics(dataContext);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.actions.runAnything
|
||||
|
||||
import com.intellij.internal.statistic.service.fus.collectors.FUSProjectUsageTrigger
|
||||
import com.intellij.internal.statistic.service.fus.collectors.ProjectUsageTriggerCollector
|
||||
import com.intellij.openapi.project.Project
|
||||
|
||||
private const val GROUP_ID = "statistics.actions.runAnything"
|
||||
|
||||
class RunAnythingUsageCollector : ProjectUsageTriggerCollector() {
|
||||
override fun getGroupId(): String = GROUP_ID
|
||||
|
||||
companion object {
|
||||
fun trigger(project: Project, featureId: String) {
|
||||
FUSProjectUsageTrigger.getInstance(project).trigger(RunAnythingUsageCollector::class.java, featureId)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,6 @@ import com.intellij.ide.actions.runAnything.items.RunAnythingCommandItem;
|
||||
import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.internal.statistic.UsageTrigger;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
@@ -29,6 +28,7 @@ import com.intellij.openapi.util.*;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.openapi.wm.ToolWindowId;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.ui.components.JBList;
|
||||
import com.intellij.ui.popup.PopupPositionManager;
|
||||
@@ -49,7 +49,7 @@ import java.util.Objects;
|
||||
|
||||
import static com.intellij.execution.actions.RunConfigurationsComboBoxAction.EMPTY_ICON;
|
||||
import static com.intellij.ide.actions.GotoActionAction.performAction;
|
||||
import static com.intellij.ide.actions.runAnything.RunAnythingAction.SHIFT_IS_PRESSED;
|
||||
import static com.intellij.ide.actions.runAnything.RunAnythingAction.EXECUTOR_KEY;
|
||||
import static com.intellij.openapi.keymap.KeymapUtil.getActiveKeymapShortcuts;
|
||||
import static com.intellij.ui.SimpleTextAttributes.STYLE_PLAIN;
|
||||
import static com.intellij.ui.SimpleTextAttributes.STYLE_SEARCH_MATCH;
|
||||
@@ -338,14 +338,15 @@ public class RunAnythingUtil {
|
||||
@NotNull String pattern,
|
||||
@NotNull VirtualFile workDirectory) {
|
||||
Project project = CommonDataKeys.PROJECT.getData(dataContext);
|
||||
Executor executor = EXECUTOR_KEY.getData(dataContext);
|
||||
|
||||
if (pattern.isEmpty()) return;
|
||||
|
||||
if (runMatchedConfiguration(Objects.requireNonNull(project), pattern, workDirectory)) return;
|
||||
if (runMatchedConfiguration(dataContext, Objects.requireNonNull(project), pattern, workDirectory)) return;
|
||||
|
||||
if (runMatchedActivity(dataContext, pattern)) return;
|
||||
|
||||
runCommand(workDirectory, StringUtil.trim(pattern), RunAnythingAction.getExecutor(), dataContext);
|
||||
runCommand(workDirectory, StringUtil.trim(pattern), Objects.requireNonNull(executor), dataContext);
|
||||
}
|
||||
|
||||
private static boolean runMatchedActivity(@NotNull DataContext dataContext, @NotNull String pattern) {
|
||||
@@ -353,24 +354,29 @@ public class RunAnythingUtil {
|
||||
return activityProvider != null && activityProvider.runActivity(dataContext, pattern);
|
||||
}
|
||||
|
||||
private static boolean runMatchedConfiguration(@NotNull Project project, @NotNull String pattern, @NotNull VirtualFile workDirectory) {
|
||||
private static boolean runMatchedConfiguration(@NotNull DataContext dataContext,
|
||||
@NotNull Project project,
|
||||
@NotNull String pattern,
|
||||
@NotNull VirtualFile workDirectory) {
|
||||
Executor executor = EXECUTOR_KEY.getData(dataContext);
|
||||
RunAnythingRunConfigurationProvider provider = RunAnythingRunConfigurationProvider.findMatchedProvider(project, pattern, workDirectory);
|
||||
if (provider != null) {
|
||||
triggerDebuggerStatistics();
|
||||
runMatchedConfiguration(RunAnythingAction.getExecutor(), project, provider.createConfiguration(project, pattern, workDirectory));
|
||||
triggerDebuggerStatistics(dataContext);
|
||||
runMatchedConfiguration(dataContext, Objects.requireNonNull(executor), project, provider.createConfiguration(project, pattern, workDirectory));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private static void runMatchedConfiguration(@NotNull Executor executor,
|
||||
private static void runMatchedConfiguration(@NotNull DataContext dataContext,
|
||||
@NotNull Executor executor,
|
||||
@NotNull Project project,
|
||||
@NotNull RunnerAndConfigurationSettings settings) {
|
||||
RunManagerEx.getInstanceEx(project).setTemporaryConfiguration(settings);
|
||||
RunManager.getInstance(project).setSelectedConfiguration(settings);
|
||||
|
||||
triggerDebuggerStatistics();
|
||||
triggerDebuggerStatistics(dataContext);
|
||||
ExecutionUtil.runConfiguration(settings, executor);
|
||||
}
|
||||
|
||||
@@ -391,22 +397,27 @@ public class RunAnythingUtil {
|
||||
return KeymapUtil.getShortcutsText(shortcuts);
|
||||
}
|
||||
|
||||
static void triggerExecCategoryStatistics(int index) {
|
||||
static void triggerExecCategoryStatistics(@NotNull Project project, int index) {
|
||||
for (int i = index; i >= 0; i--) {
|
||||
String title = RunAnythingGroup.getTitle(i);
|
||||
if (title != null) {
|
||||
UsageTrigger.trigger(RunAnythingAction.RUN_ANYTHING + " - execution - " + title);
|
||||
RunAnythingUsageCollector.Companion.trigger(project, RunAnythingAction.RUN_ANYTHING + " - execution - " + title);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void triggerDebuggerStatistics() {
|
||||
if (SHIFT_IS_PRESSED.get()) UsageTrigger.trigger(DEBUGGER_FEATURE_USAGE);
|
||||
public static void triggerDebuggerStatistics(@NotNull DataContext dataContext) {
|
||||
Project project = Objects.requireNonNull(CommonDataKeys.PROJECT.getData(dataContext));
|
||||
Executor executor = Objects.requireNonNull(EXECUTOR_KEY.getData(dataContext));
|
||||
|
||||
if (ExecutorRegistry.getInstance().getExecutorById(ToolWindowId.DEBUG) == executor) {
|
||||
RunAnythingUsageCollector.Companion.trigger(project, DEBUGGER_FEATURE_USAGE);
|
||||
}
|
||||
}
|
||||
|
||||
static void triggerMoreStatistics(@NotNull RunAnythingGroup group) {
|
||||
UsageTrigger.trigger(RunAnythingAction.RUN_ANYTHING + " - more - " + group.getTitle());
|
||||
static void triggerMoreStatistics(@NotNull Project project, @NotNull RunAnythingGroup group) {
|
||||
RunAnythingUsageCollector.Companion.trigger(project, RunAnythingAction.RUN_ANYTHING + " - more - " + group.getTitle());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+2
-2
@@ -106,8 +106,8 @@ public class RunAnythingCommandItem extends RunAnythingItem<String> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void triggerUsage() {
|
||||
RunAnythingUtil.triggerDebuggerStatistics();
|
||||
public void triggerUsage(@NotNull DataContext dataContext) {
|
||||
RunAnythingUtil.triggerDebuggerStatistics(dataContext);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+3
-2
@@ -47,8 +47,9 @@ public abstract class RunAnythingItem<T> {
|
||||
|
||||
/**
|
||||
* Sends statistic if current item action is being executed
|
||||
* @param dataContext Use {@link DataContext} to extract focus owner component, original action event, working directory, module and project
|
||||
*/
|
||||
protected void triggerUsage() {}
|
||||
protected void triggerUsage(@NotNull DataContext dataContext) {}
|
||||
|
||||
/**
|
||||
* Executes specific action on choosing current item in the list
|
||||
@@ -56,6 +57,6 @@ public abstract class RunAnythingItem<T> {
|
||||
* @param dataContext Use {@link DataContext} to extract focus owner component, original action event, working directory, module and project
|
||||
*/
|
||||
public void run(@NotNull DataContext dataContext) {
|
||||
triggerUsage();
|
||||
triggerUsage(dataContext);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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.tools;
|
||||
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.execution.filters.InvalidExpressionException;
|
||||
import com.intellij.execution.filters.RegexpFilter;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.JBPopupMenu;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.ui.PopupHandler;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.text.BadLocationException;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.regex.PatternSyntaxException;
|
||||
|
||||
class FilterDialog extends DialogWrapper {
|
||||
private final JTextField myRegexpField = new JTextField();
|
||||
private final JTextField myNameField = new JTextField();
|
||||
private final JTextField myDescriptionField = new JTextField();
|
||||
|
||||
private JPopupMenu myPopup;
|
||||
|
||||
private FilterDialog(Component component) {
|
||||
super(component, true);
|
||||
init();
|
||||
setOKActionEnabled(true);
|
||||
myRegexpField.setToolTipText(ToolsBundle.message("tools.filters.add.macro.tooltip"));
|
||||
}
|
||||
|
||||
public static boolean editFilter(FilterInfo filterInfo, JComponent parentComponent, String title) throws InvalidExpressionException {
|
||||
FilterDialog dialog = new FilterDialog(parentComponent);
|
||||
dialog.setTitle(title);
|
||||
dialog.myNameField.setText(filterInfo.getName());
|
||||
dialog.myDescriptionField.setText(filterInfo.getDescription());
|
||||
dialog.myRegexpField.setText(filterInfo.getRegExp());
|
||||
if (!dialog.showAndGet()) {
|
||||
return false;
|
||||
}
|
||||
filterInfo.setName(dialog.myNameField.getText());
|
||||
filterInfo.setDescription(dialog.myDescriptionField.getText());
|
||||
filterInfo.setRegExp(dialog.myRegexpField.getText());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getPreferredFocusedComponent() {
|
||||
return myRegexpField;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JComponent createCenterPanel() {
|
||||
JPanel mainPanel = new JPanel(new BorderLayout());
|
||||
|
||||
JPanel panel = new JPanel(new GridBagLayout());
|
||||
|
||||
GridBagConstraints constr;
|
||||
|
||||
constr = new GridBagConstraints();
|
||||
constr.gridx = 0;
|
||||
constr.gridy = 0;
|
||||
constr.anchor = GridBagConstraints.WEST;
|
||||
constr.weighty = 0;
|
||||
constr.gridwidth = 1;
|
||||
constr.insets = new Insets(5, 0, 0, 0);
|
||||
panel.add(new JLabel(ToolsBundle.message("tools.filters.add.name.label")), constr);
|
||||
|
||||
constr.gridx = 0;
|
||||
constr.gridy = 1;
|
||||
constr.weightx = 1;
|
||||
constr.gridwidth = 3;
|
||||
constr.fill = GridBagConstraints.HORIZONTAL;
|
||||
panel.add(myNameField, constr);
|
||||
|
||||
constr.gridx = 0;
|
||||
constr.gridy = 2;
|
||||
constr.weightx = 0;
|
||||
panel.add(new JLabel(ToolsBundle.message("tools.filters.add.description.label")), constr);
|
||||
|
||||
constr.gridx = 0;
|
||||
constr.gridy = 3;
|
||||
constr.gridwidth = 2;
|
||||
constr.weightx = 1;
|
||||
panel.add(myDescriptionField, constr);
|
||||
|
||||
constr.gridy = 4;
|
||||
constr.gridx = 0;
|
||||
constr.gridwidth = 2;
|
||||
constr.weightx = 0;
|
||||
panel.add(new JLabel(ToolsBundle.message("tools.filters.add.regex.label")), constr);
|
||||
|
||||
constr.gridx = 0;
|
||||
constr.gridy = 5;
|
||||
constr.gridwidth = 3;
|
||||
panel.add(myRegexpField, constr);
|
||||
|
||||
makePopup();
|
||||
|
||||
panel.setPreferredSize(JBUI.size(335, 160));
|
||||
|
||||
mainPanel.add(panel, BorderLayout.NORTH);
|
||||
|
||||
return mainPanel;
|
||||
}
|
||||
|
||||
private void makePopup() {
|
||||
myPopup = new JBPopupMenu();
|
||||
String[] macrosName = RegexpFilter.getMacrosName();
|
||||
JMenuItem[] items = new JMenuItem[macrosName.length];
|
||||
for (int i = 0; i < macrosName.length; i++) {
|
||||
items[i] = myPopup.add(macrosName[i]);
|
||||
items[i].addActionListener(new MenuItemListener(macrosName[i]));
|
||||
}
|
||||
myRegexpField.addMouseListener(new PopupListener());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doOKAction() {
|
||||
String errorMessage = null;
|
||||
if (noText(myNameField.getText())) {
|
||||
errorMessage = ToolsBundle.message("tools.filters.add.name.required.error");
|
||||
} else if (noText(myRegexpField.getText())) {
|
||||
errorMessage = ToolsBundle.message("tools.filters.add.regex.required.error");
|
||||
}
|
||||
|
||||
if (errorMessage != null) {
|
||||
Messages.showMessageDialog(getContentPane(), errorMessage, CommonBundle.getErrorTitle(), Messages.getErrorIcon());
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
checkRegexp(myRegexpField.getText());
|
||||
}
|
||||
catch (InvalidExpressionException | PatternSyntaxException e) {
|
||||
Messages.showMessageDialog(getContentPane(), e.getMessage(), ToolsBundle.message("tools.filters.add.regex.invalid.title"), Messages.getErrorIcon());
|
||||
return;
|
||||
}
|
||||
super.doOKAction();
|
||||
}
|
||||
|
||||
private void checkRegexp(String regexpText) {
|
||||
RegexpFilter.validate(regexpText);
|
||||
}
|
||||
|
||||
private boolean noText(String text) {
|
||||
return "".equals(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDimensionServiceKey(){
|
||||
return "#com.intellij.tools.FilterDialog";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getHelpId() {
|
||||
return "reference.settings.ide.settings.external.tools.output.filters.add.filter";
|
||||
}
|
||||
|
||||
private class MenuItemListener implements ActionListener {
|
||||
private final String myMacrosName;
|
||||
|
||||
private MenuItemListener(String macrosName) {
|
||||
myMacrosName = macrosName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
int position = myRegexpField.getCaretPosition();
|
||||
try {
|
||||
if (myRegexpField.getText().indexOf(myMacrosName) == -1) {
|
||||
myRegexpField.getDocument().insertString(position, myMacrosName, null);
|
||||
myRegexpField.setCaretPosition(position + myMacrosName.length());
|
||||
}
|
||||
} catch (BadLocationException ex) {
|
||||
}
|
||||
IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> {
|
||||
IdeFocusManager.getGlobalInstance().requestFocus(myRegexpField, true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private class PopupListener extends PopupHandler {
|
||||
@Override
|
||||
public void invokePopup(Component comp, int x, int y) {
|
||||
myPopup.show(comp, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,188 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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.tools;
|
||||
|
||||
import com.intellij.openapi.help.HelpManager;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.ui.components.JBList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class OutputFiltersDialog extends DialogWrapper {
|
||||
private final DefaultListModel myFiltersModel = new DefaultListModel();
|
||||
private final JList myFiltersList = new JBList(myFiltersModel);
|
||||
private boolean myModified = false;
|
||||
private FilterInfo[] myFilters;
|
||||
|
||||
public OutputFiltersDialog(Component parent, FilterInfo[] filters) {
|
||||
super(parent, true);
|
||||
myFilters = filters;
|
||||
|
||||
setTitle(ToolsBundle.message("tools.filters.title"));
|
||||
init();
|
||||
initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
protected Action[] createActions() {
|
||||
return new Action[]{getOKAction(), getCancelAction(), getHelpAction()};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doHelpAction() {
|
||||
HelpManager.getInstance().invokeHelp("reference.settings.ide.settings.external.tools.output.filters");
|
||||
}
|
||||
|
||||
private void initGui() {
|
||||
myFiltersList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
myFiltersList.setCellRenderer(new ColoredListCellRenderer() {
|
||||
@Override
|
||||
protected void customizeCellRenderer(@NotNull JList list, Object value, int index, boolean selected, boolean hasFocus) {
|
||||
FilterInfo info = (FilterInfo)value;
|
||||
append(info.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
|
||||
}
|
||||
});
|
||||
ScrollingUtil.ensureSelectionExists(myFiltersList);
|
||||
}
|
||||
|
||||
private String suggestFilterName() {
|
||||
String prefix = ToolsBundle.message("tools.filters.name.template") + " ";
|
||||
|
||||
int number = 1;
|
||||
for (int i = 0; i < myFiltersModel.getSize(); i++) {
|
||||
FilterInfo wrapper = (FilterInfo)myFiltersModel.getElementAt(i);
|
||||
String name = wrapper.getName();
|
||||
if (name.startsWith(prefix)) {
|
||||
try {
|
||||
int n = Integer.valueOf(name.substring(prefix.length()).trim()).intValue();
|
||||
number = Math.max(number, n + 1);
|
||||
}
|
||||
catch (NumberFormatException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return prefix + number;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doOKAction() {
|
||||
if (myModified) {
|
||||
myFilters = new FilterInfo[myFiltersModel.getSize()];
|
||||
for (int i = 0; i < myFiltersModel.getSize(); i++) {
|
||||
myFilters[i] = (FilterInfo)myFiltersModel.get(i);
|
||||
}
|
||||
}
|
||||
super.doOKAction();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JComponent createCenterPanel() {
|
||||
for (FilterInfo myFilter : myFilters) {
|
||||
myFiltersModel.addElement(myFilter.createCopy());
|
||||
}
|
||||
|
||||
JPanel panel = ToolbarDecorator.createDecorator(myFiltersList)
|
||||
.setAddAction(new AnActionButtonRunnable() {
|
||||
@Override
|
||||
public void run(AnActionButton button) {
|
||||
FilterInfo filterInfo = new FilterInfo();
|
||||
filterInfo.setName(suggestFilterName());
|
||||
boolean wasCreated = FilterDialog.editFilter(filterInfo, myFiltersList, ToolsBundle.message("tools.filters.add.title"));
|
||||
if (wasCreated) {
|
||||
myFiltersModel.addElement(filterInfo);
|
||||
setModified(true);
|
||||
}
|
||||
IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> {
|
||||
IdeFocusManager.getGlobalInstance().requestFocus(myFiltersList, true);
|
||||
});
|
||||
}
|
||||
}).setEditAction(new AnActionButtonRunnable() {
|
||||
@Override
|
||||
public void run(AnActionButton button) {
|
||||
int index = myFiltersList.getSelectedIndex();
|
||||
FilterInfo filterInfo = (FilterInfo)myFiltersModel.getElementAt(index);
|
||||
boolean wasEdited = FilterDialog.editFilter(filterInfo, myFiltersList, ToolsBundle.message("tools.filters.edit.title"));
|
||||
if (wasEdited) {
|
||||
setModified(true);
|
||||
}
|
||||
IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> {
|
||||
IdeFocusManager.getGlobalInstance().requestFocus(myFiltersList, true);
|
||||
});
|
||||
}
|
||||
}).setRemoveAction(new AnActionButtonRunnable() {
|
||||
@Override
|
||||
public void run(AnActionButton button) {
|
||||
if (myFiltersList.getSelectedIndex() >= 0) {
|
||||
myFiltersModel.removeElementAt(myFiltersList.getSelectedIndex());
|
||||
setModified(true);
|
||||
}
|
||||
IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> {
|
||||
IdeFocusManager.getGlobalInstance().requestFocus(myFiltersList, true);
|
||||
});
|
||||
}
|
||||
}).setMoveUpAction(new AnActionButtonRunnable() {
|
||||
@Override
|
||||
public void run(AnActionButton button) {
|
||||
int movedCount = ListUtil.moveSelectedItemsUp(myFiltersList);
|
||||
if (movedCount > 0) {
|
||||
setModified(true);
|
||||
}
|
||||
IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> {
|
||||
IdeFocusManager.getGlobalInstance().requestFocus(myFiltersList, true);
|
||||
});
|
||||
}
|
||||
}).setMoveDownAction(new AnActionButtonRunnable() {
|
||||
@Override
|
||||
public void run(AnActionButton button) {
|
||||
int movedCount = ListUtil.moveSelectedItemsDown(myFiltersList);
|
||||
if (movedCount > 0) {
|
||||
setModified(true);
|
||||
}
|
||||
IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> {
|
||||
IdeFocusManager.getGlobalInstance().requestFocus(myFiltersList, true);
|
||||
});
|
||||
}
|
||||
})
|
||||
.createPanel();
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getPreferredFocusedComponent() {
|
||||
return myFiltersList;
|
||||
}
|
||||
|
||||
private void setModified(boolean modified) {
|
||||
myModified = modified;
|
||||
}
|
||||
|
||||
public FilterInfo[] getData() {
|
||||
return myFilters;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDimensionServiceKey() {
|
||||
return "#com.intellij.tools.OutputFiltersDialog";
|
||||
}
|
||||
}
|
||||
@@ -482,10 +482,10 @@ public class IdeErrorsDialog extends DialogWrapper implements MessagePoolListene
|
||||
myCredentialsLabel.setVisible(true);
|
||||
Credentials credentials = ErrorReportConfigurable.getCredentials();
|
||||
if (CredentialAttributesKt.isFulfilled(credentials)) {
|
||||
myCredentialsLabel.setHtmlText(DiagnosticBundle.message("diagnostic.error.report.submit.report.as", credentials.getUserName()));
|
||||
myCredentialsLabel.setHtmlText(DiagnosticBundle.message("error.dialog.submit.named", credentials.getUserName()));
|
||||
}
|
||||
else {
|
||||
myCredentialsLabel.setHtmlText(DiagnosticBundle.message("diagnostic.error.report.submit.error.anonymously"));
|
||||
myCredentialsLabel.setHtmlText(DiagnosticBundle.message("error.dialog.submit.anonymous"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
+7
-15
@@ -13,7 +13,9 @@ import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.EditorFactory;
|
||||
import com.intellij.openapi.editor.event.DocumentEvent;
|
||||
import com.intellij.openapi.editor.event.DocumentListener;
|
||||
import com.intellij.openapi.fileEditor.*;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager;
|
||||
import com.intellij.openapi.fileEditor.FileEditorManagerEvent;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.popup.ListPopup;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
@@ -32,15 +34,11 @@ import org.jetbrains.annotations.Nullable;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.lang.ref.Reference;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
public abstract class EditorBasedStatusBarPopup extends EditorBasedWidget implements StatusBarWidget.Multiframe, CustomStatusBarWidget {
|
||||
private final TextPanel.WithIconAndArrows myComponent;
|
||||
private boolean actionEnabled;
|
||||
private final Alarm update;
|
||||
// store editor here to avoid expensive and EDT-only getSelectedEditor() retrievals
|
||||
private volatile Reference<Editor> myEditor = new WeakReference<>(null);
|
||||
|
||||
public EditorBasedStatusBarPopup(@NotNull Project project) {
|
||||
super(project);
|
||||
@@ -66,22 +64,16 @@ public abstract class EditorBasedStatusBarPopup extends EditorBasedWidget implem
|
||||
@Override
|
||||
public void selectionChanged(@NotNull FileEditorManagerEvent event) {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) return;
|
||||
VirtualFile newFile = event.getNewFile();
|
||||
fileChanged(newFile);
|
||||
fileChanged();
|
||||
}
|
||||
|
||||
private void fileChanged(VirtualFile newFile) {
|
||||
Project project = getProject();
|
||||
assert project != null;
|
||||
FileEditor fileEditor = newFile == null ? null : FileEditorManager.getInstance(project).getSelectedEditor(newFile);
|
||||
Editor editor = fileEditor instanceof TextEditor ? ((TextEditor)fileEditor).getEditor() : null;
|
||||
myEditor = new WeakReference<>(editor);
|
||||
private void fileChanged() {
|
||||
update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileOpened(@NotNull FileEditorManager source, @NotNull VirtualFile file) {
|
||||
fileChanged(file);
|
||||
fileChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -109,7 +101,7 @@ public abstract class EditorBasedStatusBarPopup extends EditorBasedWidget implem
|
||||
}
|
||||
|
||||
protected void updateForDocument(@Nullable("null means update anyway") Document document) {
|
||||
Editor selectedEditor = myEditor.get();
|
||||
Editor selectedEditor = getEditor();
|
||||
if (document != null && (selectedEditor == null || selectedEditor.getDocument() != document)) return;
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -33,10 +33,14 @@ error.dialog.foreign.plugin.warning.vendor=<html>This plugin is not a production
|
||||
error.dialog.comment.prompt=<html>Please fill in any details that may be important (steps to reproduce, what were you doing when the exception occurred, etc.):</html>
|
||||
error.dialog.attachments.prompt=<html>To investigate and fix the problem, we need the following files to be attached to the bug report.<br>\
|
||||
<b>Note:</b> all the data you send will be kept private.</html>
|
||||
diagnostic.error.report.submit.error.anonymously=<html>Submit anonymously or use <a>JetBrains Account</a></html>
|
||||
diagnostic.error.report.submit.report.as=<html>Submit as <b>{0}</b> or <a>change account</a></html>
|
||||
error.dialog.submit.anonymous=<html>Submit anonymously or use <a>JetBrains Account</a></html>
|
||||
error.dialog.submit.named=<html>Submit as <b>{0}</b> or <a>change account</a></html>
|
||||
error.report.to.jetbrains.action=&Report to JetBrains
|
||||
error.dialog.clear.all.action=&Clear all
|
||||
# suppress inspection "UnusedProperty"
|
||||
diagnostic.error.report.submit.error.anonymously=<html>Submit anonymously or use <a>JetBrains Account</a></html>
|
||||
# suppress inspection "UnusedProperty"
|
||||
diagnostic.error.report.submit.report.as=<html>Submit as <b>{0}</b> or <a>change account</a></html>
|
||||
|
||||
title.submitting.error.report=Submitting Error Report
|
||||
error.report.gratitude=Thank you for your feedback!
|
||||
|
||||
+1
-1
@@ -187,7 +187,7 @@ inspections.plugin.xml.invalid.order.attribute=Invalid 'order' attribute value
|
||||
invalid.order.attribute.part=Invalid ''order'' attribute value part: ''{0}'', must be ''first'', ''last'', ''before <id>'' or ''after <id>''
|
||||
|
||||
inspections.unstable.api.usage.annotations.list=Unstable API annotations
|
||||
inspections.unstable.api.usage.description=''{0}'' is unstable
|
||||
inspections.unstable.api.usage.description=''{0}'' is marked unstable
|
||||
|
||||
ant.build.jar.comment=Build archive for plugin ''{0}''
|
||||
ant.build.jar.description=Build plugin archive for module ''{0}''
|
||||
|
||||
@@ -6,10 +6,12 @@ import com.intellij.codeInspection.ProblemHighlightType;
|
||||
import com.intellij.codeInspection.ProblemsHolder;
|
||||
import com.intellij.codeInspection.util.SpecialAnnotationsUtil;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectFileIndex;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.siyeh.ig.ui.ExternalizableStringSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -48,6 +50,10 @@ public class UnstableApiUsageInspection extends LocalInspectionTool {
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiElementVisitor buildVisitor(@NotNull ProblemsHolder holder, boolean isOnTheFly) {
|
||||
if (!isApplicable(holder.getProject())) {
|
||||
return PsiElementVisitor.EMPTY_VISITOR;
|
||||
}
|
||||
|
||||
return new PsiElementVisitor() {
|
||||
@Override
|
||||
public void visitElement(PsiElement element) {
|
||||
@@ -67,13 +73,19 @@ public class UnstableApiUsageInspection extends LocalInspectionTool {
|
||||
}
|
||||
|
||||
PsiModifierListOwner modifierListOwner = (PsiModifierListOwner)resolvedElement;
|
||||
boolean problemRegistered = false;
|
||||
for (String annotation : unstableApiAnnotations) {
|
||||
if (modifierListOwner.hasAnnotation(annotation)) {
|
||||
holder.registerProblem(reference,
|
||||
DevKitBundle.message("inspections.unstable.api.usage.description", getReferenceText(reference)),
|
||||
ProblemHighlightType.GENERIC_ERROR_OR_WARNING);
|
||||
problemRegistered = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (problemRegistered) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -106,4 +118,15 @@ public class UnstableApiUsageInspection extends LocalInspectionTool {
|
||||
// references are not PsiQualifiedReference for annotation attributes
|
||||
return StringUtil.getShortName(reference.getCanonicalText());
|
||||
}
|
||||
|
||||
private boolean isApplicable(@NotNull Project project) {
|
||||
JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(project);
|
||||
GlobalSearchScope scope = GlobalSearchScope.allScope(project);
|
||||
for (String annotation : unstableApiAnnotations) {
|
||||
if (javaPsiFacade.findClass(annotation, scope) != null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+39
-39
@@ -1,44 +1,44 @@
|
||||
import pkg.<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>;
|
||||
import static pkg.<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.NON_EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS;
|
||||
import static pkg.<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.staticNonExperimentalMethodInExperimentalClass;
|
||||
import static pkg.<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.<warning descr="'EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS' is unstable">EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS</warning>;
|
||||
import static pkg.<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.<warning descr="'staticExperimentalMethodInExperimentalClass' is unstable">staticExperimentalMethodInExperimentalClass</warning>;
|
||||
import pkg.<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>;
|
||||
import static pkg.<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.NON_EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS;
|
||||
import static pkg.<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.staticNonExperimentalMethodInExperimentalClass;
|
||||
import static pkg.<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.<warning descr="'EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS' is marked unstable">EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS</warning>;
|
||||
import static pkg.<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.<warning descr="'staticExperimentalMethodInExperimentalClass' is marked unstable">staticExperimentalMethodInExperimentalClass</warning>;
|
||||
|
||||
import pkg.NonExperimentalClass;
|
||||
import static pkg.NonExperimentalClass.NON_EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS;
|
||||
import static pkg.NonExperimentalClass.staticNonExperimentalMethodInNonExperimentalClass;
|
||||
import static pkg.NonExperimentalClass.<warning descr="'EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS' is unstable">EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS</warning>;
|
||||
import static pkg.NonExperimentalClass.<warning descr="'staticExperimentalMethodInNonExperimentalClass' is unstable">staticExperimentalMethodInNonExperimentalClass</warning>;
|
||||
import static pkg.NonExperimentalClass.<warning descr="'EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS' is marked unstable">EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS</warning>;
|
||||
import static pkg.NonExperimentalClass.<warning descr="'staticExperimentalMethodInNonExperimentalClass' is marked unstable">staticExperimentalMethodInNonExperimentalClass</warning>;
|
||||
|
||||
import pkg.<warning descr="'ExperimentalEnum' is unstable">ExperimentalEnum</warning>;
|
||||
import pkg.<warning descr="'ExperimentalEnum' is marked unstable">ExperimentalEnum</warning>;
|
||||
import pkg.NonExperimentalEnum;
|
||||
import static pkg.<warning descr="'ExperimentalEnum' is unstable">ExperimentalEnum</warning>.NON_EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM;
|
||||
import static pkg.<warning descr="'ExperimentalEnum' is unstable">ExperimentalEnum</warning>.<warning descr="'EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM' is unstable">EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM</warning>;
|
||||
import static pkg.<warning descr="'ExperimentalEnum' is marked unstable">ExperimentalEnum</warning>.NON_EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM;
|
||||
import static pkg.<warning descr="'ExperimentalEnum' is marked unstable">ExperimentalEnum</warning>.<warning descr="'EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM' is marked unstable">EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM</warning>;
|
||||
import static pkg.NonExperimentalEnum.NON_EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM;
|
||||
import static pkg.NonExperimentalEnum.<warning descr="'EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM' is unstable">EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM</warning>;
|
||||
import static pkg.NonExperimentalEnum.<warning descr="'EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM' is marked unstable">EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM</warning>;
|
||||
|
||||
import pkg.<warning descr="'ExperimentalAnnotation' is unstable">ExperimentalAnnotation</warning>;
|
||||
import pkg.<warning descr="'ExperimentalAnnotation' is marked unstable">ExperimentalAnnotation</warning>;
|
||||
import pkg.NonExperimentalAnnotation;
|
||||
|
||||
import <warning descr="'unstablePkg' is unstable">unstablePkg</warning>.ClassInUnstablePkg;
|
||||
import <warning descr="'unstablePkg' is marked unstable">unstablePkg</warning>.ClassInUnstablePkg;
|
||||
|
||||
public class UnstableElementsTest {
|
||||
public void test() {
|
||||
String s = <warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.NON_EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS;
|
||||
<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.staticNonExperimentalMethodInExperimentalClass();
|
||||
<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning> experimentalClassInstanceViaNonExperimentalConstructor = new ExperimentalClass();
|
||||
String s = <warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.NON_EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS;
|
||||
<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.staticNonExperimentalMethodInExperimentalClass();
|
||||
<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning> experimentalClassInstanceViaNonExperimentalConstructor = new ExperimentalClass();
|
||||
s = experimentalClassInstanceViaNonExperimentalConstructor.nonExperimentalFieldInExperimentalClass;
|
||||
experimentalClassInstanceViaNonExperimentalConstructor.nonExperimentalMethodInExperimentalClass();
|
||||
s = NON_EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS;
|
||||
staticNonExperimentalMethodInExperimentalClass();
|
||||
|
||||
s = <warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.<warning descr="'EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS' is unstable">EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS</warning>;
|
||||
<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.<warning descr="'staticExperimentalMethodInExperimentalClass' is unstable">staticExperimentalMethodInExperimentalClass</warning>();
|
||||
<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning> experimentalClassInstanceViaExperimentalConstructor = new <warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>("");
|
||||
s = experimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalFieldInExperimentalClass' is unstable">experimentalFieldInExperimentalClass</warning>;
|
||||
experimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalMethodInExperimentalClass' is unstable">experimentalMethodInExperimentalClass</warning>();
|
||||
s = <warning descr="'EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS' is unstable">EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS</warning>;
|
||||
<warning descr="'staticExperimentalMethodInExperimentalClass' is unstable">staticExperimentalMethodInExperimentalClass</warning>();
|
||||
s = <warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.<warning descr="'EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS' is marked unstable">EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS</warning>;
|
||||
<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.<warning descr="'staticExperimentalMethodInExperimentalClass' is marked unstable">staticExperimentalMethodInExperimentalClass</warning>();
|
||||
<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning> experimentalClassInstanceViaExperimentalConstructor = new <warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>("");
|
||||
s = experimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalFieldInExperimentalClass' is marked unstable">experimentalFieldInExperimentalClass</warning>;
|
||||
experimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalMethodInExperimentalClass' is marked unstable">experimentalMethodInExperimentalClass</warning>();
|
||||
s = <warning descr="'EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS' is marked unstable">EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS</warning>;
|
||||
<warning descr="'staticExperimentalMethodInExperimentalClass' is marked unstable">staticExperimentalMethodInExperimentalClass</warning>();
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
@@ -50,33 +50,33 @@ public class UnstableElementsTest {
|
||||
s = NON_EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS;
|
||||
staticNonExperimentalMethodInNonExperimentalClass();
|
||||
|
||||
s = NonExperimentalClass.<warning descr="'EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS' is unstable">EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS</warning>;
|
||||
NonExperimentalClass.<warning descr="'staticExperimentalMethodInNonExperimentalClass' is unstable">staticExperimentalMethodInNonExperimentalClass</warning>();
|
||||
NonExperimentalClass nonExperimentalClassInstanceViaExperimentalConstructor = new <warning descr="'NonExperimentalClass' is unstable">NonExperimentalClass</warning>("");
|
||||
s = nonExperimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalFieldInNonExperimentalClass' is unstable">experimentalFieldInNonExperimentalClass</warning>;
|
||||
nonExperimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalMethodInNonExperimentalClass' is unstable">experimentalMethodInNonExperimentalClass</warning>();
|
||||
s = <warning descr="'EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS' is unstable">EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS</warning>;
|
||||
<warning descr="'staticExperimentalMethodInNonExperimentalClass' is unstable">staticExperimentalMethodInNonExperimentalClass</warning>();
|
||||
s = NonExperimentalClass.<warning descr="'EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS' is marked unstable">EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS</warning>;
|
||||
NonExperimentalClass.<warning descr="'staticExperimentalMethodInNonExperimentalClass' is marked unstable">staticExperimentalMethodInNonExperimentalClass</warning>();
|
||||
NonExperimentalClass nonExperimentalClassInstanceViaExperimentalConstructor = new <warning descr="'NonExperimentalClass' is marked unstable">NonExperimentalClass</warning>("");
|
||||
s = nonExperimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalFieldInNonExperimentalClass' is marked unstable">experimentalFieldInNonExperimentalClass</warning>;
|
||||
nonExperimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalMethodInNonExperimentalClass' is marked unstable">experimentalMethodInNonExperimentalClass</warning>();
|
||||
s = <warning descr="'EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS' is marked unstable">EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS</warning>;
|
||||
<warning descr="'staticExperimentalMethodInNonExperimentalClass' is marked unstable">staticExperimentalMethodInNonExperimentalClass</warning>();
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
<warning descr="'ExperimentalEnum' is unstable">ExperimentalEnum</warning> nonExperimentalValueInExperimentalEnum = <warning descr="'ExperimentalEnum' is unstable">ExperimentalEnum</warning>.NON_EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM;
|
||||
<warning descr="'ExperimentalEnum' is marked unstable">ExperimentalEnum</warning> nonExperimentalValueInExperimentalEnum = <warning descr="'ExperimentalEnum' is marked unstable">ExperimentalEnum</warning>.NON_EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM;
|
||||
nonExperimentalValueInExperimentalEnum = NON_EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM;
|
||||
<warning descr="'ExperimentalEnum' is unstable">ExperimentalEnum</warning> experimentalValueInExperimentalEnum = <warning descr="'ExperimentalEnum' is unstable">ExperimentalEnum</warning>.<warning descr="'EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM' is unstable">EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM</warning>;
|
||||
experimentalValueInExperimentalEnum = <warning descr="'EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM' is unstable">EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM</warning>;
|
||||
<warning descr="'ExperimentalEnum' is marked unstable">ExperimentalEnum</warning> experimentalValueInExperimentalEnum = <warning descr="'ExperimentalEnum' is marked unstable">ExperimentalEnum</warning>.<warning descr="'EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM' is marked unstable">EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM</warning>;
|
||||
experimentalValueInExperimentalEnum = <warning descr="'EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM' is marked unstable">EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM</warning>;
|
||||
|
||||
NonExperimentalEnum nonExperimentalValueInNonExperimentalEnum = NonExperimentalEnum.NON_EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM;
|
||||
nonExperimentalValueInNonExperimentalEnum = NON_EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM;
|
||||
NonExperimentalEnum experimentalValueInNonExperimentalEnum = NonExperimentalEnum.<warning descr="'EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM' is unstable">EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM</warning>;
|
||||
experimentalValueInNonExperimentalEnum = <warning descr="'EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM' is unstable">EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM</warning>;
|
||||
NonExperimentalEnum experimentalValueInNonExperimentalEnum = NonExperimentalEnum.<warning descr="'EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM' is marked unstable">EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM</warning>;
|
||||
experimentalValueInNonExperimentalEnum = <warning descr="'EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM' is marked unstable">EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM</warning>;
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
@<warning descr="'ExperimentalAnnotation' is unstable">ExperimentalAnnotation</warning> class C1 {}
|
||||
@<warning descr="'ExperimentalAnnotation' is unstable">ExperimentalAnnotation</warning>(nonExperimentalAttributeInExperimentalAnnotation = "123") class C2 {}
|
||||
@<warning descr="'ExperimentalAnnotation' is unstable">ExperimentalAnnotation</warning>(<warning descr="'experimentalAttributeInExperimentalAnnotation' is unstable">experimentalAttributeInExperimentalAnnotation</warning> = "123") class C3 {}
|
||||
@<warning descr="'ExperimentalAnnotation' is marked unstable">ExperimentalAnnotation</warning> class C1 {}
|
||||
@<warning descr="'ExperimentalAnnotation' is marked unstable">ExperimentalAnnotation</warning>(nonExperimentalAttributeInExperimentalAnnotation = "123") class C2 {}
|
||||
@<warning descr="'ExperimentalAnnotation' is marked unstable">ExperimentalAnnotation</warning>(<warning descr="'experimentalAttributeInExperimentalAnnotation' is marked unstable">experimentalAttributeInExperimentalAnnotation</warning> = "123") class C3 {}
|
||||
@NonExperimentalAnnotation class C4 {}
|
||||
@NonExperimentalAnnotation(nonExperimentalAttributeInNonExperimentalAnnotation = "123") class C5 {}
|
||||
@NonExperimentalAnnotation(<warning descr="'experimentalAttributeInNonExperimentalAnnotation' is unstable">experimentalAttributeInNonExperimentalAnnotation</warning> = "123") class C6 {}
|
||||
@NonExperimentalAnnotation(<warning descr="'experimentalAttributeInNonExperimentalAnnotation' is marked unstable">experimentalAttributeInNonExperimentalAnnotation</warning> = "123") class C6 {}
|
||||
}
|
||||
}
|
||||
+39
-39
@@ -1,45 +1,45 @@
|
||||
import pkg.<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>
|
||||
import pkg.<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.NON_EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS
|
||||
import pkg.<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.staticNonExperimentalMethodInExperimentalClass
|
||||
import pkg.<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.<warning descr="'EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS' is unstable">EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS</warning>
|
||||
import pkg.<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.<warning descr="'staticExperimentalMethodInExperimentalClass' is unstable">staticExperimentalMethodInExperimentalClass</warning>
|
||||
import pkg.<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>
|
||||
import pkg.<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.NON_EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS
|
||||
import pkg.<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.staticNonExperimentalMethodInExperimentalClass
|
||||
import pkg.<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.<warning descr="'EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS' is marked unstable">EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS</warning>
|
||||
import pkg.<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.<warning descr="'staticExperimentalMethodInExperimentalClass' is marked unstable">staticExperimentalMethodInExperimentalClass</warning>
|
||||
|
||||
import pkg.NonExperimentalClass
|
||||
import pkg.NonExperimentalClass.NON_EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS
|
||||
import pkg.NonExperimentalClass.staticNonExperimentalMethodInNonExperimentalClass
|
||||
import pkg.NonExperimentalClass.<warning descr="'EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS' is unstable">EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS</warning>
|
||||
import pkg.NonExperimentalClass.<warning descr="'staticExperimentalMethodInNonExperimentalClass' is unstable">staticExperimentalMethodInNonExperimentalClass</warning>
|
||||
import pkg.NonExperimentalClass.<warning descr="'EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS' is marked unstable">EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS</warning>
|
||||
import pkg.NonExperimentalClass.<warning descr="'staticExperimentalMethodInNonExperimentalClass' is marked unstable">staticExperimentalMethodInNonExperimentalClass</warning>
|
||||
|
||||
import pkg.<warning descr="'ExperimentalEnum' is unstable">ExperimentalEnum</warning>
|
||||
import pkg.<warning descr="'ExperimentalEnum' is marked unstable">ExperimentalEnum</warning>
|
||||
import pkg.NonExperimentalEnum
|
||||
import pkg.<warning descr="'ExperimentalEnum' is unstable">ExperimentalEnum</warning>.NON_EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM
|
||||
import pkg.<warning descr="'ExperimentalEnum' is unstable">ExperimentalEnum</warning>.<warning descr="'EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM' is unstable">EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM</warning>
|
||||
import pkg.<warning descr="'ExperimentalEnum' is marked unstable">ExperimentalEnum</warning>.NON_EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM
|
||||
import pkg.<warning descr="'ExperimentalEnum' is marked unstable">ExperimentalEnum</warning>.<warning descr="'EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM' is marked unstable">EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM</warning>
|
||||
import pkg.NonExperimentalEnum.NON_EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM
|
||||
import pkg.NonExperimentalEnum.<warning descr="'EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM' is unstable">EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM</warning>
|
||||
import pkg.NonExperimentalEnum.<warning descr="'EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM' is marked unstable">EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM</warning>
|
||||
|
||||
import pkg.<warning descr="'ExperimentalAnnotation' is unstable">ExperimentalAnnotation</warning>
|
||||
import pkg.<warning descr="'ExperimentalAnnotation' is marked unstable">ExperimentalAnnotation</warning>
|
||||
import pkg.NonExperimentalAnnotation
|
||||
|
||||
import <warning descr="'unstablePkg' is unstable">unstablePkg</warning>.ClassInUnstablePkg
|
||||
import <warning descr="'unstablePkg' is marked unstable">unstablePkg</warning>.ClassInUnstablePkg
|
||||
|
||||
@Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE", "UNUSED_VALUE")
|
||||
class UnstableElementsTest {
|
||||
fun test() {
|
||||
var s = <warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.NON_EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS
|
||||
<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.staticNonExperimentalMethodInExperimentalClass()
|
||||
val experimentalClassInstanceViaNonExperimentalConstructor : <warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning> = ExperimentalClass()
|
||||
var s = <warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.NON_EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS
|
||||
<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.staticNonExperimentalMethodInExperimentalClass()
|
||||
val experimentalClassInstanceViaNonExperimentalConstructor : <warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning> = ExperimentalClass()
|
||||
s = experimentalClassInstanceViaNonExperimentalConstructor.nonExperimentalFieldInExperimentalClass
|
||||
experimentalClassInstanceViaNonExperimentalConstructor.nonExperimentalMethodInExperimentalClass()
|
||||
s = NON_EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS
|
||||
staticNonExperimentalMethodInExperimentalClass()
|
||||
|
||||
s = <warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.<warning descr="'EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS' is unstable">EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS</warning>
|
||||
<warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>.<warning descr="'staticExperimentalMethodInExperimentalClass' is unstable">staticExperimentalMethodInExperimentalClass</warning>()
|
||||
val experimentalClassInstanceViaExperimentalConstructor : <warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning> = <warning descr="'ExperimentalClass' is unstable">ExperimentalClass</warning>("")
|
||||
s = experimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalFieldInExperimentalClass' is unstable">experimentalFieldInExperimentalClass</warning>
|
||||
experimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalMethodInExperimentalClass' is unstable">experimentalMethodInExperimentalClass</warning>()
|
||||
s = <warning descr="'EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS' is unstable">EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS</warning>
|
||||
<warning descr="'staticExperimentalMethodInExperimentalClass' is unstable">staticExperimentalMethodInExperimentalClass</warning>()
|
||||
s = <warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.<warning descr="'EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS' is marked unstable">EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS</warning>
|
||||
<warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>.<warning descr="'staticExperimentalMethodInExperimentalClass' is marked unstable">staticExperimentalMethodInExperimentalClass</warning>()
|
||||
val experimentalClassInstanceViaExperimentalConstructor : <warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning> = <warning descr="'ExperimentalClass' is marked unstable">ExperimentalClass</warning>("")
|
||||
s = experimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalFieldInExperimentalClass' is marked unstable">experimentalFieldInExperimentalClass</warning>
|
||||
experimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalMethodInExperimentalClass' is marked unstable">experimentalMethodInExperimentalClass</warning>()
|
||||
s = <warning descr="'EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS' is marked unstable">EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS</warning>
|
||||
<warning descr="'staticExperimentalMethodInExperimentalClass' is marked unstable">staticExperimentalMethodInExperimentalClass</warning>()
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
@@ -51,33 +51,33 @@ class UnstableElementsTest {
|
||||
s = NON_EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS
|
||||
staticNonExperimentalMethodInNonExperimentalClass()
|
||||
|
||||
s = NonExperimentalClass.<warning descr="'EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS' is unstable">EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS</warning>
|
||||
NonExperimentalClass.<warning descr="'staticExperimentalMethodInNonExperimentalClass' is unstable">staticExperimentalMethodInNonExperimentalClass</warning>()
|
||||
val nonExperimentalClassInstanceViaExperimentalConstructor = <warning descr="'NonExperimentalClass' is unstable">NonExperimentalClass</warning>("")
|
||||
s = nonExperimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalFieldInNonExperimentalClass' is unstable">experimentalFieldInNonExperimentalClass</warning>
|
||||
nonExperimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalMethodInNonExperimentalClass' is unstable">experimentalMethodInNonExperimentalClass</warning>()
|
||||
s = <warning descr="'EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS' is unstable">EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS</warning>
|
||||
<warning descr="'staticExperimentalMethodInNonExperimentalClass' is unstable">staticExperimentalMethodInNonExperimentalClass</warning>()
|
||||
s = NonExperimentalClass.<warning descr="'EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS' is marked unstable">EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS</warning>
|
||||
NonExperimentalClass.<warning descr="'staticExperimentalMethodInNonExperimentalClass' is marked unstable">staticExperimentalMethodInNonExperimentalClass</warning>()
|
||||
val nonExperimentalClassInstanceViaExperimentalConstructor = <warning descr="'NonExperimentalClass' is marked unstable">NonExperimentalClass</warning>("")
|
||||
s = nonExperimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalFieldInNonExperimentalClass' is marked unstable">experimentalFieldInNonExperimentalClass</warning>
|
||||
nonExperimentalClassInstanceViaExperimentalConstructor.<warning descr="'experimentalMethodInNonExperimentalClass' is marked unstable">experimentalMethodInNonExperimentalClass</warning>()
|
||||
s = <warning descr="'EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS' is marked unstable">EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS</warning>
|
||||
<warning descr="'staticExperimentalMethodInNonExperimentalClass' is marked unstable">staticExperimentalMethodInNonExperimentalClass</warning>()
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
var nonExperimentalValueInExperimentalEnum : <warning descr="'ExperimentalEnum' is unstable">ExperimentalEnum</warning> = <warning descr="'ExperimentalEnum' is unstable">ExperimentalEnum</warning>.NON_EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM
|
||||
var nonExperimentalValueInExperimentalEnum : <warning descr="'ExperimentalEnum' is marked unstable">ExperimentalEnum</warning> = <warning descr="'ExperimentalEnum' is marked unstable">ExperimentalEnum</warning>.NON_EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM
|
||||
nonExperimentalValueInExperimentalEnum = NON_EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM
|
||||
var experimentalValueInExperimentalEnum : <warning descr="'ExperimentalEnum' is unstable">ExperimentalEnum</warning> = <warning descr="'ExperimentalEnum' is unstable">ExperimentalEnum</warning>.<warning descr="'EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM' is unstable">EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM</warning>
|
||||
experimentalValueInExperimentalEnum = <warning descr="'EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM' is unstable">EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM</warning>
|
||||
var experimentalValueInExperimentalEnum : <warning descr="'ExperimentalEnum' is marked unstable">ExperimentalEnum</warning> = <warning descr="'ExperimentalEnum' is marked unstable">ExperimentalEnum</warning>.<warning descr="'EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM' is marked unstable">EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM</warning>
|
||||
experimentalValueInExperimentalEnum = <warning descr="'EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM' is marked unstable">EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM</warning>
|
||||
|
||||
var nonExperimentalValueInNonExperimentalEnum = NonExperimentalEnum.NON_EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM
|
||||
nonExperimentalValueInNonExperimentalEnum = NON_EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM
|
||||
var experimentalValueInNonExperimentalEnum = NonExperimentalEnum.<warning descr="'EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM' is unstable">EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM</warning>
|
||||
experimentalValueInNonExperimentalEnum = <warning descr="'EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM' is unstable">EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM</warning>
|
||||
var experimentalValueInNonExperimentalEnum = NonExperimentalEnum.<warning descr="'EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM' is marked unstable">EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM</warning>
|
||||
experimentalValueInNonExperimentalEnum = <warning descr="'EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM' is marked unstable">EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM</warning>
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
@<warning descr="'ExperimentalAnnotation' is unstable">ExperimentalAnnotation</warning> class C1
|
||||
@<warning descr="'ExperimentalAnnotation' is unstable">ExperimentalAnnotation</warning>(nonExperimentalAttributeInExperimentalAnnotation = "123") class C2
|
||||
@<warning descr="'ExperimentalAnnotation' is unstable">ExperimentalAnnotation</warning>(<warning descr="'experimentalAttributeInExperimentalAnnotation' is unstable">experimentalAttributeInExperimentalAnnotation</warning> = "123") class C3
|
||||
@<warning descr="'ExperimentalAnnotation' is marked unstable">ExperimentalAnnotation</warning> class C1
|
||||
@<warning descr="'ExperimentalAnnotation' is marked unstable">ExperimentalAnnotation</warning>(nonExperimentalAttributeInExperimentalAnnotation = "123") class C2
|
||||
@<warning descr="'ExperimentalAnnotation' is marked unstable">ExperimentalAnnotation</warning>(<warning descr="'experimentalAttributeInExperimentalAnnotation' is marked unstable">experimentalAttributeInExperimentalAnnotation</warning> = "123") class C3
|
||||
@NonExperimentalAnnotation class C4
|
||||
@NonExperimentalAnnotation(nonExperimentalAttributeInNonExperimentalAnnotation = "123") class C5
|
||||
@NonExperimentalAnnotation(<warning descr="'experimentalAttributeInNonExperimentalAnnotation' is unstable">experimentalAttributeInNonExperimentalAnnotation</warning> = "123") class C6
|
||||
@NonExperimentalAnnotation(<warning descr="'experimentalAttributeInNonExperimentalAnnotation' is marked unstable">experimentalAttributeInNonExperimentalAnnotation</warning> = "123") class C6
|
||||
}
|
||||
}
|
||||
+60
-62
@@ -22,80 +22,78 @@ abstract class UnstableApiUsageInspectionTestBase : JavaCodeInsightFixtureTestCa
|
||||
myFixture.enableInspections(UnstableApiUsageInspection::class.java)
|
||||
|
||||
myFixture.addFileToProject(
|
||||
"pkg/ExperimentalAnnotation.java",
|
||||
"package pkg;\n" +
|
||||
"import org.jetbrains.annotations.ApiStatus;\n" +
|
||||
"@ApiStatus.Experimental public @interface ExperimentalAnnotation {\n" +
|
||||
" String nonExperimentalAttributeInExperimentalAnnotation() default \"\";\n" +
|
||||
" @ApiStatus.Experimental String experimentalAttributeInExperimentalAnnotation() default \"\";\n" +
|
||||
"}"
|
||||
"pkg/ExperimentalAnnotation.java", """
|
||||
package pkg;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
@ApiStatus.Experimental public @interface ExperimentalAnnotation {
|
||||
String nonExperimentalAttributeInExperimentalAnnotation() default "";
|
||||
@ApiStatus.Experimental String experimentalAttributeInExperimentalAnnotation() default "";
|
||||
}"""
|
||||
)
|
||||
myFixture.addFileToProject(
|
||||
"pkg/ExperimentalEnum.java",
|
||||
"package pkg;\n" +
|
||||
"\n" +
|
||||
"import org.jetbrains.annotations.ApiStatus;\n" +
|
||||
"\n" +
|
||||
"@ApiStatus.Experimental public enum ExperimentalEnum {\n" +
|
||||
" NON_EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM,\n" +
|
||||
" @ApiStatus.Experimental EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM\n" +
|
||||
"}"
|
||||
"pkg/ExperimentalEnum.java", """
|
||||
package pkg;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
@ApiStatus.Experimental public enum ExperimentalEnum {
|
||||
NON_EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM,
|
||||
@ApiStatus.Experimental EXPERIMENTAL_VALUE_IN_EXPERIMENTAL_ENUM
|
||||
}"""
|
||||
)
|
||||
myFixture.addFileToProject(
|
||||
"pkg/ExperimentalClass.java",
|
||||
"package pkg;\n" +
|
||||
"import org.jetbrains.annotations.ApiStatus;\n" +
|
||||
"@ApiStatus.Experimental public class ExperimentalClass {\n" +
|
||||
" public static final String NON_EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS = \"\";\n" +
|
||||
" public String nonExperimentalFieldInExperimentalClass = \"\";\n" +
|
||||
" public ExperimentalClass() {}\n" +
|
||||
" public static void staticNonExperimentalMethodInExperimentalClass() {}\n" +
|
||||
" public void nonExperimentalMethodInExperimentalClass() {}\n" +
|
||||
"\n" +
|
||||
" @ApiStatus.Experimental public static final String EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS = \"\";\n" +
|
||||
" @ApiStatus.Experimental public String experimentalFieldInExperimentalClass = \"\";\n" +
|
||||
" @ApiStatus.Experimental public ExperimentalClass(String s) {}\n" +
|
||||
" @ApiStatus.Experimental public static void staticExperimentalMethodInExperimentalClass() {}\n" +
|
||||
" @ApiStatus.Experimental public void experimentalMethodInExperimentalClass() {}\n" +
|
||||
"}"
|
||||
"pkg/ExperimentalClass.java", """
|
||||
package pkg;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
@ApiStatus.Experimental public class ExperimentalClass {
|
||||
public static final String NON_EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS = "";
|
||||
public String nonExperimentalFieldInExperimentalClass = "";
|
||||
public ExperimentalClass() {}
|
||||
public static void staticNonExperimentalMethodInExperimentalClass() {}
|
||||
public void nonExperimentalMethodInExperimentalClass() {}
|
||||
|
||||
@ApiStatus.Experimental public static final String EXPERIMENTAL_CONSTANT_IN_EXPERIMENTAL_CLASS = "";
|
||||
@ApiStatus.Experimental public String experimentalFieldInExperimentalClass = "";
|
||||
@ApiStatus.Experimental public ExperimentalClass(String s) {}
|
||||
@ApiStatus.Experimental public static void staticExperimentalMethodInExperimentalClass() {}
|
||||
@ApiStatus.Experimental public void experimentalMethodInExperimentalClass() {}
|
||||
}"""
|
||||
)
|
||||
|
||||
|
||||
myFixture.addFileToProject(
|
||||
"pkg/NonExperimentalAnnotation.java",
|
||||
"package pkg;\n" +
|
||||
"import org.jetbrains.annotations.ApiStatus;\n" +
|
||||
"public @interface NonExperimentalAnnotation {\n" +
|
||||
" String nonExperimentalAttributeInNonExperimentalAnnotation() default \"\";\n" +
|
||||
" @ApiStatus.Experimental String experimentalAttributeInNonExperimentalAnnotation() default \"\";\n" +
|
||||
"}"
|
||||
"pkg/NonExperimentalAnnotation.java", """
|
||||
package pkg;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
public @interface NonExperimentalAnnotation {
|
||||
String nonExperimentalAttributeInNonExperimentalAnnotation() default "";
|
||||
@ApiStatus.Experimental String experimentalAttributeInNonExperimentalAnnotation() default "";
|
||||
}"""
|
||||
)
|
||||
myFixture.addFileToProject(
|
||||
"pkg/NonExperimentalEnum.java",
|
||||
"package pkg;\n" +
|
||||
"import org.jetbrains.annotations.ApiStatus;\n" +
|
||||
"public enum NonExperimentalEnum {\n" +
|
||||
" NON_EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM,\n" +
|
||||
" @ApiStatus.Experimental EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM\n" +
|
||||
"}"
|
||||
"pkg/NonExperimentalEnum.java", """
|
||||
package pkg;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
public enum NonExperimentalEnum {
|
||||
NON_EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM,
|
||||
@ApiStatus.Experimental EXPERIMENTAL_VALUE_IN_NON_EXPERIMENTAL_ENUM
|
||||
}"""
|
||||
)
|
||||
myFixture.addFileToProject(
|
||||
"pkg/NonExperimentalClass.java",
|
||||
"package pkg;\n" +
|
||||
"import org.jetbrains.annotations.ApiStatus;\n" +
|
||||
"public class NonExperimentalClass {\n" +
|
||||
" public static final String NON_EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS = \"\";\n" +
|
||||
" public String nonExperimentalFieldInNonExperimentalClass = \"\";\n" +
|
||||
" public NonExperimentalClass() {}\n" +
|
||||
" public static void staticNonExperimentalMethodInNonExperimentalClass() {}\n" +
|
||||
" public void nonExperimentalMethodInNonExperimentalClass() {}\n" +
|
||||
"\n" +
|
||||
" @ApiStatus.Experimental public static final String EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS = \"\";\n" +
|
||||
" @ApiStatus.Experimental public String experimentalFieldInNonExperimentalClass = \"\";\n" +
|
||||
" @ApiStatus.Experimental public NonExperimentalClass(String s) {}\n" +
|
||||
" @ApiStatus.Experimental public static void staticExperimentalMethodInNonExperimentalClass() {}\n" +
|
||||
" @ApiStatus.Experimental public void experimentalMethodInNonExperimentalClass() {}\n" +
|
||||
"}"
|
||||
"pkg/NonExperimentalClass.java", """
|
||||
package pkg;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
public class NonExperimentalClass {
|
||||
public static final String NON_EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS = "";
|
||||
public String nonExperimentalFieldInNonExperimentalClass = "";
|
||||
public NonExperimentalClass() {}
|
||||
public static void staticNonExperimentalMethodInNonExperimentalClass() {}
|
||||
public void nonExperimentalMethodInNonExperimentalClass() {}
|
||||
|
||||
@ApiStatus.Experimental public static final String EXPERIMENTAL_CONSTANT_IN_NON_EXPERIMENTAL_CLASS = "";
|
||||
@ApiStatus.Experimental public String experimentalFieldInNonExperimentalClass = "";
|
||||
@ApiStatus.Experimental public NonExperimentalClass(String s) {}
|
||||
@ApiStatus.Experimental public static void staticExperimentalMethodInNonExperimentalClass() {}
|
||||
@ApiStatus.Experimental public void experimentalMethodInNonExperimentalClass() {}
|
||||
}"""
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user