[pkg-java] r17045 - in trunk/libcobra-java/debian: . patches

Shuxiong Ye yesx-guest at alioth.debian.org
Sun Jul 21 06:09:14 UTC 2013


Author: yesx-guest
Date: 2013-07-21 06:09:13 +0000 (Sun, 21 Jul 2013)
New Revision: 17045

Added:
   trunk/libcobra-java/debian/patches/
   trunk/libcobra-java/debian/patches/01-compatible-with-java7.diff
   trunk/libcobra-java/debian/patches/series
Modified:
   trunk/libcobra-java/debian/changelog
Log:
Compatible with java7

Modified: trunk/libcobra-java/debian/changelog
===================================================================
--- trunk/libcobra-java/debian/changelog	2013-07-20 02:01:24 UTC (rev 17044)
+++ trunk/libcobra-java/debian/changelog	2013-07-21 06:09:13 UTC (rev 17045)
@@ -1,3 +1,11 @@
+libcobra-java (0.98.4-5) UNRELEASED; urgency=low
+
+  * Team upload.
+  * Compatible with Java7. Closes: #717250
+    - 01-compatible-with-java7.diff
+
+ -- ShuxiongYe <yeshuxiong at gmail.com>  Sun, 21 Jul 2013 13:22:51 +0800
+
 libcobra-java (0.98.4-4) unstable; urgency=low
 
   * Team upload.

Added: trunk/libcobra-java/debian/patches/01-compatible-with-java7.diff
===================================================================
--- trunk/libcobra-java/debian/patches/01-compatible-with-java7.diff	                        (rev 0)
+++ trunk/libcobra-java/debian/patches/01-compatible-with-java7.diff	2013-07-21 06:09:13 UTC (rev 17045)
@@ -0,0 +1,150 @@
+Index: libcobra-java-0.98.4/src/org/lobobrowser/html/domimpl/ElementImpl.java
+===================================================================
+--- libcobra-java-0.98.4.orig/src/org/lobobrowser/html/domimpl/ElementImpl.java	2008-08-27 00:43:10.000000000 +0800
++++ libcobra-java-0.98.4/src/org/lobobrowser/html/domimpl/ElementImpl.java	2013-07-21 13:22:31.759840623 +0800
+@@ -26,6 +26,7 @@
+ import java.util.*;
+ 
+ import org.lobobrowser.util.*;
++import org.lobobrowser.util.Objects;
+ import org.w3c.dom.Attr;
+ import org.w3c.dom.DOMException;
+ import org.w3c.dom.Element;
+Index: libcobra-java-0.98.4/src/org/lobobrowser/html/domimpl/NodeImpl.java
+===================================================================
+--- libcobra-java-0.98.4.orig/src/org/lobobrowser/html/domimpl/NodeImpl.java	2008-09-28 16:05:54.000000000 +0800
++++ libcobra-java-0.98.4/src/org/lobobrowser/html/domimpl/NodeImpl.java	2013-07-21 13:22:31.783840759 +0800
+@@ -32,6 +32,7 @@
+ import org.lobobrowser.html.style.*;
+ import org.lobobrowser.js.*;
+ import org.lobobrowser.util.*;
++import org.lobobrowser.util.Objects;
+ import org.w3c.dom.*;
+ 
+ public abstract class NodeImpl extends AbstractScriptableDelegate implements Node, ModelNode {
+Index: libcobra-java-0.98.4/src/org/lobobrowser/html/gui/HtmlBlockPanel.java
+===================================================================
+--- libcobra-java-0.98.4.orig/src/org/lobobrowser/html/gui/HtmlBlockPanel.java	2009-01-15 15:02:02.000000000 +0800
++++ libcobra-java-0.98.4/src/org/lobobrowser/html/gui/HtmlBlockPanel.java	2013-07-21 13:22:31.459839141 +0800
+@@ -34,6 +34,7 @@
+ import org.lobobrowser.html.renderer.*;
+ import org.lobobrowser.html.style.RenderState;
+ import org.lobobrowser.util.*;
++import org.lobobrowser.util.Objects;
+ import org.lobobrowser.util.gui.ColorFactory;
+ import org.w3c.dom.*;
+ import java.util.logging.*;
+Index: libcobra-java-0.98.4/src/org/lobobrowser/html/renderer/RBlock.java
+===================================================================
+--- libcobra-java-0.98.4.orig/src/org/lobobrowser/html/renderer/RBlock.java	2009-01-19 02:02:54.000000000 +0800
++++ libcobra-java-0.98.4/src/org/lobobrowser/html/renderer/RBlock.java	2013-07-21 13:22:31.499839347 +0800
+@@ -36,6 +36,7 @@
+ import org.lobobrowser.html.domimpl.*;
+ import org.lobobrowser.html.style.*;
+ import org.lobobrowser.util.*;
++import org.lobobrowser.util.Objects;
+ import org.w3c.dom.Node;
+ 
+ /**
+Index: libcobra-java-0.98.4/src/org/lobobrowser/html/renderer/RTable.java
+===================================================================
+--- libcobra-java-0.98.4.orig/src/org/lobobrowser/html/renderer/RTable.java	2009-01-18 23:09:50.000000000 +0800
++++ libcobra-java-0.98.4/src/org/lobobrowser/html/renderer/RTable.java	2013-07-21 13:22:31.531839506 +0800
+@@ -29,6 +29,7 @@
+ 
+ import org.lobobrowser.html.*;
+ import org.lobobrowser.util.*;
++import org.lobobrowser.util.Objects;
+ import org.lobobrowser.html.domimpl.*;
+ import org.lobobrowser.html.style.RenderState;
+ 
+Index: libcobra-java-0.98.4/src/org/lobobrowser/js/JavaFunctionObject.java
+===================================================================
+--- libcobra-java-0.98.4.orig/src/org/lobobrowser/js/JavaFunctionObject.java	2007-12-08 18:51:52.000000000 +0800
++++ libcobra-java-0.98.4/src/org/lobobrowser/js/JavaFunctionObject.java	2013-07-21 13:22:32.171842682 +0800
+@@ -25,6 +25,7 @@
+ import java.util.logging.*;
+ import java.util.*;
+ import org.lobobrowser.util.*;
++import org.lobobrowser.util.Objects;
+ 
+ public class JavaFunctionObject extends ScriptableObject implements Function {
+ 	private static final Logger logger = Logger.getLogger(JavaFunctionObject.class.getName());
+Index: libcobra-java-0.98.4/src/org/lobobrowser/util/gui/FontFactory.java
+===================================================================
+--- libcobra-java-0.98.4.orig/src/org/lobobrowser/util/gui/FontFactory.java	2008-12-29 00:33:38.000000000 +0800
++++ libcobra-java-0.98.4/src/org/lobobrowser/util/gui/FontFactory.java	2013-07-21 13:45:23.154640998 +0800
+@@ -23,6 +23,8 @@
+  */
+ package org.lobobrowser.util.gui;
+ 
++import java.lang.reflect.InvocationTargetException;
++import java.lang.reflect.Method;
+ import java.util.*;
+ import java.awt.*;
+ import java.awt.font.TextAttribute;
+@@ -30,7 +32,8 @@
+ 
+ import org.lobobrowser.util.Objects;
+ /** Note: Undocumented class? */
+-import sun.font.FontManager;
++//import sun.font.FontManager;
++//import sun.font.FontManagerFactory;
+ 
+ /**
+  * @author J. H. S.
+@@ -205,9 +208,46 @@
+ 		return createFont(this.defaultFontName, fontStyle, (int) Math.round(key.fontSize));
+ 	}
+ 	
++	static private Method __method;
++	static {
++		Class<?> __cls=null;
++		try { 
++			__cls=Class.forName("sun.font.FontUtilities");
++			// java 7
++		} catch (ClassNotFoundException e) {
++			try {
++				__cls=Class.forName("sun.font.FontManager");
++				// java 6
++			} catch (ClassNotFoundException e1) {
++				// should never go here
++				e1.printStackTrace();
++			}
++		}
++		try {
++			__method=__cls.getMethod("getCompositeFontUIResource", java.awt.Font.class);
++		} catch (NoSuchMethodException e) {
++			e.printStackTrace();
++		} catch (SecurityException e) {
++			e.printStackTrace();
++		} catch (NullPointerException e){
++			e.printStackTrace();
++		}
++	}
++	
+ 	private Font createFont(String name, int style, int size) {
+ 		// Proprietary Sun API. Maybe shouldn't use it. Works well for Chinese.
+-	    return FontManager.getCompositeFontUIResource(new Font(name, style, size));
++	    //return FontManager.getCompositeFontUIResource(new Font(name, style, size));
++		Font ret=null;
++	    try {
++			ret=(Font)__method.invoke(null, new Font(name, style, size));
++		} catch (IllegalAccessException e) {
++			e.printStackTrace();
++		} catch (IllegalArgumentException e) {
++			e.printStackTrace();
++		} catch (InvocationTargetException e) {
++			e.printStackTrace();
++		};
++		return ret;
+ 	}
+ 	
+ 	private static class FontKey {
+@@ -296,4 +336,4 @@
+ 			return "FontKey[family=" + this.fontFamily + ",size=" + this.fontSize + ",style=" + this.fontStyle + ",weight=" + this.fontWeight + ",variant=" + this.fontVariant + ",superscript="+this.superscript+"]";
+ 		}
+ 	}
+-}
+\ No newline at end of file
++}

Added: trunk/libcobra-java/debian/patches/series
===================================================================
--- trunk/libcobra-java/debian/patches/series	                        (rev 0)
+++ trunk/libcobra-java/debian/patches/series	2013-07-21 06:09:13 UTC (rev 17045)
@@ -0,0 +1 @@
+01-compatible-with-java7.diff




More information about the pkg-java-commits mailing list