mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 16:55:38 +02:00
[216252] Fix Systemmessage.clone()
This commit is contained in:
parent
c2d68b20cf
commit
7855f9e110
2 changed files with 7 additions and 21 deletions
|
@ -107,12 +107,4 @@ public class SimpleSystemMessage extends SystemMessage {
|
||||||
return _pluginId + ":" + getIndicator(); //$NON-NLS-1$
|
return _pluginId + ":" + getIndicator(); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new message with the same component, subcomponent, number, level 1 and level 2 text as this message.
|
|
||||||
* @see java.lang.Object#clone()
|
|
||||||
*/
|
|
||||||
protected Object clone() throws CloneNotSupportedException {
|
|
||||||
return new SimpleSystemMessage(_pluginId, _severity, getLevelOneText(), getLevelTwoText());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,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
|
public class SystemMessage implements Cloneable
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -453,23 +453,17 @@ public class SystemMessage
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new message with the same component, subcomponent, number, level 1 and level 2 text as this message.
|
* Creates a new message with the same component, subcomponent, number, text message
|
||||||
* <p>
|
* and substitutions.
|
||||||
* Note that only the original message is cloned, but no substitutions. The
|
|
||||||
* cloned message will look like the original object as if substitutions
|
|
||||||
* have never been made.
|
|
||||||
* @see java.lang.Object#clone()
|
* @see java.lang.Object#clone()
|
||||||
*/
|
*/
|
||||||
protected Object clone() throws CloneNotSupportedException {
|
public Object clone() throws CloneNotSupportedException {
|
||||||
////Old invalid code - did not work properly for subclasses
|
////Old invalid code - did not work properly for subclasses
|
||||||
//return new SystemMessage(component, subComponent, messageNumber, indicator, level1NS, level2NS);
|
//return new SystemMessage(component, subComponent, messageNumber, indicator, level1NS, level2NS);
|
||||||
SystemMessage result = (SystemMessage)super.clone();
|
SystemMessage result = (SystemMessage)super.clone();
|
||||||
//re-initialize substitutions to empty
|
//clone the array: this might throw runtime exceptions if the
|
||||||
result.level1WS = level1NS;
|
//objects in the array are not cloneable!
|
||||||
result.level2WS = level2NS;
|
result.subs = (Object[])subs.clone();
|
||||||
result.subPrefix = '%';
|
|
||||||
result.numSubs = -1;
|
|
||||||
result.subs = null;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue