diff options
Diffstat (limited to 'java')
9 files changed, 103 insertions, 23 deletions
diff --git a/java/src/Ice/src/main/java/com/zeroc/Ice/ConnectionI.java b/java/src/Ice/src/main/java/com/zeroc/Ice/ConnectionI.java index 296f0af7969..c1c33414122 100644 --- a/java/src/Ice/src/main/java/com/zeroc/Ice/ConnectionI.java +++ b/java/src/Ice/src/main/java/com/zeroc/Ice/ConnectionI.java @@ -2727,7 +2727,9 @@ public final class ConnectionI extends com.zeroc.IceInternal.EventHandler // // Suppress AssertionError and OutOfMemoryError, rethrow everything else. // - if(!(t instanceof java.lang.AssertionError || t instanceof java.lang.OutOfMemoryError)) + if(!(t instanceof java.lang.AssertionError || + t instanceof java.lang.OutOfMemoryError || + t instanceof java.lang.StackOverflowError)) { throw (java.lang.Error)t; } @@ -2752,7 +2754,9 @@ public final class ConnectionI extends com.zeroc.IceInternal.EventHandler // // Suppress AssertionError and OutOfMemoryError, rethrow everything else. // - if(!(ex instanceof java.lang.AssertionError || ex instanceof java.lang.OutOfMemoryError)) + if(!(ex instanceof java.lang.AssertionError || + ex instanceof java.lang.OutOfMemoryError || + ex instanceof java.lang.StackOverflowError)) { throw ex; } diff --git a/java/src/Ice/src/main/java/com/zeroc/IceInternal/CollocatedRequestHandler.java b/java/src/Ice/src/main/java/com/zeroc/IceInternal/CollocatedRequestHandler.java index 7512638a7c0..a9a6ee0f919 100644 --- a/java/src/Ice/src/main/java/com/zeroc/IceInternal/CollocatedRequestHandler.java +++ b/java/src/Ice/src/main/java/com/zeroc/IceInternal/CollocatedRequestHandler.java @@ -341,7 +341,9 @@ public class CollocatedRequestHandler implements RequestHandler, ResponseHandler // // Suppress AssertionError and OutOfMemoryError, rethrow everything else. // - if(!(t instanceof java.lang.AssertionError || t instanceof java.lang.OutOfMemoryError)) + if(!(t instanceof java.lang.AssertionError || + t instanceof java.lang.OutOfMemoryError || + t instanceof java.lang.StackOverflowError)) { throw (java.lang.Error)t; } @@ -366,13 +368,17 @@ public class CollocatedRequestHandler implements RequestHandler, ResponseHandler // // Suppress AssertionError and OutOfMemoryError, rethrow everything else. // - if(!(ex instanceof java.lang.AssertionError || ex instanceof java.lang.OutOfMemoryError)) + if(!(ex instanceof java.lang.AssertionError || + ex instanceof java.lang.OutOfMemoryError || + ex instanceof java.lang.StackOverflowError)) { throw ex; } } - - _adapter.decDirectCount(); + finally + { + _adapter.decDirectCount(); + } } private void diff --git a/java/src/Ice/src/main/java/com/zeroc/IceInternal/PropertyNames.java b/java/src/Ice/src/main/java/com/zeroc/IceInternal/PropertyNames.java index eb3319e9b46..77db7c18407 100644 --- a/java/src/Ice/src/main/java/com/zeroc/IceInternal/PropertyNames.java +++ b/java/src/Ice/src/main/java/com/zeroc/IceInternal/PropertyNames.java @@ -6,7 +6,7 @@ // ICE_LICENSE file included in this distribution. // // ********************************************************************** -// Generated by makeprops.py from file ./config/PropertyNames.xml, Tue Feb 28 15:01:12 2017 +// Generated by makeprops.py from file ./config/PropertyNames.xml, Thu Mar 23 15:24:16 2017 // IMPORTANT: Do not edit this file -- any edits made here will be lost! @@ -79,6 +79,7 @@ public final class PropertyNames new Property("Ice\\.BatchAutoFlush", true, null), new Property("Ice\\.BatchAutoFlushSize", false, null), new Property("Ice\\.ChangeUser", false, null), + new Property("Ice\\.ClassGraphDepthMax", false, null), new Property("Ice\\.ClientAccessPolicyProtocol", false, null), new Property("Ice\\.Compression\\.Level", false, null), new Property("Ice\\.CollectObjects", false, null), diff --git a/java/test/src/main/java/test/Ice/exceptions/AllTests.java b/java/test/src/main/java/test/Ice/exceptions/AllTests.java index 1cce083ca40..acfb3dc000b 100644 --- a/java/test/src/main/java/test/Ice/exceptions/AllTests.java +++ b/java/test/src/main/java/test/Ice/exceptions/AllTests.java @@ -438,6 +438,10 @@ public class AllTests catch(com.zeroc.Ice.ConnectionLostException ex) { } + catch(com.zeroc.Ice.UnknownLocalException ex) + { + // Expected with JS bidir server + } catch(com.zeroc.Ice.SocketException ex) { // This can be raised if the connection is closed during the client's call to write(). @@ -448,24 +452,31 @@ public class AllTests test(false); } - ThrowerPrx thrower2 = ThrowerPrx.uncheckedCast(communicator.stringToProxy("thrower:" + - app.getTestEndpoint(1))); - try - { - thrower2.throwMemoryLimitException(new byte[2 * 1024 * 1024]); // 2MB (no limits) - } - catch(com.zeroc.Ice.MemoryLimitException ex) - { - } - ThrowerPrx thrower3 = ThrowerPrx.uncheckedCast(communicator.stringToProxy("thrower:" + - app.getTestEndpoint(2))); try { - thrower3.throwMemoryLimitException(new byte[1024]); // 1KB limit - test(false); - } - catch(com.zeroc.Ice.ConnectionLostException ex) - { + ThrowerPrx thrower2 = ThrowerPrx.uncheckedCast(communicator.stringToProxy("thrower:" + + app.getTestEndpoint(1))); + try + { + thrower2.throwMemoryLimitException(new byte[2 * 1024 * 1024]); // 2MB (no limits) + } + catch(com.zeroc.Ice.MemoryLimitException ex) + { + } + ThrowerPrx thrower3 = ThrowerPrx.uncheckedCast(communicator.stringToProxy("thrower:" + + app.getTestEndpoint(2))); + try + { + thrower3.throwMemoryLimitException(new byte[1024]); // 1KB limit + test(false); + } + catch(com.zeroc.Ice.ConnectionLostException ex) + { + } + } + catch(com.zeroc.Ice.ConnectionRefusedException ex) + { + // Expected with JS bidir server } out.println("ok"); diff --git a/java/test/src/main/java/test/Ice/objects/AllTests.java b/java/test/src/main/java/test/Ice/objects/AllTests.java index c7b65fe7164..31dc2f69cea 100644 --- a/java/test/src/main/java/test/Ice/objects/AllTests.java +++ b/java/test/src/main/java/test/Ice/objects/AllTests.java @@ -27,6 +27,7 @@ import test.Ice.objects.Test.S; import test.Ice.objects.Test.Initial; import test.Ice.objects.Test.InitialPrx; import test.Ice.objects.Test.J; +import test.Ice.objects.Test.Recursive; import test.Ice.objects.Test.UnexpectedObjectExceptionTestPrx; public class AllTests @@ -241,6 +242,42 @@ public class AllTests } out.println("ok"); + out.print("testing recursive type... "); + out.flush(); + Recursive top = new Recursive(); + Recursive p = top; + int depth = 0; + try + { + for(; depth <= 20000; ++depth) + { + p.v = new Recursive(); + p = p.v; + if((depth < 10 && (depth % 10) == 0) || + (depth < 1000 && (depth % 100) == 0) || + (depth < 10000 && (depth % 1000) == 0) || + (depth % 10000) == 0) + { + initial.setRecursive(top); + } + } + test(!initial.supportsClassGraphDepthMax()); + } + catch(com.zeroc.Ice.UnknownLocalException ex) + { + // Expected marshal exception from the server (max class graph depth reached) + } + catch(com.zeroc.Ice.UnknownException ex) + { + // Expected stack overflow from the server (Java only) + } + catch(java.lang.StackOverflowError ex) + { + // Stack overflow while writing instances + } + initial.setRecursive(new Recursive()); + out.println("ok"); + out.print("testing compact ID..."); out.flush(); try diff --git a/java/test/src/main/java/test/Ice/objects/Collocated.java b/java/test/src/main/java/test/Ice/objects/Collocated.java index 44ca644bf4d..ffb62ec24e4 100644 --- a/java/test/src/main/java/test/Ice/objects/Collocated.java +++ b/java/test/src/main/java/test/Ice/objects/Collocated.java @@ -108,6 +108,7 @@ public class Collocated extends test.Util.Application { com.zeroc.Ice.InitializationData initData = super.getInitData(args, rArgs); initData.properties.setProperty("Ice.Package.Test", "test.Ice.objects"); + initData.properties.setProperty("Ice.Warn.Dispatch", "0"); return initData; } diff --git a/java/test/src/main/java/test/Ice/objects/InitialI.java b/java/test/src/main/java/test/Ice/objects/InitialI.java index 8b0876bc4c6..fe879cf5276 100644 --- a/java/test/src/main/java/test/Ice/objects/InitialI.java +++ b/java/test/src/main/java/test/Ice/objects/InitialI.java @@ -106,6 +106,17 @@ public final class InitialI implements Initial } @Override + public void setRecursive(Recursive r, com.zeroc.Ice.Current current) + { + } + + @Override + public boolean supportsClassGraphDepthMax(com.zeroc.Ice.Current current) + { + return false; + } + + @Override public com.zeroc.Ice.Value getI(com.zeroc.Ice.Current current) { return new II(); diff --git a/java/test/src/main/java/test/Ice/objects/Server.java b/java/test/src/main/java/test/Ice/objects/Server.java index f6989af992b..d8e051a0592 100644 --- a/java/test/src/main/java/test/Ice/objects/Server.java +++ b/java/test/src/main/java/test/Ice/objects/Server.java @@ -58,6 +58,7 @@ public class Server extends test.Util.Application { com.zeroc.Ice.InitializationData initData = super.getInitData(args, rArgs); initData.properties.setProperty("Ice.Package.Test", "test.Ice.objects"); + initData.properties.setProperty("Ice.Warn.Dispatch", "0"); initData.properties.setProperty("TestAdapter.Endpoints", getTestEndpoint(initData.properties, 0)); return initData; } diff --git a/java/test/src/main/java/test/Ice/objects/Test.ice b/java/test/src/main/java/test/Ice/objects/Test.ice index c9b3b592b26..173d3e50d97 100644 --- a/java/test/src/main/java/test/Ice/objects/Test.ice +++ b/java/test/src/main/java/test/Ice/objects/Test.ice @@ -163,6 +163,11 @@ exception EDerived extends EBase A1 a4; }; +class Recursive +{ + Recursive v; +}; + interface Initial { void shutdown(); @@ -173,6 +178,9 @@ interface Initial E getE(); F getF(); + void setRecursive(Recursive p); + bool supportsClassGraphDepthMax(); + ["marshaled-result"] B getMB(); ["amd", "marshaled-result"] B getAMDMB(); |