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 205359 Details for
Bug 347557
[Edit] NPE when saving a file in a compare editor (always)
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]
org.eclipse.team.ui fix with tests v06
patch_347557_5.txt (text/plain), 4.44 KB, created by
Malgorzata Janczarska
on 2011-10-17 13:53:32 EDT
(
hide
)
Description:
org.eclipse.team.ui fix with tests v06
Filename:
MIME Type:
Creator:
Malgorzata Janczarska
Created:
2011-10-17 13:53:32 EDT
Size:
4.44 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java >index 0008fa9..fb839b4 100644 >--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java >+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java >@@ -248,10 +248,10 @@ public abstract class LocalResourceSaveableComparison extends SaveableComparison > */ > public String getName() { > // Return the name of the file element as held in the compare input >- if (fileElement.equals(input.getLeft())) { >+ if (input.getLeft().equals(fileElement)) { > return input.getLeft().getName(); > } >- if (fileElement.equals(input.getRight())) { >+ if (input.getRight().equals(fileElement)) { > return input.getRight().getName(); > } > // Fallback call returning name of the main non-null element of the input >@@ -289,14 +289,14 @@ public abstract class LocalResourceSaveableComparison extends SaveableComparison > > ContentMergeViewer cmv = (ContentMergeViewer) e.getSource(); > >- if (fileElement.equals(input.getLeft())) { >+ if (input.getLeft().equals(fileElement)) { > if (changed && cmv.internalIsLeftDirty()) > setDirty(changed); > else if (!changed && !cmv.internalIsLeftDirty()) { > setDirty(changed); > } > } >- if (fileElement.equals(input.getRight())) { >+ if (input.getRight().equals(fileElement)) { > if (changed && cmv.internalIsRightDirty()) > setDirty(changed); > else if (!changed && !cmv.internalIsRightDirty()) { >diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ReflectionUtils.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ReflectionUtils.java >index 538738a..d3d23f1 100644 >--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ReflectionUtils.java >+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ReflectionUtils.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2009 IBM Corporation and others. >+ * Copyright (c) 2009, 2011 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 >@@ -53,4 +53,27 @@ public class ReflectionUtils { > return ret; > } > >+ public static Object getField(Object object, String name, boolean deep) >+ throws IllegalArgumentException, IllegalAccessException, >+ SecurityException, NoSuchFieldException { >+ Class clazz = object.getClass(); >+ NoSuchFieldException ex = null; >+ while (clazz != null) { >+ try { >+ Field field = clazz.getDeclaredField(name); >+ field.setAccessible(true); >+ return field.get(object); >+ } catch (NoSuchFieldException e) { >+ if (ex == null) { >+ ex = e; >+ } >+ if (!deep) >+ break; >+ clazz = clazz.getSuperclass(); >+ >+ } >+ } >+ throw ex; >+ } >+ > } >\ No newline at end of file >diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/AllTeamUITests.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/AllTeamUITests.java >index 198465f..b8dc987 100644 >--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/AllTeamUITests.java >+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/AllTeamUITests.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2007 IBM Corporation and others. >+ * Copyright (c) 2007, 2011 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 >@@ -15,6 +15,7 @@ import junit.framework.TestSuite; > > import org.eclipse.core.tests.resources.ResourceTest; > import org.eclipse.team.tests.core.mapping.ScopeTests; >+import org.eclipse.team.tests.ui.SaveableCompareEditorInputTest; > > public class AllTeamUITests extends ResourceTest { > >@@ -29,6 +30,7 @@ public class AllTeamUITests extends ResourceTest { > public static Test suite() { > TestSuite suite = new TestSuite(); > suite.addTest(ScopeTests.suite()); >+ suite.addTest(SaveableCompareEditorInputTest.suite()); > return suite; > } > }
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 347557
:
201902
|
201906
|
204202
|
204452
|
204457
|
204502
|
204754
|
204957
|
205359
|
205361
|
205407
|
205708