libjopendocument-java build failures after repack

2014-06-20 Thread Pirate Praveen
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
[javac] this.remove(e.getKey(), e.getValue());
[javac]







signature.asc
Description: OpenPGP digital signature


Re: libjopendocument-java build failures after repack

2014-06-20 Thread Jerome Robert
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 [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 extends
MultiHashMap {

 public void removeAll(Map m) {
 for (final Map.Entry e :
m.entrySet()) {
-this.remove(e.getKey(), e.getValue());
+this.removeMapping(e.getKey(), e.getValue());
 }
 }

should help.

Jerome


-- 
To UNSUBSCRIBE, email to debian-java-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/53a44e15.1020...@gmx.com



Re: libjopendocument-java build failures after repack

2014-06-20 Thread Jerome Robert
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 [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 extends
> MultiHashMap {
> 
>  public void removeAll(Map m) {
>  for (final Map.Entry 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: canBeMerged(Map,Map) in EmbeddedLibrary and 
canBeMerged(Map,Map) in Library have the same 
erasure, yet neither hides the other
static private final  boolean canBeMerged(final Map m1, 
final Map m2) {
 ^
  where V is a type-variable:
V extends Object declared in method 
canBeMerged(Map,Map)
/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  boolean canBeMerged(final Map m1, 
final Map m2) {
+static private final  boolean canBeMergedImpl(final Map 
m1, final Map m2) {
 final Set duplicateKeys = 
CollectionUtils.inter(m1.keySet(), m2.keySet());
 for (final String key : duplicateKeys) {
 final V v1 = m1.get(key);

Jerome


-- 
To UNSUBSCRIBE, email to debian-java-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/53a4557b.2090...@gmx.com



Re: libjopendocument-java build failures after repack

2014-06-20 Thread Pirate Praveen
On Friday 20 June 2014 08:37 PM, Jerome Robert wrote:
> 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 extends
> MultiHashMap {
> 
>  public void removeAll(Map m) {
>  for (final Map.Entry e :
> m.entrySet()) {
> -this.remove(e.getKey(), e.getValue());
> +this.removeMapping(e.getKey(), e.getValue());
>  }
>  }
> 
> should help.
> 
> Jerome
> 
> 

Thanks! Now it builds fine in my work environment, but fails in
pbuilder. The same error is repeated many times. I think we have to set
encoding to UTF-8, but not sure where to set it.

[javac]
/tmp/buildd/libjopendocument-java-1.3repack/src/org/jopendocument/dom/ChildCreator.java:149:
error: unmappable character for encoding ASCII
[javac]  * Trouve l'index ou il faut ins??rer le fils dans ce
document.
[javac] ^
[javac]
/tmp/buildd/libjopendocument-java-1.3repack/src/org/jopendocument/dom/ChildCreator.java:149:
error: unmappable character for encoding ASCII
[javac]  * Trouve l'index ou il faut ins??rer le fils dans ce
document.
[javac]



signature.asc
Description: OpenPGP digital signature


Re: libjopendocument-java build failures after repack

2014-06-20 Thread Jerome Robert
On 20/06/2014 22:33, Pirate Praveen wrote:
> 
> Thanks! Now it builds fine in my work environment, but fails in
> pbuilder. The same error is repeated many times. I think we have to set
> encoding to UTF-8, but not sure where to set it.
> 
> [javac]
> /tmp/buildd/libjopendocument-java-1.3repack/src/org/jopendocument/dom/ChildCreator.java:149:
> error: unmappable character for encoding ASCII
> [javac]  * Trouve l'index ou il faut ins??rer le fils dans ce
> document.
> [javac] ^
> [javac]
> /tmp/buildd/libjopendocument-java-1.3repack/src/org/jopendocument/dom/ChildCreator.java:149:
> error: unmappable character for encoding ASCII
> [javac]  * Trouve l'index ou il faut ins??rer le fils dans ce
> document.
> [javac]
> 

The upstream should probably do something like that (or even better, not 
writing comments in french :-) ):
--- a/build.xml
+++ b/build.xml
@@ -76,7 +76,7 @@



-   
+   




but I guess that in a packaging context this one, which avoid patching, is 
better:

--- a/debian/rules
+++ b/debian/rules
@@ -4,6 +4,7 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 export JAVA_HOME=/usr/lib/jvm/default-java
+export ANT_OPTS=-Dfile.encoding=utf-8
 
 %:
dh $@ --with javahelper

Jerome


-- 
To UNSUBSCRIBE, email to debian-java-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/53a52b52.8070...@gmx.com



Re: libjopendocument-java build failures after repack

2014-06-21 Thread Pirate Praveen
On Saturday 21 June 2014 12:20 PM, Jerome Robert wrote:

> 
> but I guess that in a packaging context this one, which avoid patching, is 
> better:
> 
> --- a/debian/rules
> +++ b/debian/rules
> @@ -4,6 +4,7 @@
>  # Uncomment this to turn on verbose mode.
>  #export DH_VERBOSE=1
>  export JAVA_HOME=/usr/lib/jvm/default-java
> +export ANT_OPTS=-Dfile.encoding=utf-8
>  
>  %:
>   dh $@ --with javahelper
> 
> Jerome
> 
> 

Thanks! I just uploaded the package.



signature.asc
Description: OpenPGP digital signature