[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libjopendocument-java build failures after repack



On 20/06/2014 17:07, Jerome Robert wrote:
> On 20/06/2014 13:43, Pirate Praveen wrote:
>> Hi,
>>
>> This packaged had many jar files embedded in it and it was
>> building fine. But after removing the embedded jars and adding them
>> in build-deps, there is one build error now [I might have missed
>> adding some jars, but previous build errors where helpful to find
>> which jar is missing).
>>
>> Can anyone help here? This is my first java package and I don't
>> know java (I have learned it years ago in college but never used it
>> in any serious projects).
>>
>> It is already added to team repo. You'll have to run a
>> pristine-tar checkout to create a orig.tar.gz and use
>> dpkg-buildpackage to build it as git-buildpackage doesn't run clean
>> after patching. 
>> (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752165)
>>
>> Thanks Praveen
>>
>> [javac] 
>> /home/pravi/forge/debian/git/pkg-java/libjopendocument-java/src/org/jopendocument/util/CollectionMap.java:199:
>>
>>
> cannot find symbol
>> [javac] symbol  : method remove(K,V) [javac] location: class
>> org.jopendocument.util.CollectionMap<K,V> [javac]
>> this.remove(e.getKey(), e.getValue()); [javac]
>>
> 
> Hi Praveen,
> 
> According to:
> 
> http://anonscm.debian.org/viewvc/pkg-java/trunk/libcommons-collections3-java/debian/patches/java8-compatibility.patch?view=markup
> 
> MultiHashMap.remove has been renamed to MultiHashMap.removeMapping so
> adding a patch with:
> 
> @@ -196,7 +196,7 @@ public class CollectionMap<K, V> extends
> MultiHashMap {
> 
>      public void removeAll(Map<? extends K, ? extends V> m) {
>          for (final Map.Entry<? extends K, ? extends V> e :
> m.entrySet()) {
> -            this.remove(e.getKey(), e.getValue());
> +            this.removeMapping(e.getKey(), e.getValue());
>          }
>      }
> 
> should help.
> 


Yet it won't build because of:

/tmp/libjopendocument-java/src/org/jopendocument/dom/Library.java:649: error: name clash: <V>canBeMerged(Map<String,V>,Map<String,V>) in EmbeddedLibrary and canBeMerged(Map<String,Library>,Map<String,Library>) in Library have the same erasure, yet neither hides the other
        static private final <V> boolean canBeMerged(final Map<String, V> m1, final Map<String, V> m2) {
                                         ^
  where V is a type-variable:
    V extends Object declared in method <V>canBeMerged(Map<String,V>,Map<String,V>)
/home/jerome/libjopendocument-java/src/org/jopendocument/util/CollectionMap.java:199: error: no suitable method found for remove(K,V)
            this.remove(e.getKey(), e.getValue());
                ^
    method CollectionMap.remove(Object) is not applicable
      (actual and formal argument lists differ in length)
    method HashMap.remove(Object) is not applicable
      (actual and formal argument lists differ in length)
    method AbstractMap.remove(Object) is not applicable
      (actual and formal argument lists differ in length)
  where K,V are type-variables:
    K extends Object declared in class CollectionMap
    V extends Object declared in class CollectionMap

which is triggered by this fix:

http://bugs.java.com/view_bug.do?bug_id=6182950

So you should add this patch:

--- a/src/org/jopendocument/dom/Library.java
+++ b/src/org/jopendocument/dom/Library.java
@@ -643,10 +643,10 @@ public abstract class Library {
             final EmbeddedLibrary other = (EmbeddedLibrary) obj;
             if (this.passwordProtected != other.passwordProtected)
                 return false;
-            return canBeMerged(this.modules, other.modules) && canBeMerged(this.dialogs, other.dialogs);
+            return canBeMergedImpl(this.modules, other.modules) && canBeMergedImpl(this.dialogs, other.dialogs);
         }
 
-        static private final <V> boolean canBeMerged(final Map<String, V> m1, final Map<String, V> m2) {
+        static private final <V> boolean canBeMergedImpl(final Map<String, V> m1, final Map<String, V> m2) {
             final Set<String> duplicateKeys = CollectionUtils.inter(m1.keySet(), m2.keySet());
             for (final String key : duplicateKeys) {
                 final V v1 = m1.get(key);

Jerome


Reply to: