Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 111549 Details for
Bug 182665
[WorkingSets] The working set were not restored at the eclipse launching.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
a sample patch for Eclipse 3.4
patch182665.txt (text/plain), 7.50 KB, created by
Masashi Sato
on 2008-09-03 01:10:51 EDT
(
hide
)
Description:
a sample patch for Eclipse 3.4
Filename:
MIME Type:
Creator:
Masashi Sato
Created:
2008-09-03 01:10:51 EDT
Size:
7.50 KB
patch
obsolete
>Index: Eclipse UI/org/eclipse/ui/XMLMemento.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java,v >retrieving revision 1.32 >diff -u -r1.32 XMLMemento.java >--- Eclipse UI/org/eclipse/ui/XMLMemento.java 9 May 2008 14:13:12 -0000 1.32 >+++ Eclipse UI/org/eclipse/ui/XMLMemento.java 3 Sep 2008 05:10:12 -0000 >@@ -162,35 +162,42 @@ > * Method declared in IMemento. > */ > public IMemento createChild(String type) { >- Element child = factory.createElement(type); >+ synchronized (element) { >+ Element child = factory.createElement(type); > element.appendChild(child); > return new XMLMemento(factory, child); >+ } > } > > /* (non-Javadoc) > * Method declared in IMemento. > */ > public IMemento createChild(String type, String id) { >+ synchronized (element) { > Element child = factory.createElement(type); > child.setAttribute(TAG_ID, id == null ? "" : id); //$NON-NLS-1$ > element.appendChild(child); > return new XMLMemento(factory, child); >+ } > } > > /* (non-Javadoc) > * Method declared in IMemento. > */ > public IMemento copyChild(IMemento child) { >+ synchronized (element) { > Element childElement = ((XMLMemento) child).element; > Element newElement = (Element) factory.importNode(childElement, true); > element.appendChild(newElement); > return new XMLMemento(factory, newElement); >+ } > } > > /* (non-Javadoc) > * Method declared in IMemento. > */ > public IMemento getChild(String type) { >+ synchronized (element) { > > // Get the nodes. > NodeList nodes = element.getChildNodes(); >@@ -212,12 +219,14 @@ > > // A child was not found. > return null; >+ } > } > > /* (non-Javadoc) > * Method declared in IMemento. > */ > public IMemento[] getChildren(String type) { >+ synchronized (element) { > > // Get the nodes. > NodeList nodes = element.getChildNodes(); >@@ -245,12 +254,14 @@ > results[x] = new XMLMemento(factory, (Element) list.get(x)); > } > return results; >+ } > } > > /* (non-Javadoc) > * Method declared in IMemento. > */ > public Float getFloat(String key) { >+ synchronized (element) { > Attr attr = element.getAttributeNode(key); > if (attr == null) { > return null; >@@ -263,26 +274,32 @@ > + key + " value: " + strValue, e); //$NON-NLS-1$ > return null; > } >+ } > } > > /** > * @since 3.4 > */ > public String getType() { >+ synchronized (element) { > return element.getNodeName(); >+ } > } > > /* (non-Javadoc) > * Method declared in IMemento. > */ > public String getID() { >+ synchronized (element) { > return element.getAttribute(TAG_ID); >+ } > } > > /* (non-Javadoc) > * Method declared in IMemento. > */ > public Integer getInteger(String key) { >+ synchronized (element) { > Attr attr = element.getAttributeNode(key); > if (attr == null) { > return null; >@@ -296,45 +313,53 @@ > + " value: " + strValue, e); //$NON-NLS-1$ > return null; > } >- } >+ } >+ } > > /* (non-Javadoc) > * Method declared in IMemento. > */ > public String getString(String key) { >+ synchronized (element) { > Attr attr = element.getAttributeNode(key); > if (attr == null) { > return null; > } > return attr.getValue(); >+ } > } > > /** > * @since 3.4 > */ > public Boolean getBoolean(String key) { >+ synchronized (element) { > Attr attr = element.getAttributeNode(key); > if (attr == null) { > return null; > } > return Boolean.valueOf(attr.getValue()); >+ } > } > > /* (non-Javadoc) > * Method declared in IMemento. > */ > public String getTextData() { >+ synchronized (element) { > Text textNode = getTextNode(); > if (textNode != null) { > return textNode.getData(); > } > return null; >+ } > } > > /** > * @since 3.4 > */ > public String[] getAttributeKeys() { >+ synchronized (element) { > NamedNodeMap map = element.getAttributes(); > int size = map.getLength(); > String[] attributes = new String[size]; >@@ -343,6 +368,7 @@ > attributes[i] = node.getNodeName(); > } > return attributes; >+ } > } > > /** >@@ -353,6 +379,7 @@ > * the memento has no Text node. > */ > private Text getTextNode() { >+ synchronized (element) { > // Get the nodes. > NodeList nodes = element.getChildNodes(); > int size = nodes.getLength(); >@@ -367,6 +394,7 @@ > } > // a Text node was not found > return null; >+ } > } > > /** >@@ -374,6 +402,7 @@ > * @param copyText true if the first text node should be copied > */ > private void putElement(Element element, boolean copyText) { >+ synchronized (element) { > NamedNodeMap nodeMap = element.getAttributes(); > int size = nodeMap.getLength(); > for (int i = 0; i < size; i++) { >@@ -396,52 +425,64 @@ > needToCopyText = false; > } > } >+ } > } > > /* (non-Javadoc) > * Method declared in IMemento. > */ > public void putFloat(String key, float f) { >+ synchronized (element) { > element.setAttribute(key, String.valueOf(f)); >+ } > } > > /* (non-Javadoc) > * Method declared in IMemento. > */ > public void putInteger(String key, int n) { >+ synchronized (element) { > element.setAttribute(key, String.valueOf(n)); >+ } > } > > /* (non-Javadoc) > * Method declared in IMemento. > */ > public void putMemento(IMemento memento) { >+ synchronized (element) { > // Do not copy the element's top level text node (this would overwrite the existing text). > // Text nodes of children are copied. > putElement(((XMLMemento) memento).element, false); >+ } > } > > /* (non-Javadoc) > * Method declared in IMemento. > */ > public void putString(String key, String value) { >+ synchronized (element) { > if (value == null) { > return; > } > element.setAttribute(key, value); >+ } > } > > /** > * @since 3.4 > */ > public void putBoolean(String key, boolean value) { >+ synchronized (element) { > element.setAttribute(key, value ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+ } > } > > /* (non-Javadoc) > * Method declared in IMemento. > */ > public void putTextData(String data) { >+ synchronized (element) { > Text textNode = getTextNode(); > if (textNode == null) { > textNode = factory.createTextNode(data); >@@ -450,6 +491,7 @@ > } else { > textNode.setData(data); > } >+ } > } > > /** >@@ -460,12 +502,14 @@ > * @throws IOException if there is a problem serializing the document to the stream. > */ > public void save(Writer writer) throws IOException { >+ synchronized (element) { > DOMWriter out = new DOMWriter(writer); > try { > out.print(element); > } finally { > out.close(); > } >+ } > } > > /**
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 182665
: 111549