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 132748 Details for
Bug 262557
[Edit] Save in Compare Editor throws OperationCanceledException
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]
Fix for problem 1
patch_compare.txt (text/plain), 5.94 KB, created by
Dani Megert
on 2009-04-22 07:05:09 EDT
(
hide
)
Description:
Fix for problem 1
Filename:
MIME Type:
Creator:
Dani Megert
Created:
2009-04-22 07:05:09 EDT
Size:
5.94 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.compare >Index: compare/org/eclipse/compare/structuremergeviewer/StructureCreator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureCreator.java,v >retrieving revision 1.14 >diff -u -r1.14 StructureCreator.java >--- compare/org/eclipse/compare/structuremergeviewer/StructureCreator.java 19 Jul 2007 17:01:30 -0000 1.14 >+++ compare/org/eclipse/compare/structuremergeviewer/StructureCreator.java 22 Apr 2009 11:05:35 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006, 2007 IBM Corporation and others. >+ * Copyright (c) 2006, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -12,18 +12,33 @@ > > import java.io.UnsupportedEncodingException; > >-import org.eclipse.compare.*; >-import org.eclipse.compare.contentmergeviewer.IDocumentRange; >-import org.eclipse.compare.internal.CompareUIPlugin; >-import org.eclipse.compare.internal.Utilities; >-import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IProgressMonitor; >-import org.eclipse.jface.text.*; >+import org.eclipse.core.runtime.OperationCanceledException; >+ >+import org.eclipse.core.resources.ResourcesPlugin; >+ >+import org.eclipse.jface.text.Document; >+import org.eclipse.jface.text.IDocument; >+import org.eclipse.jface.text.IDocumentExtension3; >+import org.eclipse.jface.text.IDocumentPartitioner; >+ > import org.eclipse.ui.IEditorInput; > import org.eclipse.ui.services.IDisposable; >+ > import org.eclipse.ui.texteditor.IDocumentProvider; > >+import org.eclipse.compare.CompareUI; >+import org.eclipse.compare.IEditableContent; >+import org.eclipse.compare.IEncodedStreamContentAccessor; >+import org.eclipse.compare.ISharedDocumentAdapter; >+import org.eclipse.compare.IStreamContentAccessor; >+import org.eclipse.compare.ITypedElement; >+import org.eclipse.compare.SharedDocumentAdapter; >+import org.eclipse.compare.contentmergeviewer.IDocumentRange; >+import org.eclipse.compare.internal.CompareUIPlugin; >+import org.eclipse.compare.internal.Utilities; >+ > /** > * An {@link IStructureCreator2} that attempts to use an {@link IDocumentProvider} > * to obtain a shared document for an {@link ITypedElement}. >@@ -43,14 +58,14 @@ > IDocument doc= CompareUI.getDocument(input); > if (doc == null) { > if (input instanceof IStreamContentAccessor) { >- IStreamContentAccessor sca= (IStreamContentAccessor) input; >+ IStreamContentAccessor sca= (IStreamContentAccessor) input; > try { > contents= Utilities.readString(sca); > } catch (CoreException e) { > // return null indicates the error. > CompareUIPlugin.log(e); > return null; >- } >+ } > } > > if (contents == null) { >@@ -59,7 +74,7 @@ > } > > doc= new Document(contents); >- setupDocument(doc); >+ setupDocument(doc); > } > > try { >@@ -77,7 +92,11 @@ > final IStructureComparator[] result = new IStructureComparator[] { null }; > Runnable runnable = new Runnable() { > public void run() { >- result[0] = internalCreateStructure(element, monitor); >+ try { >+ result[0]= internalCreateStructure(element, monitor); >+ } catch (OperationCanceledException ex) { >+ return; >+ } > } > }; > Utilities.runInUIThread(runnable); >@@ -194,7 +213,7 @@ > } > > /** >- * Default implementation of save that extracts the contents from >+ * Default implementation of save that extracts the contents from > * the document of an {@link IDocumentRange} and sets it on the > * input. If the input is an {@link IEncodedStreamContentAccessor}, > * the charset of the input is used to extract the contents from the >@@ -234,11 +253,11 @@ > } > if (encoding == null) > encoding= ResourcesPlugin.getEncoding(); >- byte[] bytes; >+ byte[] bytes; > try { > bytes= contents.getBytes(encoding); > } catch (UnsupportedEncodingException e) { >- bytes= contents.getBytes(); >+ bytes= contents.getBytes(); > } > bca.setContent(bytes); > } >@@ -257,7 +276,7 @@ > > /** > * Create an {@link ISharedDocumentAdapter} that will provide the document key for the given input >- * object for any {@link DocumentRangeNode} instances whose document is the same as the >+ * object for any {@link DocumentRangeNode} instances whose document is the same as the > * provided document. > * @param input the input element > * @param document the document associated with the input element >@@ -308,7 +327,7 @@ > > // Build the structure > IStructureComparator structure= createStructure(input, monitor); >- if (structure == null) // we couldn't parse the structure >+ if (structure == null) // we couldn't parse the structure > return null; // so we can't find anything > > // find the path in the tree >@@ -331,7 +350,7 @@ > return null; > // Build the structure > IStructureComparator structure= getStructure(input); >- if (structure == null) // we couldn't parse the structure >+ if (structure == null) // we couldn't parse the structure > return null; // so we can't find anything > > // find the path in the tree >@@ -373,7 +392,7 @@ > IStructureComparator result= find(child, path, index+1); > if (result != null) > return result; >- } >+ } > } > } > } >@@ -408,7 +427,7 @@ > > private IDisposable getDisposable(Object object) { > if (object instanceof IDisposable) { >- return (IDisposable) object; >+ return (IDisposable) object; > } > if (object instanceof DocumentRangeNode) { > DocumentRangeNode node = (DocumentRangeNode) object;
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 262557
: 132748