felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1781886 - in /felix/trunk/converter/converter/src: main/java/org/apache/felix/converter/impl/ main/java/org/osgi/util/converter/ test/java/org/apache/felix/converter/impl/
Date Mon, 06 Feb 2017 12:06:17 GMT
Author: davidb
Date: Mon Feb  6 12:06:16 2017
New Revision: 1781886

URL: http://svn.apache.org/viewvc?rev=1781886&view=rev
Log:
Felix Converter - remove equals() functionality.

Removed:
    felix/trunk/converter/converter/src/test/java/org/apache/felix/converter/impl/ConverterEqualsTest.java
Modified:
    felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/AdapterImpl.java
    felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/InternalConverter.java
    felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/StandardConverter.java

Modified: felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/AdapterImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/AdapterImpl.java?rev=1781886&r1=1781885&r2=1781886&view=diff
==============================================================================
--- felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/AdapterImpl.java
(original)
+++ felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/AdapterImpl.java
Mon Feb  6 12:06:16 2017
@@ -177,6 +177,7 @@ public class AdapterImpl implements Inte
             return (T) to(ref.getType());
         }
 
+        @SuppressWarnings("unchecked")
         @Override
         public Object to(Type type) {
             if (object != null) {

Modified: felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/InternalConverter.java
URL: http://svn.apache.org/viewvc/felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/InternalConverter.java?rev=1781886&r1=1781885&r2=1781886&view=diff
==============================================================================
--- felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/InternalConverter.java
(original)
+++ felix/trunk/converter/converter/src/main/java/org/apache/felix/converter/impl/InternalConverter.java
Mon Feb  6 12:06:16 2017
@@ -16,37 +16,8 @@
  */
 package org.apache.felix.converter.impl;
 
-import java.util.Map;
-
-import org.osgi.util.converter.ConversionException;
 import org.osgi.util.converter.Converter;
-import org.osgi.util.converter.TypeReference;
 
 public interface InternalConverter extends Converter {
     public InternalConverting convert(Object obj);
-
-    @Override
-    default public boolean equals(Object o1, Object o2) {
-        try {
-            Map<String, Object> m1 = convert(o1).to(new TypeReference<Map<String,Object>>(){});
-            Map<String, Object> m2 = convert(o2).to(new TypeReference<Map<String,Object>>(){});
-
-            if (m1.size() != m2.size())
-                return false;
-
-            for (Map.Entry<String, Object> entry : m1.entrySet()) {
-                Object val = m2.get(entry.getKey());
-                if (!equals(entry.getValue(), val))
-                    return false;
-            }
-            return true;
-        } catch (ConversionException e) {
-            // do lists as well
-
-            // It's a scalar - compare via strings
-            String s1 = convert(o1).to(String.class);
-            String s2 = convert(o2).to(String.class);
-            return s1.equals(s2);
-        }
-    }
 }

Modified: felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/StandardConverter.java
URL: http://svn.apache.org/viewvc/felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/StandardConverter.java?rev=1781886&r1=1781885&r2=1781886&view=diff
==============================================================================
--- felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/StandardConverter.java
(original)
+++ felix/trunk/converter/converter/src/main/java/org/osgi/util/converter/StandardConverter.java
Mon Feb  6 12:06:16 2017
@@ -45,9 +45,4 @@ public class StandardConverter implement
     public ConverterBuilder newConverterBuilder() {
         return converter.newConverterBuilder();
     }
-
-    @Override
-    public boolean equals(Object o1, Object o2) {
-        return converter.equals(o1, o2);
-    }
 }



Mime
View raw message