[libbluray-devel] [Git][videolan/libbluray][master] Fix build with Java 1.6

Petri Hintukainen gitlab at videolan.org
Fri Feb 22 17:13:32 CET 2019


Petri Hintukainen pushed to branch master at VideoLAN / libbluray


Commits:
e9956108 by hpi1 at 2019-02-22T16:13:02Z
Fix build with Java 1.6

- - - - -


3 changed files:

- src/libbluray/bdj/java/org/dvb/application/AppsDatabase.java
- src/libbluray/bdj/java/org/havi/ui/HScreenPoint.java
- src/libbluray/bdj/java/org/havi/ui/HScreenRectangle.java


Changes:

=====================================
src/libbluray/bdj/java/org/dvb/application/AppsDatabase.java
=====================================
@@ -21,7 +21,6 @@ package org.dvb.application;
 
 import java.util.LinkedList;
 import java.util.Enumeration;
-import java.util.Collections;
 import org.videolan.BDJAppsDatabase;
 import org.videolan.BDJListeners;
 import org.videolan.Logger;
@@ -38,12 +37,12 @@ public class AppsDatabase {
 
     public Enumeration getAppIDs(AppsDatabaseFilter filter) {
         logger.unimplemented("getAppIDs");
-        return Collections.emptyEnumeration();
+        return emptyEnumeration;
     }
 
     public Enumeration getAppAttributes(AppsDatabaseFilter filter) {
         logger.unimplemented("getAppAttributes");
-        return Collections.emptyEnumeration();
+        return emptyEnumeration;
     }
 
     public AppAttributes getAppAttributes(AppID key) {
@@ -68,6 +67,11 @@ public class AppsDatabase {
         listeners.putCallback(new AppsDatabaseEvent(id, appid, this));
     }
 
+    private static final Enumeration emptyEnumeration = new Enumeration() {
+	    public boolean hasMoreElements() { return false; }
+	    public Object nextElement() { throw new java.util.NoSuchElementException(); }
+	};
+
     private BDJListeners listeners = new BDJListeners();
     private static final Logger logger = Logger.getLogger(AppsDatabase.class.getName());
 }


=====================================
src/libbluray/bdj/java/org/havi/ui/HScreenPoint.java
=====================================
@@ -30,7 +30,7 @@ public class HScreenPoint {
     }
 
     public int hashCode() {
-        return Float.hashCode(x) + 31 * Float.hashCode(y);
+        return (new Float(x).hashCode()) + 31 * (new Float(y).hashCode());
     }
 
     public boolean equals(Object obj)


=====================================
src/libbluray/bdj/java/org/havi/ui/HScreenRectangle.java
=====================================
@@ -36,10 +36,10 @@ public class HScreenRectangle {
     }
 
     public int hashCode() {
-        int result = Float.hashCode(x);
-        result = 31 * result + Float.hashCode(y);
-        result = 31 * result + Float.hashCode(width);
-        result = 31 * result + Float.hashCode(height);
+        int result = (new Float(x).hashCode());
+        result = 31 * result + (new Float(y).hashCode());
+        result = 31 * result + (new Float(width).hashCode());
+        result = 31 * result + (new Float(height).hashCode());
         return result;
     }
 



View it on GitLab: https://code.videolan.org/videolan/libbluray/commit/e995610883b12034223ea2882a04571f6d0ddb53

-- 
View it on GitLab: https://code.videolan.org/videolan/libbluray/commit/e995610883b12034223ea2882a04571f6d0ddb53
You're receiving this email because of your account on code.videolan.org.


More information about the libbluray-devel mailing list