init package

This commit is contained in:
root 2020-09-02 15:47:18 +08:00
parent 114fcb7ea1
commit 8e2591f54e
2 changed files with 66 additions and 58 deletions

View File

@ -1,57 +1,65 @@
*** src/core/mx4j/remote/resolver/iiop/Resolver.java.orig 2005-05-12 12:13:28.000000000 -0400 From ea814e3b378a2305fb1d0e6b7e3a05458178dee6 Mon Sep 17 00:00:00 2001
--- src/core/mx4j/remote/resolver/iiop/Resolver.java 2005-05-13 14:38:21.000000000 -0400 Subject: [PATCH]
***************
*** 33,36 ****
--- 33,37 ----
private ORB orb; ---
+ private static final String ORB_KEY = "java.naming.corba.orb"; .../mx4j/remote/resolver/iiop/Resolver.java | 37 ++++++++++++-------
1 file changed, 24 insertions(+), 13 deletions(-)
diff --git a/src/core/mx4j/remote/resolver/iiop/Resolver.java b/src/core/mx4j/remote/resolver/iiop/Resolver.java
index 1666d05..559be34 100644
--- a/src/core/mx4j/remote/resolver/iiop/Resolver.java
+++ b/src/core/mx4j/remote/resolver/iiop/Resolver.java
@@ -32,6 +32,7 @@ public class Resolver extends mx4j.remote.resolver.rmi.Resolver
private static final String IOR_CONTEXT = "/ior/";
private ORB orb;
+ private static final String ORB_KEY = "java.naming.corba.orb";
*************** //********************************************************************************************************************//
*** 111,127 **** @@ -110,19 +111,29 @@ public class Resolver extends mx4j.remote.resolver.rmi.Resolver
if (orb == null) {
{ if (orb == null)
! Properties props = new Properties(); {
! // Using putAll() on a Properties is discouraged, since it expects only Strings - Properties props = new Properties();
! for (Iterator i = environment.entrySet().iterator(); i.hasNext();) - // Using putAll() on a Properties is discouraged, since it expects only Strings
! { - for (Iterator i = environment.entrySet().iterator(); i.hasNext();)
! Map.Entry entry = (Map.Entry)i.next(); - {
! Object key = entry.getKey(); - Map.Entry entry = (Map.Entry)i.next();
! Object value = entry.getValue(); - Object key = entry.getKey();
! if (key instanceof String && value instanceof String) - Object value = entry.getValue();
! { - if (key instanceof String && value instanceof String)
! props.setProperty((String)key, (String)value); - {
! } - props.setProperty((String)key, (String)value);
! } - }
! orb = ORB.init((String[])null, props); - }
} - orb = ORB.init((String[])null, props);
return orb; + Object candidateORB = environment.get(ORB_KEY);
--- 112,138 ---- + if (candidateORB != null)
if (orb == null) + {
{ + // Throw as required by the spec
! Object candidateORB = environment.get(ORB_KEY); + if (!(candidateORB instanceof ORB)) throw new IllegalArgumentException("Property " + ORB_KEY + " must specify a " + ORB.class.getName() + ", not " + candidateORB.getClass().getName());
! if (candidateORB != null) + orb = (ORB)candidateORB;
! { + }
! // Throw as required by the spec + else
! if (!(candidateORB instanceof ORB)) throw new IllegalArgumentException("Property " + ORB_KEY + " must specify a " + ORB.class.getName() + ", not " + candidateORB.getClass().getName()); + {
! orb = (ORB)candidateORB; + Properties props = new Properties();
! } + // Using putAll() on a Properties is discouraged, since it expects only Strings
! else + for (Iterator i = environment.entrySet().iterator(); i.hasNext();)
! { + {
! Properties props = new Properties(); + Map.Entry entry = (Map.Entry)i.next();
! // Using putAll() on a Properties is discouraged, since it expects only Strings + Object key = entry.getKey();
! for (Iterator i = environment.entrySet().iterator(); i.hasNext();) + Object value = entry.getValue();
! { + if (key instanceof String && value instanceof String)
! Map.Entry entry = (Map.Entry)i.next(); + {
! Object key = entry.getKey(); + props.setProperty((String)key, (String)value);
! Object value = entry.getValue(); + }
! if (key instanceof String && value instanceof String) + }
! { + orb = ORB.init((String[])null, props);
! props.setProperty((String)key, (String)value); + }
! } }
! } return orb;
! orb = ORB.init((String[])null, props); }
! } --
} 2.23.0
return orb;

View File

@ -50,7 +50,7 @@ Documentation for %{name}.
%prep %prep
%setup -q %setup -q
%patch0 -p1 %patch0 -p1
%patch1 -p0 %patch1 -p1
%patch2 -b .sav %patch2 -b .sav
%patch3 -p1 %patch3 -p1
%patch5 -p1 %patch5 -p1