mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-26 02:15:31 +02:00
[219975][api][breaking] Get rid of SystemMessage#clone()
This commit is contained in:
parent
774e2450b7
commit
114cc635e8
3 changed files with 6 additions and 20 deletions
|
@ -19,14 +19,14 @@ import java.io.StringWriter;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
|
||||||
public class SimpleSystemMessage extends SystemMessage implements Cloneable {
|
public class SimpleSystemMessage extends SystemMessage {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* alternative to message number for ids?
|
* alternative to message number for ids?
|
||||||
*/
|
*/
|
||||||
private String _pluginId;
|
private String _pluginId;
|
||||||
|
|
||||||
private int _severity;
|
//private int _severity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for messages that use explicit strings and severities rather than
|
* Constructor for messages that use explicit strings and severities rather than
|
||||||
|
@ -55,7 +55,7 @@ public class SimpleSystemMessage extends SystemMessage implements Cloneable {
|
||||||
super("RSE", "G", "-", severityToIndicator(severity), msg, msgDetails); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
|
super("RSE", "G", "-", severityToIndicator(severity), msg, msgDetails); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
|
||||||
|
|
||||||
_pluginId = pluginId;
|
_pluginId = pluginId;
|
||||||
_severity = severity;
|
//_severity = severity;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -71,7 +71,7 @@ public class SimpleSystemMessage extends SystemMessage implements Cloneable {
|
||||||
public SimpleSystemMessage(String pluginId, int severity, String msg, Throwable e) {
|
public SimpleSystemMessage(String pluginId, int severity, String msg, Throwable e) {
|
||||||
super("RSE", "G", "-", severityToIndicator(severity), msg, throwableToDetails(e)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
super("RSE", "G", "-", severityToIndicator(severity), msg, throwableToDetails(e)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
_pluginId = pluginId;
|
_pluginId = pluginId;
|
||||||
_severity = severity;
|
//_severity = severity;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String throwableToDetails(Throwable e){
|
private static String throwableToDetails(Throwable e){
|
||||||
|
|
|
@ -25,7 +25,7 @@ import java.io.StringWriter;
|
||||||
* SystemMessage is used to supply detailed status when an error or other significant event occurs that should
|
* SystemMessage is used to supply detailed status when an error or other significant event occurs that should
|
||||||
* be presented to the user or logged. It is structured to capture information from a variety of remote systems.
|
* be presented to the user or logged. It is structured to capture information from a variety of remote systems.
|
||||||
*/
|
*/
|
||||||
public class SystemMessage implements Cloneable
|
public class SystemMessage
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -453,18 +453,4 @@ public class SystemMessage implements Cloneable
|
||||||
return sub.toString();
|
return sub.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new message with the same component, subcomponent, number, text message
|
|
||||||
* and substitutions.
|
|
||||||
* @see java.lang.Object#clone()
|
|
||||||
*/
|
|
||||||
public Object clone() throws CloneNotSupportedException {
|
|
||||||
////Old invalid code - did not work properly for subclasses
|
|
||||||
//return new SystemMessage(component, subComponent, messageNumber, indicator, level1NS, level2NS);
|
|
||||||
SystemMessage result = (SystemMessage)super.clone();
|
|
||||||
//clone the array: this might throw runtime exceptions if the
|
|
||||||
//objects in the array are not cloneable!
|
|
||||||
result.subs = (Object[])subs.clone();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class SystemUIMessage extends SystemMessage implements Cloneable
|
public class SystemUIMessage extends SystemMessage
|
||||||
{
|
{
|
||||||
protected static final int displayMask = IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR; // for IStatus substitution variables
|
protected static final int displayMask = IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR; // for IStatus substitution variables
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue