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 ---- .../mx4j/remote/resolver/iiop/Resolver.java | 37 ++++++++++++-------
1 file changed, 24 insertions(+), 13 deletions(-)
private ORB orb;
+ private static final String ORB_KEY = "java.naming.corba.orb"; 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
*** 111,127 **** @@ -32,6 +32,7 @@ public class Resolver extends mx4j.remote.resolver.rmi.Resolver
if (orb == null) private static final String IOR_CONTEXT = "/ior/";
{
! Properties props = new Properties(); private ORB orb;
! // Using putAll() on a Properties is discouraged, since it expects only Strings + private static final String ORB_KEY = "java.naming.corba.orb";
! for (Iterator i = environment.entrySet().iterator(); i.hasNext();)
! {
! Map.Entry entry = (Map.Entry)i.next(); //********************************************************************************************************************//
! Object key = entry.getKey(); @@ -110,19 +111,29 @@ public class Resolver extends mx4j.remote.resolver.rmi.Resolver
! Object value = entry.getValue(); {
! if (key instanceof String && value instanceof String) if (orb == null)
! { {
! props.setProperty((String)key, (String)value); - Properties props = new Properties();
! } - // Using putAll() on a Properties is discouraged, since it expects only Strings
! } - for (Iterator i = environment.entrySet().iterator(); i.hasNext();)
! orb = ORB.init((String[])null, props); - {
} - Map.Entry entry = (Map.Entry)i.next();
return orb; - Object key = entry.getKey();
--- 112,138 ---- - Object value = entry.getValue();
if (orb == null) - if (key instanceof String && value instanceof String)
{ - {
! Object candidateORB = environment.get(ORB_KEY); - props.setProperty((String)key, (String)value);
! if (candidateORB != null) - }
! { - }
! // Throw as required by the spec - orb = ORB.init((String[])null, props);
! if (!(candidateORB instanceof ORB)) throw new IllegalArgumentException("Property " + ORB_KEY + " must specify a " + ORB.class.getName() + ", not " + candidateORB.getClass().getName()); + Object candidateORB = environment.get(ORB_KEY);
! orb = (ORB)candidateORB; + if (candidateORB != null)
! } + {
! else + // Throw as required by the spec
! { + if (!(candidateORB instanceof ORB)) throw new IllegalArgumentException("Property " + ORB_KEY + " must specify a " + ORB.class.getName() + ", not " + candidateORB.getClass().getName());
! Properties props = new Properties(); + orb = (ORB)candidateORB;
! // Using putAll() on a Properties is discouraged, since it expects only Strings + }
! for (Iterator i = environment.entrySet().iterator(); i.hasNext();) + else
! { + {
! Map.Entry entry = (Map.Entry)i.next(); + Properties props = new Properties();
! Object key = entry.getKey(); + // Using putAll() on a Properties is discouraged, since it expects only Strings
! Object value = entry.getValue(); + for (Iterator i = environment.entrySet().iterator(); i.hasNext();)
! if (key instanceof String && value instanceof String) + {
! { + Map.Entry entry = (Map.Entry)i.next();
! props.setProperty((String)key, (String)value); + Object key = entry.getKey();
! } + 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);
+ }
}
return orb;
}
--
2.23.0

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