jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1837457 - in /jackrabbit/branches/2.14: ./ jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JNDIRepositoryStub.java
Date Sun, 05 Aug 2018 08:17:00 GMT
Author: reschke
Date: Sun Aug  5 08:17:00 2018
New Revision: 1837457

URL: http://svn.apache.org/viewvc?rev=1837457&view=rev
Log:
JCR-4338: avoid use of javax.rmi.PortableRemoteObject (removed in Java 11) (ported to 2.14)

Modified:
    jackrabbit/branches/2.14/   (props changed)
    jackrabbit/branches/2.14/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JNDIRepositoryStub.java

Propchange: jackrabbit/branches/2.14/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Aug  5 08:17:00 2018
@@ -1,3 +1,3 @@
 /jackrabbit/branches/JCR-2272:1173165-1176545
 /jackrabbit/sandbox/JCR-2415-lucene-3.0:1060860-1064038
-/jackrabbit/trunk:1776907,1776911-1776912,1776914,1776918,1779166,1779460,1779614,1779632,1780208,1780220,1780335-1780336,1780406,1785225,1786325,1786330,1787043,1787381,1792100,1792105,1792113,1792193,1793315,1793323,1793327,1793332,1793339,1796980,1797209,1797917,1798586,1799429,1799538,1799549,1799575,1800359,1800378,1800752,1802925,1802977,1807234,1807244,1808752,1808754,1809149,1809329,1809624,1810108,1811667,1812543,1812634,1812994,1814831,1817094,1817097-1817098,1817100,1817113,1817201,1817213,1817373,1817377,1818586,1819269,1819271,1819839,1819849,1820119,1820133,1820294,1820573,1820675,1821247,1821475,1821597,1821705,1821880,1822643,1822863,1822947,1822950,1824756,1824763-1824764,1824771,1824876,1826178,1826230,1826647,1826940,1826964,1828213,1830107,1830201,1830540,1830753,1830814,1830878,1830951,1831854,1831860,1832058,1832090,1833374,1833835,1833891,1834008,1834308,1834315,1834401,1834418,1834424,1834673,1834922,1835445,1835448,1835459
+/jackrabbit/trunk:1776907,1776911-1776912,1776914,1776918,1779166,1779460,1779614,1779632,1780208,1780220,1780335-1780336,1780406,1785225,1786325,1786330,1787043,1787381,1792100,1792105,1792113,1792193,1793315,1793323,1793327,1793332,1793339,1796980,1797209,1797917,1798586,1799429,1799538,1799549,1799575,1800359,1800378,1800752,1802925,1802977,1807234,1807244,1808752,1808754,1809149,1809329,1809624,1810108,1811667,1812543,1812634,1812994,1814831,1817094,1817097-1817098,1817100,1817113,1817201,1817213,1817373,1817377,1818586,1819269,1819271,1819839,1819849,1820119,1820133,1820294,1820573,1820675,1821247,1821475,1821597,1821705,1821880,1822643,1822863,1822947,1822950,1824756,1824763-1824764,1824771,1824876,1826178,1826230,1826647,1826940,1826964,1828213,1830107,1830201,1830540,1830753,1830814,1830878,1830951,1831854,1831860,1832058,1832090,1833374,1833835,1833891,1834008,1834308,1834315,1834401,1834418,1834424,1834673,1834922,1835445,1835448,1835459,1836349

Modified: jackrabbit/branches/2.14/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JNDIRepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.14/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JNDIRepositoryStub.java?rev=1837457&r1=1837456&r2=1837457&view=diff
==============================================================================
--- jackrabbit/branches/2.14/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JNDIRepositoryStub.java
(original)
+++ jackrabbit/branches/2.14/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JNDIRepositoryStub.java
Sun Aug  5 08:17:00 2018
@@ -24,7 +24,6 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-import javax.rmi.PortableRemoteObject;
 
 /**
  * Implements the abstract class <code>RepositoryStub</code> and uses JNDI
@@ -55,12 +54,11 @@ public class JNDIRepositoryStub extends
                 InitialContext initial = new InitialContext(environment);
                 Object obj = initial.lookup(lookupName);
 
-                repository = (Repository)PortableRemoteObject.narrow(obj, Repository.class);
-
-            } catch (ClassCastException e) {
-                // ClassCastException may be thrown by ProtableRemoteObject.narrow()
-                throw new RepositoryStubException(
-                        "Object cannot be narrowed to javax.jcr.Repository", e);
+                if (obj instanceof Repository) {
+                    repository = (Repository) obj;
+                } else {
+                    throw new RepositoryStubException("Object is not instanceof javax.jcr.Repository:
" + obj.getClass().getName());
+                }
             } catch (NamingException e) {
                 throw new RepositoryStubException(e);
             }



Mime
View raw message