Skip to content

Commit

Permalink
7362: Reference wrong in agent plug-in.xml
Browse files Browse the repository at this point in the history
Reviewed-by: ghb, aptmac
  • Loading branch information
thegreystone committed Jul 26, 2021
1 parent 0113da9 commit 4b492a4
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 51 deletions.
8 changes: 8 additions & 0 deletions application/org.openjdk.jmc.console.agent/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ Import-Package: javax.inject,
org.eclipse.debug.core.sourcelookup.containers
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.openjdk.jmc.console.agent.AgentPlugin
Automatic-Module-Name: org.openjdk.jmc.console.agent
3 changes: 2 additions & 1 deletion application/org.openjdk.jmc.console.agent/build.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source.. = src/main/java/
source.. = src/main/java/,\
src/main/resources/
output.. = target/classes/
bin.includes = plugin.xml,\
META-INF/,\
Expand Down
2 changes: 1 addition & 1 deletion application/org.openjdk.jmc.console.agent/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
name="Agent XML Editor"
icon="icons/agent.png"
extensions="xml"
class="org.openjdk.jmc.console.agent.tabs.raweditor.RawEditor"
class="org.openjdk.jmc.console.agent.raweditor.RawEditor"
contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor">
</editor>
</extension>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
*/
package org.openjdk.jmc.console.agent.actions;

import java.util.Objects;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
Expand Down Expand Up @@ -64,8 +66,7 @@
import org.openjdk.jmc.ui.misc.DialogToolkit;
import org.openjdk.jmc.ui.misc.DisplayToolkit;

import java.util.Objects;

@SuppressWarnings("restriction")
public class AgentEditorOpener implements IActionFactory {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,15 @@ private TreeViewer createViewer(Composite parent, FormToolkit formToolkit) {

List<IColumn> columns = new ArrayList<>();
columns.add(new ColumnBuilder(HEADER_KEY, HEADER_KEY, new ColumnLabelProvider() {
@SuppressWarnings("unchecked")
@Override
public String getText(Object element) {
Map.Entry<String, ?> entry = (Map.Entry<String, ?>) element;
return entry.getKey();
}
}).build());
columns.add(new ColumnBuilder(HEADER_VALUE, HEADER_VALUE, new ColumnLabelProvider() {
@SuppressWarnings("unchecked")
@Override
public String getText(Object element) {
Map.Entry<String, ?> entry = (Map.Entry<String, ?>) element;
Expand Down Expand Up @@ -201,6 +203,7 @@ public Object[] getElements(Object o) {
return serializeEvent((IEvent) o).entrySet().toArray(new Map.Entry[0]);
}

@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public Object[] getChildren(Object o) {
Map.Entry<String, ?> entry = (Map.Entry<String, ?>) o;
Expand All @@ -216,6 +219,7 @@ public Object getParent(Object o) {
return null;
}

@SuppressWarnings("unchecked")
@Override
public boolean hasChildren(Object o) {
Map.Entry<String, ?> entry = (Map.Entry<String, ?>) o;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,14 @@ private TableViewer createViewer(Composite parent, FormToolkit formToolkit) {

List<IColumn> columns = new ArrayList<>(2);
columns.add(new ColumnBuilder(HEADER_OPTION, HEADER_OPTION, new ColumnLabelProvider() {
@SuppressWarnings("unchecked")
@Override
public String getText(Object element) {
return ((Map.Entry<String, String>) element).getKey();
}
}).build());
columns.add(new ColumnBuilder(HEADER_VALUE, HEADER_VALUE, new ColumnLabelProvider() {
@SuppressWarnings("unchecked")
@Override
public String getText(Object element) {
return ((Map.Entry<String, String>) element).getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@
*/
package org.openjdk.jmc.console.agent.manager.model;

import java.net.URI;
import java.net.URISyntaxException;

import org.openjdk.jmc.console.agent.messages.internal.Messages;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.Locale;

class CapturedValue implements ICapturedValue {

private static final String DEFAULT_STRING_FIELD = ""; // $NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,6 @@
*/
package org.openjdk.jmc.console.agent.manager.model;

import org.openjdk.jmc.console.agent.AgentPlugin;
import org.openjdk.jmc.console.agent.messages.internal.Messages;
import org.openjdk.jmc.console.agent.utils.ProbeValidator;
import org.openjdk.jmc.console.agent.utils.ValidationResult;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -62,11 +42,31 @@
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;

import org.openjdk.jmc.console.agent.AgentPlugin;
import org.openjdk.jmc.console.agent.messages.internal.Messages;
import org.openjdk.jmc.console.agent.utils.ProbeValidator;
import org.openjdk.jmc.console.agent.utils.ValidationResult;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

public class Preset implements IPreset {

private static final String FILE_NAME_EXTENSION = ".xml"; // $NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
*/
package org.openjdk.jmc.console.agent.manager.wizards;

import java.util.stream.Stream;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.ModifyListener;
Expand All @@ -45,17 +47,14 @@
import org.eclipse.swt.widgets.Spinner;
import org.eclipse.swt.widgets.Text;
import org.openjdk.jmc.console.agent.manager.model.ICapturedValue;
import org.openjdk.jmc.console.agent.manager.model.ICapturedValue.ContentType;
import org.openjdk.jmc.console.agent.manager.model.IEvent;
import org.openjdk.jmc.console.agent.manager.model.IField;
import org.openjdk.jmc.console.agent.manager.model.IMethodParameter;
import org.openjdk.jmc.console.agent.manager.model.IMethodReturnValue;
import org.openjdk.jmc.console.agent.manager.model.ICapturedValue.ContentType;
import org.openjdk.jmc.console.agent.messages.internal.Messages;
import org.openjdk.jmc.console.agent.wizards.BaseWizardPage;

import java.util.Locale;
import java.util.stream.Stream;

public class CapturedValueEditingPage extends BaseWizardPage {

private final IEvent event;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
package org.openjdk.jmc.console.agent.manager.wizards;

import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@
*/
package org.openjdk.jmc.console.agent.manager.wizards;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
Expand All @@ -54,10 +57,6 @@
import org.openjdk.jmc.ui.misc.DialogToolkit;
import org.openjdk.jmc.ui.wizards.OnePageWizardDialog;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class EventEditingWizardParameterPage extends BaseWizardPage {

private final IEvent event;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public boolean isReadOnly() {
};

return new IStorageEditorInput() {
@SuppressWarnings("unchecked")
public <T> T getAdapter(Class<T> adapter) {
if (adapter.equals(ILocationProvider.class)) {
return (T) (ILocationProvider) element -> p;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,20 @@
*/
package org.openjdk.jmc.console.agent.wizards;

import org.eclipse.jface.dialogs.TrayDialog;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
Expand All @@ -65,15 +72,6 @@
import org.openjdk.jmc.ui.misc.DialogToolkit;
import org.openjdk.jmc.ui.misc.OptimisticComparator;

import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public abstract class BaseWizardPage extends WizardPage {

private static final String FILE_OPEN_FILTER_PATH = "file.open.filter.path"; // $NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
package org.openjdk.jmc.console.agent.wizards;

import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.layout.GridData;
Expand Down

0 comments on commit 4b492a4

Please sign in to comment.