Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2016-07-20 17:14:46 +0000
committerBrian Vosburgh2017-05-18 22:38:14 +0000
commitddf39d58d7934326d0981c9378b357e734911257 (patch)
tree9f823aa705f3488b279251343dfb00510ad48092
parent683f311fa8a53b4cbad22215be45a9f266442a2f (diff)
downloadwebtools.dali-ddf39d58d7934326d0981c9378b357e734911257.tar.gz
webtools.dali-ddf39d58d7934326d0981c9378b357e734911257.tar.xz
webtools.dali-ddf39d58d7934326d0981c9378b357e734911257.zip
delete AbstractTransformer and AbstractInterruptibleTransformer
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTextLabelProvider.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ResourceManagerLabelProvider.java9
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/IntegerCombo.java5
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/AbstractTreeNodeValueModel.java5
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/TransformationListValueModel.java10
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/AbstractInterruptibleTransformer.java28
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/AbstractTransformer.java36
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NullOutputTransformer.java3
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/TransformerAdapter.java3
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/XMLStringDecoder.java7
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/XMLStringEncoder.java5
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/model/value/TreeNodeValueModel.java8
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlSwitcherTest.java12
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/collection/MapToolsTests.java12
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationListValueModelTests.java14
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationModifiablePropertyValueModelTests.java14
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java14
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformationPredicateTests.java8
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformerPredicateTests.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConverterDialog.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertersComposite.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTenantDiscriminatorColumnsComposite.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/MappingUiDefinition.java16
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeDetailsPageManager.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeDetailsPageManager.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/QueriesComposite.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TemporalTypeCombo.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsGeneratorsComposite.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_1/details/QueriesComposite2_1.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitClassesComposite.java15
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitJarFilesComposite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitMappingFilesComposite.java11
32 files changed, 149 insertions, 189 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTextLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTextLabelProvider.java
index 28d39c2097..d05d9defc2 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTextLabelProvider.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTextLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
+ * Copyright (c) 2012. 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -53,7 +53,7 @@ public class PluggableTextLabelProvider<E>
if (textTransformer == null) {
throw new NullPointerException();
}
- this.textTransformer = textTransformer;
+ this.textTransformer = TransformerTools.nullCheck(textTransformer);
}
/**
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ResourceManagerLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ResourceManagerLabelProvider.java
index 91c2f797e2..1156d2714d 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ResourceManagerLabelProvider.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ResourceManagerLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -76,10 +76,13 @@ public class ResourceManagerLabelProvider<E>
*/
public ResourceManagerLabelProvider(Transformer<E, ImageDescriptor> imageDescriptorTransformer, Transformer<E, String> textTransformer, ResourceManager resourceManager) {
super(textTransformer);
- if ((imageDescriptorTransformer == null) || (resourceManager == null)) {
+ if (imageDescriptorTransformer == null) {
+ throw new NullPointerException();
+ }
+ this.imageDescriptorTransformer = TransformerTools.nullCheck(imageDescriptorTransformer);
+ if (resourceManager == null) {
throw new NullPointerException();
}
- this.imageDescriptorTransformer = imageDescriptorTransformer;
this.resourceManager = new LocalResourceManager(resourceManager);
}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/IntegerCombo.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/IntegerCombo.java
index 9bda41c06a..58fca78003 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/IntegerCombo.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/IntegerCombo.java
@@ -14,7 +14,6 @@ import org.eclipse.jpt.common.ui.JptCommonUiMessages;
import org.eclipse.jpt.common.ui.internal.swt.widgets.ComboTools;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.internal.transformer.TransformerTools;
import org.eclipse.jpt.common.utility.model.Model;
@@ -157,10 +156,10 @@ public abstract class IntegerCombo<T extends Model>
}
public class SelectedItemStringModelSetTransformer
- extends AbstractTransformer<String, Integer>
+ extends TransformerAdapter<String, Integer>
{
@Override
- protected Integer transform_(String string) {
+ public Integer transform(String string) {
try {
return Integer.valueOf(string);
} catch (NumberFormatException ex) {
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/AbstractTreeNodeValueModel.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/AbstractTreeNodeValueModel.java
index b4315334c0..72f255127c 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/AbstractTreeNodeValueModel.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/AbstractTreeNodeValueModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -15,6 +15,7 @@ import org.eclipse.jpt.common.utility.internal.collection.ListTools;
import org.eclipse.jpt.common.utility.internal.iterator.IteratorTools;
import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
import org.eclipse.jpt.common.utility.internal.model.ChangeSupport;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerTools;
import org.eclipse.jpt.common.utility.model.listener.StateChangeListener;
import org.eclipse.jpt.common.utility.model.value.ListValueModel;
import org.eclipse.jpt.common.utility.model.value.TreeNodeValueModel;
@@ -125,7 +126,7 @@ public abstract class AbstractTreeNodeValueModel<V>
*/
@SuppressWarnings("unchecked")
protected Iterator<TreeNodeValueModel<V>> backPath() {
- return IteratorTools.chainIterator(this, PARENT_TRANSFORMER);
+ return IteratorTools.chainIterator(this, TransformerTools.nullCheck(PARENT_TRANSFORMER));
}
public TreeNodeValueModel<V> child(int index) {
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/TransformationListValueModel.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/TransformationListValueModel.java
index 81c52a7eb9..9b19ad5992 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/TransformationListValueModel.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/TransformationListValueModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -14,7 +14,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import org.eclipse.jpt.common.utility.internal.iterator.IteratorTools;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
@@ -307,11 +307,11 @@ public class TransformationListValueModel<E1, E2>
* implementation of {@link TransformationListValueModel#transformItem_(Object)}.
*/
protected class DefaultTransformer
- extends AbstractTransformer<E1, E2>
+ extends TransformerAdapter<E1, E2>
{
@Override
- public E2 transform_(E1 item) {
- return TransformationListValueModel.this.transformItem_(item);
+ public E2 transform(E1 item) {
+ return (item == null) ? null : TransformationListValueModel.this.transformItem_(item);
}
}
}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/AbstractInterruptibleTransformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/AbstractInterruptibleTransformer.java
deleted file mode 100644
index 16d7fb2964..0000000000
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/AbstractInterruptibleTransformer.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.internal.transformer;
-
-/**
- * @see AbstractTransformer
- */
-public abstract class AbstractInterruptibleTransformer<I, O>
- extends InterruptibleTransformerAdapter<I, O>
-{
- @Override
- public O transform(I input) throws InterruptedException {
- return (input == null) ? null : this.transform_(input);
- }
-
- /**
- * Transform the specified input; its value is guaranteed to be not
- * <code>null</code>.
- */
- protected abstract O transform_(I input) throws InterruptedException;
-}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/AbstractTransformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/AbstractTransformer.java
deleted file mode 100644
index 2af2bd3d4c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/AbstractTransformer.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.internal.transformer;
-
-/**
- * Convenience superclass that returns <code>null</code> if the original
- * object is <code>null</code>; otherwise it calls {@link #transform_(Object)},
- * which is to be implemented by subclasses.
- *
- * @param <I> input: the type of the object passed to the transformer
- * @param <O> output: the type of the object returned by the transformer
- *
- * @see TransformerAdapter
- * @see NullCheckTransformerWrapper
- */
-public abstract class AbstractTransformer<I, O>
- extends TransformerAdapter<I, O>
-{
- @Override
- public final O transform(I input) {
- return (input == null) ? null : this.transform_(input);
- }
-
- /**
- * Transform the specified input; its value is guaranteed to be not
- * <code>null</code>.
- */
- protected abstract O transform_(I input);
-}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NullOutputTransformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NullOutputTransformer.java
index 4294e27abb..e7ec6af68b 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NullOutputTransformer.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NullOutputTransformer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2005, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -18,7 +18,6 @@ import org.eclipse.jpt.common.utility.transformer.Transformer;
* @param <I> input: the type of the object passed to the transformer
* @param <O> output: the type of the object returned by the transformer
*
- * @see AbstractTransformer
* @see TransformerAdapter
*/
public final class NullOutputTransformer<I, O>
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/TransformerAdapter.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/TransformerAdapter.java
index fbb02e7d95..25dfc7e0c7 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/TransformerAdapter.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/TransformerAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -19,7 +19,6 @@ import org.eclipse.jpt.common.utility.transformer.Transformer;
* @param <I> input: the type of the object passed to the transformer
* @param <O> output: the type of the object returned by the transformer
*
- * @see AbstractTransformer
* @see NullOutputTransformer
*/
public class TransformerAdapter<I, O>
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/XMLStringDecoder.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/XMLStringDecoder.java
index e82a6ecbc3..953ddd716b 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/XMLStringDecoder.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/XMLStringDecoder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2005, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -22,8 +22,7 @@ import org.eclipse.jpt.common.utility.transformer.Transformer;
* @see XMLStringEncoder
*/
public final class XMLStringDecoder
- extends AbstractTransformer<String, String>
- implements Serializable
+ implements Transformer<String, String>, Serializable
{
public static final Transformer<String, String> INSTANCE = new XMLStringDecoder();
@@ -43,7 +42,7 @@ public final class XMLStringDecoder
* replaced by the characters themselves.
*/
@Override
- protected String transform_(String s) {
+ public String transform(String s) {
StringBuilder sb = new StringBuilder(s.length());
StringBuilder temp = new StringBuilder(); // performance tweak
this.decode(sb, new StringReader(s), temp);
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/XMLStringEncoder.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/XMLStringEncoder.java
index e149810cf9..089fb94553 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/XMLStringEncoder.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/XMLStringEncoder.java
@@ -12,6 +12,7 @@ package org.eclipse.jpt.common.utility.internal.transformer;
import java.util.Arrays;
import org.eclipse.jpt.common.utility.internal.ArrayTools;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
/**
* This transformer will replace any of a specified set of characters with an XML
@@ -19,7 +20,7 @@ import org.eclipse.jpt.common.utility.internal.ObjectTools;
* @see XMLStringDecoder
*/
public class XMLStringEncoder
- extends AbstractTransformer<String, String>
+ implements Transformer<String, String>
{
/** The set of characters to be converted into XML character references. */
private final char[] chars;
@@ -69,7 +70,7 @@ public class XMLStringEncoder
* replaced with XML character references.
*/
@Override
- protected String transform_(String s) {
+ public String transform(String s) {
int len = s.length();
// allow for a few encoded characters
StringBuilder sb = new StringBuilder(len + 20);
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/model/value/TreeNodeValueModel.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/model/value/TreeNodeValueModel.java
index eaf099d555..9e63c62b58 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/model/value/TreeNodeValueModel.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/model/value/TreeNodeValueModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -9,7 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.common.utility.model.value;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.transformer.Transformer;
/**
@@ -45,10 +45,10 @@ public interface TreeNodeValueModel<V>
@SuppressWarnings("rawtypes")
Transformer PARENT_TRANSFORMER = new ParentTransformer();
class ParentTransformer<V>
- extends AbstractTransformer<TreeNodeValueModel<V>, TreeNodeValueModel<V>>
+ extends TransformerAdapter<TreeNodeValueModel<V>, TreeNodeValueModel<V>>
{
@Override
- protected TreeNodeValueModel<V> transform_(TreeNodeValueModel<V> treeNodeValueModel) {
+ public TreeNodeValueModel<V> transform(TreeNodeValueModel<V> treeNodeValueModel) {
return treeNodeValueModel.parent();
}
}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlSwitcherTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlSwitcherTest.java
index fa0c385f4c..966c6dc900 100644
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlSwitcherTest.java
+++ b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlSwitcherTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -16,7 +16,7 @@ import org.eclipse.jpt.common.ui.internal.swt.bindings.SWTBindingTools;
import org.eclipse.jpt.common.ui.internal.swt.widgets.DisplayTools;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
@@ -85,13 +85,13 @@ public final class ControlSwitcherTest {
}
protected class PaneTransformer
- extends AbstractTransformer<Boolean, Control>
+ extends TransformerAdapter<Boolean, Control>
{
@Override
- public Control transform_(Boolean value) {
- return value.booleanValue() ?
+ public Control transform(Boolean value) {
+ return (value == null) ? null : (value.booleanValue() ?
ControlSwitcherTest.this.pane1 :
- ControlSwitcherTest.this.pane2;
+ ControlSwitcherTest.this.pane2);
}
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/collection/MapToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/collection/MapToolsTests.java
index f257662833..4551d0a04e 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/collection/MapToolsTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/collection/MapToolsTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2013, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -24,7 +24,7 @@ import org.eclipse.jpt.common.utility.internal.factory.FactoryTools;
import org.eclipse.jpt.common.utility.internal.predicate.PredicateAdapter;
import org.eclipse.jpt.common.utility.internal.queue.QueueTools;
import org.eclipse.jpt.common.utility.internal.stack.StackTools;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.queue.Queue;
import org.eclipse.jpt.common.utility.stack.Stack;
import org.eclipse.jpt.common.utility.transformer.Transformer;
@@ -478,20 +478,20 @@ public class MapToolsTests
public static final Transformer<String, String> REVERSE_STRING_TRANSFORMER = new ReverseStringTransformer();
public static class ReverseStringTransformer
- extends AbstractTransformer<String, String>
+ extends TransformerAdapter<String, String>
{
@Override
- protected String transform_(String input) {
+ public String transform(String input) {
return StringTools.reverse(input);
}
}
public static final Transformer<String, String> SORT_STRING_TRANSFORMER = new SortStringTransformer();
public static class SortStringTransformer
- extends AbstractTransformer<String, String>
+ extends TransformerAdapter<String, String>
{
@Override
- protected String transform_(String input) {
+ public String transform(String input) {
return new String(ArrayTools.sort(input.toCharArray()));
}
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationListValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationListValueModelTests.java
index 4cd4659dc4..370a27b490 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationListValueModelTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationListValueModelTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -14,14 +14,13 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-import junit.framework.TestCase;
import org.eclipse.jpt.common.utility.internal.collection.ListTools;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.common.utility.internal.iterator.IteratorTools;
import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
import org.eclipse.jpt.common.utility.internal.model.value.TransformationListValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
@@ -35,6 +34,7 @@ import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
import org.eclipse.jpt.common.utility.model.value.ListValueModel;
import org.eclipse.jpt.common.utility.tests.internal.TestTools;
import org.eclipse.jpt.common.utility.transformer.Transformer;
+import junit.framework.TestCase;
@SuppressWarnings("nls")
public class TransformationListValueModelTests extends TestCase {
@@ -329,17 +329,17 @@ public class TransformationListValueModelTests extends TestCase {
@Override
ListValueModel<String> buildTransformedListHolder(ListValueModel<String> lvm) {
- return new TransformationListValueModel<String, String>(lvm, UPPER_CASE_TRANSFORMER);
+ return new TransformationListValueModel<>(lvm, UPPER_CASE_TRANSFORMER);
}
}
static final Transformer<String, String> UPPER_CASE_TRANSFORMER = new UpperCaseTransformer();
static class UpperCaseTransformer
- extends AbstractTransformer<String, String>
+ extends TransformerAdapter<String, String>
{
@Override
- public String transform_(String s) {
- return s.toUpperCase();
+ public String transform(String s) {
+ return (s == null) ? null : s.toUpperCase();
}
}
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationModifiablePropertyValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationModifiablePropertyValueModelTests.java
index c23cf44a2d..51c65e54a6 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationModifiablePropertyValueModelTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationModifiablePropertyValueModelTests.java
@@ -12,7 +12,7 @@ package org.eclipse.jpt.common.utility.tests.internal.model.value;
import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
@@ -220,21 +220,21 @@ public class TransformationModifiablePropertyValueModelTests
private static final Transformer<Person, Person> PARENT_TRANSFORMER = new ParentTransformer();
static class ParentTransformer
- extends AbstractTransformer<Person, Person>
+ extends TransformerAdapter<Person, Person>
{
@Override
- public Person transform_(Person p) {
- return p.getParent();
+ public Person transform(Person p) {
+ return (p == null) ? null : p.getParent();
}
}
private static final Transformer<Person, Person> CHILD_TRANSFORMER = new ChildTransformer();
static class ChildTransformer
- extends AbstractTransformer<Person, Person>
+ extends TransformerAdapter<Person, Person>
{
@Override
- public Person transform_(Person p) {
- return p.getChild();
+ public Person transform(Person p) {
+ return (p == null) ? null : p.getChild();
}
}
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java
index 4d7248c792..f7ae005d50 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java
@@ -12,7 +12,7 @@ package org.eclipse.jpt.common.utility.tests.internal.model.value;
import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
@@ -45,21 +45,21 @@ public class TransformationPropertyValueModelTests
private static final Transformer<String, String> UPPER_CASE_TRANSFORMER = new UpperCaseTransformer();
static class UpperCaseTransformer
- extends AbstractTransformer<String, String>
+ extends TransformerAdapter<String, String>
{
@Override
- public String transform_(String s) {
- return s.toUpperCase();
+ public String transform(String s) {
+ return (s == null) ? null : s.toUpperCase();
}
}
private static final Transformer<String, String> LOWER_CASE_TRANSFORMER = new LowerCaseTransformer();
static class LowerCaseTransformer
- extends AbstractTransformer<String, String>
+ extends TransformerAdapter<String, String>
{
@Override
- public String transform_(String s) {
- return s.toLowerCase();
+ public String transform(String s) {
+ return (s == null) ? null : s.toLowerCase();
}
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformationPredicateTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformationPredicateTests.java
index fc72ef117c..102eacefdc 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformationPredicateTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformationPredicateTests.java
@@ -10,13 +10,13 @@
package org.eclipse.jpt.common.utility.tests.internal.predicate;
import java.io.Serializable;
-import junit.framework.TestCase;
import org.eclipse.jpt.common.utility.internal.predicate.IsNotNull;
import org.eclipse.jpt.common.utility.internal.predicate.PredicateTools;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.predicate.Predicate;
import org.eclipse.jpt.common.utility.tests.internal.TestTools;
import org.eclipse.jpt.common.utility.transformer.Transformer;
+import junit.framework.TestCase;
@SuppressWarnings("nls")
public class TransformationPredicateTests
@@ -62,12 +62,12 @@ public class TransformationPredicateTests
}
static final Transformer<Person, String> NAME_TRANSFORMER = new NameTransformer();
static class NameTransformer
- extends AbstractTransformer<Person, String>
+ extends TransformerAdapter<Person, String>
implements Serializable
{
private static final long serialVersionUID = 1L;
@Override
- protected String transform_(Person person) {
+ public String transform(Person person) {
return person.name;
}
@Override
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformerPredicateTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformerPredicateTests.java
index a687d658ba..84646f50e5 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformerPredicateTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformerPredicateTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Oracle. All rights reserved.
+ * Copyright (c) 2013, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -10,13 +10,13 @@
package org.eclipse.jpt.common.utility.tests.internal.predicate;
import java.io.Serializable;
-import junit.framework.TestCase;
import org.eclipse.jpt.common.utility.internal.predicate.IsNotNull;
import org.eclipse.jpt.common.utility.internal.predicate.PredicateTools;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.predicate.Predicate;
import org.eclipse.jpt.common.utility.tests.internal.TestTools;
import org.eclipse.jpt.common.utility.transformer.Transformer;
+import junit.framework.TestCase;
@SuppressWarnings("nls")
public class TransformerPredicateTests
@@ -68,12 +68,12 @@ public class TransformerPredicateTests
}
static class LessThan42Transformer
- extends AbstractTransformer<Integer, Boolean>
+ extends TransformerAdapter<Integer, Boolean>
implements Serializable
{
private static final long serialVersionUID = 1L;
@Override
- protected Boolean transform_(Integer integer) {
+ public Boolean transform(Integer integer) {
return Boolean.valueOf(integer.intValue() < 42);
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConverterDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConverterDialog.java
index a5cd796c5a..2383715e5e 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConverterDialog.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConverterDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -14,7 +14,7 @@ import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
import org.eclipse.jpt.common.ui.internal.widgets.ValidatingDialog;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
import org.eclipse.jpt.common.utility.internal.model.value.StaticListValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.model.value.ListValueModel;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
@@ -149,10 +149,13 @@ public class EclipseLinkConverterDialog
}
static class ConverterTypeLabelTransformer
- extends AbstractTransformer<Class<? extends EclipseLinkConverter>, String>
+ extends TransformerAdapter<Class<? extends EclipseLinkConverter>, String>
{
@Override
- public String transform_(Class<? extends EclipseLinkConverter> value) {
+ public String transform(Class<? extends EclipseLinkConverter> value) {
+ if (value == null) {
+ return null;
+ }
if (value == EclipseLinkCustomConverter.class) {
return JptJpaEclipseLinkUiDetailsMessages.ECLIPSELINK_CONVERTERS_COMPOSITE_CUSTOM_CONVERTER;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertersComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertersComposite.java
index 5fbaf8b712..a34e13e471 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertersComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertersComposite.java
@@ -25,7 +25,7 @@ import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValue
import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.iterable.ListIterable;
import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
import org.eclipse.jpt.common.utility.model.value.ListValueModel;
@@ -231,7 +231,7 @@ public class EclipseLinkConvertersComposite
}
protected class PaneTransformer
- extends AbstractTransformer<EclipseLinkConverter, Control>
+ extends TransformerAdapter<EclipseLinkConverter, Control>
{
private final PageBook pageBook;
@@ -240,7 +240,10 @@ public class EclipseLinkConvertersComposite
}
@Override
- public Control transform_(EclipseLinkConverter converter) {
+ public Control transform(EclipseLinkConverter converter) {
+ if (converter == null) {
+ return null;
+ }
if (converter.getConverterType() == EclipseLinkCustomConverter.class) {
return EclipseLinkConvertersComposite.this.getCustomConverterComposite(this.pageBook).getControl();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTenantDiscriminatorColumnsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTenantDiscriminatorColumnsComposite.java
index c53350841f..3fb5a07cec 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTenantDiscriminatorColumnsComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTenantDiscriminatorColumnsComposite.java
@@ -23,7 +23,7 @@ import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueMod
import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.iterable.ListIterable;
import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
import org.eclipse.jpt.common.utility.model.value.ListValueModel;
@@ -134,7 +134,7 @@ public class EclipseLinkTenantDiscriminatorColumnsComposite<T extends JpaModel>
}
protected class PaneTransformer
- extends AbstractTransformer<EclipseLinkTenantDiscriminatorColumn2_3, Control>
+ extends TransformerAdapter<EclipseLinkTenantDiscriminatorColumn2_3, Control>
{
private final PageBook pageBook;
@@ -143,8 +143,8 @@ public class EclipseLinkTenantDiscriminatorColumnsComposite<T extends JpaModel>
}
@Override
- public Control transform_(EclipseLinkTenantDiscriminatorColumn2_3 column) {
- return getTenantDiscriminatorColumnComposite(this.pageBook).getControl();
+ public Control transform(EclipseLinkTenantDiscriminatorColumn2_3 column) {
+ return (column == null) ? null : getTenantDiscriminatorColumnComposite(this.pageBook).getControl();
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/MappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/MappingUiDefinition.java
index aef40d1eee..57008e4a41 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/MappingUiDefinition.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/MappingUiDefinition.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -14,7 +14,7 @@ import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jpt.common.ui.WidgetFactory;
import org.eclipse.jpt.common.ui.internal.widgets.Pane;
import org.eclipse.jpt.common.utility.internal.predicate.CriterionPredicate;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.jpt.jpa.core.context.JpaContextModel;
@@ -47,10 +47,10 @@ public interface MappingUiDefinition {
String getKey();
Transformer<MappingUiDefinition, String> KEY_TRANSFORMER = new KeyTransformer();
class KeyTransformer
- extends AbstractTransformer<MappingUiDefinition, String>
+ extends TransformerAdapter<MappingUiDefinition, String>
{
@Override
- public String transform_(MappingUiDefinition def) {
+ public String transform(MappingUiDefinition def) {
return def.getKey();
}
}
@@ -61,10 +61,10 @@ public interface MappingUiDefinition {
String getLabel();
Transformer<MappingUiDefinition, String> LABEL_TRANSFORMER = new LabelTransformer();
class LabelTransformer
- extends AbstractTransformer<MappingUiDefinition, String>
+ extends TransformerAdapter<MappingUiDefinition, String>
{
@Override
- public String transform_(MappingUiDefinition def) {
+ public String transform(MappingUiDefinition def) {
return def.getLabel();
}
}
@@ -95,10 +95,10 @@ public interface MappingUiDefinition {
Transformer<MappingUiDefinition, ImageDescriptor> IMAGE_DESCRIPTOR_TRANSFORMER = new ImageDescriptorTransformer();
class ImageDescriptorTransformer
- extends AbstractTransformer<MappingUiDefinition, ImageDescriptor>
+ extends TransformerAdapter<MappingUiDefinition, ImageDescriptor>
{
@Override
- public ImageDescriptor transform_(MappingUiDefinition def) {
+ public ImageDescriptor transform(MappingUiDefinition def) {
return def.getImageDescriptor();
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeDetailsPageManager.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeDetailsPageManager.java
index 75b6282e7c..4ac26e9cd8 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeDetailsPageManager.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeDetailsPageManager.java
@@ -16,7 +16,7 @@ import org.eclipse.jpt.common.ui.internal.swt.bindings.SWTBindingTools;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.internal.predicate.CriterionPredicate;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.common.utility.predicate.Predicate;
@@ -76,11 +76,11 @@ public abstract class PersistentAttributeDetailsPageManager<A extends Persistent
}
protected class PaneTransformer
- extends AbstractTransformer<AttributeMapping, Control>
+ extends TransformerAdapter<AttributeMapping, Control>
{
@Override
- public Control transform_(AttributeMapping attributeMapping) {
- return getMappingComposite(attributeMapping.getKey()).getControl();
+ public Control transform(AttributeMapping attributeMapping) {
+ return (attributeMapping == null) ? null : getMappingComposite(attributeMapping.getKey()).getControl();
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeDetailsPageManager.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeDetailsPageManager.java
index 922de1b3f1..bae0321b0c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeDetailsPageManager.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeDetailsPageManager.java
@@ -16,7 +16,7 @@ import org.eclipse.jpt.common.ui.internal.swt.bindings.SWTBindingTools;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.internal.predicate.CriterionPredicate;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.common.utility.predicate.Predicate;
import org.eclipse.jpt.common.utility.transformer.Transformer;
@@ -88,11 +88,11 @@ public class PersistentTypeDetailsPageManager
}
protected class PaneTransformer
- extends AbstractTransformer<TypeMapping, Control>
+ extends TransformerAdapter<TypeMapping, Control>
{
@Override
- public Control transform_(TypeMapping typeMapping) {
- return getMappingComposite(typeMapping.getKey()).getControl();
+ public Control transform(TypeMapping typeMapping) {
+ return (typeMapping == null) ? null : getMappingComposite(typeMapping.getKey()).getControl();
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/QueriesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/QueriesComposite.java
index 2748220cee..843d9154a0 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/QueriesComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/QueriesComposite.java
@@ -27,7 +27,7 @@ import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValue
import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.iterable.ListIterable;
import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
import org.eclipse.jpt.common.utility.model.value.ListValueModel;
@@ -231,7 +231,7 @@ public class QueriesComposite
}
protected class PaneTransformer
- extends AbstractTransformer<Query, Control>
+ extends TransformerAdapter<Query, Control>
{
private final PageBook pageBook;
@@ -240,7 +240,10 @@ public class QueriesComposite
}
@Override
- public Control transform_(Query query) {
+ public Control transform(Query query) {
+ if (query == null) {
+ return null;
+ }
if (query instanceof NamedNativeQuery) {
return QueriesComposite.this.getNamedNativeQueryPropertyComposite(this.pageBook).getControl();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TemporalTypeCombo.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TemporalTypeCombo.java
index abf79cdd9e..bac7c1f530 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TemporalTypeCombo.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TemporalTypeCombo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -15,7 +15,7 @@ import org.eclipse.jpt.common.ui.internal.widgets.Pane;
import org.eclipse.jpt.common.utility.internal.collection.ListTools;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.model.value.ListValueModel;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
@@ -108,11 +108,11 @@ public class TemporalTypeCombo extends Pane<BaseTemporalConverter> {
}
class TemporalTypeLabelTransformer
- extends AbstractTransformer<TemporalType, String>
+ extends TransformerAdapter<TemporalType, String>
{
@Override
- public String transform_(TemporalType temporalType) {
- return displayString(temporalType);
+ public String transform(TemporalType temporalType) {
+ return (temporalType == null) ? null : displayString(temporalType);
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsGeneratorsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsGeneratorsComposite.java
index b4917f6c7b..586d661978 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsGeneratorsComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsGeneratorsComposite.java
@@ -25,7 +25,7 @@ import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValue
import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.iterable.ListIterable;
import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
import org.eclipse.jpt.common.utility.model.value.ListValueModel;
@@ -208,7 +208,7 @@ public class EntityMappingsGeneratorsComposite extends Pane<EntityMappings>
}
protected class PaneTransformer
- extends AbstractTransformer<OrmGenerator, Control>
+ extends TransformerAdapter<OrmGenerator, Control>
{
private final Composite container;
@@ -217,7 +217,10 @@ public class EntityMappingsGeneratorsComposite extends Pane<EntityMappings>
}
@Override
- public Control transform_(OrmGenerator generator) {
+ public Control transform(OrmGenerator generator) {
+ if (generator == null) {
+ return null;
+ }
if (generator instanceof OrmSequenceGenerator) {
return EntityMappingsGeneratorsComposite.this.getSequenceGeneratorComposite(this.container).getControl();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_1/details/QueriesComposite2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_1/details/QueriesComposite2_1.java
index 9deccf55d4..04edc8ed70 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_1/details/QueriesComposite2_1.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_1/details/QueriesComposite2_1.java
@@ -21,7 +21,7 @@ import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.common.utility.internal.iterable.SuperListIterableWrapper;
import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.iterable.ListIterable;
import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
import org.eclipse.jpt.common.utility.model.value.ListValueModel;
@@ -106,7 +106,7 @@ public class QueriesComposite2_1
}
protected class PaneTransformer
- extends AbstractTransformer<Query, Control>
+ extends TransformerAdapter<Query, Control>
{
private final PageBook pageBook;
@@ -115,7 +115,7 @@ public class QueriesComposite2_1
}
@Override
- public Control transform_(Query query) {
+ public Control transform(Query query) {
if (query instanceof NamedNativeQuery) {
return QueriesComposite2_1.this.getNamedNativeQueryPropertyComposite(this.pageBook).getControl();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitClassesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitClassesComposite.java
index fe4a8cba4a..7a67977b6b 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitClassesComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitClassesComposite.java
@@ -32,7 +32,6 @@ import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.iterable.ListIterable;
import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
@@ -208,14 +207,17 @@ public class PersistenceUnitClassesComposite
//also need to make the image and label the same in the structure view
private static final Transformer<ClassRef, ImageDescriptor> CLASS_REF_LABEL_IMAGE_DESCRIPTOR_TRANSFORMER = new ClassRefLabelImageDescriptorTransformer();
/* CU private */ static class ClassRefLabelImageDescriptorTransformer
- extends AbstractTransformer<ClassRef, ImageDescriptor>
+ extends TransformerAdapter<ClassRef, ImageDescriptor>
{
@Override
- protected ImageDescriptor transform_(ClassRef classRef) {
+ public ImageDescriptor transform(ClassRef classRef) {
return this.getImageDescriptor(classRef);
}
private ImageDescriptor getImageDescriptor(ClassRef classRef) {
+ if (classRef == null) {
+ return null;
+ }
if (classRef.getJavaManagedType() == null) {
return JptJpaUiImages.NULL_TYPE_MAPPING;
}
@@ -242,10 +244,13 @@ public class PersistenceUnitClassesComposite
private static final Transformer<ClassRef, String> CLASS_REF_LABEL_TEXT_TRANSFORMER = new ClassRefLabelTextTransformer();
/* CU private */ static class ClassRefLabelTextTransformer
- extends AbstractTransformer<ClassRef, String>
+ extends TransformerAdapter<ClassRef, String>
{
@Override
- protected String transform_(ClassRef classRef) {
+ public String transform(ClassRef classRef) {
+ if (classRef == null) {
+ return null;
+ }
String name = classRef.getClassName();
return (name != null) ? name : JptJpaUiPersistenceMessages.PERSISTENCE_UNIT_CLASSES_COMPOSITE_CLASS_REF_NO_NAME;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitJarFilesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitJarFilesComposite.java
index 8fb0d30042..56d407eaf5 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitJarFilesComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitJarFilesComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -20,7 +20,7 @@ import org.eclipse.jpt.common.ui.internal.widgets.Pane;
import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.internal.transformer.TransformerTools;
import org.eclipse.jpt.common.utility.iterable.ListIterable;
import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
@@ -119,10 +119,13 @@ public abstract class PersistenceUnitJarFilesComposite
private static final Transformer<JarFileRef, String> JAR_FILE_REF_LABEL_TEXT_TRANSFORMER = new JarFileRefLabelTextTransformer();
/* CU private */ static class JarFileRefLabelTextTransformer
- extends AbstractTransformer<JarFileRef, String>
+ extends TransformerAdapter<JarFileRef, String>
{
@Override
- protected String transform_(JarFileRef jarFileRef) {
+ public String transform(JarFileRef jarFileRef) {
+ if (jarFileRef == null) {
+ return null;
+ }
String name = jarFileRef.getFileName();
return (name != null) ? name : JptJpaUiPersistenceMessages.PERSISTENCE_UNIT_JAR_FILES_COMPOSITE_NO_FILE_NAME;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitMappingFilesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitMappingFilesComposite.java
index 0df0e59727..df0b5b6034 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitMappingFilesComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitMappingFilesComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. 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 http://www.eclipse.org/legal/epl-v10.html.
@@ -25,7 +25,7 @@ import org.eclipse.jpt.common.ui.internal.widgets.Pane;
import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.internal.transformer.TransformerTools;
import org.eclipse.jpt.common.utility.iterable.ListIterable;
import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
@@ -144,10 +144,13 @@ public abstract class PersistenceUnitMappingFilesComposite
private static final Transformer<MappingFileRef, String> MAPPING_FILE_REF_LABEL_TEXT_TRANSFORMER = new MappingFileRefLabelTextTransformer();
/* CU private */ static class MappingFileRefLabelTextTransformer
- extends AbstractTransformer<MappingFileRef, String>
+ extends TransformerAdapter<MappingFileRef, String>
{
@Override
- protected String transform_(MappingFileRef mappingFileRef) {
+ public String transform(MappingFileRef mappingFileRef) {
+ if (mappingFileRef == null) {
+ return null;
+ }
String name = mappingFileRef.getFileName();
return (name != null) ? name : JptJpaUiPersistenceMessages.PERSISTENCE_UNIT_MAPPING_FILES_COMPOSITE_ORM_NO_NAME;
}

Back to the top