Merge jdk9-b37
authorduke
Wed, 05 Jul 2017 20:05:30 +0200
changeset 27236 b409bc51bc23
parent 27235 b666d0408ad6 (diff)
parent 27131 f177f171a952 (current diff)
child 27237 c6b4f475b842
child 27238 57b4b3f6ca26
child 27239 12771c65e334
child 27243 f1815fd7bfed
child 27254 d1b3c60bb3f1
child 27257 c13e766267ca
child 27258 e66ef2eba095
child 27303 97d38ac57757
child 27305 cc4954ff0692
child 27306 cfb08ee17d57
child 27310 1cc6cdd84786
child 27311 8f2d46041f72
child 27314 e47d7d1e7897
child 27316 952159eaf30b
child 27317 a497a919b562
Merge
--- a/.hgtags-top-repo	Wed Jul 05 20:04:47 2017 +0200
+++ b/.hgtags-top-repo	Wed Jul 05 20:05:30 2017 +0200
@@ -278,3 +278,4 @@
 e4ba01b726e263953ae129be37c94de6ed145b1d jdk9-b33
 087b23f35631e68e950496a36fce8ccca612966a jdk9-b34
 c173ba994245380fb11ef077d1e59823386840eb jdk9-b35
+201d4e235d597a25a2d3ee1404394789ba386119 jdk9-b36
--- a/common/autoconf/generated-configure.sh	Wed Jul 05 20:04:47 2017 +0200
+++ b/common/autoconf/generated-configure.sh	Wed Jul 05 20:05:30 2017 +0200
@@ -4328,7 +4328,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1412599039
+DATE_WHEN_GENERATED=1413533532
 
 ###############################################################################
 #
@@ -20119,7 +20119,7 @@
     if test "x$USER_RELEASE_SUFFIX" = x; then
       BUILD_DATE=`date '+%Y_%m_%d_%H_%M'`
       # Avoid [:alnum:] since it depends on the locale.
-      CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'`
+      CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'`
       USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
     fi
   fi
--- a/common/autoconf/jdk-options.m4	Wed Jul 05 20:04:47 2017 +0200
+++ b/common/autoconf/jdk-options.m4	Wed Jul 05 20:05:30 2017 +0200
@@ -528,7 +528,7 @@
     if test "x$USER_RELEASE_SUFFIX" = x; then
       BUILD_DATE=`date '+%Y_%m_%d_%H_%M'`
       # Avoid [:alnum:] since it depends on the locale.
-      CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'`
+      CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'`
       USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
     fi
   fi
--- a/common/bin/compare_exceptions.sh.incl	Wed Jul 05 20:04:47 2017 +0200
+++ b/common/bin/compare_exceptions.sh.incl	Wed Jul 05 20:05:30 2017 +0200
@@ -71,7 +71,6 @@
 ./jre/lib/i386/libverify.so
 ./jre/lib/i386/server/libjvm.so
 ./bin/appletviewer
-./bin/extcheck
 ./bin/idlj
 ./bin/jar
 ./bin/jarsigner
@@ -159,7 +158,6 @@
 ./jre/lib/amd64/server/libjsig.so
 ./jre/lib/amd64/server/libjvm.so
 ./bin/appletviewer
-./bin/extcheck
 ./bin/idlj
 ./bin/jar
 ./bin/jarsigner
@@ -302,7 +300,6 @@
 ./jre/lib/i386/server/libjvm_db.so
 ./jre/lib/i386/server/libjvm_dtrace.so
 ./bin/appletviewer
-./bin/extcheck
 ./bin/idlj
 ./bin/jar
 ./bin/jarsigner
@@ -443,7 +440,6 @@
 ./jre/lib/amd64/server/libjvm_db.so
 ./jre/lib/amd64/server/libjvm_dtrace.so
 ./bin/amd64/appletviewer
-./bin/amd64/extcheck
 ./bin/amd64/idlj
 ./bin/amd64/jar
 ./bin/amd64/jarsigner
@@ -601,7 +597,6 @@
 ./jre/plugin/sparc/ns7/libjavaplugin_oji.so
 ./jre/lib/sparc/server/libjvm.so
 ./bin/appletviewer
-./bin/extcheck
 ./bin/idlj
 ./bin/jar
 ./bin/jarsigner
@@ -747,7 +742,6 @@
 ./jre/lib/sparcv9/libzip.so
 ./jre/lib/sparcv9/server/libjvm.so
 ./bin/sparcv9/appletviewer
-./bin/sparcv9/extcheck
 ./bin/sparcv9/idlj
 ./bin/sparcv9/jar
 ./bin/sparcv9/jarsigner
@@ -827,7 +821,6 @@
 ./jre/bin/jsoundds.dll
 ./jre/bin/server/jvm.dll
 ./bin/appletviewer.exe
-./bin/extcheck.exe
 ./bin/idlj.exe
 ./bin/jar.exe
 ./bin/jarsigner.exe
@@ -924,7 +917,6 @@
 
 ACCEPTED_BIN_DIFF="
 ./bin/appletviewer
-./bin/extcheck
 ./bin/idlj
 ./bin/jar
 ./bin/jarsigner
--- a/common/bin/unshuffle_list.txt	Wed Jul 05 20:04:47 2017 +0200
+++ b/common/bin/unshuffle_list.txt	Wed Jul 05 20:05:30 2017 +0200
@@ -1300,7 +1300,6 @@
 jdk/src/jdk.deploy.osx/macosx/native/libosx/JavaAppLauncher.m : jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m
 jdk/src/jdk.deploy.osx/macosx/native/libosx/KeystoreImpl.m : jdk/src/macosx/native/apple/security/KeystoreImpl.m
 jdk/src/jdk.dev/share/classes/com/sun/jarsigner : jdk/src/share/classes/com/sun/jarsigner
-jdk/src/jdk.dev/share/classes/com/sun/tools/extcheck : jdk/src/share/classes/com/sun/tools/extcheck
 jdk/src/jdk.dev/share/classes/com/sun/tools/hat : jdk/src/share/classes/com/sun/tools/hat
 jdk/src/jdk.dev/share/classes/com/sun/tools/script/shell : jdk/src/share/classes/com/sun/tools/script/shell
 jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner : jdk/src/share/classes/sun/security/tools/jarsigner
--- a/corba/.hgtags	Wed Jul 05 20:04:47 2017 +0200
+++ b/corba/.hgtags	Wed Jul 05 20:05:30 2017 +0200
@@ -278,3 +278,4 @@
 cfdac5887952c2dd73c73a1d8d9aa880d0539bbf jdk9-b33
 24a0bad5910f775bb4002d1dacf8b3af87c63cd8 jdk9-b34
 9bc2dbd3dfb8c9fa88e00056b8b93a81ee6d306e jdk9-b35
+ffd90c81d4ef9d94d880fc852e2fc482ecd9b374 jdk9-b36
--- a/hotspot/.hgtags	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/.hgtags	Wed Jul 05 20:05:30 2017 +0200
@@ -438,3 +438,4 @@
 9b3f5e4f33725f7c1d9b8e523133fe8383a54d9f jdk9-b33
 821164b0131a47ca065697c7d27d8f215e608c8d jdk9-b34
 438cb613151c4bd290bb732697517cba1cafcb04 jdk9-b35
+464ab653fbb17eb518d8ef60f8df301de7ef00d0 jdk9-b36
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ObjectMonitor.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ObjectMonitor.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,8 +50,8 @@
     ownerFieldOffset = f.getOffset();
     f = type.getField("FreeNext");
     FreeNextFieldOffset = f.getOffset();
-    countField  = type.getCIntegerField("_count");
-    waitersField = type.getCIntegerField("_waiters");
+    countField  = type.getJIntField("_count");
+    waitersField = type.getJIntField("_waiters");
     recursionsField = type.getCIntegerField("_recursions");
   }
 
@@ -81,15 +81,15 @@
   // FIXME
   //  void      set_owner(void* owner);
 
-  public long    waiters() { return waitersField.getValue(addr); }
+  public int    waiters() { return waitersField.getValue(addr); }
 
   public Address freeNext() { return addr.getAddressAt(FreeNextFieldOffset); }
   // FIXME
   //  void      set_queue(void* owner);
 
-  public long count() { return countField.getValue(addr); }
+  public int count() { return countField.getValue(addr); }
   // FIXME
-  //  void      set_count(intptr_t count);
+  //  void      set_count(int count);
 
   public long recursions() { return recursionsField.getValue(addr); }
 
@@ -97,18 +97,9 @@
     return addr.getOopHandleAt(objectFieldOffset);
   }
 
-  public long contentions() {
-      // refer to objectMonitor_xxx.inline.hpp - contentions definition.
-      // for Solaris and Linux, contentions is same as count. for Windows
-      // it is different (objectMonitor_win32.inline.hpp)
-      long count = count();
-      if (VM.getVM().getOS().equals("win32")) {
-          // don't count the owner of the monitor
-          return count > 0? count - 1 : 0;
-      } else {
-          // Solaris and Linux
-          return count;
-      }
+  // contentions is always equal to count
+  public int contentions() {
+      return count();
   }
 
   // FIXME
@@ -123,8 +114,8 @@
   private static long          objectFieldOffset;
   private static long          ownerFieldOffset;
   private static long          FreeNextFieldOffset;
-  private static CIntegerField countField;
-  private static CIntegerField waitersField;
+  private static JIntField     countField;
+  private static JIntField     waitersField;
   private static CIntegerField recursionsField;
   // FIXME: expose platform-dependent stuff
 }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,9 +48,17 @@
       blockListField = type.getAddressField("gBlockList");
       gBlockListAddr = blockListField.getValue();
       blockSize = db.lookupIntConstant("ObjectSynchronizer::_BLOCKSIZE").intValue();
+      defaultCacheLineSize = db.lookupIntConstant("DEFAULT_CACHE_LINE_SIZE").intValue();
     } catch (RuntimeException e) { }
     type = db.lookupType("ObjectMonitor");
     objectMonitorTypeSize = type.getSize();
+    if ((objectMonitorTypeSize % defaultCacheLineSize) != 0) {
+      // sizeof(ObjectMonitor) is not already a multiple of a cache line.
+      // The ObjectMonitor allocation code in ObjectSynchronizer pads each
+      // ObjectMonitor in a block to the next cache line boundary.
+      int needLines = ((int)objectMonitorTypeSize / defaultCacheLineSize) + 1;
+      objectMonitorTypeSize = needLines * defaultCacheLineSize;
+    }
   }
 
   public long identityHashValueFor(Oop obj) {
@@ -122,6 +130,7 @@
 
   private static Address gBlockListAddr;
   private static int blockSize;
+  private static int defaultCacheLineSize;
   private static long objectMonitorTypeSize;
 
 }
--- a/hotspot/make/aix/makefiles/mapfile-vers-debug	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/make/aix/makefiles/mapfile-vers-debug	Wed Jul 05 20:05:30 2017 +0200
@@ -32,23 +32,12 @@
                 JNI_GetDefaultJavaVMInitArgs;
 
                 # JVM
-                JVM_Accept;
                 JVM_ActiveProcessorCount;
-                JVM_AllocateNewArray;
-                JVM_AllocateNewObject;
                 JVM_ArrayCopy;
                 JVM_AssertionStatusDirectives;
-                JVM_Available;
-                JVM_Bind;
                 JVM_ClassDepth;
                 JVM_ClassLoaderDepth;
                 JVM_Clone;
-                JVM_Close;
-                JVM_CX8Field;
-                JVM_CompileClass;
-                JVM_CompileClasses;
-                JVM_CompilerCommand;
-                JVM_Connect;
                 JVM_ConstantPoolGetClassAt;
                 JVM_ConstantPoolGetClassAtIfLoaded;
                 JVM_ConstantPoolGetDoubleAt;
@@ -72,7 +61,6 @@
                 JVM_DefineClassWithSource;
                 JVM_DefineClassWithSourceCond;
                 JVM_DesiredAssertionStatus;
-                JVM_DisableCompiler;
                 JVM_DoPrivileged;
                 JVM_DTraceGetVersion;
                 JVM_DTraceActivate;
@@ -81,8 +69,6 @@
                 JVM_DTraceDispose;
                 JVM_DumpAllStacks;
                 JVM_DumpThreads;
-                JVM_EnableCompiler;
-                JVM_Exit;
                 JVM_FillInStackTrace;
                 JVM_FindClassFromCaller;
                 JVM_FindClassFromClass;
@@ -128,16 +114,11 @@
                 JVM_GetDeclaredClasses;
                 JVM_GetDeclaringClass;
                 JVM_GetEnclosingMethodInfo;
-                JVM_GetFieldAnnotations;
                 JVM_GetFieldIxModifiers;
                 JVM_GetFieldTypeAnnotations;
-                JVM_GetHostName;
                 JVM_GetInheritedAccessControlContext;
                 JVM_GetInterfaceVersion;
-                JVM_GetLastErrorString;
                 JVM_GetManagement;
-                JVM_GetMethodAnnotations;
-                JVM_GetMethodDefaultAnnotationValue;
                 JVM_GetMethodIxArgsSize;
                 JVM_GetMethodIxByteCode;
                 JVM_GetMethodIxByteCodeLength;
@@ -150,29 +131,22 @@
                 JVM_GetMethodIxModifiers;
                 JVM_GetMethodIxNameUTF;
                 JVM_GetMethodIxSignatureUTF;
-                JVM_GetMethodParameterAnnotations;
                 JVM_GetMethodParameters;
                 JVM_GetMethodTypeAnnotations;
                 JVM_GetPrimitiveArrayElement;
                 JVM_GetProtectionDomain;
-                JVM_GetSockName;
-                JVM_GetSockOpt;
                 JVM_GetStackAccessControlContext;
                 JVM_GetStackTraceDepth;
                 JVM_GetStackTraceElement;
                 JVM_GetSystemPackage;
                 JVM_GetSystemPackages;
                 JVM_GetTemporaryDirectory;
-                JVM_GetThreadStateNames;
-                JVM_GetThreadStateValues;
                 JVM_GetVersionInfo;
                 JVM_Halt;
                 JVM_HoldsLock;
                 JVM_IHashCode;
                 JVM_InitAgentProperties;
                 JVM_InitProperties;
-                JVM_InitializeCompiler;
-                JVM_InitializeSocketLibrary;
                 JVM_InternString;
                 JVM_Interrupt;
                 JVM_InvokeMethod;
@@ -180,18 +154,13 @@
                 JVM_IsConstructorIx;
                 JVM_IsInterface;
                 JVM_IsInterrupted;
-                JVM_IsNaN;
                 JVM_IsPrimitiveClass;
                 JVM_IsSameClassPackage;
-                JVM_IsSilentCompiler;
                 JVM_IsSupportedJNIVersion;
                 JVM_IsThreadAlive;
                 JVM_IsVMGeneratedMethodIx;
                 JVM_LatestUserDefinedLoader;
-                JVM_Listen;
-                JVM_LoadClass0;
                 JVM_LoadLibrary;
-                JVM_Lseek;
                 JVM_MaxObjectInspectionAge;
                 JVM_MaxMemory;
                 JVM_MonitorNotify;
@@ -202,46 +171,27 @@
                 JVM_NewArray;
                 JVM_NewInstanceFromConstructor;
                 JVM_NewMultiArray;
-                JVM_OnExit;
-                JVM_Open;
                 JVM_RaiseSignal;
                 JVM_RawMonitorCreate;
                 JVM_RawMonitorDestroy;
                 JVM_RawMonitorEnter;
                 JVM_RawMonitorExit;
-                JVM_Read;
-                JVM_Recv;
-                JVM_RecvFrom;
                 JVM_RegisterSignal;
                 JVM_ReleaseUTF;
-                JVM_ResolveClass;
                 JVM_ResumeThread;
-                JVM_Send;
-                JVM_SendTo;
                 JVM_SetArrayElement;
                 JVM_SetClassSigners;
-                JVM_SetLength;
                 JVM_SetNativeThreadName;
                 JVM_SetPrimitiveArrayElement;
                 JVM_SetProtectionDomain;
-                JVM_SetSockOpt;
                 JVM_SetThreadPriority;
                 JVM_Sleep;
-                JVM_Socket;
-                JVM_SocketAvailable;
-                JVM_SocketClose;
-                JVM_SocketShutdown;
                 JVM_StartThread;
                 JVM_StopThread;
                 JVM_SuspendThread;
                 JVM_SupportsCX8;
-                JVM_Sync;
-                JVM_Timeout;
                 JVM_TotalMemory;
-                JVM_TraceInstructions;
-                JVM_TraceMethodCalls;
                 JVM_UnloadLibrary;
-                JVM_Write;
                 JVM_Yield;
                 JVM_handle_linux_signal;
 
--- a/hotspot/make/aix/makefiles/mapfile-vers-product	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/make/aix/makefiles/mapfile-vers-product	Wed Jul 05 20:05:30 2017 +0200
@@ -32,23 +32,12 @@
                 JNI_GetDefaultJavaVMInitArgs;
 
                 # JVM
-                JVM_Accept;
                 JVM_ActiveProcessorCount;
-                JVM_AllocateNewArray;
-                JVM_AllocateNewObject;
                 JVM_ArrayCopy;
                 JVM_AssertionStatusDirectives;
-                JVM_Available;
-                JVM_Bind;
                 JVM_ClassDepth;
                 JVM_ClassLoaderDepth;
                 JVM_Clone;
-                JVM_Close;
-                JVM_CX8Field;
-                JVM_CompileClass;
-                JVM_CompileClasses;
-                JVM_CompilerCommand;
-                JVM_Connect;
                 JVM_ConstantPoolGetClassAt;
                 JVM_ConstantPoolGetClassAtIfLoaded;
                 JVM_ConstantPoolGetDoubleAt;
@@ -72,7 +61,6 @@
                 JVM_DefineClassWithSource;
                 JVM_DefineClassWithSourceCond;
                 JVM_DesiredAssertionStatus;
-                JVM_DisableCompiler;
                 JVM_DoPrivileged;
                 JVM_DTraceGetVersion;
                 JVM_DTraceActivate;
@@ -81,8 +69,6 @@
                 JVM_DTraceDispose;
                 JVM_DumpAllStacks;
                 JVM_DumpThreads;
-                JVM_EnableCompiler;
-                JVM_Exit;
                 JVM_FillInStackTrace;
                 JVM_FindClassFromCaller;
                 JVM_FindClassFromClass;
@@ -128,15 +114,10 @@
                 JVM_GetDeclaredClasses;
                 JVM_GetDeclaringClass;
                 JVM_GetEnclosingMethodInfo;
-                JVM_GetFieldAnnotations;
                 JVM_GetFieldIxModifiers;
-                JVM_GetHostName;
                 JVM_GetInheritedAccessControlContext;
                 JVM_GetInterfaceVersion;
-                JVM_GetLastErrorString;
                 JVM_GetManagement;
-                JVM_GetMethodAnnotations;
-                JVM_GetMethodDefaultAnnotationValue;
                 JVM_GetMethodIxArgsSize;
                 JVM_GetMethodIxByteCode;
                 JVM_GetMethodIxByteCodeLength;
@@ -149,28 +130,21 @@
                 JVM_GetMethodIxModifiers;
                 JVM_GetMethodIxNameUTF;
                 JVM_GetMethodIxSignatureUTF;
-                JVM_GetMethodParameterAnnotations;
                 JVM_GetMethodParameters;
                 JVM_GetPrimitiveArrayElement;
                 JVM_GetProtectionDomain;
-                JVM_GetSockName;
-                JVM_GetSockOpt;
                 JVM_GetStackAccessControlContext;
                 JVM_GetStackTraceDepth;
                 JVM_GetStackTraceElement;
                 JVM_GetSystemPackage;
                 JVM_GetSystemPackages;
                 JVM_GetTemporaryDirectory;
-                JVM_GetThreadStateNames;
-                JVM_GetThreadStateValues;
                 JVM_GetVersionInfo;
                 JVM_Halt;
                 JVM_HoldsLock;
                 JVM_IHashCode;
                 JVM_InitAgentProperties;
                 JVM_InitProperties;
-                JVM_InitializeCompiler;
-                JVM_InitializeSocketLibrary;
                 JVM_InternString;
                 JVM_Interrupt;
                 JVM_InvokeMethod;
@@ -178,18 +152,13 @@
                 JVM_IsConstructorIx;
                 JVM_IsInterface;
                 JVM_IsInterrupted;
-                JVM_IsNaN;
                 JVM_IsPrimitiveClass;
                 JVM_IsSameClassPackage;
-                JVM_IsSilentCompiler;
                 JVM_IsSupportedJNIVersion;
                 JVM_IsThreadAlive;
                 JVM_IsVMGeneratedMethodIx;
                 JVM_LatestUserDefinedLoader;
-                JVM_Listen;
-                JVM_LoadClass0;
                 JVM_LoadLibrary;
-                JVM_Lseek;
                 JVM_MaxObjectInspectionAge;
                 JVM_MaxMemory;
                 JVM_MonitorNotify;
@@ -200,46 +169,27 @@
                 JVM_NewArray;
                 JVM_NewInstanceFromConstructor;
                 JVM_NewMultiArray;
-                JVM_OnExit;
-                JVM_Open;
                 JVM_RaiseSignal;
                 JVM_RawMonitorCreate;
                 JVM_RawMonitorDestroy;
                 JVM_RawMonitorEnter;
                 JVM_RawMonitorExit;
-                JVM_Read;
-                JVM_Recv;
-                JVM_RecvFrom;
                 JVM_RegisterSignal;
                 JVM_ReleaseUTF;
-                JVM_ResolveClass;
                 JVM_ResumeThread;
-                JVM_Send;
-                JVM_SendTo;
                 JVM_SetArrayElement;
                 JVM_SetClassSigners;
-                JVM_SetLength;
                 JVM_SetNativeThreadName;
                 JVM_SetPrimitiveArrayElement;
                 JVM_SetProtectionDomain;
-                JVM_SetSockOpt;
                 JVM_SetThreadPriority;
                 JVM_Sleep;
-                JVM_Socket;
-                JVM_SocketAvailable;
-                JVM_SocketClose;
-                JVM_SocketShutdown;
                 JVM_StartThread;
                 JVM_StopThread;
                 JVM_SuspendThread;
                 JVM_SupportsCX8;
-                JVM_Sync;
-                JVM_Timeout;
                 JVM_TotalMemory;
-                JVM_TraceInstructions;
-                JVM_TraceMethodCalls;
                 JVM_UnloadLibrary;
-                JVM_Write;
                 JVM_Yield;
                 JVM_handle_linux_signal;
 
--- a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug	Wed Jul 05 20:05:30 2017 +0200
@@ -30,23 +30,12 @@
                 _JNI_GetDefaultJavaVMInitArgs
 
                 # _JVM
-                _JVM_Accept
                 _JVM_ActiveProcessorCount
-                _JVM_AllocateNewArray
-                _JVM_AllocateNewObject
                 _JVM_ArrayCopy
                 _JVM_AssertionStatusDirectives
-                _JVM_Available
-                _JVM_Bind
                 _JVM_ClassDepth
                 _JVM_ClassLoaderDepth
                 _JVM_Clone
-                _JVM_Close
-                _JVM_CX8Field
-                _JVM_CompileClass
-                _JVM_CompileClasses
-                _JVM_CompilerCommand
-                _JVM_Connect
                 _JVM_ConstantPoolGetClassAt
                 _JVM_ConstantPoolGetClassAtIfLoaded
                 _JVM_ConstantPoolGetDoubleAt
@@ -70,7 +59,6 @@
                 _JVM_DefineClassWithSource
                 _JVM_DefineClassWithSourceCond
                 _JVM_DesiredAssertionStatus
-                _JVM_DisableCompiler
                 _JVM_DoPrivileged
                 _JVM_DTraceGetVersion
                 _JVM_DTraceActivate
@@ -79,8 +67,6 @@
                 _JVM_DTraceDispose
                 _JVM_DumpAllStacks
                 _JVM_DumpThreads
-                _JVM_EnableCompiler
-                _JVM_Exit
                 _JVM_FillInStackTrace
                 _JVM_FindClassFromCaller
                 _JVM_FindClassFromClass
@@ -126,16 +112,11 @@
                 _JVM_GetDeclaredClasses
                 _JVM_GetDeclaringClass
                 _JVM_GetEnclosingMethodInfo
-                _JVM_GetFieldAnnotations
                 _JVM_GetFieldIxModifiers
                 _JVM_GetFieldTypeAnnotations
-                _JVM_GetHostName
                 _JVM_GetInheritedAccessControlContext
                 _JVM_GetInterfaceVersion
-                _JVM_GetLastErrorString
                 _JVM_GetManagement
-                _JVM_GetMethodAnnotations
-                _JVM_GetMethodDefaultAnnotationValue
                 _JVM_GetMethodIxArgsSize
                 _JVM_GetMethodIxByteCode
                 _JVM_GetMethodIxByteCodeLength
@@ -148,29 +129,22 @@
                 _JVM_GetMethodIxModifiers
                 _JVM_GetMethodIxNameUTF
                 _JVM_GetMethodIxSignatureUTF
-                _JVM_GetMethodParameterAnnotations
                 _JVM_GetMethodParameters
                 _JVM_GetMethodTypeAnnotations
                 _JVM_GetPrimitiveArrayElement
                 _JVM_GetProtectionDomain
-                _JVM_GetSockName
-                _JVM_GetSockOpt
                 _JVM_GetStackAccessControlContext
                 _JVM_GetStackTraceDepth
                 _JVM_GetStackTraceElement
                 _JVM_GetSystemPackage
                 _JVM_GetSystemPackages
                 _JVM_GetTemporaryDirectory
-                _JVM_GetThreadStateNames
-                _JVM_GetThreadStateValues
                 _JVM_GetVersionInfo
                 _JVM_Halt
                 _JVM_HoldsLock
                 _JVM_IHashCode
                 _JVM_InitAgentProperties
                 _JVM_InitProperties
-                _JVM_InitializeCompiler
-                _JVM_InitializeSocketLibrary
                 _JVM_InternString
                 _JVM_Interrupt
                 _JVM_InvokeMethod
@@ -178,18 +152,13 @@
                 _JVM_IsConstructorIx
                 _JVM_IsInterface
                 _JVM_IsInterrupted
-                _JVM_IsNaN
                 _JVM_IsPrimitiveClass
                 _JVM_IsSameClassPackage
-                _JVM_IsSilentCompiler
                 _JVM_IsSupportedJNIVersion
                 _JVM_IsThreadAlive
                 _JVM_IsVMGeneratedMethodIx
                 _JVM_LatestUserDefinedLoader
-                _JVM_Listen
-                _JVM_LoadClass0
                 _JVM_LoadLibrary
-                _JVM_Lseek
                 _JVM_MaxObjectInspectionAge
                 _JVM_MaxMemory
                 _JVM_MonitorNotify
@@ -200,45 +169,26 @@
                 _JVM_NewArray
                 _JVM_NewInstanceFromConstructor
                 _JVM_NewMultiArray
-                _JVM_OnExit
-                _JVM_Open
                 _JVM_RaiseSignal
                 _JVM_RawMonitorCreate
                 _JVM_RawMonitorDestroy
                 _JVM_RawMonitorEnter
                 _JVM_RawMonitorExit
-                _JVM_Read
-                _JVM_Recv
-                _JVM_RecvFrom
                 _JVM_RegisterSignal
                 _JVM_ReleaseUTF
-                _JVM_ResolveClass
                 _JVM_ResumeThread
-                _JVM_Send
-                _JVM_SendTo
                 _JVM_SetArrayElement
                 _JVM_SetClassSigners
-                _JVM_SetLength
                 _JVM_SetNativeThreadName
                 _JVM_SetPrimitiveArrayElement
-                _JVM_SetSockOpt
                 _JVM_SetThreadPriority
                 _JVM_Sleep
-                _JVM_Socket
-                _JVM_SocketAvailable
-                _JVM_SocketClose
-                _JVM_SocketShutdown
                 _JVM_StartThread
                 _JVM_StopThread
                 _JVM_SuspendThread
                 _JVM_SupportsCX8
-                _JVM_Sync
-                _JVM_Timeout
                 _JVM_TotalMemory
-                _JVM_TraceInstructions
-                _JVM_TraceMethodCalls
                 _JVM_UnloadLibrary
-                _JVM_Write
                 _JVM_Yield
                 _JVM_handle_bsd_signal
 
--- a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product	Wed Jul 05 20:05:30 2017 +0200
@@ -30,23 +30,12 @@
                 _JNI_GetDefaultJavaVMInitArgs
 
                 # _JVM
-                _JVM_Accept
                 _JVM_ActiveProcessorCount
-                _JVM_AllocateNewArray
-                _JVM_AllocateNewObject
                 _JVM_ArrayCopy
                 _JVM_AssertionStatusDirectives
-                _JVM_Available
-                _JVM_Bind
                 _JVM_ClassDepth
                 _JVM_ClassLoaderDepth
                 _JVM_Clone
-                _JVM_Close
-                _JVM_CX8Field
-                _JVM_CompileClass
-                _JVM_CompileClasses
-                _JVM_CompilerCommand
-                _JVM_Connect
                 _JVM_ConstantPoolGetClassAt
                 _JVM_ConstantPoolGetClassAtIfLoaded
                 _JVM_ConstantPoolGetDoubleAt
@@ -70,7 +59,6 @@
                 _JVM_DefineClassWithSource
                 _JVM_DefineClassWithSourceCond
                 _JVM_DesiredAssertionStatus
-                _JVM_DisableCompiler
                 _JVM_DoPrivileged
                 _JVM_DTraceGetVersion
                 _JVM_DTraceActivate
@@ -79,8 +67,6 @@
                 _JVM_DTraceDispose
                 _JVM_DumpAllStacks
                 _JVM_DumpThreads
-                _JVM_EnableCompiler
-                _JVM_Exit
                 _JVM_FillInStackTrace
                 _JVM_FindClassFromCaller
                 _JVM_FindClassFromClass
@@ -126,16 +112,11 @@
                 _JVM_GetDeclaredClasses
                 _JVM_GetDeclaringClass
                 _JVM_GetEnclosingMethodInfo
-                _JVM_GetFieldAnnotations
                 _JVM_GetFieldIxModifiers
                 _JVM_GetFieldTypeAnnotations
-                _JVM_GetHostName
                 _JVM_GetInheritedAccessControlContext
                 _JVM_GetInterfaceVersion
-                _JVM_GetLastErrorString
                 _JVM_GetManagement
-                _JVM_GetMethodAnnotations
-                _JVM_GetMethodDefaultAnnotationValue
                 _JVM_GetMethodIxArgsSize
                 _JVM_GetMethodIxByteCode
                 _JVM_GetMethodIxByteCodeLength
@@ -148,29 +129,22 @@
                 _JVM_GetMethodIxModifiers
                 _JVM_GetMethodIxNameUTF
                 _JVM_GetMethodIxSignatureUTF
-                _JVM_GetMethodParameterAnnotations
                 _JVM_GetMethodParameters
                 _JVM_GetMethodTypeAnnotations
                 _JVM_GetPrimitiveArrayElement
                 _JVM_GetProtectionDomain
-                _JVM_GetSockName
-                _JVM_GetSockOpt
                 _JVM_GetStackAccessControlContext
                 _JVM_GetStackTraceDepth
                 _JVM_GetStackTraceElement
                 _JVM_GetSystemPackage
                 _JVM_GetSystemPackages
                 _JVM_GetTemporaryDirectory
-                _JVM_GetThreadStateNames
-                _JVM_GetThreadStateValues
                 _JVM_GetVersionInfo
                 _JVM_Halt
                 _JVM_HoldsLock
                 _JVM_IHashCode
                 _JVM_InitAgentProperties
                 _JVM_InitProperties
-                _JVM_InitializeCompiler
-                _JVM_InitializeSocketLibrary
                 _JVM_InternString
                 _JVM_Interrupt
                 _JVM_InvokeMethod
@@ -178,18 +152,13 @@
                 _JVM_IsConstructorIx
                 _JVM_IsInterface
                 _JVM_IsInterrupted
-                _JVM_IsNaN
                 _JVM_IsPrimitiveClass
                 _JVM_IsSameClassPackage
-                _JVM_IsSilentCompiler
                 _JVM_IsSupportedJNIVersion
                 _JVM_IsThreadAlive
                 _JVM_IsVMGeneratedMethodIx
                 _JVM_LatestUserDefinedLoader
-                _JVM_Listen
-                _JVM_LoadClass0
                 _JVM_LoadLibrary
-                _JVM_Lseek
                 _JVM_MaxObjectInspectionAge
                 _JVM_MaxMemory
                 _JVM_MonitorNotify
@@ -200,45 +169,26 @@
                 _JVM_NewArray
                 _JVM_NewInstanceFromConstructor
                 _JVM_NewMultiArray
-                _JVM_OnExit
-                _JVM_Open
                 _JVM_RaiseSignal
                 _JVM_RawMonitorCreate
                 _JVM_RawMonitorDestroy
                 _JVM_RawMonitorEnter
                 _JVM_RawMonitorExit
-                _JVM_Read
-                _JVM_Recv
-                _JVM_RecvFrom
                 _JVM_RegisterSignal
                 _JVM_ReleaseUTF
-                _JVM_ResolveClass
                 _JVM_ResumeThread
-                _JVM_Send
-                _JVM_SendTo
                 _JVM_SetArrayElement
                 _JVM_SetClassSigners
-                _JVM_SetLength
                 _JVM_SetNativeThreadName
                 _JVM_SetPrimitiveArrayElement
-                _JVM_SetSockOpt
                 _JVM_SetThreadPriority
                 _JVM_Sleep
-                _JVM_Socket
-                _JVM_SocketAvailable
-                _JVM_SocketClose
-                _JVM_SocketShutdown
                 _JVM_StartThread
                 _JVM_StopThread
                 _JVM_SuspendThread
                 _JVM_SupportsCX8
-                _JVM_Sync
-                _JVM_Timeout
                 _JVM_TotalMemory
-                _JVM_TraceInstructions
-                _JVM_TraceMethodCalls
                 _JVM_UnloadLibrary
-                _JVM_Write
                 _JVM_Yield
                 _JVM_handle_bsd_signal
 
--- a/hotspot/make/bsd/makefiles/mapfile-vers-debug	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-debug	Wed Jul 05 20:05:30 2017 +0200
@@ -32,23 +32,12 @@
                 JNI_GetDefaultJavaVMInitArgs;
 
                 # JVM
-                JVM_Accept;
                 JVM_ActiveProcessorCount;
-                JVM_AllocateNewArray;
-                JVM_AllocateNewObject;
                 JVM_ArrayCopy;
                 JVM_AssertionStatusDirectives;
-                JVM_Available;
-                JVM_Bind;
                 JVM_ClassDepth;
                 JVM_ClassLoaderDepth;
                 JVM_Clone;
-                JVM_Close;
-                JVM_CX8Field;
-                JVM_CompileClass;
-                JVM_CompileClasses;
-                JVM_CompilerCommand;
-                JVM_Connect;
                 JVM_ConstantPoolGetClassAt;
                 JVM_ConstantPoolGetClassAtIfLoaded;
                 JVM_ConstantPoolGetDoubleAt;
@@ -72,7 +61,6 @@
                 JVM_DefineClassWithSource;
                 JVM_DefineClassWithSourceCond;
                 JVM_DesiredAssertionStatus;
-                JVM_DisableCompiler;
                 JVM_DoPrivileged;
                 JVM_DTraceGetVersion;
                 JVM_DTraceActivate;
@@ -81,8 +69,6 @@
                 JVM_DTraceDispose;
                 JVM_DumpAllStacks;
                 JVM_DumpThreads;
-                JVM_EnableCompiler;
-                JVM_Exit;
                 JVM_FillInStackTrace;
                 JVM_FindClassFromCaller;
                 JVM_FindClassFromClass;
@@ -128,16 +114,11 @@
                 JVM_GetDeclaredClasses;
                 JVM_GetDeclaringClass;
                 JVM_GetEnclosingMethodInfo;
-                JVM_GetFieldAnnotations;
                 JVM_GetFieldIxModifiers;
                 JVM_GetFieldTypeAnnotations;
-                JVM_GetHostName;
                 JVM_GetInheritedAccessControlContext;
                 JVM_GetInterfaceVersion;
-                JVM_GetLastErrorString;
                 JVM_GetManagement;
-                JVM_GetMethodAnnotations;
-                JVM_GetMethodDefaultAnnotationValue;
                 JVM_GetMethodIxArgsSize;
                 JVM_GetMethodIxByteCode;
                 JVM_GetMethodIxByteCodeLength;
@@ -150,29 +131,22 @@
                 JVM_GetMethodIxModifiers;
                 JVM_GetMethodIxNameUTF;
                 JVM_GetMethodIxSignatureUTF;
-                JVM_GetMethodParameterAnnotations;
                 JVM_GetMethodParameters;
                 JVM_GetMethodTypeAnnotations;
                 JVM_GetPrimitiveArrayElement;
                 JVM_GetProtectionDomain;
-                JVM_GetSockName;
-                JVM_GetSockOpt;
                 JVM_GetStackAccessControlContext;
                 JVM_GetStackTraceDepth;
                 JVM_GetStackTraceElement;
                 JVM_GetSystemPackage;
                 JVM_GetSystemPackages;
                 JVM_GetTemporaryDirectory;
-                JVM_GetThreadStateNames;
-                JVM_GetThreadStateValues;
                 JVM_GetVersionInfo;
                 JVM_Halt;
                 JVM_HoldsLock;
                 JVM_IHashCode;
                 JVM_InitAgentProperties;
                 JVM_InitProperties;
-                JVM_InitializeCompiler;
-                JVM_InitializeSocketLibrary;
                 JVM_InternString;
                 JVM_Interrupt;
                 JVM_InvokeMethod;
@@ -180,18 +154,13 @@
                 JVM_IsConstructorIx;
                 JVM_IsInterface;
                 JVM_IsInterrupted;
-                JVM_IsNaN;
                 JVM_IsPrimitiveClass;
                 JVM_IsSameClassPackage;
-                JVM_IsSilentCompiler;
                 JVM_IsSupportedJNIVersion;
                 JVM_IsThreadAlive;
                 JVM_IsVMGeneratedMethodIx;
                 JVM_LatestUserDefinedLoader;
-                JVM_Listen;
-                JVM_LoadClass0;
                 JVM_LoadLibrary;
-                JVM_Lseek;
                 JVM_MaxObjectInspectionAge;
                 JVM_MaxMemory;
                 JVM_MonitorNotify;
@@ -202,45 +171,26 @@
                 JVM_NewArray;
                 JVM_NewInstanceFromConstructor;
                 JVM_NewMultiArray;
-                JVM_OnExit;
-                JVM_Open;
                 JVM_RaiseSignal;
                 JVM_RawMonitorCreate;
                 JVM_RawMonitorDestroy;
                 JVM_RawMonitorEnter;
                 JVM_RawMonitorExit;
-                JVM_Read;
-                JVM_Recv;
-                JVM_RecvFrom;
                 JVM_RegisterSignal;
                 JVM_ReleaseUTF;
-                JVM_ResolveClass;
                 JVM_ResumeThread;
-                JVM_Send;
-                JVM_SendTo;
                 JVM_SetArrayElement;
                 JVM_SetClassSigners;
-                JVM_SetLength;
                 JVM_SetNativeThreadName;
                 JVM_SetPrimitiveArrayElement;
-                JVM_SetSockOpt;
                 JVM_SetThreadPriority;
                 JVM_Sleep;
-                JVM_Socket;
-                JVM_SocketAvailable;
-                JVM_SocketClose;
-                JVM_SocketShutdown;
                 JVM_StartThread;
                 JVM_StopThread;
                 JVM_SuspendThread;
                 JVM_SupportsCX8;
-                JVM_Sync;
-                JVM_Timeout;
                 JVM_TotalMemory;
-                JVM_TraceInstructions;
-                JVM_TraceMethodCalls;
                 JVM_UnloadLibrary;
-                JVM_Write;
                 JVM_Yield;
                 JVM_handle_linux_signal;
 
--- a/hotspot/make/bsd/makefiles/mapfile-vers-product	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-product	Wed Jul 05 20:05:30 2017 +0200
@@ -32,23 +32,12 @@
                 JNI_GetDefaultJavaVMInitArgs;
 
                 # JVM
-                JVM_Accept;
                 JVM_ActiveProcessorCount;
-                JVM_AllocateNewArray;
-                JVM_AllocateNewObject;
                 JVM_ArrayCopy;
                 JVM_AssertionStatusDirectives;
-                JVM_Available;
-                JVM_Bind;
                 JVM_ClassDepth;
                 JVM_ClassLoaderDepth;
                 JVM_Clone;
-                JVM_Close;
-                JVM_CX8Field;
-                JVM_CompileClass;
-                JVM_CompileClasses;
-                JVM_CompilerCommand;
-                JVM_Connect;
                 JVM_ConstantPoolGetClassAt;
                 JVM_ConstantPoolGetClassAtIfLoaded;
                 JVM_ConstantPoolGetDoubleAt;
@@ -72,7 +61,6 @@
                 JVM_DefineClassWithSource;
                 JVM_DefineClassWithSourceCond;
                 JVM_DesiredAssertionStatus;
-                JVM_DisableCompiler;
                 JVM_DoPrivileged;
                 JVM_DTraceGetVersion;
                 JVM_DTraceActivate;
@@ -81,8 +69,6 @@
                 JVM_DTraceDispose;
                 JVM_DumpAllStacks;
                 JVM_DumpThreads;
-                JVM_EnableCompiler;
-                JVM_Exit;
                 JVM_FillInStackTrace;
                 JVM_FindClassFromCaller;
                 JVM_FindClassFromClass;
@@ -128,16 +114,11 @@
                 JVM_GetDeclaredClasses;
                 JVM_GetDeclaringClass;
                 JVM_GetEnclosingMethodInfo;
-                JVM_GetFieldAnnotations;
                 JVM_GetFieldIxModifiers;
                 JVM_GetFieldTypeAnnotations;
-                JVM_GetHostName;
                 JVM_GetInheritedAccessControlContext;
                 JVM_GetInterfaceVersion;
-                JVM_GetLastErrorString;
                 JVM_GetManagement;
-                JVM_GetMethodAnnotations;
-                JVM_GetMethodDefaultAnnotationValue;
                 JVM_GetMethodIxArgsSize;
                 JVM_GetMethodIxByteCode;
                 JVM_GetMethodIxByteCodeLength;
@@ -150,29 +131,22 @@
                 JVM_GetMethodIxModifiers;
                 JVM_GetMethodIxNameUTF;
                 JVM_GetMethodIxSignatureUTF;
-                JVM_GetMethodParameterAnnotations;
                 JVM_GetMethodParameters;
                 JVM_GetMethodTypeAnnotations;
                 JVM_GetPrimitiveArrayElement;
                 JVM_GetProtectionDomain;
-                JVM_GetSockName;
-                JVM_GetSockOpt;
                 JVM_GetStackAccessControlContext;
                 JVM_GetStackTraceDepth;
                 JVM_GetStackTraceElement;
                 JVM_GetSystemPackage;
                 JVM_GetSystemPackages;
                 JVM_GetTemporaryDirectory;
-                JVM_GetThreadStateNames;
-                JVM_GetThreadStateValues;
                 JVM_GetVersionInfo;
                 JVM_Halt;
                 JVM_HoldsLock;
                 JVM_IHashCode;
                 JVM_InitAgentProperties;
                 JVM_InitProperties;
-                JVM_InitializeCompiler;
-                JVM_InitializeSocketLibrary;
                 JVM_InternString;
                 JVM_Interrupt;
                 JVM_InvokeMethod;
@@ -180,18 +154,13 @@
                 JVM_IsConstructorIx;
                 JVM_IsInterface;
                 JVM_IsInterrupted;
-                JVM_IsNaN;
                 JVM_IsPrimitiveClass;
                 JVM_IsSameClassPackage;
-                JVM_IsSilentCompiler;
                 JVM_IsSupportedJNIVersion;
                 JVM_IsThreadAlive;
                 JVM_IsVMGeneratedMethodIx;
                 JVM_LatestUserDefinedLoader;
-                JVM_Listen;
-                JVM_LoadClass0;
                 JVM_LoadLibrary;
-                JVM_Lseek;
                 JVM_MaxObjectInspectionAge;
                 JVM_MaxMemory;
                 JVM_MonitorNotify;
@@ -202,45 +171,26 @@
                 JVM_NewArray;
                 JVM_NewInstanceFromConstructor;
                 JVM_NewMultiArray;
-                JVM_OnExit;
-                JVM_Open;
                 JVM_RaiseSignal;
                 JVM_RawMonitorCreate;
                 JVM_RawMonitorDestroy;
                 JVM_RawMonitorEnter;
                 JVM_RawMonitorExit;
-                JVM_Read;
-                JVM_Recv;
-                JVM_RecvFrom;
                 JVM_RegisterSignal;
                 JVM_ReleaseUTF;
-                JVM_ResolveClass;
                 JVM_ResumeThread;
-                JVM_Send;
-                JVM_SendTo;
                 JVM_SetArrayElement;
                 JVM_SetClassSigners;
-                JVM_SetLength;
                 JVM_SetNativeThreadName;
                 JVM_SetPrimitiveArrayElement;
-                JVM_SetSockOpt;
                 JVM_SetThreadPriority;
                 JVM_Sleep;
-                JVM_Socket;
-                JVM_SocketAvailable;
-                JVM_SocketClose;
-                JVM_SocketShutdown;
                 JVM_StartThread;
                 JVM_StopThread;
                 JVM_SuspendThread;
                 JVM_SupportsCX8;
-                JVM_Sync;
-                JVM_Timeout;
                 JVM_TotalMemory;
-                JVM_TraceInstructions;
-                JVM_TraceMethodCalls;
                 JVM_UnloadLibrary;
-                JVM_Write;
                 JVM_Yield;
                 JVM_handle_linux_signal;
 
--- a/hotspot/make/linux/makefiles/mapfile-vers-debug	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/make/linux/makefiles/mapfile-vers-debug	Wed Jul 05 20:05:30 2017 +0200
@@ -32,23 +32,12 @@
                 JNI_GetDefaultJavaVMInitArgs;
 
                 # JVM
-                JVM_Accept;
                 JVM_ActiveProcessorCount;
-                JVM_AllocateNewArray;
-                JVM_AllocateNewObject;
                 JVM_ArrayCopy;
                 JVM_AssertionStatusDirectives;
-                JVM_Available;
-                JVM_Bind;
                 JVM_ClassDepth;
                 JVM_ClassLoaderDepth;
                 JVM_Clone;
-                JVM_Close;
-                JVM_CX8Field;
-                JVM_CompileClass;
-                JVM_CompileClasses;
-                JVM_CompilerCommand;
-                JVM_Connect;
                 JVM_ConstantPoolGetClassAt;
                 JVM_ConstantPoolGetClassAtIfLoaded;
                 JVM_ConstantPoolGetDoubleAt;
@@ -72,7 +61,6 @@
                 JVM_DefineClassWithSource;
                 JVM_DefineClassWithSourceCond;
                 JVM_DesiredAssertionStatus;
-                JVM_DisableCompiler;
                 JVM_DoPrivileged;
                 JVM_DTraceGetVersion;
                 JVM_DTraceActivate;
@@ -81,8 +69,6 @@
                 JVM_DTraceDispose;
                 JVM_DumpAllStacks;
                 JVM_DumpThreads;
-                JVM_EnableCompiler;
-                JVM_Exit;
                 JVM_FillInStackTrace;
                 JVM_FindClassFromCaller;
                 JVM_FindClassFromClass;
@@ -128,16 +114,11 @@
                 JVM_GetDeclaredClasses;
                 JVM_GetDeclaringClass;
                 JVM_GetEnclosingMethodInfo;
-                JVM_GetFieldAnnotations;
                 JVM_GetFieldIxModifiers;
                 JVM_GetFieldTypeAnnotations;
-                JVM_GetHostName;
                 JVM_GetInheritedAccessControlContext;
                 JVM_GetInterfaceVersion;
-                JVM_GetLastErrorString;
                 JVM_GetManagement;
-                JVM_GetMethodAnnotations;
-                JVM_GetMethodDefaultAnnotationValue;
                 JVM_GetMethodIxArgsSize;
                 JVM_GetMethodIxByteCode;
                 JVM_GetMethodIxByteCodeLength;
@@ -150,29 +131,22 @@
                 JVM_GetMethodIxModifiers;
                 JVM_GetMethodIxNameUTF;
                 JVM_GetMethodIxSignatureUTF;
-                JVM_GetMethodParameterAnnotations;
                 JVM_GetMethodParameters;
                 JVM_GetMethodTypeAnnotations;
                 JVM_GetPrimitiveArrayElement;
                 JVM_GetProtectionDomain;
-                JVM_GetSockName;
-                JVM_GetSockOpt;
                 JVM_GetStackAccessControlContext;
                 JVM_GetStackTraceDepth;
                 JVM_GetStackTraceElement;
                 JVM_GetSystemPackage;
                 JVM_GetSystemPackages;
                 JVM_GetTemporaryDirectory;
-                JVM_GetThreadStateNames;
-                JVM_GetThreadStateValues;
                 JVM_GetVersionInfo;
                 JVM_Halt;
                 JVM_HoldsLock;
                 JVM_IHashCode;
                 JVM_InitAgentProperties;
                 JVM_InitProperties;
-                JVM_InitializeCompiler;
-                JVM_InitializeSocketLibrary;
                 JVM_InternString;
                 JVM_Interrupt;
                 JVM_InvokeMethod;
@@ -180,18 +154,13 @@
                 JVM_IsConstructorIx;
                 JVM_IsInterface;
                 JVM_IsInterrupted;
-                JVM_IsNaN;
                 JVM_IsPrimitiveClass;
                 JVM_IsSameClassPackage;
-                JVM_IsSilentCompiler;
                 JVM_IsSupportedJNIVersion;
                 JVM_IsThreadAlive;
                 JVM_IsVMGeneratedMethodIx;
                 JVM_LatestUserDefinedLoader;
-                JVM_Listen;
-                JVM_LoadClass0;
                 JVM_LoadLibrary;
-                JVM_Lseek;
                 JVM_MaxObjectInspectionAge;
                 JVM_MaxMemory;
                 JVM_MonitorNotify;
@@ -202,45 +171,26 @@
                 JVM_NewArray;
                 JVM_NewInstanceFromConstructor;
                 JVM_NewMultiArray;
-                JVM_OnExit;
-                JVM_Open;
                 JVM_RaiseSignal;
                 JVM_RawMonitorCreate;
                 JVM_RawMonitorDestroy;
                 JVM_RawMonitorEnter;
                 JVM_RawMonitorExit;
-                JVM_Read;
-                JVM_Recv;
-                JVM_RecvFrom;
                 JVM_RegisterSignal;
                 JVM_ReleaseUTF;
-                JVM_ResolveClass;
                 JVM_ResumeThread;
-                JVM_Send;
-                JVM_SendTo;
                 JVM_SetArrayElement;
                 JVM_SetClassSigners;
-                JVM_SetLength;
                 JVM_SetNativeThreadName;
                 JVM_SetPrimitiveArrayElement;
-                JVM_SetSockOpt;
                 JVM_SetThreadPriority;
                 JVM_Sleep;
-                JVM_Socket;
-                JVM_SocketAvailable;
-                JVM_SocketClose;
-                JVM_SocketShutdown;
                 JVM_StartThread;
                 JVM_StopThread;
                 JVM_SuspendThread;
                 JVM_SupportsCX8;
-                JVM_Sync;
-                JVM_Timeout;
                 JVM_TotalMemory;
-                JVM_TraceInstructions;
-                JVM_TraceMethodCalls;
                 JVM_UnloadLibrary;
-                JVM_Write;
                 JVM_Yield;
                 JVM_handle_linux_signal;
 
--- a/hotspot/make/linux/makefiles/mapfile-vers-product	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/make/linux/makefiles/mapfile-vers-product	Wed Jul 05 20:05:30 2017 +0200
@@ -32,23 +32,12 @@
                 JNI_GetDefaultJavaVMInitArgs;
 
                 # JVM
-                JVM_Accept;
                 JVM_ActiveProcessorCount;
-                JVM_AllocateNewArray;
-                JVM_AllocateNewObject;
                 JVM_ArrayCopy;
                 JVM_AssertionStatusDirectives;
-                JVM_Available;
-                JVM_Bind;
                 JVM_ClassDepth;
                 JVM_ClassLoaderDepth;
                 JVM_Clone;
-                JVM_Close;
-                JVM_CX8Field;
-                JVM_CompileClass;
-                JVM_CompileClasses;
-                JVM_CompilerCommand;
-                JVM_Connect;
                 JVM_ConstantPoolGetClassAt;
                 JVM_ConstantPoolGetClassAtIfLoaded;
                 JVM_ConstantPoolGetDoubleAt;
@@ -72,7 +61,6 @@
                 JVM_DefineClassWithSource;
                 JVM_DefineClassWithSourceCond;
                 JVM_DesiredAssertionStatus;
-                JVM_DisableCompiler;
                 JVM_DoPrivileged;
                 JVM_DTraceGetVersion;
                 JVM_DTraceActivate;
@@ -81,8 +69,6 @@
                 JVM_DTraceDispose;
                 JVM_DumpAllStacks;
                 JVM_DumpThreads;
-                JVM_EnableCompiler;
-                JVM_Exit;
                 JVM_FillInStackTrace;
                 JVM_FindClassFromCaller;
                 JVM_FindClassFromClass;
@@ -128,16 +114,11 @@
                 JVM_GetDeclaredClasses;
                 JVM_GetDeclaringClass;
                 JVM_GetEnclosingMethodInfo;
-                JVM_GetFieldAnnotations;
                 JVM_GetFieldIxModifiers;
                 JVM_GetFieldTypeAnnotations;
-                JVM_GetHostName;
                 JVM_GetInheritedAccessControlContext;
                 JVM_GetInterfaceVersion;
-                JVM_GetLastErrorString;
                 JVM_GetManagement;
-                JVM_GetMethodAnnotations;
-                JVM_GetMethodDefaultAnnotationValue;
                 JVM_GetMethodIxArgsSize;
                 JVM_GetMethodIxByteCode;
                 JVM_GetMethodIxByteCodeLength;
@@ -150,29 +131,22 @@
                 JVM_GetMethodIxModifiers;
                 JVM_GetMethodIxNameUTF;
                 JVM_GetMethodIxSignatureUTF;
-                JVM_GetMethodParameterAnnotations;
                 JVM_GetMethodParameters;
                 JVM_GetMethodTypeAnnotations;
                 JVM_GetPrimitiveArrayElement;
                 JVM_GetProtectionDomain;
-                JVM_GetSockName;
-                JVM_GetSockOpt;
                 JVM_GetStackAccessControlContext;
                 JVM_GetStackTraceDepth;
                 JVM_GetStackTraceElement;
                 JVM_GetSystemPackage;
                 JVM_GetSystemPackages;
                 JVM_GetTemporaryDirectory;
-                JVM_GetThreadStateNames;
-                JVM_GetThreadStateValues;
                 JVM_GetVersionInfo;
                 JVM_Halt;
                 JVM_HoldsLock;
                 JVM_IHashCode;
                 JVM_InitAgentProperties;
                 JVM_InitProperties;
-                JVM_InitializeCompiler;
-                JVM_InitializeSocketLibrary;
                 JVM_InternString;
                 JVM_Interrupt;
                 JVM_InvokeMethod;
@@ -180,18 +154,13 @@
                 JVM_IsConstructorIx;
                 JVM_IsInterface;
                 JVM_IsInterrupted;
-                JVM_IsNaN;
                 JVM_IsPrimitiveClass;
                 JVM_IsSameClassPackage;
-                JVM_IsSilentCompiler;
                 JVM_IsSupportedJNIVersion;
                 JVM_IsThreadAlive;
                 JVM_IsVMGeneratedMethodIx;
                 JVM_LatestUserDefinedLoader;
-                JVM_Listen;
-                JVM_LoadClass0;
                 JVM_LoadLibrary;
-                JVM_Lseek;
                 JVM_MaxObjectInspectionAge;
                 JVM_MaxMemory;
                 JVM_MonitorNotify;
@@ -202,45 +171,26 @@
                 JVM_NewArray;
                 JVM_NewInstanceFromConstructor;
                 JVM_NewMultiArray;
-                JVM_OnExit;
-                JVM_Open;
                 JVM_RaiseSignal;
                 JVM_RawMonitorCreate;
                 JVM_RawMonitorDestroy;
                 JVM_RawMonitorEnter;
                 JVM_RawMonitorExit;
-                JVM_Read;
-                JVM_Recv;
-                JVM_RecvFrom;
                 JVM_RegisterSignal;
                 JVM_ReleaseUTF;
-                JVM_ResolveClass;
                 JVM_ResumeThread;
-                JVM_Send;
-                JVM_SendTo;
                 JVM_SetArrayElement;
                 JVM_SetClassSigners;
-                JVM_SetLength;
                 JVM_SetNativeThreadName;
                 JVM_SetPrimitiveArrayElement;
-                JVM_SetSockOpt;
                 JVM_SetThreadPriority;
                 JVM_Sleep;
-                JVM_Socket;
-                JVM_SocketAvailable;
-                JVM_SocketClose;
-                JVM_SocketShutdown;
                 JVM_StartThread;
                 JVM_StopThread;
                 JVM_SuspendThread;
                 JVM_SupportsCX8;
-                JVM_Sync;
-                JVM_Timeout;
                 JVM_TotalMemory;
-                JVM_TraceInstructions;
-                JVM_TraceMethodCalls;
                 JVM_UnloadLibrary;
-                JVM_Write;
                 JVM_Yield;
                 JVM_handle_linux_signal;
 
--- a/hotspot/make/solaris/makefiles/mapfile-vers	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/make/solaris/makefiles/mapfile-vers	Wed Jul 05 20:05:30 2017 +0200
@@ -32,23 +32,12 @@
                 JNI_GetDefaultJavaVMInitArgs;
         
                 # JVM
-                JVM_Accept;
                 JVM_ActiveProcessorCount;
-                JVM_AllocateNewArray;
-                JVM_AllocateNewObject;
                 JVM_ArrayCopy;
                 JVM_AssertionStatusDirectives;
-                JVM_Available;
-                JVM_Bind;
                 JVM_ClassDepth;
                 JVM_ClassLoaderDepth;
                 JVM_Clone;
-                JVM_Close;
-                JVM_CX8Field;
-                JVM_CompileClass;
-                JVM_CompileClasses;
-                JVM_CompilerCommand;
-                JVM_Connect;
                 JVM_ConstantPoolGetClassAt;
                 JVM_ConstantPoolGetClassAtIfLoaded;
                 JVM_ConstantPoolGetDoubleAt;
@@ -72,7 +61,6 @@
                 JVM_DefineClassWithSource;
                 JVM_DefineClassWithSourceCond;
                 JVM_DesiredAssertionStatus;
-                JVM_DisableCompiler;
                 JVM_DoPrivileged;
                 JVM_DTraceGetVersion;
                 JVM_DTraceActivate;
@@ -81,8 +69,6 @@
                 JVM_DTraceDispose;
                 JVM_DumpAllStacks;
                 JVM_DumpThreads;
-                JVM_EnableCompiler;
-                JVM_Exit;
                 JVM_FillInStackTrace;
                 JVM_FindClassFromCaller;
                 JVM_FindClassFromClass;
@@ -128,16 +114,11 @@
                 JVM_GetDeclaredClasses;
                 JVM_GetDeclaringClass;
                 JVM_GetEnclosingMethodInfo;
-                JVM_GetFieldAnnotations;
                 JVM_GetFieldIxModifiers;
                 JVM_GetFieldTypeAnnotations;
-                JVM_GetHostName;
                 JVM_GetInheritedAccessControlContext;
                 JVM_GetInterfaceVersion;
-                JVM_GetLastErrorString;
                 JVM_GetManagement;
-                JVM_GetMethodAnnotations;
-                JVM_GetMethodDefaultAnnotationValue;
                 JVM_GetMethodIxArgsSize;
                 JVM_GetMethodIxByteCode;
                 JVM_GetMethodIxByteCodeLength;
@@ -150,29 +131,22 @@
                 JVM_GetMethodIxModifiers;
                 JVM_GetMethodIxNameUTF;
                 JVM_GetMethodIxSignatureUTF;
-                JVM_GetMethodParameterAnnotations;
                 JVM_GetMethodParameters;
                 JVM_GetMethodTypeAnnotations;
                 JVM_GetPrimitiveArrayElement;
                 JVM_GetProtectionDomain;
-                JVM_GetSockName;
-                JVM_GetSockOpt;
                 JVM_GetStackAccessControlContext;
                 JVM_GetStackTraceDepth;
                 JVM_GetStackTraceElement;
                 JVM_GetSystemPackage;
                 JVM_GetSystemPackages;
                 JVM_GetTemporaryDirectory;
-                JVM_GetThreadStateNames;
-                JVM_GetThreadStateValues;
                 JVM_GetVersionInfo;
                 JVM_Halt;
                 JVM_HoldsLock;
                 JVM_IHashCode;
                 JVM_InitAgentProperties;
                 JVM_InitProperties;
-                JVM_InitializeCompiler;
-                JVM_InitializeSocketLibrary;
                 JVM_InternString;
                 JVM_Interrupt;
                 JVM_InvokeMethod;
@@ -180,18 +154,13 @@
                 JVM_IsConstructorIx;
                 JVM_IsInterface;
                 JVM_IsInterrupted;
-                JVM_IsNaN;
                 JVM_IsPrimitiveClass;
                 JVM_IsSameClassPackage;
-                JVM_IsSilentCompiler;
                 JVM_IsSupportedJNIVersion;
                 JVM_IsThreadAlive;
                 JVM_IsVMGeneratedMethodIx;
                 JVM_LatestUserDefinedLoader;
-                JVM_Listen;
-                JVM_LoadClass0;
                 JVM_LoadLibrary;
-                JVM_Lseek;
                 JVM_MaxObjectInspectionAge;
                 JVM_MaxMemory;
                 JVM_MonitorNotify;
@@ -202,45 +171,26 @@
                 JVM_NewArray;
                 JVM_NewInstanceFromConstructor;
                 JVM_NewMultiArray;
-                JVM_OnExit;
-                JVM_Open;
                 JVM_RaiseSignal;
                 JVM_RawMonitorCreate;
                 JVM_RawMonitorDestroy;
                 JVM_RawMonitorEnter;
                 JVM_RawMonitorExit;
-                JVM_Read;
-                JVM_Recv;
-                JVM_RecvFrom;
                 JVM_RegisterSignal;
                 JVM_ReleaseUTF;
-                JVM_ResolveClass;
                 JVM_ResumeThread;
-                JVM_Send;
-                JVM_SendTo;
                 JVM_SetArrayElement;
                 JVM_SetClassSigners;
-                JVM_SetLength;
                 JVM_SetNativeThreadName;
                 JVM_SetPrimitiveArrayElement;
-                JVM_SetSockOpt;
                 JVM_SetThreadPriority;
                 JVM_Sleep;
-                JVM_Socket;
-                JVM_SocketAvailable;
-                JVM_SocketClose;
-                JVM_SocketShutdown;
                 JVM_StartThread;
                 JVM_StopThread;
                 JVM_SuspendThread;
                 JVM_SupportsCX8;
-                JVM_Sync;
-                JVM_Timeout;
                 JVM_TotalMemory;
-                JVM_TraceInstructions;
-                JVM_TraceMethodCalls;
                 JVM_UnloadLibrary;
-                JVM_Write;
                 JVM_Yield;
                 JVM_handle_solaris_signal;
 
--- a/hotspot/make/windows/makefiles/vm.make	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/make/windows/makefiles/vm.make	Wed Jul 05 20:05:30 2017 +0200
@@ -101,8 +101,6 @@
   /export:jio_vsnprintf                      \
   $(AGCT_EXPORT)                             \
   /export:JVM_GetVersionInfo                 \
-  /export:JVM_GetThreadStateNames            \
-  /export:JVM_GetThreadStateValues           \
   /export:JVM_InitAgentProperties
 
 CXX_INCLUDE_DIRS=/I "..\generated"
--- a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,4 +38,26 @@
 
 #define SUPPORTS_NATIVE_CX8
 
+// The expected size in bytes of a cache line, used to pad data structures.
+#if defined(TIERED)
+  #ifdef _LP64
+    // tiered, 64-bit, large machine
+    #define DEFAULT_CACHE_LINE_SIZE 128
+  #else
+    // tiered, 32-bit, medium machine
+    #define DEFAULT_CACHE_LINE_SIZE 64
+  #endif
+#elif defined(COMPILER1)
+  // pure C1, 32-bit, small machine
+  #define DEFAULT_CACHE_LINE_SIZE 16
+#elif defined(COMPILER2) || defined(SHARK)
+  #ifdef _LP64
+    // pure C2, 64-bit, large machine
+    #define DEFAULT_CACHE_LINE_SIZE 128
+  #else
+    // pure C2, 32-bit, medium machine
+    #define DEFAULT_CACHE_LINE_SIZE 64
+  #endif
+#endif
+
 #endif // CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP
--- a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,4 +35,27 @@
 
 #define SUPPORTS_NATIVE_CX8
 
+// The expected size in bytes of a cache line, used to pad data structures.
+#if defined(TIERED)
+  #ifdef _LP64
+    // tiered, 64-bit, large machine
+    #define DEFAULT_CACHE_LINE_SIZE 128
+  #else
+    // tiered, 32-bit, medium machine
+    #define DEFAULT_CACHE_LINE_SIZE 64
+  #endif
+#elif defined(COMPILER1)
+  // pure C1, 32-bit, small machine
+  // i486 was the last Intel chip with 16-byte cache line size
+  #define DEFAULT_CACHE_LINE_SIZE 32
+#elif defined(COMPILER2) || defined(SHARK)
+  #ifdef _LP64
+    // pure C2, 64-bit, large machine
+    #define DEFAULT_CACHE_LINE_SIZE 128
+  #else
+    // pure C2, 32-bit, medium machine
+    #define DEFAULT_CACHE_LINE_SIZE 64
+  #endif
+#endif
+
 #endif // CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP
--- a/hotspot/src/os/aix/vm/os_aix.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/os/aix/vm/os_aix.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -4025,14 +4025,6 @@
 // This code originates from JDK's sysOpen and open64_w
 // from src/solaris/hpi/src/system_md.c
 
-#ifndef O_DELETE
-#define O_DELETE 0x10000
-#endif
-
-// Open a file. Unlink the file immediately after open returns
-// if the specified oflag has the O_DELETE flag set.
-// O_DELETE is used only in j2se/src/share/native/java/util/zip/ZipFile.c
-
 int os::open(const char *path, int oflag, int mode) {
 
   if (strlen(path) > MAX_PATH - 1) {
@@ -4040,8 +4032,6 @@
     return -1;
   }
   int fd;
-  int o_delete = (oflag & O_DELETE);
-  oflag = oflag & ~O_DELETE;
 
   fd = ::open64(path, oflag, mode);
   if (fd == -1) return -1;
@@ -4092,9 +4082,6 @@
   }
 #endif
 
-  if (o_delete != 0) {
-    ::unlink(path);
-  }
   return fd;
 }
 
--- a/hotspot/src/os/bsd/dtrace/libjvm_db.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/os/bsd/dtrace/libjvm_db.c	Wed Jul 05 20:05:30 2017 +0200
@@ -347,10 +347,10 @@
                  &J->Number_of_heaps, sizeof(J->Number_of_heaps));
 
   /* Allocate memory for heap configurations */
-  J->Heap_low = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
-  J->Heap_high = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
-  J->Heap_segmap_low = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
-  J->Heap_segmap_high = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
+  J->Heap_low         = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
+  J->Heap_high        = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
+  J->Heap_segmap_low  = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
+  J->Heap_segmap_high = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
 
   /* Read code heap configurations */
   for (i = 0; i < J->Number_of_heaps; ++i) {
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -3845,22 +3845,12 @@
 // This code originates from JDK's sysOpen and open64_w
 // from src/solaris/hpi/src/system_md.c
 
-#ifndef O_DELETE
-  #define O_DELETE 0x10000
-#endif
-
-// Open a file. Unlink the file immediately after open returns
-// if the specified oflag has the O_DELETE flag set.
-// O_DELETE is used only in j2se/src/share/native/java/util/zip/ZipFile.c
-
 int os::open(const char *path, int oflag, int mode) {
   if (strlen(path) > MAX_PATH - 1) {
     errno = ENAMETOOLONG;
     return -1;
   }
   int fd;
-  int o_delete = (oflag & O_DELETE);
-  oflag = oflag & ~O_DELETE;
 
   fd = ::open(path, oflag, mode);
   if (fd == -1) return -1;
@@ -3913,9 +3903,6 @@
   }
 #endif
 
-  if (o_delete != 0) {
-    ::unlink(path);
-  }
   return fd;
 }
 
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -129,6 +129,7 @@
 
 int (*os::Linux::_clock_gettime)(clockid_t, struct timespec *) = NULL;
 int (*os::Linux::_pthread_getcpuclockid)(pthread_t, clockid_t *) = NULL;
+int (*os::Linux::_pthread_setname_np)(pthread_t, const char*) = NULL;
 Mutex* os::Linux::_createThread_lock = NULL;
 pthread_t os::Linux::_main_thread;
 int os::Linux::_page_size = -1;
@@ -4695,6 +4696,11 @@
     StackRedPages = 1;
     StackShadowPages = round_to((StackShadowPages*Linux::vm_default_page_size()), vm_page_size()) / vm_page_size();
   }
+
+  // retrieve entry point for pthread_setname_np
+  Linux::_pthread_setname_np =
+    (int(*)(pthread_t, const char*))dlsym(RTLD_DEFAULT, "pthread_setname_np");
+
 }
 
 // To install functions for atexit system call
@@ -4894,8 +4900,14 @@
 }
 
 void os::set_native_thread_name(const char *name) {
-  // Not yet implemented.
-  return;
+  if (Linux::_pthread_setname_np) {
+    char buf [16]; // according to glibc manpage, 16 chars incl. '/0'
+    snprintf(buf, sizeof(buf), "%s", name);
+    buf[sizeof(buf) - 1] = '\0';
+    const int rc = Linux::_pthread_setname_np(pthread_self(), buf);
+    // ERANGE should not happen; all other errors should just be ignored.
+    assert(rc != ERANGE, "pthread_setname_np failed");
+  }
 }
 
 bool os::distribute_processes(uint length, uint* distribution) {
@@ -5086,22 +5098,12 @@
 // This code originates from JDK's sysOpen and open64_w
 // from src/solaris/hpi/src/system_md.c
 
-#ifndef O_DELETE
-  #define O_DELETE 0x10000
-#endif
-
-// Open a file. Unlink the file immediately after open returns
-// if the specified oflag has the O_DELETE flag set.
-// O_DELETE is used only in j2se/src/share/native/java/util/zip/ZipFile.c
-
 int os::open(const char *path, int oflag, int mode) {
   if (strlen(path) > MAX_PATH - 1) {
     errno = ENAMETOOLONG;
     return -1;
   }
   int fd;
-  int o_delete = (oflag & O_DELETE);
-  oflag = oflag & ~O_DELETE;
 
   fd = ::open64(path, oflag, mode);
   if (fd == -1) return -1;
@@ -5154,9 +5156,6 @@
   }
 #endif
 
-  if (o_delete != 0) {
-    ::unlink(path);
-  }
   return fd;
 }
 
--- a/hotspot/src/os/linux/vm/os_linux.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/os/linux/vm/os_linux.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -55,6 +55,7 @@
 
   static int (*_clock_gettime)(clockid_t, struct timespec *);
   static int (*_pthread_getcpuclockid)(pthread_t, clockid_t *);
+  static int (*_pthread_setname_np)(pthread_t, const char*);
 
   static address   _initial_thread_stack_bottom;
   static uintptr_t _initial_thread_stack_size;
--- a/hotspot/src/os/solaris/dtrace/libjvm_db.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/os/solaris/dtrace/libjvm_db.c	Wed Jul 05 20:05:30 2017 +0200
@@ -347,10 +347,10 @@
                  &J->Number_of_heaps, sizeof(J->Number_of_heaps));
 
   /* Allocate memory for heap configurations */
-  J->Heap_low = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
-  J->Heap_high = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
-  J->Heap_segmap_low = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
-  J->Heap_segmap_high = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
+  J->Heap_low         = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
+  J->Heap_high        = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
+  J->Heap_segmap_low  = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
+  J->Heap_segmap_high = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
 
   /* Read code heap configurations */
   for (i = 0; i < J->Number_of_heaps; ++i) {
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -4807,22 +4807,12 @@
 // This code originates from JDK's sysOpen and open64_w
 // from src/solaris/hpi/src/system_md.c
 
-#ifndef O_DELETE
-  #define O_DELETE 0x10000
-#endif
-
-// Open a file. Unlink the file immediately after open returns
-// if the specified oflag has the O_DELETE flag set.
-// O_DELETE is used only in j2se/src/share/native/java/util/zip/ZipFile.c
-
 int os::open(const char *path, int oflag, int mode) {
   if (strlen(path) > MAX_PATH - 1) {
     errno = ENAMETOOLONG;
     return -1;
   }
   int fd;
-  int o_delete = (oflag & O_DELETE);
-  oflag = oflag & ~O_DELETE;
 
   fd = ::open64(path, oflag, mode);
   if (fd == -1) return -1;
@@ -4918,9 +4908,6 @@
   }
 #endif
 
-  if (o_delete != 0) {
-    ::unlink(path);
-  }
   return fd;
 }
 
--- a/hotspot/src/os/windows/vm/jvm_windows.h	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/os/windows/vm/jvm_windows.h	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -116,7 +116,6 @@
 #define JVM_O_O_APPEND   O_APPEND
 #define JVM_O_EXCL       O_EXCL
 #define JVM_O_CREAT      O_CREAT
-#define JVM_O_DELETE     O_TEMPORARY
 
 /* Signals */
 
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -745,8 +745,29 @@
 }
 
 void os::set_native_thread_name(const char *name) {
-  // Not yet implemented.
-  return;
+
+  // See: http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx
+  //
+  // Note that unfortunately this only works if the process
+  // is already attached to a debugger; debugger must observe
+  // the exception below to show the correct name.
+
+  const DWORD MS_VC_EXCEPTION = 0x406D1388;
+  struct {
+    DWORD dwType;     // must be 0x1000
+    LPCSTR szName;    // pointer to name (in user addr space)
+    DWORD dwThreadID; // thread ID (-1=caller thread)
+    DWORD dwFlags;    // reserved for future use, must be zero
+  } info;
+
+  info.dwType = 0x1000;
+  info.szName = name;
+  info.dwThreadID = -1;
+  info.dwFlags = 0;
+
+  __try {
+    RaiseException (MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (const ULONG_PTR*)&info );
+  } __except(EXCEPTION_CONTINUE_EXECUTION) {}
 }
 
 bool os::distribute_processes(uint length, uint* distribution) {
--- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -410,8 +410,6 @@
                 "/export:jio_fprintf /export:jio_vfprintf "+
                 "/export:jio_vsnprintf "+
                 "/export:JVM_GetVersionInfo "+
-                "/export:JVM_GetThreadStateNames "+
-                "/export:JVM_GetThreadStateValues "+
                 "/export:JVM_InitAgentProperties");
         addAttr(rv, "AdditionalDependencies", "kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;Wsock32.lib;winmm.lib;psapi.lib");
         addAttr(rv, "OutputFile", outDll);
--- a/hotspot/src/share/vm/ci/ciMethod.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/ci/ciMethod.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -1116,6 +1116,7 @@
 template bool ciMethod::has_option_value<uintx>(const char* option, uintx& value);
 template bool ciMethod::has_option_value<bool>(const char* option, bool& value);
 template bool ciMethod::has_option_value<ccstr>(const char* option, ccstr& value);
+template bool ciMethod::has_option_value<double>(const char* option, double& value);
 
 // ------------------------------------------------------------------
 // ciMethod::can_be_compiled
--- a/hotspot/src/share/vm/classfile/verifier.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/classfile/verifier.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -98,6 +98,19 @@
   HandleMark hm;
   ResourceMark rm(THREAD);
 
+  // Eagerly allocate the identity hash code for a klass. This is a fallout
+  // from 6320749 and 8059924: hash code generator is not supposed to be called
+  // during the safepoint, but it allows to sneak the hashcode in during
+  // verification. Without this eager hashcode generation, we may end up
+  // installing the hashcode during some other operation, which may be at
+  // safepoint -- blowing up the checks. It was previously done as the side
+  // effect (sic!) for external_name(), but instead of doing that, we opt to
+  // explicitly push the hashcode in here. This is signify the following block
+  // is IMPORTANT:
+  if (klass->java_mirror() != NULL) {
+    klass->java_mirror()->identity_hash();
+  }
+
   if (!is_eligible_for_verification(klass, should_verify_class)) {
     return true;
   }
--- a/hotspot/src/share/vm/compiler/compilerOracle.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/compiler/compilerOracle.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -173,6 +173,7 @@
   UintxType,
   BoolType,
   CcstrType,
+  DoubleType,
   UnknownType
 };
 
@@ -198,6 +199,10 @@
   return CcstrType;
 }
 
+template<> OptionType get_type_for<double>() {
+  return DoubleType;
+}
+
 template<typename T>
 static const T copy_value(const T value) {
   return value;
@@ -297,6 +302,15 @@
   tty->cr();
 };
 
+template<>
+void TypedMethodOptionMatcher<double>::print() {
+  ttyLocker ttyl;
+  print_base();
+  tty->print(" double %s", _option);
+  tty->print(" = %f", _value);
+  tty->cr();
+};
+
 // this must parallel the command_names below
 enum OracleCommand {
   UnknownCommand = -1,
@@ -390,6 +404,7 @@
 template bool CompilerOracle::has_option_value<uintx>(methodHandle method, const char* option, uintx& value);
 template bool CompilerOracle::has_option_value<bool>(methodHandle method, const char* option, bool& value);
 template bool CompilerOracle::has_option_value<ccstr>(methodHandle method, const char* option, ccstr& value);
+template bool CompilerOracle::has_option_value<double>(methodHandle method, const char* option, double& value);
 
 bool CompilerOracle::should_exclude(methodHandle method, bool& quietly) {
   quietly = true;
@@ -610,6 +625,20 @@
       } else {
         jio_snprintf(errorbuf, sizeof(errorbuf), "  Value cannot be read for flag %s of type %s", flag, type);
       }
+    } else if (strcmp(type, "double") == 0) {
+      char buffer[2][256];
+      // Decimal separator '.' has been replaced with ' ' or '/' earlier,
+      // so read integer and fraction part of double value separately.
+      if (sscanf(line, "%*[ \t]%255[0-9]%*[ /\t]%255[0-9]%n", buffer[0], buffer[1], &bytes_read) == 2) {
+        char value[512] = "";
+        strncat(value, buffer[0], 255);
+        strcat(value, ".");
+        strncat(value, buffer[1], 255);
+        total_bytes_read += bytes_read;
+        return add_option_string(c_name, c_match, m_name, m_match, signature, flag, atof(value));
+      } else {
+        jio_snprintf(errorbuf, buf_size, "  Value cannot be read for flag %s of type %s", flag, type);
+      }
     } else {
       jio_snprintf(errorbuf, sizeof(errorbuf), "  Type %s not supported ", type);
     }
@@ -700,11 +729,10 @@
       // (1) CompileCommand=option,Klass::method,flag
       // (2) CompileCommand=option,Klass::method,type,flag,value
       //
-      // Type (1) is used to support ciMethod::has_option("someflag")
-      // (i.e., to check if a flag "someflag" is enabled for a method).
+      // Type (1) is used to enable a boolean flag for a method.
       //
       // Type (2) is used to support options with a value. Values can have the
-      // the following types: intx, uintx, bool, ccstr, and ccstrlist.
+      // the following types: intx, uintx, bool, ccstr, ccstrlist, and double.
       //
       // For future extensions: extend scan_flag_and_value()
       char option[256]; // stores flag for Type (1) and type of Type (2)
@@ -722,6 +750,7 @@
             || strcmp(option, "bool") == 0
             || strcmp(option, "ccstr") == 0
             || strcmp(option, "ccstrlist") == 0
+            || strcmp(option, "double") == 0
             ) {
 
           // Type (2) option: parse flag name and value.
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -131,7 +131,10 @@
   storage->set_mapping_changed_listener(&_listener);
 }
 
-void CMBitMapMappingChangedListener::on_commit(uint start_region, size_t num_regions) {
+void CMBitMapMappingChangedListener::on_commit(uint start_region, size_t num_regions, bool zero_filled) {
+  if (zero_filled) {
+    return;
+  }
   // We need to clear the bitmap on commit, removing any existing information.
   MemRegion mr(G1CollectedHeap::heap()->bottom_addr_for_region(start_region), num_regions * HeapRegion::GrainWords);
   _bm->clearRange(mr);
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -127,7 +127,7 @@
 
   void set_bitmap(CMBitMap* bm) { _bm = bm; }
 
-  virtual void on_commit(uint start_idx, size_t num_regions);
+  virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled);
 };
 
 class CMBitMap : public CMBitMapRO {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -109,7 +109,7 @@
 
 class G1BlockOffsetSharedArrayMappingChangedListener : public G1MappingChangedListener {
  public:
-  virtual void on_commit(uint start_idx, size_t num_regions) {
+  virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
     // Nothing to do. The BOT is hard-wired to be part of the HeapRegion, and we cannot
     // retrieve it here since this would cause firing of several asserts. The code
     // executed after commit of a region already needs to do some re-initialization of
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -33,7 +33,10 @@
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
-void G1CardCountsMappingChangedListener::on_commit(uint start_idx, size_t num_regions) {
+void G1CardCountsMappingChangedListener::on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
+  if (zero_filled) {
+    return;
+  }
   MemRegion mr(G1CollectedHeap::heap()->bottom_addr_for_region(start_idx), num_regions * HeapRegion::GrainWords);
   _counts->clear_range(mr);
 }
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -42,7 +42,7 @@
  public:
   void set_cardcounts(G1CardCounts* counts) { _counts = counts; }
 
-  virtual void on_commit(uint start_idx, size_t num_regions);
+  virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled);
 };
 
 // Table to track the number of times a card has been refined. Once
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -389,7 +389,9 @@
   OtherRegionsTable::invalidate(start_idx, num_regions);
 }
 
-void G1RegionMappingChangedListener::on_commit(uint start_idx, size_t num_regions) {
+void G1RegionMappingChangedListener::on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
+  // The from card cache is not the memory that is actually committed. So we cannot
+  // take advantage of the zero_filled parameter.
   reset_from_card_cache(start_idx, num_regions);
 }
 
@@ -3610,7 +3612,7 @@
                                                                   cl.candidate_humongous());
   _has_humongous_reclaim_candidates = cl.candidate_humongous() > 0;
 
-  if (_has_humongous_reclaim_candidates) {
+  if (_has_humongous_reclaim_candidates || G1TraceReclaimDeadHumongousObjectsAtYoungGC) {
     clear_humongous_is_live_table();
   }
 }
@@ -4096,7 +4098,7 @@
     _hrm.verify_optional();
     verify_region_sets_optional();
 
-    TASKQUEUE_STATS_ONLY(if (ParallelGCVerbose) print_taskqueue_stats());
+    TASKQUEUE_STATS_ONLY(if (PrintTaskqueue) print_taskqueue_stats());
     TASKQUEUE_STATS_ONLY(reset_taskqueue_stats());
 
     print_heap_after_gc();
@@ -4666,7 +4668,7 @@
       _g1h->g1_policy()->record_thread_age_table(pss.age_table());
       _g1h->update_surviving_young_words(pss.surviving_young_words()+1);
 
-      if (ParallelGCVerbose) {
+      if (PrintTerminationStats) {
         MutexLocker x(stats_lock());
         pss.print_termination_stats(worker_id);
       }
@@ -5760,7 +5762,7 @@
 
     if (G1CollectedHeap::use_parallel_gc_threads()) {
       // The individual threads will set their evac-failure closures.
-      if (ParallelGCVerbose) G1ParScanThreadState::print_termination_stats_hdr();
+      if (PrintTerminationStats) G1ParScanThreadState::print_termination_stats_hdr();
       // These tasks use ShareHeap::_process_strong_tasks
       assert(UseDynamicNumberOfGCThreads ||
              workers()->active_workers() == workers()->total_workers(),
@@ -6272,9 +6274,10 @@
         g1h->humongous_region_is_always_live(region_idx)) {
 
       if (G1TraceReclaimDeadHumongousObjectsAtYoungGC) {
-        gclog_or_tty->print_cr("Live humongous %d region %d with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d live-other %d obj array %d",
+        gclog_or_tty->print_cr("Live humongous %d region %d size "SIZE_FORMAT" with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d live-other %d obj array %d",
                                r->is_humongous(),
                                region_idx,
+                               obj->size()*HeapWordSize,
                                r->rem_set()->occupied(),
                                r->rem_set()->strong_code_roots_list_length(),
                                next_bitmap->isMarked(r->bottom()),
@@ -6291,8 +6294,9 @@
                       r->bottom()));
 
     if (G1TraceReclaimDeadHumongousObjectsAtYoungGC) {
-      gclog_or_tty->print_cr("Reclaim humongous region %d start "PTR_FORMAT" region %d length "UINT32_FORMAT" with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d live-other %d obj array %d",
+      gclog_or_tty->print_cr("Reclaim humongous region %d size "SIZE_FORMAT" start "PTR_FORMAT" region %d length "UINT32_FORMAT" with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d live-other %d obj array %d",
                              r->is_humongous(),
+                             obj->size()*HeapWordSize,
                              r->bottom(),
                              region_idx,
                              r->region_num(),
@@ -6331,7 +6335,8 @@
 void G1CollectedHeap::eagerly_reclaim_humongous_regions() {
   assert_at_safepoint(true);
 
-  if (!G1ReclaimDeadHumongousObjectsAtYoungGC || !_has_humongous_reclaim_candidates) {
+  if (!G1ReclaimDeadHumongousObjectsAtYoungGC ||
+      (!_has_humongous_reclaim_candidates && !G1TraceReclaimDeadHumongousObjectsAtYoungGC)) {
     g1_policy()->phase_times()->record_fast_reclaim_humongous_time_ms(0.0, 0);
     return;
   }
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -172,7 +172,7 @@
  private:
   void reset_from_card_cache(uint start_idx, size_t num_regions);
  public:
-  virtual void on_commit(uint start_idx, size_t num_regions);
+  virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled);
 };
 
 class G1CollectedHeap : public SharedHeap {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -69,7 +69,7 @@
   virtual void commit_regions(uintptr_t start_idx, size_t num_regions) {
     _storage.commit(start_idx * _pages_per_region, num_regions * _pages_per_region);
     _commit_map.set_range(start_idx, start_idx + num_regions);
-    fire_on_commit(start_idx, num_regions);
+    fire_on_commit(start_idx, num_regions, true);
   }
 
   virtual void uncommit_regions(uintptr_t start_idx, size_t num_regions) {
@@ -115,12 +115,14 @@
       assert(!_commit_map.at(i), err_msg("Trying to commit storage at region "INTPTR_FORMAT" that is already committed", i));
       uintptr_t idx = region_idx_to_page_idx(i);
       uint old_refcount = _refcounts.get_by_index(idx);
+      bool zero_filled = false;
       if (old_refcount == 0) {
         _storage.commit(idx, 1);
+        zero_filled = true;
       }
       _refcounts.set_by_index(idx, old_refcount + 1);
       _commit_map.set_bit(i);
-      fire_on_commit(i, 1);
+      fire_on_commit(i, 1, zero_filled);
     }
   }
 
@@ -139,9 +141,9 @@
   }
 };
 
-void G1RegionToSpaceMapper::fire_on_commit(uint start_idx, size_t num_regions) {
+void G1RegionToSpaceMapper::fire_on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
   if (_listener != NULL) {
-    _listener->on_commit(start_idx, num_regions);
+    _listener->on_commit(start_idx, num_regions, zero_filled);
   }
 }
 
--- a/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -33,7 +33,9 @@
  public:
   // Fired after commit of the memory, i.e. the memory this listener is registered
   // for can be accessed.
-  virtual void on_commit(uint start_idx, size_t num_regions) = 0;
+  // Zero_filled indicates that the memory can be considered as filled with zero bytes
+  // when called.
+  virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled) = 0;
 };
 
 // Maps region based commit/uncommit requests to the underlying page sized virtual
@@ -51,7 +53,7 @@
 
   G1RegionToSpaceMapper(ReservedSpace rs, size_t commit_granularity, size_t region_granularity, MemoryType type);
 
-  void fire_on_commit(uint start_idx, size_t num_regions);
+  void fire_on_commit(uint start_idx, size_t num_regions, bool zero_filled);
  public:
   MemRegion reserved() { return _storage.reserved(); }
 
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -125,7 +125,8 @@
 }
 #endif
 
-void G1SATBCardTableLoggingModRefBSChangedListener::on_commit(uint start_idx, size_t num_regions) {
+void G1SATBCardTableLoggingModRefBSChangedListener::on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
+  // Default value for a clean card on the card table is -1. So we cannot take advantage of the zero_filled parameter.
   MemRegion mr(G1CollectedHeap::heap()->bottom_addr_for_region(start_idx), num_regions * HeapRegion::GrainWords);
   _card_table->clear(mr);
 }
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -136,7 +136,7 @@
 
   void set_card_table(G1SATBCardTableLoggingModRefBS* card_table) { _card_table = card_table; }
 
-  virtual void on_commit(uint start_idx, size_t num_regions);
+  virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled);
 };
 
 // Adds card-table logging to the post-barrier.
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -1065,10 +1065,8 @@
     gch->print_heap_change(gch_prev_used);
   }
 
-  if (PrintGCDetails && ParallelGCVerbose) {
-    TASKQUEUE_STATS_ONLY(thread_state_set.print_termination_stats());
-    TASKQUEUE_STATS_ONLY(thread_state_set.print_taskqueue_stats());
-  }
+  TASKQUEUE_STATS_ONLY(if (PrintTerminationStats) thread_state_set.print_termination_stats());
+  TASKQUEUE_STATS_ONLY(if (PrintTaskqueue) thread_state_set.print_taskqueue_stats());
 
   if (UseAdaptiveSizePolicy) {
     size_policy->minor_collection_end(gch->gc_cause());
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -91,7 +91,7 @@
 bool PSPromotionManager::post_scavenge(YoungGCTracer& gc_tracer) {
   bool promotion_failure_occurred = false;
 
-  TASKQUEUE_STATS_ONLY(if (PrintGCDetails && ParallelGCVerbose) print_stats());
+  TASKQUEUE_STATS_ONLY(if (PrintTaskqueue) print_taskqueue_stats());
   for (uint i = 0; i < ParallelGCThreads + 1; i++) {
     PSPromotionManager* manager = manager_array(i);
     assert(manager->claimed_stack_depth()->is_empty(), "should be empty");
@@ -106,16 +106,9 @@
 
 #if TASKQUEUE_STATS
 void
-PSPromotionManager::print_taskqueue_stats(uint i) const {
-  tty->print("%3u ", i);
-  _claimed_stack_depth.stats.print();
-  tty->cr();
-}
-
-void
-PSPromotionManager::print_local_stats(uint i) const {
+PSPromotionManager::print_local_stats(outputStream* const out, uint i) const {
   #define FMT " " SIZE_FORMAT_W(10)
-  tty->print_cr("%3u" FMT FMT FMT FMT, i, _masked_pushes, _masked_steals,
+  out->print_cr("%3u" FMT FMT FMT FMT, i, _masked_pushes, _masked_steals,
                 _arrays_chunked, _array_chunks_processed);
   #undef FMT
 }
@@ -127,20 +120,24 @@
 };
 
 void
-PSPromotionManager::print_stats() {
-  tty->print_cr("== GC Tasks Stats, GC %3d",
+PSPromotionManager::print_taskqueue_stats(outputStream* const out) {
+  out->print_cr("== GC Tasks Stats, GC %3d",
                 Universe::heap()->total_collections());
 
-  tty->print("thr "); TaskQueueStats::print_header(1); tty->cr();
-  tty->print("--- "); TaskQueueStats::print_header(2); tty->cr();
+  TaskQueueStats totals;
+  out->print("thr "); TaskQueueStats::print_header(1, out); out->cr();
+  out->print("--- "); TaskQueueStats::print_header(2, out); out->cr();
   for (uint i = 0; i < ParallelGCThreads + 1; ++i) {
-    manager_array(i)->print_taskqueue_stats(i);
+    TaskQueueStats& next = manager_array(i)->_claimed_stack_depth.stats;
+    out->print("%3d ", i); next.print(out); out->cr();
+    totals += next;
   }
+  out->print("tot "); totals.print(out); out->cr();
 
   const uint hlines = sizeof(pm_stats_hdr) / sizeof(pm_stats_hdr[0]);
-  for (uint i = 0; i < hlines; ++i) tty->print_cr("%s", pm_stats_hdr[i]);
+  for (uint i = 0; i < hlines; ++i) out->print_cr("%s", pm_stats_hdr[i]);
   for (uint i = 0; i < ParallelGCThreads + 1; ++i) {
-    manager_array(i)->print_local_stats(i);
+    manager_array(i)->print_local_stats(out, i);
   }
 }
 
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -68,9 +68,8 @@
   size_t                              _arrays_chunked;
   size_t                              _array_chunks_processed;
 
-  void print_taskqueue_stats(uint i) const;
-  void print_local_stats(uint i) const;
-  static void print_stats();
+  void print_local_stats(outputStream* const out, uint i) const;
+  static void print_taskqueue_stats(outputStream* const out = gclog_or_tty);
 
   void reset_stats();
 #endif // TASKQUEUE_STATS
--- a/hotspot/src/share/vm/memory/padded.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/memory/padded.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -76,10 +76,16 @@
 // if the start address is a multiple of alignment.
 template <class T, size_t alignment = DEFAULT_CACHE_LINE_SIZE>
 class PaddedEnd : public PaddedEndImpl<T, PADDED_END_SIZE(T, alignment)> {
-  // C++ don't allow zero-length arrays. The padding is put in a
+  // C++ doesn't allow zero-length arrays. The padding is put in a
   // super class that is specialized for the pad_size == 0 case.
 };
 
+// Similar to PaddedEnd, this macro defines a _pad_buf#id field
+// that is (alignment - size) bytes in size. This macro is used
+// to add padding in between non-class fields in a class or struct.
+#define DEFINE_PAD_MINUS_SIZE(id, alignment, size) \
+          char _pad_buf##id[(alignment) - (size)]
+
 // Helper class to create an array of PaddedEnd<T> objects. All elements will
 // start at a multiple of alignment and the size will be aligned to alignment.
 template <class T, MEMFLAGS flags, size_t alignment = DEFAULT_CACHE_LINE_SIZE>
--- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -298,10 +298,19 @@
     if (is_init_with_ea(callee_method, caller_method, C)) {
       // Escape Analysis: inline all executed constructors
       return false;
-    } else if (!callee_method->was_executed_more_than(MIN2(MinInliningThreshold,
-                                                           CompileThreshold >> 1))) {
-      set_msg("executed < MinInliningThreshold times");
-      return true;
+    } else {
+      intx counter_high_value;
+      // Tiered compilation uses a different "high value" than non-tiered compilation.
+      // Determine the right value to use.
+      if (TieredCompilation) {
+        counter_high_value = InvocationCounter::count_limit / 2;
+      } else {
+        counter_high_value = CompileThreshold / 2;
+      }
+      if (!callee_method->was_executed_more_than(MIN2(MinInliningThreshold, counter_high_value))) {
+        set_msg("executed < MinInliningThreshold times");
+        return true;
+      }
     }
   }
 
--- a/hotspot/src/share/vm/opto/c2_globals.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/opto/c2_globals.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -343,10 +343,16 @@
   product(bool, UseRDPCForConstantTableBase, false,                         \
           "Use Sparc RDPC instruction for the constant table base.")        \
                                                                             \
-  develop(intx, PrintIdealGraphLevel, 0,                                    \
+  develop(bool, PrintIdealGraph, false,                                     \
           "Print ideal graph to XML file / network interface. "             \
           "By default attempts to connect to the visualizer on a socket.")  \
                                                                             \
+  develop(intx, PrintIdealGraphLevel, 0,                                    \
+          "Level of detail of the ideal graph printout. "                   \
+          "System-wide value, 0=nothing is printed, 3=all details printed. "\
+          "Level of detail of printouts can be set on a per-method level "  \
+          "as well by using CompileCommand=option.")                        \
+                                                                            \
   develop(intx, PrintIdealGraphPort, 4444,                                  \
           "Ideal graph printer to network port")                            \
                                                                             \
--- a/hotspot/src/share/vm/opto/compile.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/opto/compile.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -827,7 +827,7 @@
   // Drain the list.
   Finish_Warm();
 #ifndef PRODUCT
-  if (_printer) {
+  if (_printer && _printer->should_print(_method)) {
     _printer->print_inlining(this);
   }
 #endif
--- a/hotspot/src/share/vm/opto/compile.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/opto/compile.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -622,7 +622,9 @@
 
   void begin_method() {
 #ifndef PRODUCT
-    if (_printer) _printer->begin_method(this);
+    if (_printer && _printer->should_print(_method)) {
+      _printer->begin_method(this);
+    }
 #endif
     C->_latest_stage_start_counter.stamp();
   }
@@ -639,7 +641,9 @@
 
 
 #ifndef PRODUCT
-    if (_printer) _printer->print_method(this, CompilerPhaseTypeHelper::to_string(cpt), level);
+    if (_printer && _printer->should_print(_method)) {
+      _printer->print_method(this, CompilerPhaseTypeHelper::to_string(cpt), level);
+    }
 #endif
     C->_latest_stage_start_counter.stamp();
   }
@@ -654,7 +658,9 @@
       event.commit();
     }
 #ifndef PRODUCT
-    if (_printer) _printer->end_method();
+    if (_printer && _printer->should_print(_method)) {
+      _printer->end_method();
+    }
 #endif
   }
 
--- a/hotspot/src/share/vm/opto/escape.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/opto/escape.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -882,9 +882,14 @@
       assert(false, "should be done already");
       break;
 #endif
+    case Op_ArrayCopy:
     case Op_CallLeafNoFP:
-      is_arraycopy = (call->as_CallLeaf()->_name != NULL &&
-                      strstr(call->as_CallLeaf()->_name, "arraycopy") != 0);
+      // Most array copies are ArrayCopy nodes at this point but there
+      // are still a few direct calls to the copy subroutines (See
+      // PhaseStringOpts::copy_string())
+      is_arraycopy = (call->Opcode() == Op_ArrayCopy) ||
+        (call->as_CallLeaf()->_name != NULL &&
+         strstr(call->as_CallLeaf()->_name, "arraycopy") != 0);
       // fall through
     case Op_CallLeaf: {
       // Stub calls, objects do not escape but they are not scale replaceable.
@@ -894,6 +899,9 @@
       for (uint i = TypeFunc::Parms; i < d->cnt(); i++) {
         const Type* at = d->field_at(i);
         Node *arg = call->in(i);
+        if (arg == NULL) {
+          continue;
+        }
         const Type *aat = _igvn->type(arg);
         if (arg->is_top() || !at->isa_ptr() || !aat->isa_ptr())
           continue;
--- a/hotspot/src/share/vm/opto/graphKit.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/opto/graphKit.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -3826,6 +3826,110 @@
   // Final sync IdealKit and GraphKit.
   final_sync(ideal);
 }
+/*
+ * Determine if the G1 pre-barrier can be removed. The pre-barrier is
+ * required by SATB to make sure all objects live at the start of the
+ * marking are kept alive, all reference updates need to any previous
+ * reference stored before writing.
+ *
+ * If the previous value is NULL there is no need to save the old value.
+ * References that are NULL are filtered during runtime by the barrier
+ * code to avoid unnecessary queuing.
+ *
+ * However in the case of newly allocated objects it might be possible to
+ * prove that the reference about to be overwritten is NULL during compile
+ * time and avoid adding the barrier code completely.
+ *
+ * The compiler needs to determine that the object in which a field is about
+ * to be written is newly allocated, and that no prior store to the same field
+ * has happened since the allocation.
+ *
+ * Returns true if the pre-barrier can be removed
+ */
+bool GraphKit::g1_can_remove_pre_barrier(PhaseTransform* phase, Node* adr,
+                                         BasicType bt, uint adr_idx) {
+  intptr_t offset = 0;
+  Node* base = AddPNode::Ideal_base_and_offset(adr, phase, offset);
+  AllocateNode* alloc = AllocateNode::Ideal_allocation(base, phase);
+
+  if (offset == Type::OffsetBot) {
+    return false; // cannot unalias unless there are precise offsets
+  }
+
+  if (alloc == NULL) {
+    return false; // No allocation found
+  }
+
+  intptr_t size_in_bytes = type2aelembytes(bt);
+
+  Node* mem = memory(adr_idx); // start searching here...
+
+  for (int cnt = 0; cnt < 50; cnt++) {
+
+    if (mem->is_Store()) {
+
+      Node* st_adr = mem->in(MemNode::Address);
+      intptr_t st_offset = 0;
+      Node* st_base = AddPNode::Ideal_base_and_offset(st_adr, phase, st_offset);
+
+      if (st_base == NULL) {
+        break; // inscrutable pointer
+      }
+
+      // Break we have found a store with same base and offset as ours so break
+      if (st_base == base && st_offset == offset) {
+        break;
+      }
+
+      if (st_offset != offset && st_offset != Type::OffsetBot) {
+        const int MAX_STORE = BytesPerLong;
+        if (st_offset >= offset + size_in_bytes ||
+            st_offset <= offset - MAX_STORE ||
+            st_offset <= offset - mem->as_Store()->memory_size()) {
+          // Success:  The offsets are provably independent.
+          // (You may ask, why not just test st_offset != offset and be done?
+          // The answer is that stores of different sizes can co-exist
+          // in the same sequence of RawMem effects.  We sometimes initialize
+          // a whole 'tile' of array elements with a single jint or jlong.)
+          mem = mem->in(MemNode::Memory);
+          continue; // advance through independent store memory
+        }
+      }
+
+      if (st_base != base
+          && MemNode::detect_ptr_independence(base, alloc, st_base,
+                                              AllocateNode::Ideal_allocation(st_base, phase),
+                                              phase)) {
+        // Success:  The bases are provably independent.
+        mem = mem->in(MemNode::Memory);
+        continue; // advance through independent store memory
+      }
+    } else if (mem->is_Proj() && mem->in(0)->is_Initialize()) {
+
+      InitializeNode* st_init = mem->in(0)->as_Initialize();
+      AllocateNode* st_alloc = st_init->allocation();
+
+      // Make sure that we are looking at the same allocation site.
+      // The alloc variable is guaranteed to not be null here from earlier check.
+      if (alloc == st_alloc) {
+        // Check that the initialization is storing NULL so that no previous store
+        // has been moved up and directly write a reference
+        Node* captured_store = st_init->find_captured_store(offset,
+                                                            type2aelembytes(T_OBJECT),
+                                                            phase);
+        if (captured_store == NULL || captured_store == st_init->zero_memory()) {
+          return true;
+        }
+      }
+    }
+
+    // Unless there is an explicit 'continue', we must bail out here,
+    // because 'mem' is an inscrutable memory state (e.g., a call).
+    break;
+  }
+
+  return false;
+}
 
 // G1 pre/post barriers
 void GraphKit::g1_write_barrier_pre(bool do_load,
@@ -3846,6 +3950,12 @@
     assert(adr != NULL, "where are loading from?");
     assert(pre_val == NULL, "loaded already?");
     assert(val_type != NULL, "need a type");
+
+    if (use_ReduceInitialCardMarks()
+        && g1_can_remove_pre_barrier(&_gvn, adr, bt, alias_idx)) {
+      return;
+    }
+
   } else {
     // In this case both val_type and alias_idx are unused.
     assert(pre_val != NULL, "must be loaded already");
@@ -3927,6 +4037,65 @@
   final_sync(ideal);
 }
 
+/*
+ * G1 similar to any GC with a Young Generation requires a way to keep track of
+ * references from Old Generation to Young Generation to make sure all live
+ * objects are found. G1 also requires to keep track of object references
+ * between different regions to enable evacuation of old regions, which is done
+ * as part of mixed collections. References are tracked in remembered sets and
+ * is continuously updated as reference are written to with the help of the
+ * post-barrier.
+ *
+ * To reduce the number of updates to the remembered set the post-barrier
+ * filters updates to fields in objects located in the Young Generation,
+ * the same region as the reference, when the NULL is being written or
+ * if the card is already marked as dirty by an earlier write.
+ *
+ * Under certain circumstances it is possible to avoid generating the
+ * post-barrier completely if it is possible during compile time to prove
+ * the object is newly allocated and that no safepoint exists between the
+ * allocation and the store.
+ *
+ * In the case of slow allocation the allocation code must handle the barrier
+ * as part of the allocation in the case the allocated object is not located
+ * in the nursery, this would happen for humongous objects. This is similar to
+ * how CMS is required to handle this case, see the comments for the method
+ * CollectedHeap::new_store_pre_barrier and OptoRuntime::new_store_pre_barrier.
+ * A deferred card mark is required for these objects and handled in the above
+ * mentioned methods.
+ *
+ * Returns true if the post barrier can be removed
+ */
+bool GraphKit::g1_can_remove_post_barrier(PhaseTransform* phase, Node* store,
+                                          Node* adr) {
+  intptr_t      offset = 0;
+  Node*         base   = AddPNode::Ideal_base_and_offset(adr, phase, offset);
+  AllocateNode* alloc  = AllocateNode::Ideal_allocation(base, phase);
+
+  if (offset == Type::OffsetBot) {
+    return false; // cannot unalias unless there are precise offsets
+  }
+
+  if (alloc == NULL) {
+     return false; // No allocation found
+  }
+
+  // Start search from Store node
+  Node* mem = store->in(MemNode::Control);
+  if (mem->is_Proj() && mem->in(0)->is_Initialize()) {
+
+    InitializeNode* st_init = mem->in(0)->as_Initialize();
+    AllocateNode*  st_alloc = st_init->allocation();
+
+    // Make sure we are looking at the same allocation
+    if (alloc == st_alloc) {
+      return true;
+    }
+  }
+
+  return false;
+}
+
 //
 // Update the card table and add card address to the queue
 //
@@ -3979,6 +4148,20 @@
     return;
   }
 
+  if (use_ReduceInitialCardMarks() && obj == just_allocated_object(control())) {
+    // We can skip marks on a freshly-allocated object in Eden.
+    // Keep this code in sync with new_store_pre_barrier() in runtime.cpp.
+    // That routine informs GC to take appropriate compensating steps,
+    // upon a slow-path allocation, so as to make this card-mark
+    // elision safe.
+    return;
+  }
+
+  if (use_ReduceInitialCardMarks()
+      && g1_can_remove_post_barrier(&_gvn, oop_store, adr)) {
+    return;
+  }
+
   if (!use_precise) {
     // All card marks for a (non-array) instance are in one place:
     adr = obj;
--- a/hotspot/src/share/vm/opto/graphKit.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/opto/graphKit.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -771,6 +771,10 @@
                     Node* index, Node* index_adr,
                     Node* buffer, const TypeFunc* tf);
 
+  bool g1_can_remove_pre_barrier(PhaseTransform* phase, Node* adr, BasicType bt, uint adr_idx);
+
+  bool g1_can_remove_post_barrier(PhaseTransform* phase, Node* store, Node* adr);
+
   public:
   // Helper function to round double arguments before a call
   void round_double_arguments(ciMethod* dest_method);
--- a/hotspot/src/share/vm/opto/idealGraphPrinter.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/opto/idealGraphPrinter.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -73,7 +73,9 @@
 int IdealGraphPrinter::_file_count = 0;
 
 IdealGraphPrinter *IdealGraphPrinter::printer() {
-  if (PrintIdealGraphLevel == 0) return NULL;
+  if (!PrintIdealGraph) {
+    return NULL;
+  }
 
   JavaThread *thread = JavaThread::current();
   if (!thread->is_Compiler_thread()) return NULL;
@@ -193,7 +195,6 @@
   }
 }
 
-
 void IdealGraphPrinter::begin_elem(const char *s) {
   _xml->begin_elem("%s", s);
 }
@@ -680,7 +681,7 @@
 // Print current ideal graph
 void IdealGraphPrinter::print(Compile* compile, const char *name, Node *node, int level, bool clear_nodes) {
 
-  if (!_current_method || !_should_send_method || level > PrintIdealGraphLevel) return;
+  if (!_current_method || !_should_send_method || !should_print(_current_method, level)) return;
 
   this->C = compile;
 
@@ -732,6 +733,13 @@
   output()->flush();
 }
 
+// Should method be printed?
+bool IdealGraphPrinter::should_print(ciMethod* method, int level) {
+  intx ideal_graph_level = PrintIdealGraphLevel;
+  method->has_option_value("PrintIdealGraphLevel", ideal_graph_level); // update value with per-method value (if available)
+  return ideal_graph_level >= level;
+}
+
 extern const char *NodeClassNames[];
 
 outputStream *IdealGraphPrinter::output() {
--- a/hotspot/src/share/vm/opto/idealGraphPrinter.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/opto/idealGraphPrinter.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -134,6 +134,7 @@
   void print_method(Compile* compile, const char *name, int level=1, bool clear_nodes = false);
   void print(Compile* compile, const char *name, Node *root, int level=1, bool clear_nodes = false);
   void print_xml(const char *name);
+  static bool should_print(ciMethod* method, int level = 1);
 };
 
 #endif
--- a/hotspot/src/share/vm/opto/parse2.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/opto/parse2.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -2344,7 +2344,7 @@
 
 #ifndef PRODUCT
   IdealGraphPrinter *printer = IdealGraphPrinter::printer();
-  if(printer) {
+  if (printer && printer->should_print(_method)) {
     char buffer[256];
     sprintf(buffer, "Bytecode %d: %s", bci(), Bytecodes::name(bc()));
     bool old = printer->traverse_outs();
--- a/hotspot/src/share/vm/prims/jvm.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -415,27 +415,12 @@
 
 extern volatile jint vm_created;
 
-JVM_ENTRY_NO_ENV(void, JVM_Exit(jint code))
-  if (vm_created != 0 && (code == 0)) {
-    // The VM is about to exit. We call back into Java to check whether finalizers should be run
-    Universe::run_finalizers_on_exit();
-  }
-  before_exit(thread);
-  vm_exit(code);
-JVM_END
-
-
 JVM_ENTRY_NO_ENV(void, JVM_Halt(jint code))
   before_exit(thread);
   vm_exit(code);
 JVM_END
 
 
-JVM_LEAF(void, JVM_OnExit(void (*func)(void)))
-  register_on_exit_function(func);
-JVM_END
-
-
 JVM_ENTRY_NO_ENV(void, JVM_GC(void))
   JVMWrapper("JVM_GC");
   if (!DisableExplicitGC) {
@@ -450,15 +435,6 @@
 JVM_END
 
 
-JVM_LEAF(void, JVM_TraceInstructions(jboolean on))
-  if (PrintJVMWarnings) warning("JVM_TraceInstructions not supported");
-JVM_END
-
-
-JVM_LEAF(void, JVM_TraceMethodCalls(jboolean on))
-  if (PrintJVMWarnings) warning("JVM_TraceMethodCalls not supported");
-JVM_END
-
 static inline jlong convert_size_t_to_jlong(size_t val) {
   // In the 64-bit vm, a size_t can overflow a jlong (which is signed).
   NOT_LP64 (return (jlong)val;)
@@ -628,60 +604,6 @@
   return JNIHandles::make_local(env, oop(new_obj));
 JVM_END
 
-// java.lang.Compiler ////////////////////////////////////////////////////
-
-// The initial cuts of the HotSpot VM will not support JITs, and all existing
-// JITs would need extensive changes to work with HotSpot.  The JIT-related JVM
-// functions are all silently ignored unless JVM warnings are printed.
-
-JVM_LEAF(void, JVM_InitializeCompiler (JNIEnv *env, jclass compCls))
-  if (PrintJVMWarnings) warning("JVM_InitializeCompiler not supported");
-JVM_END
-
-
-JVM_LEAF(jboolean, JVM_IsSilentCompiler(JNIEnv *env, jclass compCls))
-  if (PrintJVMWarnings) warning("JVM_IsSilentCompiler not supported");
-  return JNI_FALSE;
-JVM_END
-
-
-JVM_LEAF(jboolean, JVM_CompileClass(JNIEnv *env, jclass compCls, jclass cls))
-  if (PrintJVMWarnings) warning("JVM_CompileClass not supported");
-  return JNI_FALSE;
-JVM_END
-
-
-JVM_LEAF(jboolean, JVM_CompileClasses(JNIEnv *env, jclass cls, jstring jname))
-  if (PrintJVMWarnings) warning("JVM_CompileClasses not supported");
-  return JNI_FALSE;
-JVM_END
-
-
-JVM_LEAF(jobject, JVM_CompilerCommand(JNIEnv *env, jclass compCls, jobject arg))
-  if (PrintJVMWarnings) warning("JVM_CompilerCommand not supported");
-  return NULL;
-JVM_END
-
-
-JVM_LEAF(void, JVM_EnableCompiler(JNIEnv *env, jclass compCls))
-  if (PrintJVMWarnings) warning("JVM_EnableCompiler not supported");
-JVM_END
-
-
-JVM_LEAF(void, JVM_DisableCompiler(JNIEnv *env, jclass compCls))
-  if (PrintJVMWarnings) warning("JVM_DisableCompiler not supported");
-JVM_END
-
-
-
-// Error message support //////////////////////////////////////////////////////
-
-JVM_LEAF(jint, JVM_GetLastErrorString(char *buf, int len))
-  JVMWrapper("JVM_GetLastErrorString");
-  return (jint)os::lasterror(buf, len);
-JVM_END
-
-
 // java.io.File ///////////////////////////////////////////////////////////////
 
 JVM_LEAF(char*, JVM_NativePath(char* path))
@@ -757,12 +679,6 @@
 JVM_END
 
 
-JVM_ENTRY(void, JVM_ResolveClass(JNIEnv* env, jclass cls))
-  JVMWrapper("JVM_ResolveClass");
-  if (PrintJVMWarnings) warning("JVM_ResolveClass not implemented");
-JVM_END
-
-
 // Returns a class loaded by the bootstrap class loader; or null
 // if not found.  ClassNotFoundException is not thrown.
 //
@@ -1651,21 +1567,6 @@
   return true;
 }
 
-JVM_ENTRY(jbyteArray, JVM_GetFieldAnnotations(JNIEnv *env, jobject field))
-  // field is a handle to a java.lang.reflect.Field object
-  assert(field != NULL, "illegal field");
-  JVMWrapper("JVM_GetFieldAnnotations");
-
-  fieldDescriptor fd;
-  bool gotFd = jvm_get_field_common(field, fd, CHECK_NULL);
-  if (!gotFd) {
-    return NULL;
-  }
-
-  return (jbyteArray) JNIHandles::make_local(env, Annotations::make_java_array(fd.annotations(), THREAD));
-JVM_END
-
-
 static Method* jvm_get_method_common(jobject method) {
   // some of this code was adapted from from jni_FromReflectedMethod
 
@@ -1689,48 +1590,6 @@
   return m;  // caller has to deal with NULL in product mode
 }
 
-
-JVM_ENTRY(jbyteArray, JVM_GetMethodAnnotations(JNIEnv *env, jobject method))
-  JVMWrapper("JVM_GetMethodAnnotations");
-
-  // method is a handle to a java.lang.reflect.Method object
-  Method* m = jvm_get_method_common(method);
-  if (m == NULL) {
-    return NULL;
-  }
-
-  return (jbyteArray) JNIHandles::make_local(env,
-    Annotations::make_java_array(m->annotations(), THREAD));
-JVM_END
-
-
-JVM_ENTRY(jbyteArray, JVM_GetMethodDefaultAnnotationValue(JNIEnv *env, jobject method))
-  JVMWrapper("JVM_GetMethodDefaultAnnotationValue");
-
-  // method is a handle to a java.lang.reflect.Method object
-  Method* m = jvm_get_method_common(method);
-  if (m == NULL) {
-    return NULL;
-  }
-
-  return (jbyteArray) JNIHandles::make_local(env,
-    Annotations::make_java_array(m->annotation_default(), THREAD));
-JVM_END
-
-
-JVM_ENTRY(jbyteArray, JVM_GetMethodParameterAnnotations(JNIEnv *env, jobject method))
-  JVMWrapper("JVM_GetMethodParameterAnnotations");
-
-  // method is a handle to a java.lang.reflect.Method object
-  Method* m = jvm_get_method_common(method);
-  if (m == NULL) {
-    return NULL;
-  }
-
-  return (jbyteArray) JNIHandles::make_local(env,
-    Annotations::make_java_array(m->parameter_annotations(), THREAD));
-JVM_END
-
 /* Type use annotations support (JDK 1.8) */
 
 JVM_ENTRY(jbyteArray, JVM_GetClassTypeAnnotations(JNIEnv *env, jclass cls))
@@ -2717,77 +2576,6 @@
   return (jboolean) Reflection::is_same_class_package(klass1, klass2);
 JVM_END
 
-
-// IO functions ////////////////////////////////////////////////////////////////////////////////////////
-
-JVM_LEAF(jint, JVM_Open(const char *fname, jint flags, jint mode))
-  JVMWrapper2("JVM_Open (%s)", fname);
-
-  //%note jvm_r6
-  int result = os::open(fname, flags, mode);
-  if (result >= 0) {
-    return result;
-  } else {
-    switch(errno) {
-      case EEXIST:
-        return JVM_EEXIST;
-      default:
-        return -1;
-    }
-  }
-JVM_END
-
-
-JVM_LEAF(jint, JVM_Close(jint fd))
-  JVMWrapper2("JVM_Close (0x%x)", fd);
-  //%note jvm_r6
-  return os::close(fd);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_Read(jint fd, char *buf, jint nbytes))
-  JVMWrapper2("JVM_Read (0x%x)", fd);
-
-  //%note jvm_r6
-  return (jint)os::restartable_read(fd, buf, nbytes);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_Write(jint fd, char *buf, jint nbytes))
-  JVMWrapper2("JVM_Write (0x%x)", fd);
-
-  //%note jvm_r6
-  return (jint)os::write(fd, buf, nbytes);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_Available(jint fd, jlong *pbytes))
-  JVMWrapper2("JVM_Available (0x%x)", fd);
-  //%note jvm_r6
-  return os::available(fd, pbytes);
-JVM_END
-
-
-JVM_LEAF(jlong, JVM_Lseek(jint fd, jlong offset, jint whence))
-  JVMWrapper4("JVM_Lseek (0x%x, " INT64_FORMAT ", %d)", fd, (int64_t) offset, whence);
-  //%note jvm_r6
-  return os::lseek(fd, offset, whence);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_SetLength(jint fd, jlong length))
-  JVMWrapper3("JVM_SetLength (0x%x, " INT64_FORMAT ")", fd, (int64_t) length);
-  return os::ftruncate(fd, length);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_Sync(jint fd))
-  JVMWrapper2("JVM_Sync (0x%x)", fd);
-  //%note jvm_r6
-  return os::fsync(fd);
-JVM_END
-
-
 // Printing support //////////////////////////////////////////////////
 extern "C" {
 
@@ -3459,96 +3247,6 @@
   return (!access.is_private() && InstanceKlass::cast(current_class)->is_same_class_package(field_class));
 }
 
-
-// JVM_AllocateNewObject and JVM_AllocateNewArray are unused as of 1.4
-JVM_ENTRY(jobject, JVM_AllocateNewObject(JNIEnv *env, jobject receiver, jclass currClass, jclass initClass))
-  JVMWrapper("JVM_AllocateNewObject");
-  JvmtiVMObjectAllocEventCollector oam;
-  // Receiver is not used
-  oop curr_mirror = JNIHandles::resolve_non_null(currClass);
-  oop init_mirror = JNIHandles::resolve_non_null(initClass);
-
-  // Cannot instantiate primitive types
-  if (java_lang_Class::is_primitive(curr_mirror) || java_lang_Class::is_primitive(init_mirror)) {
-    ResourceMark rm(THREAD);
-    THROW_0(vmSymbols::java_lang_InvalidClassException());
-  }
-
-  // Arrays not allowed here, must use JVM_AllocateNewArray
-  if (java_lang_Class::as_Klass(curr_mirror)->oop_is_array() ||
-      java_lang_Class::as_Klass(init_mirror)->oop_is_array()) {
-    ResourceMark rm(THREAD);
-    THROW_0(vmSymbols::java_lang_InvalidClassException());
-  }
-
-  instanceKlassHandle curr_klass (THREAD, java_lang_Class::as_Klass(curr_mirror));
-  instanceKlassHandle init_klass (THREAD, java_lang_Class::as_Klass(init_mirror));
-
-  assert(curr_klass->is_subclass_of(init_klass()), "just checking");
-
-  // Interfaces, abstract classes, and java.lang.Class classes cannot be instantiated directly.
-  curr_klass->check_valid_for_instantiation(false, CHECK_NULL);
-
-  // Make sure klass is initialized, since we are about to instantiate one of them.
-  curr_klass->initialize(CHECK_NULL);
-
- methodHandle m (THREAD,
-                 init_klass->find_method(vmSymbols::object_initializer_name(),
-                                         vmSymbols::void_method_signature()));
-  if (m.is_null()) {
-    ResourceMark rm(THREAD);
-    THROW_MSG_0(vmSymbols::java_lang_NoSuchMethodError(),
-                Method::name_and_sig_as_C_string(init_klass(),
-                                          vmSymbols::object_initializer_name(),
-                                          vmSymbols::void_method_signature()));
-  }
-
-  if (curr_klass ==  init_klass && !m->is_public()) {
-    // Calling the constructor for class 'curr_klass'.
-    // Only allow calls to a public no-arg constructor.
-    // This path corresponds to creating an Externalizable object.
-    THROW_0(vmSymbols::java_lang_IllegalAccessException());
-  }
-
-  if (!force_verify_field_access(curr_klass(), init_klass(), m->access_flags(), false)) {
-    // subclass 'curr_klass' does not have access to no-arg constructor of 'initcb'
-    THROW_0(vmSymbols::java_lang_IllegalAccessException());
-  }
-
-  Handle obj = curr_klass->allocate_instance_handle(CHECK_NULL);
-  // Call constructor m. This might call a constructor higher up in the hierachy
-  JavaCalls::call_default_constructor(thread, m, obj, CHECK_NULL);
-
-  return JNIHandles::make_local(obj());
-JVM_END
-
-
-JVM_ENTRY(jobject, JVM_AllocateNewArray(JNIEnv *env, jobject obj, jclass currClass, jint length))
-  JVMWrapper("JVM_AllocateNewArray");
-  JvmtiVMObjectAllocEventCollector oam;
-  oop mirror = JNIHandles::resolve_non_null(currClass);
-
-  if (java_lang_Class::is_primitive(mirror)) {
-    THROW_0(vmSymbols::java_lang_InvalidClassException());
-  }
-  Klass* k = java_lang_Class::as_Klass(mirror);
-  oop result;
-
-  if (k->oop_is_typeArray()) {
-    // typeArray
-    result = TypeArrayKlass::cast(k)->allocate(length, CHECK_NULL);
-  } else if (k->oop_is_objArray()) {
-    // objArray
-    ObjArrayKlass* oak = ObjArrayKlass::cast(k);
-    oak->initialize(CHECK_NULL); // make sure class is initialized (matches Classic VM behavior)
-    result = oak->allocate(length, CHECK_NULL);
-  } else {
-    THROW_0(vmSymbols::java_lang_InvalidClassException());
-  }
-  return JNIHandles::make_local(env, result);
-JVM_END
-
-
 // Return the first non-null class loader up the execution stack, or null
 // if only code from the null class loader is on the stack.
 
@@ -3564,60 +3262,6 @@
 JVM_END
 
 
-// Load a class relative to the most recent class on the stack  with a non-null
-// classloader.
-// This function has been deprecated and should not be considered part of the
-// specified JVM interface.
-
-JVM_ENTRY(jclass, JVM_LoadClass0(JNIEnv *env, jobject receiver,
-                                 jclass currClass, jstring currClassName))
-  JVMWrapper("JVM_LoadClass0");
-  // Receiver is not used
-  ResourceMark rm(THREAD);
-
-  // Class name argument is not guaranteed to be in internal format
-  Handle classname (THREAD, JNIHandles::resolve_non_null(currClassName));
-  Handle string = java_lang_String::internalize_classname(classname, CHECK_NULL);
-
-  const char* str = java_lang_String::as_utf8_string(string());
-
-  if (str == NULL || (int)strlen(str) > Symbol::max_length()) {
-    // It's impossible to create this class;  the name cannot fit
-    // into the constant pool.
-    THROW_MSG_0(vmSymbols::java_lang_NoClassDefFoundError(), str);
-  }
-
-  TempNewSymbol name = SymbolTable::new_symbol(str, CHECK_NULL);
-  Handle curr_klass (THREAD, JNIHandles::resolve(currClass));
-  // Find the most recent class on the stack with a non-null classloader
-  oop loader = NULL;
-  oop protection_domain = NULL;
-  if (curr_klass.is_null()) {
-    for (vframeStream vfst(thread);
-         !vfst.at_end() && loader == NULL;
-         vfst.next()) {
-      if (!vfst.method()->is_native()) {
-        InstanceKlass* holder = vfst.method()->method_holder();
-        loader             = holder->class_loader();
-        protection_domain  = holder->protection_domain();
-      }
-    }
-  } else {
-    Klass* curr_klass_oop = java_lang_Class::as_Klass(curr_klass());
-    loader            = InstanceKlass::cast(curr_klass_oop)->class_loader();
-    protection_domain = InstanceKlass::cast(curr_klass_oop)->protection_domain();
-  }
-  Handle h_loader(THREAD, loader);
-  Handle h_prot  (THREAD, protection_domain);
-  jclass result =  find_class_from_class_loader(env, name, true, h_loader, h_prot,
-                                                false, thread);
-  if (TraceClassResolution && result != NULL) {
-    trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result)));
-  }
-  return result;
-JVM_END
-
-
 // Array ///////////////////////////////////////////////////////////////////////////////////////////
 
 
@@ -3713,143 +3357,6 @@
 JVM_END
 
 
-// Networking library support ////////////////////////////////////////////////////////////////////
-
-JVM_LEAF(jint, JVM_InitializeSocketLibrary())
-  JVMWrapper("JVM_InitializeSocketLibrary");
-  return 0;
-JVM_END
-
-
-JVM_LEAF(jint, JVM_Socket(jint domain, jint type, jint protocol))
-  JVMWrapper("JVM_Socket");
-  return os::socket(domain, type, protocol);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_SocketClose(jint fd))
-  JVMWrapper2("JVM_SocketClose (0x%x)", fd);
-  //%note jvm_r6
-  return os::socket_close(fd);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_SocketShutdown(jint fd, jint howto))
-  JVMWrapper2("JVM_SocketShutdown (0x%x)", fd);
-  //%note jvm_r6
-  return os::socket_shutdown(fd, howto);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_Recv(jint fd, char *buf, jint nBytes, jint flags))
-  JVMWrapper2("JVM_Recv (0x%x)", fd);
-  //%note jvm_r6
-  return os::recv(fd, buf, (size_t)nBytes, (uint)flags);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_Send(jint fd, char *buf, jint nBytes, jint flags))
-  JVMWrapper2("JVM_Send (0x%x)", fd);
-  //%note jvm_r6
-  return os::send(fd, buf, (size_t)nBytes, (uint)flags);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_Timeout(int fd, long timeout))
-  JVMWrapper2("JVM_Timeout (0x%x)", fd);
-  //%note jvm_r6
-  return os::timeout(fd, timeout);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_Listen(jint fd, jint count))
-  JVMWrapper2("JVM_Listen (0x%x)", fd);
-  //%note jvm_r6
-  return os::listen(fd, count);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_Connect(jint fd, struct sockaddr *him, jint len))
-  JVMWrapper2("JVM_Connect (0x%x)", fd);
-  //%note jvm_r6
-  return os::connect(fd, him, (socklen_t)len);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_Bind(jint fd, struct sockaddr *him, jint len))
-  JVMWrapper2("JVM_Bind (0x%x)", fd);
-  //%note jvm_r6
-  return os::bind(fd, him, (socklen_t)len);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_Accept(jint fd, struct sockaddr *him, jint *len))
-  JVMWrapper2("JVM_Accept (0x%x)", fd);
-  //%note jvm_r6
-  socklen_t socklen = (socklen_t)(*len);
-  jint result = os::accept(fd, him, &socklen);
-  *len = (jint)socklen;
-  return result;
-JVM_END
-
-
-JVM_LEAF(jint, JVM_RecvFrom(jint fd, char *buf, int nBytes, int flags, struct sockaddr *from, int *fromlen))
-  JVMWrapper2("JVM_RecvFrom (0x%x)", fd);
-  //%note jvm_r6
-  socklen_t socklen = (socklen_t)(*fromlen);
-  jint result = os::recvfrom(fd, buf, (size_t)nBytes, (uint)flags, from, &socklen);
-  *fromlen = (int)socklen;
-  return result;
-JVM_END
-
-
-JVM_LEAF(jint, JVM_GetSockName(jint fd, struct sockaddr *him, int *len))
-  JVMWrapper2("JVM_GetSockName (0x%x)", fd);
-  //%note jvm_r6
-  socklen_t socklen = (socklen_t)(*len);
-  jint result = os::get_sock_name(fd, him, &socklen);
-  *len = (int)socklen;
-  return result;
-JVM_END
-
-
-JVM_LEAF(jint, JVM_SendTo(jint fd, char *buf, int len, int flags, struct sockaddr *to, int tolen))
-  JVMWrapper2("JVM_SendTo (0x%x)", fd);
-  //%note jvm_r6
-  return os::sendto(fd, buf, (size_t)len, (uint)flags, to, (socklen_t)tolen);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_SocketAvailable(jint fd, jint *pbytes))
-  JVMWrapper2("JVM_SocketAvailable (0x%x)", fd);
-  //%note jvm_r6
-  return os::socket_available(fd, pbytes);
-JVM_END
-
-
-JVM_LEAF(jint, JVM_GetSockOpt(jint fd, int level, int optname, char *optval, int *optlen))
-  JVMWrapper2("JVM_GetSockOpt (0x%x)", fd);
-  //%note jvm_r6
-  socklen_t socklen = (socklen_t)(*optlen);
-  jint result = os::get_sock_opt(fd, level, optname, optval, &socklen);
-  *optlen = (int)socklen;
-  return result;
-JVM_END
-
-
-JVM_LEAF(jint, JVM_SetSockOpt(jint fd, int level, int optname, const char *optval, int optlen))
-  JVMWrapper2("JVM_GetSockOpt (0x%x)", fd);
-  //%note jvm_r6
-  return os::set_sock_opt(fd, level, optname, optval, (socklen_t)optlen);
-JVM_END
-
-
-JVM_LEAF(int, JVM_GetHostName(char* name, int namelen))
-  JVMWrapper("JVM_GetHostName");
-  return os::get_host_name(name, namelen);
-JVM_END
-
-
 // Library support ///////////////////////////////////////////////////////////////////////////
 
 JVM_ENTRY_NO_ENV(void*, JVM_LoadLibrary(const char* name))
@@ -3891,14 +3398,6 @@
 JVM_END
 
 
-// Floating point support ////////////////////////////////////////////////////////////////////
-
-JVM_LEAF(jboolean, JVM_IsNaN(jdouble a))
-  JVMWrapper("JVM_IsNaN");
-  return g_isnan(a);
-JVM_END
-
-
 // JNI version ///////////////////////////////////////////////////////////////////////////////
 
 JVM_LEAF(jboolean, JVM_IsSupportedJNIVersion(jint version))
@@ -4024,20 +3523,6 @@
   return VM_Version::supports_cx8();
 JVM_END
 
-
-JVM_ENTRY(jboolean, JVM_CX8Field(JNIEnv *env, jobject obj, jfieldID fid, jlong oldVal, jlong newVal))
-  JVMWrapper("JVM_CX8Field");
-  jlong res;
-  oop             o       = JNIHandles::resolve(obj);
-  intptr_t        fldOffs = jfieldIDWorkaround::from_instance_jfieldID(o->klass(), fid);
-  volatile jlong* addr    = (volatile jlong*)((address)o + fldOffs);
-
-  assert(VM_Version::supports_cx8(), "cx8 not supported");
-  res = Atomic::cmpxchg(newVal, addr, oldVal);
-
-  return res == oldVal;
-JVM_END
-
 // DTrace ///////////////////////////////////////////////////////////////////
 
 JVM_ENTRY(jint, JVM_DTraceGetVersion(JNIEnv* env))
@@ -4192,189 +3677,6 @@
 }
 JVM_END
 
-JVM_ENTRY(jintArray, JVM_GetThreadStateValues(JNIEnv* env,
-                                              jint javaThreadState))
-{
-  // If new thread states are added in future JDK and VM versions,
-  // this should check if the JDK version is compatible with thread
-  // states supported by the VM.  Return NULL if not compatible.
-  //
-  // This function must map the VM java_lang_Thread::ThreadStatus
-  // to the Java thread state that the JDK supports.
-  //
-
-  typeArrayHandle values_h;
-  switch (javaThreadState) {
-    case JAVA_THREAD_STATE_NEW : {
-      typeArrayOop r = oopFactory::new_typeArray(T_INT, 1, CHECK_NULL);
-      values_h = typeArrayHandle(THREAD, r);
-      values_h->int_at_put(0, java_lang_Thread::NEW);
-      break;
-    }
-    case JAVA_THREAD_STATE_RUNNABLE : {
-      typeArrayOop r = oopFactory::new_typeArray(T_INT, 1, CHECK_NULL);
-      values_h = typeArrayHandle(THREAD, r);
-      values_h->int_at_put(0, java_lang_Thread::RUNNABLE);
-      break;
-    }
-    case JAVA_THREAD_STATE_BLOCKED : {
-      typeArrayOop r = oopFactory::new_typeArray(T_INT, 1, CHECK_NULL);
-      values_h = typeArrayHandle(THREAD, r);
-      values_h->int_at_put(0, java_lang_Thread::BLOCKED_ON_MONITOR_ENTER);
-      break;
-    }
-    case JAVA_THREAD_STATE_WAITING : {
-      typeArrayOop r = oopFactory::new_typeArray(T_INT, 2, CHECK_NULL);
-      values_h = typeArrayHandle(THREAD, r);
-      values_h->int_at_put(0, java_lang_Thread::IN_OBJECT_WAIT);
-      values_h->int_at_put(1, java_lang_Thread::PARKED);
-      break;
-    }
-    case JAVA_THREAD_STATE_TIMED_WAITING : {
-      typeArrayOop r = oopFactory::new_typeArray(T_INT, 3, CHECK_NULL);
-      values_h = typeArrayHandle(THREAD, r);
-      values_h->int_at_put(0, java_lang_Thread::SLEEPING);
-      values_h->int_at_put(1, java_lang_Thread::IN_OBJECT_WAIT_TIMED);
-      values_h->int_at_put(2, java_lang_Thread::PARKED_TIMED);
-      break;
-    }
-    case JAVA_THREAD_STATE_TERMINATED : {
-      typeArrayOop r = oopFactory::new_typeArray(T_INT, 1, CHECK_NULL);
-      values_h = typeArrayHandle(THREAD, r);
-      values_h->int_at_put(0, java_lang_Thread::TERMINATED);
-      break;
-    }
-    default:
-      // Unknown state - probably incompatible JDK version
-      return NULL;
-  }
-
-  return (jintArray) JNIHandles::make_local(env, values_h());
-}
-JVM_END
-
-
-JVM_ENTRY(jobjectArray, JVM_GetThreadStateNames(JNIEnv* env,
-                                                jint javaThreadState,
-                                                jintArray values))
-{
-  // If new thread states are added in future JDK and VM versions,
-  // this should check if the JDK version is compatible with thread
-  // states supported by the VM.  Return NULL if not compatible.
-  //
-  // This function must map the VM java_lang_Thread::ThreadStatus
-  // to the Java thread state that the JDK supports.
-  //
-
-  ResourceMark rm;
-
-  // Check if threads is null
-  if (values == NULL) {
-    THROW_(vmSymbols::java_lang_NullPointerException(), 0);
-  }
-
-  typeArrayOop v = typeArrayOop(JNIHandles::resolve_non_null(values));
-  typeArrayHandle values_h(THREAD, v);
-
-  objArrayHandle names_h;
-  switch (javaThreadState) {
-    case JAVA_THREAD_STATE_NEW : {
-      assert(values_h->length() == 1 &&
-               values_h->int_at(0) == java_lang_Thread::NEW,
-             "Invalid threadStatus value");
-
-      objArrayOop r = oopFactory::new_objArray(SystemDictionary::String_klass(),
-                                               1, /* only 1 substate */
-                                               CHECK_NULL);
-      names_h = objArrayHandle(THREAD, r);
-      Handle name = java_lang_String::create_from_str("NEW", CHECK_NULL);
-      names_h->obj_at_put(0, name());
-      break;
-    }
-    case JAVA_THREAD_STATE_RUNNABLE : {
-      assert(values_h->length() == 1 &&
-               values_h->int_at(0) == java_lang_Thread::RUNNABLE,
-             "Invalid threadStatus value");
-
-      objArrayOop r = oopFactory::new_objArray(SystemDictionary::String_klass(),
-                                               1, /* only 1 substate */
-                                               CHECK_NULL);
-      names_h = objArrayHandle(THREAD, r);
-      Handle name = java_lang_String::create_from_str("RUNNABLE", CHECK_NULL);
-      names_h->obj_at_put(0, name());
-      break;
-    }
-    case JAVA_THREAD_STATE_BLOCKED : {
-      assert(values_h->length() == 1 &&
-               values_h->int_at(0) == java_lang_Thread::BLOCKED_ON_MONITOR_ENTER,
-             "Invalid threadStatus value");
-
-      objArrayOop r = oopFactory::new_objArray(SystemDictionary::String_klass(),
-                                               1, /* only 1 substate */
-                                               CHECK_NULL);
-      names_h = objArrayHandle(THREAD, r);
-      Handle name = java_lang_String::create_from_str("BLOCKED", CHECK_NULL);
-      names_h->obj_at_put(0, name());
-      break;
-    }
-    case JAVA_THREAD_STATE_WAITING : {
-      assert(values_h->length() == 2 &&
-               values_h->int_at(0) == java_lang_Thread::IN_OBJECT_WAIT &&
-               values_h->int_at(1) == java_lang_Thread::PARKED,
-             "Invalid threadStatus value");
-      objArrayOop r = oopFactory::new_objArray(SystemDictionary::String_klass(),
-                                               2, /* number of substates */
-                                               CHECK_NULL);
-      names_h = objArrayHandle(THREAD, r);
-      Handle name0 = java_lang_String::create_from_str("WAITING.OBJECT_WAIT",
-                                                       CHECK_NULL);
-      Handle name1 = java_lang_String::create_from_str("WAITING.PARKED",
-                                                       CHECK_NULL);
-      names_h->obj_at_put(0, name0());
-      names_h->obj_at_put(1, name1());
-      break;
-    }
-    case JAVA_THREAD_STATE_TIMED_WAITING : {
-      assert(values_h->length() == 3 &&
-               values_h->int_at(0) == java_lang_Thread::SLEEPING &&
-               values_h->int_at(1) == java_lang_Thread::IN_OBJECT_WAIT_TIMED &&
-               values_h->int_at(2) == java_lang_Thread::PARKED_TIMED,
-             "Invalid threadStatus value");
-      objArrayOop r = oopFactory::new_objArray(SystemDictionary::String_klass(),
-                                               3, /* number of substates */
-                                               CHECK_NULL);
-      names_h = objArrayHandle(THREAD, r);
-      Handle name0 = java_lang_String::create_from_str("TIMED_WAITING.SLEEPING",
-                                                       CHECK_NULL);
-      Handle name1 = java_lang_String::create_from_str("TIMED_WAITING.OBJECT_WAIT",
-                                                       CHECK_NULL);
-      Handle name2 = java_lang_String::create_from_str("TIMED_WAITING.PARKED",
-                                                       CHECK_NULL);
-      names_h->obj_at_put(0, name0());
-      names_h->obj_at_put(1, name1());
-      names_h->obj_at_put(2, name2());
-      break;
-    }
-    case JAVA_THREAD_STATE_TERMINATED : {
-      assert(values_h->length() == 1 &&
-               values_h->int_at(0) == java_lang_Thread::TERMINATED,
-             "Invalid threadStatus value");
-      objArrayOop r = oopFactory::new_objArray(SystemDictionary::String_klass(),
-                                               1, /* only 1 substate */
-                                               CHECK_NULL);
-      names_h = objArrayHandle(THREAD, r);
-      Handle name = java_lang_String::create_from_str("TERMINATED", CHECK_NULL);
-      names_h->obj_at_put(0, name());
-      break;
-    }
-    default:
-      // Unknown state - probably incompatible JDK version
-      return NULL;
-  }
-  return (jobjectArray) JNIHandles::make_local(env, names_h());
-}
-JVM_END
-
 JVM_ENTRY(void, JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size))
 {
   memset(info, 0, info_size);
--- a/hotspot/src/share/vm/prims/jvm.h	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/prims/jvm.h	Wed Jul 05 20:05:30 2017 +0200
@@ -138,18 +138,6 @@
 JNIEXPORT jobject JNICALL
 JVM_InitProperties(JNIEnv *env, jobject p);
 
-/*
- * java.io.File
- */
-JNIEXPORT void JNICALL
-JVM_OnExit(void (*func)(void));
-
-/*
- * java.lang.Runtime
- */
-JNIEXPORT void JNICALL
-JVM_Exit(jint code);
-
 JNIEXPORT void JNICALL
 JVM_Halt(jint code);
 
@@ -173,12 +161,6 @@
 JNIEXPORT jlong JNICALL
 JVM_MaxObjectInspectionAge(void);
 
-JNIEXPORT void JNICALL
-JVM_TraceInstructions(jboolean on);
-
-JNIEXPORT void JNICALL
-JVM_TraceMethodCalls(jboolean on);
-
 JNIEXPORT jlong JNICALL
 JVM_TotalMemory(void);
 
@@ -204,12 +186,6 @@
 JVM_IsSupportedJNIVersion(jint version);
 
 /*
- * java.lang.Float and java.lang.Double
- */
-JNIEXPORT jboolean JNICALL
-JVM_IsNaN(jdouble d);
-
-/*
  * java.lang.Throwable
  */
 JNIEXPORT void JNICALL
@@ -222,30 +198,6 @@
 JVM_GetStackTraceElement(JNIEnv *env, jobject throwable, jint index);
 
 /*
- * java.lang.Compiler
- */
-JNIEXPORT void JNICALL
-JVM_InitializeCompiler (JNIEnv *env, jclass compCls);
-
-JNIEXPORT jboolean JNICALL
-JVM_IsSilentCompiler(JNIEnv *env, jclass compCls);
-
-JNIEXPORT jboolean JNICALL
-JVM_CompileClass(JNIEnv *env, jclass compCls, jclass cls);
-
-JNIEXPORT jboolean JNICALL
-JVM_CompileClasses(JNIEnv *env, jclass cls, jstring jname);
-
-JNIEXPORT jobject JNICALL
-JVM_CompilerCommand(JNIEnv *env, jclass compCls, jobject arg);
-
-JNIEXPORT void JNICALL
-JVM_EnableCompiler(JNIEnv *env, jclass compCls);
-
-JNIEXPORT void JNICALL
-JVM_DisableCompiler(JNIEnv *env, jclass compCls);
-
-/*
  * java.lang.Thread
  */
 JNIEXPORT void JNICALL
@@ -331,25 +283,9 @@
  * java.io.ObjectInputStream
  */
 JNIEXPORT jobject JNICALL
-JVM_AllocateNewObject(JNIEnv *env, jobject obj, jclass currClass,
-                      jclass initClass);
-
-JNIEXPORT jobject JNICALL
-JVM_AllocateNewArray(JNIEnv *env, jobject obj, jclass currClass,
-                     jint length);
-
-JNIEXPORT jobject JNICALL
 JVM_LatestUserDefinedLoader(JNIEnv *env);
 
 /*
- * This function has been deprecated and should not be considered
- * part of the specified JVM interface.
- */
-JNIEXPORT jclass JNICALL
-JVM_LoadClass0(JNIEnv *env, jobject obj, jclass currClass,
-               jstring currClassName);
-
-/*
  * java.lang.reflect.Array
  */
 JNIEXPORT jint JNICALL
@@ -399,12 +335,6 @@
 JVM_FindPrimitiveClass(JNIEnv *env, const char *utf);
 
 /*
- * Link the class
- */
-JNIEXPORT void JNICALL
-JVM_ResolveClass(JNIEnv *env, jclass cls);
-
-/*
  * Find a class from a given class loader. Throw ClassNotFoundException
  * or NoClassDefFoundError depending on the value of the last
  * argument.
@@ -512,22 +442,6 @@
 
 /* Annotations support (JDK 1.6) */
 
-// field is a handle to a java.lang.reflect.Field object
-JNIEXPORT jbyteArray JNICALL
-JVM_GetFieldAnnotations(JNIEnv *env, jobject field);
-
-// method is a handle to a java.lang.reflect.Method object
-JNIEXPORT jbyteArray JNICALL
-JVM_GetMethodAnnotations(JNIEnv *env, jobject method);
-
-// method is a handle to a java.lang.reflect.Method object
-JNIEXPORT jbyteArray JNICALL
-JVM_GetMethodDefaultAnnotationValue(JNIEnv *env, jobject method);
-
-// method is a handle to a java.lang.reflect.Method object
-JNIEXPORT jbyteArray JNICALL
-JVM_GetMethodParameterAnnotations(JNIEnv *env, jobject method);
-
 /* Type use annotations support (JDK 1.8) */
 
 JNIEXPORT jbyteArray JNICALL
@@ -660,9 +574,6 @@
 JNIEXPORT jboolean JNICALL
 JVM_SupportsCX8(void);
 
-JNIEXPORT jboolean JNICALL
-JVM_CX8Field(JNIEnv *env, jobject obj, jfieldID fldID, jlong oldVal, jlong newVal);
-
 /*
  * com.sun.dtrace.jsdt support
  */
@@ -1243,43 +1154,6 @@
  PART 3: I/O and Network Support
  ************************************************************************/
 
-/* Note that the JVM IO functions are expected to return JVM_IO_ERR
- * when there is any kind of error. The caller can then use the
- * platform specific support (e.g., errno) to get the detailed
- * error info.  The JVM_GetLastErrorString procedure may also be used
- * to obtain a descriptive error string.
- */
-#define JVM_IO_ERR  (-1)
-
-/* For interruptible IO. Returning JVM_IO_INTR indicates that an IO
- * operation has been disrupted by Thread.interrupt. There are a
- * number of technical difficulties related to interruptible IO that
- * need to be solved. For example, most existing programs do not handle
- * InterruptedIOExceptions specially, they simply treat those as any
- * IOExceptions, which typically indicate fatal errors.
- *
- * There are also two modes of operation for interruptible IO. In the
- * resumption mode, an interrupted IO operation is guaranteed not to
- * have any side-effects, and can be restarted. In the termination mode,
- * an interrupted IO operation corrupts the underlying IO stream, so
- * that the only reasonable operation on an interrupted stream is to
- * close that stream. The resumption mode seems to be impossible to
- * implement on Win32 and Solaris. Implementing the termination mode is
- * easier, but it's not clear that's the right semantics.
- *
- * Interruptible IO is not supported on Win32.It can be enabled/disabled
- * using a compile-time flag on Solaris. Third-party JVM ports do not
- * need to implement interruptible IO.
- */
-#define JVM_IO_INTR (-2)
-
-/* Write a string into the given buffer, in the platform's local encoding,
- * that describes the most recent system-level error to occur in this thread.
- * Return the length of the string or zero if no error occurred.
- */
-JNIEXPORT jint JNICALL
-JVM_GetLastErrorString(char *buf, int len);
-
 /*
  * Convert a pathname into native format.  This function does syntactic
  * cleanup, such as removing redundant separator characters.  It modifies
@@ -1289,150 +1163,6 @@
 JVM_NativePath(char *);
 
 /*
- * JVM I/O error codes
- */
-#define JVM_EEXIST       -100
-
-/*
- * Open a file descriptor. This function returns a negative error code
- * on error, and a non-negative integer that is the file descriptor on
- * success.
- */
-JNIEXPORT jint JNICALL
-JVM_Open(const char *fname, jint flags, jint mode);
-
-/*
- * Close a file descriptor. This function returns -1 on error, and 0
- * on success.
- *
- * fd        the file descriptor to close.
- */
-JNIEXPORT jint JNICALL
-JVM_Close(jint fd);
-
-/*
- * Read data from a file decriptor into a char array.
- *
- * fd        the file descriptor to read from.
- * buf       the buffer where to put the read data.
- * nbytes    the number of bytes to read.
- *
- * This function returns -1 on error, and 0 on success.
- */
-JNIEXPORT jint JNICALL
-JVM_Read(jint fd, char *buf, jint nbytes);
-
-/*
- * Write data from a char array to a file decriptor.
- *
- * fd        the file descriptor to read from.
- * buf       the buffer from which to fetch the data.
- * nbytes    the number of bytes to write.
- *
- * This function returns -1 on error, and 0 on success.
- */
-JNIEXPORT jint JNICALL
-JVM_Write(jint fd, char *buf, jint nbytes);
-
-/*
- * Returns the number of bytes available for reading from a given file
- * descriptor
- */
-JNIEXPORT jint JNICALL
-JVM_Available(jint fd, jlong *pbytes);
-
-/*
- * Move the file descriptor pointer from whence by offset.
- *
- * fd        the file descriptor to move.
- * offset    the number of bytes to move it by.
- * whence    the start from where to move it.
- *
- * This function returns the resulting pointer location.
- */
-JNIEXPORT jlong JNICALL
-JVM_Lseek(jint fd, jlong offset, jint whence);
-
-/*
- * Set the length of the file associated with the given descriptor to the given
- * length.  If the new length is longer than the current length then the file
- * is extended; the contents of the extended portion are not defined.  The
- * value of the file pointer is undefined after this procedure returns.
- */
-JNIEXPORT jint JNICALL
-JVM_SetLength(jint fd, jlong length);
-
-/*
- * Synchronize the file descriptor's in memory state with that of the
- * physical device.  Return of -1 is an error, 0 is OK.
- */
-JNIEXPORT jint JNICALL
-JVM_Sync(jint fd);
-
-/*
- * Networking library support
- */
-
-JNIEXPORT jint JNICALL
-JVM_InitializeSocketLibrary(void);
-
-struct sockaddr;
-
-JNIEXPORT jint JNICALL
-JVM_Socket(jint domain, jint type, jint protocol);
-
-JNIEXPORT jint JNICALL
-JVM_SocketClose(jint fd);
-
-JNIEXPORT jint JNICALL
-JVM_SocketShutdown(jint fd, jint howto);
-
-JNIEXPORT jint JNICALL
-JVM_Recv(jint fd, char *buf, jint nBytes, jint flags);
-
-JNIEXPORT jint JNICALL
-JVM_Send(jint fd, char *buf, jint nBytes, jint flags);
-
-JNIEXPORT jint JNICALL
-JVM_Timeout(int fd, long timeout);
-
-JNIEXPORT jint JNICALL
-JVM_Listen(jint fd, jint count);
-
-JNIEXPORT jint JNICALL
-JVM_Connect(jint fd, struct sockaddr *him, jint len);
-
-JNIEXPORT jint JNICALL
-JVM_Bind(jint fd, struct sockaddr *him, jint len);
-
-JNIEXPORT jint JNICALL
-JVM_Accept(jint fd, struct sockaddr *him, jint *len);
-
-JNIEXPORT jint JNICALL
-JVM_RecvFrom(jint fd, char *buf, int nBytes,
-                  int flags, struct sockaddr *from, int *fromlen);
-
-JNIEXPORT jint JNICALL
-JVM_SendTo(jint fd, char *buf, int len,
-                int flags, struct sockaddr *to, int tolen);
-
-JNIEXPORT jint JNICALL
-JVM_SocketAvailable(jint fd, jint *result);
-
-
-JNIEXPORT jint JNICALL
-JVM_GetSockName(jint fd, struct sockaddr *him, int *len);
-
-JNIEXPORT jint JNICALL
-JVM_GetSockOpt(jint fd, int level, int optname, char *optval, int *optlen);
-
-JNIEXPORT jint JNICALL
-JVM_SetSockOpt(jint fd, int level, int optname, const char *optval, int optlen);
-
-JNIEXPORT int JNICALL
-JVM_GetHostName(char* name, int namelen);
-
-/*
  * The standard printing functions supported by the Java VM. (Should they
  * be renamed to JVM_* in the future?
  */
@@ -1509,39 +1239,6 @@
 JNIEXPORT jobjectArray JNICALL
 JVM_GetEnclosingMethodInfo(JNIEnv* env, jclass ofClass);
 
-/*
- * Java thread state support
- */
-enum {
-    JAVA_THREAD_STATE_NEW           = 0,
-    JAVA_THREAD_STATE_RUNNABLE      = 1,
-    JAVA_THREAD_STATE_BLOCKED       = 2,
-    JAVA_THREAD_STATE_WAITING       = 3,
-    JAVA_THREAD_STATE_TIMED_WAITING = 4,
-    JAVA_THREAD_STATE_TERMINATED    = 5,
-    JAVA_THREAD_STATE_COUNT         = 6
-};
-
-/*
- * Returns an array of the threadStatus values representing the
- * given Java thread state.  Returns NULL if the VM version is
- * incompatible with the JDK or doesn't support the given
- * Java thread state.
- */
-JNIEXPORT jintArray JNICALL
-JVM_GetThreadStateValues(JNIEnv* env, jint javaThreadState);
-
-/*
- * Returns an array of the substate names representing the
- * given Java thread state.  Returns NULL if the VM version is
- * incompatible with the JDK or the VM doesn't support
- * the given Java thread state.
- * values must be the jintArray returned from JVM_GetThreadStateValues
- * and javaThreadState.
- */
-JNIEXPORT jobjectArray JNICALL
-JVM_GetThreadStateNames(JNIEnv* env, jint javaThreadState, jintArray values);
-
 /* =========================================================================
  * The following defines a private JVM interface that the JDK can query
  * for the JVM version and capabilities.  sun.misc.Version defines
--- a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -1031,7 +1031,7 @@
     // implied else: entry_count == 0
   }
 
-  int nWant,nWait;
+  jint nWant, nWait;
   if (mon != NULL) {
     // this object has a heavyweight monitor
     nWant = mon->contentions(); // # of threads contending for monitor
--- a/hotspot/src/share/vm/prims/whitebox.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/prims/whitebox.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -335,7 +335,36 @@
   }
 WB_END
 
+WB_ENTRY(jboolean, WB_NMTChangeTrackingLevel(JNIEnv* env))
+  // Test that we can downgrade NMT levels but not upgrade them.
+  if (MemTracker::tracking_level() == NMT_off) {
+    MemTracker::transition_to(NMT_off);
+    return MemTracker::tracking_level() == NMT_off;
+  } else {
+    assert(MemTracker::tracking_level() == NMT_detail, "Should start out as detail tracking");
+    MemTracker::transition_to(NMT_summary);
+    assert(MemTracker::tracking_level() == NMT_summary, "Should be summary now");
 
+    // Can't go to detail once NMT is set to summary.
+    MemTracker::transition_to(NMT_detail);
+    assert(MemTracker::tracking_level() == NMT_summary, "Should still be summary now");
+
+    // Shutdown sets tracking level to minimal.
+    MemTracker::shutdown();
+    assert(MemTracker::tracking_level() == NMT_minimal, "Should be minimal now");
+
+    // Once the tracking level is minimal, we cannot increase to summary.
+    // The code ignores this request instead of asserting because if the malloc site
+    // table overflows in another thread, it tries to change the code to summary.
+    MemTracker::transition_to(NMT_summary);
+    assert(MemTracker::tracking_level() == NMT_minimal, "Should still be minimal now");
+
+    // Really can never go up to detail, verify that the code would never do this.
+    MemTracker::transition_to(NMT_detail);
+    assert(MemTracker::tracking_level() == NMT_minimal, "Should still be minimal now");
+    return MemTracker::tracking_level() == NMT_minimal;
+  }
+WB_END
 #endif // INCLUDE_NMT
 
 static jmethodID reflected_method_to_jmid(JavaThread* thread, JNIEnv* env, jobject method) {
@@ -962,6 +991,7 @@
   {CC"NMTReleaseMemory",    CC"(JJ)V",                (void*)&WB_NMTReleaseMemory   },
   {CC"NMTOverflowHashBucket", CC"(J)V",               (void*)&WB_NMTOverflowHashBucket},
   {CC"NMTIsDetailSupported",CC"()Z",                  (void*)&WB_NMTIsDetailSupported},
+  {CC"NMTChangeTrackingLevel", CC"()Z",               (void*)&WB_NMTChangeTrackingLevel},
 #endif // INCLUDE_NMT
   {CC"deoptimizeAll",      CC"()V",                   (void*)&WB_DeoptimizeAll     },
   {CC"deoptimizeMethod",   CC"(Ljava/lang/reflect/Executable;Z)I",
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -1135,6 +1135,21 @@
 }
 #endif
 
+// Returns threshold scaled with CompileThresholdScaling
+intx Arguments::get_scaled_compile_threshold(intx threshold) {
+  return (intx)(threshold * CompileThresholdScaling);
+}
+
+// Returns freq_log scaled with CompileThresholdScaling
+intx Arguments::get_scaled_freq_log(intx freq_log) {
+  intx scaled_freq = get_scaled_compile_threshold((intx)1 << freq_log);
+  if (scaled_freq == 0) {
+    return 0;
+  } else {
+    return log2_intptr(scaled_freq);
+  }
+}
+
 void Arguments::set_tiered_flags() {
   // With tiered, set default policy to AdvancedThresholdPolicy, which is 3.
   if (FLAG_IS_DEFAULT(CompilationPolicyChoice)) {
@@ -1174,6 +1189,32 @@
     Tier3InvokeNotifyFreqLog = 0;
     Tier4InvocationThreshold = 0;
   }
+  // Scale tiered compilation thresholds
+  if (!FLAG_IS_DEFAULT(CompileThresholdScaling)) {
+    FLAG_SET_ERGO(intx, Tier0InvokeNotifyFreqLog, get_scaled_freq_log(Tier0InvokeNotifyFreqLog));
+    FLAG_SET_ERGO(intx, Tier0BackedgeNotifyFreqLog, get_scaled_freq_log(Tier0BackedgeNotifyFreqLog));
+
+    FLAG_SET_ERGO(intx, Tier3InvocationThreshold, get_scaled_compile_threshold(Tier3InvocationThreshold));
+    FLAG_SET_ERGO(intx, Tier3MinInvocationThreshold, get_scaled_compile_threshold(Tier3MinInvocationThreshold));
+    FLAG_SET_ERGO(intx, Tier3CompileThreshold, get_scaled_compile_threshold(Tier3CompileThreshold));
+    FLAG_SET_ERGO(intx, Tier3BackEdgeThreshold, get_scaled_compile_threshold(Tier3BackEdgeThreshold));
+
+    // Tier2{Invocation,MinInvocation,Compile,Backedge}Threshold should be scaled here
+    // once these thresholds become supported.
+
+    FLAG_SET_ERGO(intx, Tier2InvokeNotifyFreqLog, get_scaled_freq_log(Tier2InvokeNotifyFreqLog));
+    FLAG_SET_ERGO(intx, Tier2BackedgeNotifyFreqLog, get_scaled_freq_log(Tier2BackedgeNotifyFreqLog));
+
+    FLAG_SET_ERGO(intx, Tier3InvokeNotifyFreqLog, get_scaled_freq_log(Tier3InvokeNotifyFreqLog));
+    FLAG_SET_ERGO(intx, Tier3BackedgeNotifyFreqLog, get_scaled_freq_log(Tier3BackedgeNotifyFreqLog));
+
+    FLAG_SET_ERGO(intx, Tier23InlineeNotifyFreqLog, get_scaled_freq_log(Tier23InlineeNotifyFreqLog));
+
+    FLAG_SET_ERGO(intx, Tier4InvocationThreshold, get_scaled_compile_threshold(Tier4InvocationThreshold));
+    FLAG_SET_ERGO(intx, Tier4MinInvocationThreshold, get_scaled_compile_threshold(Tier4MinInvocationThreshold));
+    FLAG_SET_ERGO(intx, Tier4CompileThreshold, get_scaled_compile_threshold(Tier4CompileThreshold));
+    FLAG_SET_ERGO(intx, Tier4BackEdgeThreshold, get_scaled_compile_threshold(Tier4BackEdgeThreshold));
+  }
 }
 
 /**
@@ -3501,7 +3542,9 @@
     // not specified.
     set_mode_flags(_int);
   }
-  if (CompileThreshold == 0) {
+
+  if ((TieredCompilation && CompileThresholdScaling == 0)
+      || (!TieredCompilation && get_scaled_compile_threshold(CompileThreshold) == 0)) {
     set_mode_flags(_int);
   }
 
@@ -3739,6 +3782,8 @@
   bool settings_file_specified = false;
   bool needs_hotspotrc_warning = false;
 
+  ArgumentsExt::process_options(args);
+
   const char* flags_file;
   int index;
   for (index = 0; index < args->nOptions; index++) {
@@ -3926,7 +3971,20 @@
       vm_exit_during_initialization(
         "Incompatible compilation policy selected", NULL);
     }
+    // Scale CompileThreshold
+    if (!FLAG_IS_DEFAULT(CompileThresholdScaling)) {
+      FLAG_SET_ERGO(intx, CompileThreshold, get_scaled_compile_threshold(CompileThreshold));
+    }
   }
+
+#ifdef COMPILER2
+#ifndef PRODUCT
+  if (PrintIdealGraphLevel > 0) {
+    FLAG_SET_ERGO(bool, PrintIdealGraph, true);
+  }
+#endif
+#endif
+
   // Set NmethodSweepFraction after the size of the code cache is adapted (in case of tiered)
   if (FLAG_IS_DEFAULT(NmethodSweepFraction)) {
     FLAG_SET_DEFAULT(NmethodSweepFraction, 1 + ReservedCodeCacheSize / (16 * M));
--- a/hotspot/src/share/vm/runtime/arguments.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -326,6 +326,9 @@
   static bool _ClipInlining;
   static bool _CIDynamicCompilePriority;
 
+  // Scale compile thresholds
+  static intx get_scaled_compile_threshold(intx threshold);
+  static intx get_scaled_freq_log(intx freq_log);
   // Tiered
   static void set_tiered_flags();
   static int  get_min_number_of_compiler_threads();
--- a/hotspot/src/share/vm/runtime/arguments_ext.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/arguments_ext.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -34,6 +34,7 @@
   static inline bool check_gc_consistency_user();
   static inline bool check_gc_consistency_ergo();
   static inline bool check_vm_args_consistency();
+  static        void process_options(const JavaVMInitArgs* args) {}
 };
 
 void ArgumentsExt::select_gc_ergonomically() {
--- a/hotspot/src/share/vm/runtime/globals.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/globals.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -256,6 +256,11 @@
   return is_unlocked_ext();
 }
 
+void Flag::unlock_diagnostic() {
+  assert(is_diagnostic(), "sanity");
+  _flags = Flags(_flags & ~KIND_DIAGNOSTIC);
+}
+
 // Get custom message for this locked flag, or return NULL if
 // none is available.
 void Flag::get_locked_message(char* buf, int buflen) const {
--- a/hotspot/src/share/vm/runtime/globals.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -320,6 +320,8 @@
   bool is_writeable_ext() const;
   bool is_external_ext() const;
 
+  void unlock_diagnostic();
+
   void get_locked_message(char*, int) const;
   void get_locked_message_ext(char*, int) const;
 
@@ -454,7 +456,7 @@
 // notproduct flags are settable / visible only during development and are not declared in the PRODUCT version
 
 // A flag must be declared with one of the following types:
-// bool, intx, uintx, ccstr.
+// bool, intx, uintx, ccstr, double, or uint64_t.
 // The type "ccstr" is an alias for "const char*" and is used
 // only in this file, because the macrology requires single-token type names.
 
@@ -1533,8 +1535,11 @@
   product(bool, UseParNewGC, false,                                         \
           "Use parallel threads in the new generation")                     \
                                                                             \
-  product(bool, ParallelGCVerbose, false,                                   \
-          "Verbose output for parallel gc")                                 \
+  product(bool, PrintTaskqueue, false,                                      \
+          "Print taskqueue statistics for parallel collectors")             \
+                                                                            \
+  product(bool, PrintTerminationStats, false,                               \
+          "Print termination statistics for parallel collectors")           \
                                                                             \
   product(uintx, ParallelGCBufferWastePct, 10,                              \
           "Wasted fraction of parallel allocation buffer")                  \
@@ -3578,6 +3583,10 @@
   product_pd(intx, CompileThreshold,                                        \
           "number of interpreted method invocations before (re-)compiling") \
                                                                             \
+  product(double, CompileThresholdScaling, 1.0,                             \
+          "Factor to control when first compilation happens "               \
+          "(both with and without tiered compilation)")                     \
+                                                                            \
   product(intx, Tier0InvokeNotifyFreqLog, 7,                                \
           "Interpreter (tier 0) invocation notification frequency")         \
                                                                             \
--- a/hotspot/src/share/vm/runtime/java.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/java.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -387,46 +387,6 @@
 
 #endif
 
-
-// Helper class for registering on_exit calls through JVM_OnExit
-
-extern "C" {
-    typedef void (*__exit_proc)(void);
-}
-
-class ExitProc : public CHeapObj<mtInternal> {
- private:
-  __exit_proc _proc;
-  // void (*_proc)(void);
-  ExitProc* _next;
- public:
-  // ExitProc(void (*proc)(void)) {
-  ExitProc(__exit_proc proc) {
-    _proc = proc;
-    _next = NULL;
-  }
-  void evaluate()               { _proc(); }
-  ExitProc* next() const        { return _next; }
-  void set_next(ExitProc* next) { _next = next; }
-};
-
-
-// Linked list of registered on_exit procedures
-
-static ExitProc* exit_procs = NULL;
-
-
-extern "C" {
-  void register_on_exit_function(void (*func)(void)) {
-    ExitProc *entry = new ExitProc(func);
-    // Classic vm does not throw an exception in case the allocation failed,
-    if (entry != NULL) {
-      entry->set_next(exit_procs);
-      exit_procs = entry;
-    }
-  }
-}
-
 // Note: before_exit() can be executed only once, if more than one threads
 //       are trying to shutdown the VM at the same time, only one thread
 //       can run before_exit() and all other threads must wait.
@@ -457,16 +417,6 @@
     }
   }
 
-  // The only difference between this and Win32's _onexit procs is that
-  // this version is invoked before any threads get killed.
-  ExitProc* current = exit_procs;
-  while (current != NULL) {
-    ExitProc* next = current->next();
-    current->evaluate();
-    delete current;
-    current = next;
-  }
-
   // Hang forever on exit if we're reporting an error.
   if (ShowMessageBoxOnError && is_error_reported()) {
     os::infinite_sleep();
--- a/hotspot/src/share/vm/runtime/java.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/java.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -27,9 +27,6 @@
 
 #include "runtime/os.hpp"
 
-// Register function to be called by before_exit
-extern "C" { void register_on_exit_function(void (*func)(void)) ;}
-
 // Execute code before all handles are released and thread is killed; prologue to vm_exit
 extern void before_exit(JavaThread * thread);
 
--- a/hotspot/src/share/vm/runtime/javaCalls.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/javaCalls.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -173,22 +173,6 @@
   return T_ILLEGAL;
 }
 
-// ===== object constructor calls =====
-
-void JavaCalls::call_default_constructor(JavaThread* thread, methodHandle method, Handle receiver, TRAPS) {
-  assert(method->name() == vmSymbols::object_initializer_name(),    "Should only be called for default constructor");
-  assert(method->signature() == vmSymbols::void_method_signature(), "Should only be called for default constructor");
-
-  InstanceKlass* ik = method->method_holder();
-  if (ik->is_initialized() && ik->has_vanilla_constructor()) {
-    // safe to skip constructor call
-  } else {
-    static JavaValue result(T_VOID);
-    JavaCallArguments args(receiver);
-    call(&result, method, &args, CHECK);
-  }
-}
-
 // ============ Virtual calls ============
 
 void JavaCalls::call_virtual(JavaValue* result, KlassHandle spec_klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) {
--- a/hotspot/src/share/vm/runtime/javaCalls.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/javaCalls.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -183,9 +183,6 @@
 class JavaCalls: AllStatic {
   static void call_helper(JavaValue* result, methodHandle* method, JavaCallArguments* args, TRAPS);
  public:
-  // Optimized Constuctor call
-  static void call_default_constructor(JavaThread* thread, methodHandle method, Handle receiver, TRAPS);
-
   // call_special
   // ------------
   // The receiver must be first oop in argument list
--- a/hotspot/src/share/vm/runtime/objectMonitor.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/objectMonitor.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -257,7 +257,6 @@
       assert(_recursions == 0, "internal state error");
       _owner = THREAD;
       _recursions = 1;
-      OwnerIsThread = 1;
       return true;
     }
     if (Atomic::cmpxchg_ptr (THREAD, &_owner, NULL) != NULL) {
@@ -280,7 +279,6 @@
     // Either ASSERT _recursions == 0 or explicitly set _recursions = 0.
     assert(_recursions == 0, "invariant");
     assert(_owner == Self, "invariant");
-    // CONSIDER: set or assert OwnerIsThread == 1
     return;
   }
 
@@ -296,7 +294,6 @@
     // Commute owner from a thread-specific on-stack BasicLockObject address to
     // a full-fledged "Thread *".
     _owner = Self;
-    OwnerIsThread = 1;
     return;
   }
 
@@ -328,7 +325,7 @@
 
   // Prevent deflation at STW-time.  See deflate_idle_monitors() and is_busy().
   // Ensure the object-monitor relationship remains stable while there's contention.
-  Atomic::inc_ptr(&_count);
+  Atomic::inc(&_count);
 
   EventJavaMonitorEnter event;
 
@@ -384,7 +381,7 @@
     // acquire it.
   }
 
-  Atomic::dec_ptr(&_count);
+  Atomic::dec(&_count);
   assert(_count >= 0, "invariant");
   Self->_Stalled = 0;
 
@@ -440,7 +437,6 @@
     // Either guarantee _recursions == 0 or set _recursions = 0.
     assert(_recursions == 0, "invariant");
     assert(_owner == Self, "invariant");
-    // CONSIDER: set or assert that OwnerIsThread == 1
     return 1;
   }
   // The lock had been free momentarily, but we lost the race to the lock.
@@ -922,7 +918,6 @@
       assert(_recursions == 0, "invariant");
       _owner = THREAD;
       _recursions = 0;
-      OwnerIsThread = 1;
     } else {
       // Apparent unbalanced locking ...
       // Naively we'd like to throw IllegalMonitorStateException.
@@ -1346,7 +1341,6 @@
       assert(_recursions == 0, "internal state error");
       _owner = THREAD;   // Convert from basiclock addr to Thread addr
       _recursions = 0;
-      OwnerIsThread = 1;
     }
   }
 
@@ -1385,7 +1379,6 @@
       if (THREAD->is_lock_owned((address) _owner)) {                        \
         _owner = THREAD;  /* Convert from basiclock addr to Thread addr */  \
         _recursions = 0;                                                    \
-        OwnerIsThread = 1;                                                  \
       } else {                                                              \
         TEVENT(Throw IMSX);                                                 \
         THROW(vmSymbols::java_lang_IllegalMonitorStateException());         \
@@ -1906,8 +1899,8 @@
 // a contending thread could enqueue itself on the cxq and then spin locally
 // on a thread-specific variable such as its ParkEvent._Event flag.
 // That's left as an exercise for the reader.  Note that global spinning is
-// not problematic on Niagara, as the L2$ serves the interconnect and has both
-// low latency and massive bandwidth.
+// not problematic on Niagara, as the L2 cache serves the interconnect and
+// has both low latency and massive bandwidth.
 //
 // Broadly, we can fix the spin frequency -- that is, the % of contended lock
 // acquisition attempts where we opt to spin --  at 100% and vary the spin count
@@ -2208,7 +2201,7 @@
 // as advisory.
 //
 // Beware too, that _owner is sometimes a BasicLock address and sometimes
-// a thread pointer.  We differentiate the two cases with OwnerIsThread.
+// a thread pointer.
 // Alternately, we might tag the type (thread pointer vs basiclock pointer)
 // with the LSB of _owner.  Another option would be to probablistically probe
 // the putative _owner->TypeTag value.
@@ -2230,9 +2223,7 @@
 
 
 int ObjectMonitor::NotRunnable(Thread * Self, Thread * ox) {
-  // Check either OwnerIsThread or ox->TypeTag == 2BAD.
-  if (!OwnerIsThread) return 0;
-
+  // Check ox->TypeTag == 2BAD.
   if (ox == NULL) return 0;
 
   // Avoid transitive spinning ...
@@ -2399,20 +2390,6 @@
   }
 }
 
-
-// Compile-time asserts
-// When possible, it's better to catch errors deterministically at
-// compile-time than at runtime.  The down-side to using compile-time
-// asserts is that error message -- often something about negative array
-// indices -- is opaque.
-
-#define CTASSERT(x) { int tag[1-(2*!(x))]; printf ("Tag @" INTPTR_FORMAT "\n", (intptr_t)tag); }
-
-void ObjectMonitor::ctAsserts() {
-  CTASSERT(offset_of (ObjectMonitor, _header) == 0);
-}
-
-
 static char * kvGet(char * kvList, const char * Key) {
   if (kvList == NULL) return NULL;
   size_t n = strlen(Key);
@@ -2526,6 +2503,8 @@
   if (verbose) {
     tty->print_cr("INFO: sizeof(ObjectMonitor)=" SIZE_FORMAT,
                   sizeof(ObjectMonitor));
+    tty->print_cr("INFO: sizeof(PaddedEnd<ObjectMonitor>)=" SIZE_FORMAT,
+                  sizeof(PaddedEnd<ObjectMonitor>));
   }
 
   uint cache_line_size = VM_Version::L1_data_cache_line_size();
@@ -2559,9 +2538,9 @@
       warning_cnt++;
     }
 
-    if ((sizeof(ObjectMonitor) % cache_line_size) != 0) {
-      tty->print_cr("WARNING: ObjectMonitor size is not a multiple of "
-                    "a cache line which permits false sharing.");
+    if ((sizeof(PaddedEnd<ObjectMonitor>) % cache_line_size) != 0) {
+      tty->print_cr("WARNING: PaddedEnd<ObjectMonitor> size is not a "
+                    "multiple of a cache line which permits false sharing.");
       warning_cnt++;
     }
   }
--- a/hotspot/src/share/vm/runtime/objectMonitor.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/objectMonitor.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_RUNTIME_OBJECTMONITOR_HPP
 #define SHARE_VM_RUNTIME_OBJECTMONITOR_HPP
 
+#include "memory/padded.hpp"
 #include "runtime/os.hpp"
 #include "runtime/park.hpp"
 #include "runtime/perfData.hpp"
@@ -58,21 +59,71 @@
 // forward declaration to avoid include tracing.hpp
 class EventJavaMonitorWait;
 
-// WARNING:
-//   This is a very sensitive and fragile class. DO NOT make any
-// change unless you are fully aware of the underlying semantics.
-
-//   This class can not inherit from any other class, because I have
-// to let the displaced header be the very first word. Otherwise I
-// have to let markOop include this file, which would export the
-// monitor data structure to everywhere.
+// The ObjectMonitor class implements the heavyweight version of a
+// JavaMonitor. The lightweight BasicLock/stack lock version has been
+// inflated into an ObjectMonitor. This inflation is typically due to
+// contention or use of Object.wait().
+//
+// WARNING: This is a very sensitive and fragile class. DO NOT make any
+// changes unless you are fully aware of the underlying semantics.
+//
+// Class JvmtiRawMonitor currently inherits from ObjectMonitor so
+// changes in this class must be careful to not break JvmtiRawMonitor.
+// These two subsystems should be separated.
+//
+// ObjectMonitor Layout Overview/Highlights/Restrictions:
 //
-// The ObjectMonitor class is used to implement JavaMonitors which have
-// transformed from the lightweight structure of the thread stack to a
-// heavy weight lock due to contention
-
-// It is also used as RawMonitor by the JVMTI
-
+// - The _header field must be at offset 0 because the displaced header
+//   from markOop is stored there. We do not want markOop.hpp to include
+//   ObjectMonitor.hpp to avoid exposing ObjectMonitor everywhere. This
+//   means that ObjectMonitor cannot inherit from any other class nor can
+//   it use any virtual member functions. This restriction is critical to
+//   the proper functioning of the VM.
+// - The _header and _owner fields should be separated by enough space
+//   to avoid false sharing due to parallel access by different threads.
+//   This is an advisory recommendation.
+// - The general layout of the fields in ObjectMonitor is:
+//     _header
+//     <lightly_used_fields>
+//     <optional padding>
+//     _owner
+//     <remaining_fields>
+// - The VM assumes write ordering and machine word alignment with
+//   respect to the _owner field and the <remaining_fields> that can
+//   be read in parallel by other threads.
+// - Generally fields that are accessed closely together in time should
+//   be placed proximally in space to promote data cache locality. That
+//   is, temporal locality should condition spatial locality.
+// - We have to balance avoiding false sharing with excessive invalidation
+//   from coherence traffic. As such, we try to cluster fields that tend
+//   to be _written_ at approximately the same time onto the same data
+//   cache line.
+// - We also have to balance the natural tension between minimizing
+//   single threaded capacity misses with excessive multi-threaded
+//   coherency misses. There is no single optimal layout for both
+//   single-threaded and multi-threaded environments.
+//
+// - See ObjectMonitor::sanity_checks() for how critical restrictions are
+//   enforced and advisory recommendations are reported.
+// - Adjacent ObjectMonitors should be separated by enough space to avoid
+//   false sharing. This is handled by the ObjectMonitor allocation code
+//   in synchronizer.cpp. Also see ObjectSynchronizer::sanity_checks().
+//
+// Futures notes:
+//   - Separating _owner from the <remaining_fields> by enough space to
+//     avoid false sharing might be profitable. Given
+//     http://blogs.oracle.com/dave/entry/cas_and_cache_trivia_invalidate
+//     we know that the CAS in monitorenter will invalidate the line
+//     underlying _owner. We want to avoid an L1 data cache miss on that
+//     same line for monitorexit. Putting these <remaining_fields>:
+//     _recursions, _EntryList, _cxq, and _succ, all of which may be
+//     fetched in the inflated unlock path, on a different cache line
+//     would make them immune to CAS-based invalidation from the _owner
+//     field.
+//
+//   - The _recursions field should be of type int, or int32_t but not
+//     intptr_t. There's no reason to use a 64-bit type for this field
+//     in a 64-bit JVM.
 
 class ObjectMonitor {
  public:
@@ -84,7 +135,84 @@
     OM_TIMED_OUT              // Object.wait() timed out
   };
 
+ private:
+  friend class ObjectSynchronizer;
+  friend class ObjectWaiter;
+  friend class VMStructs;
+
+  volatile markOop   _header;       // displaced object header word - mark
+  void*     volatile _object;       // backward object pointer - strong root
  public:
+  ObjectMonitor *    FreeNext;      // Free list linkage
+ private:
+  DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE,
+                        sizeof(volatile markOop) + sizeof(void * volatile) +
+                        sizeof(ObjectMonitor *));
+ protected:                         // protected for JvmtiRawMonitor
+  void *  volatile _owner;          // pointer to owning thread OR BasicLock
+  volatile jlong _previous_owner_tid;  // thread id of the previous owner of the monitor
+  volatile intptr_t  _recursions;   // recursion count, 0 for first entry
+  ObjectWaiter * volatile _EntryList; // Threads blocked on entry or reentry.
+                                      // The list is actually composed of WaitNodes,
+                                      // acting as proxies for Threads.
+ private:
+  ObjectWaiter * volatile _cxq;     // LL of recently-arrived threads blocked on entry.
+  Thread * volatile _succ;          // Heir presumptive thread - used for futile wakeup throttling
+  Thread * volatile _Responsible;
+
+  volatile int _Spinner;            // for exit->spinner handoff optimization
+  volatile int _SpinFreq;           // Spin 1-out-of-N attempts: success rate
+  volatile int _SpinClock;
+  volatile intptr_t _SpinState;     // MCS/CLH list of spinners
+  volatile int _SpinDuration;
+
+  volatile jint  _count;            // reference count to prevent reclamation/deflation
+                                    // at stop-the-world time.  See deflate_idle_monitors().
+                                    // _count is approximately |_WaitSet| + |_EntryList|
+ protected:
+  ObjectWaiter * volatile _WaitSet; // LL of threads wait()ing on the monitor
+  volatile jint  _waiters;          // number of waiting threads
+ private:
+  volatile int _WaitSetLock;        // protects Wait Queue - simple spinlock
+
+ public:
+  static void Initialize();
+  static PerfCounter * _sync_ContendedLockAttempts;
+  static PerfCounter * _sync_FutileWakeups;
+  static PerfCounter * _sync_Parks;
+  static PerfCounter * _sync_EmptyNotifications;
+  static PerfCounter * _sync_Notifications;
+  static PerfCounter * _sync_SlowEnter;
+  static PerfCounter * _sync_SlowExit;
+  static PerfCounter * _sync_SlowNotify;
+  static PerfCounter * _sync_SlowNotifyAll;
+  static PerfCounter * _sync_FailedSpins;
+  static PerfCounter * _sync_SuccessfulSpins;
+  static PerfCounter * _sync_PrivateA;
+  static PerfCounter * _sync_PrivateB;
+  static PerfCounter * _sync_MonInCirculation;
+  static PerfCounter * _sync_MonScavenged;
+  static PerfCounter * _sync_Inflations;
+  static PerfCounter * _sync_Deflations;
+  static PerfLongVariable * _sync_MonExtant;
+
+  static int Knob_Verbose;
+  static int Knob_VerifyInUse;
+  static int Knob_SpinLimit;
+
+  void* operator new (size_t size) throw() {
+    return AllocateHeap(size, mtInternal);
+  }
+  void* operator new[] (size_t size) throw() {
+    return operator new (size);
+  }
+  void operator delete(void* p) {
+    FreeHeap(p, mtInternal);
+  }
+  void operator delete[] (void *p) {
+    operator delete(p);
+  }
+
   // TODO-FIXME: the "offset" routines should return a type of off_t instead of int ...
   // ByteSize would also be an appropriate type.
   static int header_offset_in_bytes()      { return offset_of(ObjectMonitor, _header); }
@@ -100,14 +228,11 @@
   static int Responsible_offset_in_bytes() { return offset_of(ObjectMonitor, _Responsible); }
   static int Spinner_offset_in_bytes()     { return offset_of(ObjectMonitor, _Spinner); }
 
- public:
   // Eventually we'll make provisions for multiple callbacks, but
   // now one will suffice.
   static int (*SpinCallbackFunction)(intptr_t, int);
   static intptr_t SpinCallbackArgument;
 
-
- public:
   markOop   header() const;
   void      set_header(markOop hdr);
 
@@ -123,39 +248,22 @@
   void*     owner() const;
   void      set_owner(void* owner);
 
-  intptr_t  waiters() const;
+  jint      waiters() const;
 
-  intptr_t  count() const;
-  void      set_count(intptr_t count);
-  intptr_t  contentions() const;
+  jint      count() const;
+  void      set_count(jint count);
+  jint      contentions() const;
   intptr_t  recursions() const                                         { return _recursions; }
 
-  // JVM/DI GetMonitorInfo() needs this
+  // JVM/TI GetObjectMonitorUsage() needs this:
   ObjectWaiter* first_waiter()                                         { return _WaitSet; }
   ObjectWaiter* next_waiter(ObjectWaiter* o)                           { return o->_next; }
   Thread* thread_of_waiter(ObjectWaiter* o)                            { return o->_thread; }
 
-  // initialize the monitor, exception the semaphore, all other fields
-  // are simple integers or pointers
-  ObjectMonitor() {
-    _header       = NULL;
-    _count        = 0;
-    _waiters      = 0;
-    _recursions   = 0;
-    _object       = NULL;
-    _owner        = NULL;
-    _WaitSet      = NULL;
-    _WaitSetLock  = 0;
-    _Responsible  = NULL;
-    _succ         = NULL;
-    _cxq          = NULL;
-    FreeNext      = NULL;
-    _EntryList    = NULL;
-    _SpinFreq     = 0;
-    _SpinClock    = 0;
-    OwnerIsThread = 0;
-    _previous_owner_tid = 0;
-  }
+ protected:
+  // We don't typically expect or want the ctors or dtors to run.
+  // normal ObjectMonitors are type-stable and immortal.
+  ObjectMonitor() { ::memset((void *)this, 0, sizeof(*this)); }
 
   ~ObjectMonitor() {
     // TODO: Add asserts ...
@@ -169,7 +277,7 @@
     // _cxq == 0 _succ == NULL _owner == NULL _waiters == 0
     // _count == 0 EntryList  == NULL
     // _recursions == 0 _WaitSet == NULL
-    // TODO: assert (is_busy()|_recursions) == 0
+    assert(((is_busy()|_recursions) == 0), "freeing inuse monitor");
     _succ          = NULL;
     _EntryList     = NULL;
     _cxq           = NULL;
@@ -177,7 +285,6 @@
     _recursions    = 0;
     _SpinFreq      = 0;
     _SpinClock     = 0;
-    OwnerIsThread  = 0;
   }
 
  public:
@@ -221,7 +328,6 @@
   int       TrySpin_Fixed(Thread * Self);
   int       TrySpin_VaryFrequency(Thread * Self);
   int       TrySpin_VaryDuration(Thread * Self);
-  void      ctAsserts();
   void      ExitEpilog(Thread * Self, ObjectWaiter * Wakee);
   bool      ExitSuspendEquivalent(JavaThread * Self);
   void      post_monitor_wait_event(EventJavaMonitorWait * event,
@@ -229,102 +335,6 @@
                                     jlong timeout,
                                     bool timedout);
 
- private:
-  friend class ObjectSynchronizer;
-  friend class ObjectWaiter;
-  friend class VMStructs;
-
-  // WARNING: this must be the very first word of ObjectMonitor
-  // This means this class can't use any virtual member functions.
-
-  volatile markOop   _header;       // displaced object header word - mark
-  void*     volatile _object;       // backward object pointer - strong root
-
-  double SharingPad[1];             // temp to reduce false sharing
-
-  // All the following fields must be machine word aligned
-  // The VM assumes write ordering wrt these fields, which can be
-  // read from other threads.
-
- protected:                         // protected for jvmtiRawMonitor
-  void *  volatile _owner;          // pointer to owning thread OR BasicLock
-  volatile jlong _previous_owner_tid;  // thread id of the previous owner of the monitor
-  volatile intptr_t  _recursions;   // recursion count, 0 for first entry
- private:
-  int OwnerIsThread;                // _owner is (Thread *) vs SP/BasicLock
-  ObjectWaiter * volatile _cxq;     // LL of recently-arrived threads blocked on entry.
-                                    // The list is actually composed of WaitNodes, acting
-                                    // as proxies for Threads.
- protected:
-  ObjectWaiter * volatile _EntryList;  // Threads blocked on entry or reentry.
- private:
-  Thread * volatile _succ;          // Heir presumptive thread - used for futile wakeup throttling
-  Thread * volatile _Responsible;
-  int _PromptDrain;                 // rqst to drain cxq into EntryList ASAP
-
-  volatile int _Spinner;            // for exit->spinner handoff optimization
-  volatile int _SpinFreq;           // Spin 1-out-of-N attempts: success rate
-  volatile int _SpinClock;
-  volatile int _SpinDuration;
-  volatile intptr_t _SpinState;     // MCS/CLH list of spinners
-
-  // TODO-FIXME: _count, _waiters and _recursions should be of
-  // type int, or int32_t but not intptr_t.  There's no reason
-  // to use 64-bit fields for these variables on a 64-bit JVM.
-
-  volatile intptr_t  _count;        // reference count to prevent reclamation/deflation
-                                    // at stop-the-world time.  See deflate_idle_monitors().
-                                    // _count is approximately |_WaitSet| + |_EntryList|
- protected:
-  volatile intptr_t  _waiters;      // number of waiting threads
- private:
- protected:
-  ObjectWaiter * volatile _WaitSet; // LL of threads wait()ing on the monitor
- private:
-  volatile int _WaitSetLock;        // protects Wait Queue - simple spinlock
-
- public:
-  int _QMix;                        // Mixed prepend queue discipline
-  ObjectMonitor * FreeNext;         // Free list linkage
-  intptr_t StatA, StatsB;
-
- public:
-  static void Initialize();
-  static PerfCounter * _sync_ContendedLockAttempts;
-  static PerfCounter * _sync_FutileWakeups;
-  static PerfCounter * _sync_Parks;
-  static PerfCounter * _sync_EmptyNotifications;
-  static PerfCounter * _sync_Notifications;
-  static PerfCounter * _sync_SlowEnter;
-  static PerfCounter * _sync_SlowExit;
-  static PerfCounter * _sync_SlowNotify;
-  static PerfCounter * _sync_SlowNotifyAll;
-  static PerfCounter * _sync_FailedSpins;
-  static PerfCounter * _sync_SuccessfulSpins;
-  static PerfCounter * _sync_PrivateA;
-  static PerfCounter * _sync_PrivateB;
-  static PerfCounter * _sync_MonInCirculation;
-  static PerfCounter * _sync_MonScavenged;
-  static PerfCounter * _sync_Inflations;
-  static PerfCounter * _sync_Deflations;
-  static PerfLongVariable * _sync_MonExtant;
-
- public:
-  static int Knob_Verbose;
-  static int Knob_VerifyInUse;
-  static int Knob_SpinLimit;
-  void* operator new (size_t size) throw() {
-    return AllocateHeap(size, mtInternal);
-  }
-  void* operator new[] (size_t size) throw() {
-    return operator new (size);
-  }
-  void operator delete(void* p) {
-    FreeHeap(p, mtInternal);
-  }
-  void operator delete[] (void *p) {
-    operator delete(p);
-  }
 };
 
 #undef TEVENT
--- a/hotspot/src/share/vm/runtime/objectMonitor.inline.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/objectMonitor.inline.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,15 +40,11 @@
   _header = hdr;
 }
 
-inline intptr_t ObjectMonitor::count() const {
+inline jint ObjectMonitor::count() const {
   return _count;
 }
 
-inline void ObjectMonitor::set_count(intptr_t count) {
-  _count= count;
-}
-
-inline intptr_t ObjectMonitor::waiters() const {
+inline jint ObjectMonitor::waiters() const {
   return _waiters;
 }
 
@@ -61,7 +57,7 @@
   assert(_count == 0, "Fatal logic error in ObjectMonitor count!");
   assert(_waiters == 0, "Fatal logic error in ObjectMonitor waiters!");
   assert(_recursions == 0, "Fatal logic error in ObjectMonitor recursions!");
-  assert(_object, "Fatal logic error in ObjectMonitor object!");
+  assert(_object != NULL, "Fatal logic error in ObjectMonitor object!");
   assert(_owner == 0, "Fatal logic error in ObjectMonitor owner!");
 
   _header = NULL;
@@ -85,7 +81,6 @@
   if (THREAD != _owner) {
     if (THREAD->is_lock_owned((address) _owner)) {
       _owner = THREAD;  // regain ownership of inflated monitor
-      OwnerIsThread = 1 ;
       assert (_recursions == 0, "invariant") ;
     } else {
       check_slow(THREAD);
@@ -97,7 +92,7 @@
 
 
 // return number of threads contending for this monitor
-inline intptr_t ObjectMonitor::contentions() const {
+inline jint ObjectMonitor::contentions() const {
   return _count;
 }
 
--- a/hotspot/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -30,11 +30,11 @@
   switch(level) {
   case CompLevel_none:
   case CompLevel_limited_profile:
-    return (i > Tier3InvocationThreshold * scale) ||
-           (i > Tier3MinInvocationThreshold * scale && i + b > Tier3CompileThreshold * scale);
+    return (i >= Tier3InvocationThreshold * scale) ||
+           (i >= Tier3MinInvocationThreshold * scale && i + b >= Tier3CompileThreshold * scale);
   case CompLevel_full_profile:
-   return (i > Tier4InvocationThreshold * scale) ||
-          (i > Tier4MinInvocationThreshold * scale && i + b > Tier4CompileThreshold * scale);
+   return (i >= Tier4InvocationThreshold * scale) ||
+          (i >= Tier4MinInvocationThreshold * scale && i + b >= Tier4CompileThreshold * scale);
   }
   return true;
 }
@@ -44,9 +44,9 @@
   switch(level) {
   case CompLevel_none:
   case CompLevel_limited_profile:
-    return b > Tier3BackEdgeThreshold * scale;
+    return b >= Tier3BackEdgeThreshold * scale;
   case CompLevel_full_profile:
-    return b > Tier4BackEdgeThreshold * scale;
+    return b >= Tier4BackEdgeThreshold * scale;
   }
   return true;
 }
--- a/hotspot/src/share/vm/runtime/synchronizer.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/synchronizer.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "memory/padded.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/markOop.hpp"
 #include "oops/oop.inline.hpp"
@@ -110,6 +111,8 @@
 #define NINFLATIONLOCKS 256
 static volatile intptr_t InflationLocks[NINFLATIONLOCKS];
 
+// gBlockList is really PaddedEnd<ObjectMonitor> *, but we don't
+// want to expose the PaddedEnd template more than necessary.
 ObjectMonitor * ObjectSynchronizer::gBlockList = NULL;
 ObjectMonitor * volatile ObjectSynchronizer::gFreeList  = NULL;
 ObjectMonitor * volatile ObjectSynchronizer::gOmInUseList  = NULL;
@@ -410,16 +413,15 @@
 // performed by the CPU(s) or platform.
 
 struct SharedGlobals {
+  char         _pad_prefix[DEFAULT_CACHE_LINE_SIZE];
   // These are highly shared mostly-read variables.
-  // To avoid false-sharing they need to be the sole occupants of a $ line.
-  double padPrefix[8];
+  // To avoid false-sharing they need to be the sole occupants of a cache line.
   volatile int stwRandom;
   volatile int stwCycle;
-
-  // Hot RW variables -- Sequester to avoid false-sharing
-  double padSuffix[16];
+  DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile int) * 2);
+  // Hot RW variable -- Sequester to avoid false-sharing
   volatile int hcSequence;
-  double padFinal[8];
+  DEFINE_PAD_MINUS_SIZE(2, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile int));
 };
 
 static SharedGlobals GVars;
@@ -780,18 +782,18 @@
 // Visitors ...
 
 void ObjectSynchronizer::monitors_iterate(MonitorClosure* closure) {
-  ObjectMonitor* block = gBlockList;
+  PaddedEnd<ObjectMonitor> * block = (PaddedEnd<ObjectMonitor> *)gBlockList;
   ObjectMonitor* mid;
   while (block) {
     assert(block->object() == CHAINMARKER, "must be a block header");
     for (int i = _BLOCKSIZE - 1; i > 0; i--) {
-      mid = block + i;
+      mid = (ObjectMonitor *)(block + i);
       oop object = (oop) mid->object();
       if (object != NULL) {
         closure->do_monitor(mid);
       }
     }
-    block = (ObjectMonitor*) block->FreeNext;
+    block = (PaddedEnd<ObjectMonitor> *) block->FreeNext;
   }
 }
 
@@ -806,10 +808,12 @@
 
 void ObjectSynchronizer::oops_do(OopClosure* f) {
   assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
-  for (ObjectMonitor* block = gBlockList; block != NULL; block = next(block)) {
+  for (PaddedEnd<ObjectMonitor> * block =
+       (PaddedEnd<ObjectMonitor> *)gBlockList; block != NULL;
+       block = (PaddedEnd<ObjectMonitor> *)next(block)) {
     assert(block->object() == CHAINMARKER, "must be a block header");
     for (int i = 1; i < _BLOCKSIZE; i++) {
-      ObjectMonitor* mid = &block[i];
+      ObjectMonitor* mid = (ObjectMonitor *)&block[i];
       if (mid->object() != NULL) {
         f->do_oop((oop*)mid->object_addr());
       }
@@ -966,16 +970,29 @@
     // 3: allocate a block of new ObjectMonitors
     // Both the local and global free lists are empty -- resort to malloc().
     // In the current implementation objectMonitors are TSM - immortal.
+    // Ideally, we'd write "new ObjectMonitor[_BLOCKSIZE], but we want
+    // each ObjectMonitor to start at the beginning of a cache line,
+    // so we use align_size_up().
+    // A better solution would be to use C++ placement-new.
+    // BEWARE: As it stands currently, we don't run the ctors!
     assert(_BLOCKSIZE > 1, "invariant");
-    ObjectMonitor * temp = new ObjectMonitor[_BLOCKSIZE];
+    size_t neededsize = sizeof(PaddedEnd<ObjectMonitor>) * _BLOCKSIZE;
+    PaddedEnd<ObjectMonitor> * temp;
+    size_t aligned_size = neededsize + (DEFAULT_CACHE_LINE_SIZE - 1);
+    void* real_malloc_addr = (void *)NEW_C_HEAP_ARRAY(char, aligned_size,
+                                                      mtInternal);
+    temp = (PaddedEnd<ObjectMonitor> *)
+             align_size_up((intptr_t)real_malloc_addr,
+                           DEFAULT_CACHE_LINE_SIZE);
 
     // NOTE: (almost) no way to recover if allocation failed.
     // We might be able to induce a STW safepoint and scavenge enough
     // objectMonitors to permit progress.
     if (temp == NULL) {
-      vm_exit_out_of_memory(sizeof (ObjectMonitor[_BLOCKSIZE]), OOM_MALLOC_ERROR,
+      vm_exit_out_of_memory(neededsize, OOM_MALLOC_ERROR,
                             "Allocate ObjectMonitors");
     }
+    (void)memset((void *) temp, 0, neededsize);
 
     // Format the block.
     // initialize the linked list, each monitor points to its next
@@ -986,7 +1003,7 @@
     // look like: class Block { Block * next; int N; ObjectMonitor Body [N] ; }
 
     for (int i = 1; i < _BLOCKSIZE; i++) {
-      temp[i].FreeNext = &temp[i+1];
+      temp[i].FreeNext = (ObjectMonitor *)&temp[i+1];
     }
 
     // terminate the last monitor as the end of list
@@ -1141,10 +1158,6 @@
 }
 
 
-// Note that we could encounter some performance loss through false-sharing as
-// multiple locks occupy the same $ line.  Padding might be appropriate.
-
-
 ObjectMonitor * NOINLINE ObjectSynchronizer::inflate(Thread * Self,
                                                      oop object) {
   // Inflate mutates the heap ...
@@ -1210,7 +1223,6 @@
       // in which INFLATING appears in the mark.
       m->Recycle();
       m->_Responsible  = NULL;
-      m->OwnerIsThread = 0;
       m->_recursions   = 0;
       m->_SpinDuration = ObjectMonitor::Knob_SpinLimit;   // Consider: maintain by type/class
 
@@ -1257,8 +1269,8 @@
       m->set_header(dmw);
 
       // Optimization: if the mark->locker stack address is associated
-      // with this thread we could simply set m->_owner = Self and
-      // m->OwnerIsThread = 1. Note that a thread can inflate an object
+      // with this thread we could simply set m->_owner = Self.
+      // Note that a thread can inflate an object
       // that it has stack-locked -- as might happen in wait() -- directly
       // with CAS.  That is, we can avoid the xchg-NULL .... ST idiom.
       m->set_owner(mark->locker());
@@ -1302,7 +1314,6 @@
     m->set_header(mark);
     m->set_owner(NULL);
     m->set_object(object);
-    m->OwnerIsThread = 1;
     m->_recursions   = 0;
     m->_Responsible  = NULL;
     m->_SpinDuration = ObjectMonitor::Knob_SpinLimit;       // consider: keep metastats by type/class
@@ -1310,7 +1321,6 @@
     if (Atomic::cmpxchg_ptr (markOopDesc::encode(m), object->mark_addr(), mark) != mark) {
       m->set_object(NULL);
       m->set_owner(NULL);
-      m->OwnerIsThread = 0;
       m->Recycle();
       omRelease(Self, m, true);
       m = NULL;
@@ -1336,9 +1346,6 @@
   }
 }
 
-// Note that we could encounter some performance loss through false-sharing as
-// multiple locks occupy the same $ line.  Padding might be appropriate.
-
 
 // Deflate_idle_monitors() is called at all safepoints, immediately
 // after all mutators are stopped, but before any objects have moved.
@@ -1491,12 +1498,14 @@
       nInuse += gOmInUseCount;
     }
 
-  } else for (ObjectMonitor* block = gBlockList; block != NULL; block = next(block)) {
+  } else for (PaddedEnd<ObjectMonitor> * block =
+              (PaddedEnd<ObjectMonitor> *)gBlockList; block != NULL;
+              block = (PaddedEnd<ObjectMonitor> *)next(block)) {
     // Iterate over all extant monitors - Scavenge all idle monitors.
     assert(block->object() == CHAINMARKER, "must be a block header");
     nInCirculation += _BLOCKSIZE;
     for (int i = 1; i < _BLOCKSIZE; i++) {
-      ObjectMonitor* mid = &block[i];
+      ObjectMonitor* mid = (ObjectMonitor*)&block[i];
       oop obj = (oop) mid->object();
 
       if (obj == NULL) {
@@ -1648,18 +1657,18 @@
 
 // Verify all monitors in the monitor cache, the verification is weak.
 void ObjectSynchronizer::verify() {
-  ObjectMonitor* block = gBlockList;
+  PaddedEnd<ObjectMonitor> * block = (PaddedEnd<ObjectMonitor> *)gBlockList;
   ObjectMonitor* mid;
   while (block) {
     assert(block->object() == CHAINMARKER, "must be a block header");
     for (int i = 1; i < _BLOCKSIZE; i++) {
-      mid = block + i;
+      mid = (ObjectMonitor *)(block + i);
       oop object = (oop) mid->object();
       if (object != NULL) {
         mid->verify();
       }
     }
-    block = (ObjectMonitor*) block->FreeNext;
+    block = (PaddedEnd<ObjectMonitor> *) block->FreeNext;
   }
 }
 
@@ -1668,18 +1677,19 @@
 // the list of extant blocks without taking a lock.
 
 int ObjectSynchronizer::verify_objmon_isinpool(ObjectMonitor *monitor) {
-  ObjectMonitor* block = gBlockList;
+  PaddedEnd<ObjectMonitor> * block = (PaddedEnd<ObjectMonitor> *)gBlockList;
 
   while (block) {
     assert(block->object() == CHAINMARKER, "must be a block header");
-    if (monitor > &block[0] && monitor < &block[_BLOCKSIZE]) {
+    if (monitor > (ObjectMonitor *)&block[0] &&
+        monitor < (ObjectMonitor *)&block[_BLOCKSIZE]) {
       address mon = (address) monitor;
       address blk = (address) block;
       size_t diff = mon - blk;
-      assert((diff % sizeof(ObjectMonitor)) == 0, "check");
+      assert((diff % sizeof(PaddedEnd<ObjectMonitor>)) == 0, "check");
       return 1;
     }
-    block = (ObjectMonitor*) block->FreeNext;
+    block = (PaddedEnd<ObjectMonitor> *) block->FreeNext;
   }
   return 0;
 }
--- a/hotspot/src/share/vm/runtime/synchronizer.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/synchronizer.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -134,6 +134,8 @@
 
  private:
   enum { _BLOCKSIZE = 128 };
+  // gBlockList is really PaddedEnd<ObjectMonitor> *, but we don't
+  // want to expose the PaddedEnd template more than necessary.
   static ObjectMonitor* gBlockList;
   static ObjectMonitor * volatile gFreeList;
   // global monitor in use list, for moribund threads,
--- a/hotspot/src/share/vm/runtime/thread.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -1287,6 +1287,7 @@
 
   this->record_stack_base_and_size();
   this->initialize_thread_local_storage();
+  this->set_native_thread_name(this->name());
   this->set_active_handles(JNIHandleBlock::allocate_block());
   while (!_should_terminate) {
     assert(watcher_thread() == Thread::current(), "thread consistency check");
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -1070,8 +1070,8 @@
   volatile_nonstatic_field(ObjectMonitor,      _header,                                       markOop)                               \
   unchecked_nonstatic_field(ObjectMonitor,     _object,                                       sizeof(void *)) /* NOTE: no type */    \
   unchecked_nonstatic_field(ObjectMonitor,     _owner,                                        sizeof(void *)) /* NOTE: no type */    \
-  volatile_nonstatic_field(ObjectMonitor,      _count,                                        intptr_t)                              \
-  volatile_nonstatic_field(ObjectMonitor,      _waiters,                                      intptr_t)                              \
+  volatile_nonstatic_field(ObjectMonitor,      _count,                                        jint)                                  \
+  volatile_nonstatic_field(ObjectMonitor,      _waiters,                                      jint)                                  \
   volatile_nonstatic_field(ObjectMonitor,      _recursions,                                   intptr_t)                              \
   nonstatic_field(ObjectMonitor,               FreeNext,                                      ObjectMonitor*)                        \
   volatile_nonstatic_field(BasicLock,          _displaced_header,                             markOop)                               \
@@ -2507,6 +2507,12 @@
   declare_constant(Deoptimization::Action_make_not_compilable)            \
   declare_constant(Deoptimization::Action_LIMIT)                          \
                                                                           \
+  /***************************************************/                   \
+  /* DEFAULT_CACHE_LINE_SIZE (globalDefinitions.hpp) */                   \
+  /***************************************************/                   \
+                                                                          \
+  declare_constant(DEFAULT_CACHE_LINE_SIZE)                               \
+                                                                          \
   /*********************/                                                 \
   /* Matcher (C2 only) */                                                 \
   /*********************/                                                 \
--- a/hotspot/src/share/vm/runtime/vmThread.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/runtime/vmThread.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -241,6 +241,7 @@
   assert(this == vm_thread(), "check");
 
   this->initialize_thread_local_storage();
+  this->set_native_thread_name(this->name());
   this->record_stack_base_and_size();
   // Notify_lock wait checks on active_handles() to rewait in
   // case of spurious wakeup, it should wait on the last
--- a/hotspot/src/share/vm/services/mallocTracker.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/services/mallocTracker.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -51,14 +51,6 @@
   return amount;
 }
 
-
-void MallocMemorySnapshot::reset() {
-  _tracking_header.reset();
-  for (int index = 0; index < mt_number_of_types; index ++) {
-    _malloc[index].reset();
-  }
-}
-
 // Make adjustment by subtracting chunks used by arenas
 // from total chunks to get total free chunck size
 void MallocMemorySnapshot::make_adjustment() {
@@ -116,14 +108,9 @@
 bool MallocTracker::transition(NMT_TrackingLevel from, NMT_TrackingLevel to) {
   assert(from != NMT_off, "Can not transition from off state");
   assert(to != NMT_off, "Can not transition to off state");
-  if (from == NMT_minimal) {
-    MallocMemorySummary::reset();
-  }
+  assert (from != NMT_minimal, "cannot transition from minimal state");
 
-  if (to == NMT_detail) {
-    assert(from == NMT_minimal || from == NMT_summary, "Just check");
-    return MallocSiteTable::initialize();
-  } else if (from == NMT_detail) {
+  if (from == NMT_detail) {
     assert(to == NMT_minimal || to == NMT_summary, "Just check");
     MallocSiteTable::shutdown();
   }
--- a/hotspot/src/share/vm/services/mallocTracker.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/services/mallocTracker.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -51,14 +51,6 @@
     DEBUG_ONLY(_peak_size  = 0;)
   }
 
-  // Reset counters
-  void reset() {
-    _size  = 0;
-    _count = 0;
-    DEBUG_ONLY(_peak_size = 0;)
-    DEBUG_ONLY(_peak_count = 0;)
-  }
-
   inline void allocate(size_t sz) {
     Atomic::add(1, (volatile MemoryCounterType*)&_count);
     if (sz > 0) {
@@ -124,11 +116,6 @@
     _arena.resize(sz);
   }
 
-  void reset() {
-    _malloc.reset();
-    _arena.reset();
-  }
-
   inline size_t malloc_size()  const { return _malloc.size(); }
   inline size_t malloc_count() const { return _malloc.count();}
   inline size_t arena_size()   const { return _arena.size();  }
@@ -176,8 +163,6 @@
     return s->by_type(mtThreadStack)->malloc_count();
   }
 
-  void reset();
-
   void copy_to(MallocMemorySnapshot* s) {
     s->_tracking_header = _tracking_header;
     for (int index = 0; index < mt_number_of_types; index ++) {
@@ -240,11 +225,6 @@
      return as_snapshot()->malloc_overhead()->size();
    }
 
-   // Reset all counters to zero
-   static void reset() {
-     as_snapshot()->reset();
-   }
-
   static MallocMemorySnapshot* as_snapshot() {
     return (MallocMemorySnapshot*)_snapshot;
   }
--- a/hotspot/src/share/vm/services/memBaseline.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/services/memBaseline.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -90,10 +90,6 @@
     _class_count(0) {
   }
 
-  ~MemBaseline() {
-    reset();
-  }
-
   bool baseline(bool summaryOnly = true);
 
   BaselineType baseline_type() const { return _baseline_type; }
@@ -169,8 +165,7 @@
   // reset the baseline for reuse
   void reset() {
     _baseline_type = Not_baselined;
-    _malloc_memory_snapshot.reset();
-    _virtual_memory_snapshot.reset();
+    // _malloc_memory_snapshot and _virtual_memory_snapshot are copied over.
     _class_count  = 0;
 
     _malloc_sites.clear();
--- a/hotspot/src/share/vm/services/memReporter.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/services/memReporter.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -96,20 +96,6 @@
   size_t                  _class_count;
 
  public:
-  // Report summary tracking data from global snapshots directly.
-  // This constructor is used for final reporting and hs_err reporting.
-  MemSummaryReporter(MallocMemorySnapshot* malloc_snapshot,
-    VirtualMemorySnapshot* vm_snapshot, outputStream* output,
-    size_t class_count = 0, size_t scale = K) :
-    MemReporterBase(output, scale),
-    _malloc_snapshot(malloc_snapshot),
-    _vm_snapshot(vm_snapshot) {
-    if (class_count == 0) {
-      _class_count = InstanceKlass::number_of_instance_classes();
-    } else {
-      _class_count = class_count;
-    }
-  }
   // This constructor is for normal reporting from a recent baseline.
   MemSummaryReporter(MemBaseline& baseline, outputStream* output,
     size_t scale = K) : MemReporterBase(output, scale),
--- a/hotspot/src/share/vm/services/memTracker.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/services/memTracker.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -144,11 +144,9 @@
 }
 
 
-// Shutdown can only be issued via JCmd, and NMT JCmd is serialized
-// by lock
+// Shutdown can only be issued via JCmd, and NMT JCmd is serialized by lock
 void MemTracker::shutdown() {
-  // We can only shutdown NMT to minimal tracking level if it is
-  // ever on.
+  // We can only shutdown NMT to minimal tracking level if it is ever on.
   if (tracking_level () > NMT_minimal) {
     transition_to(NMT_minimal);
   }
@@ -157,45 +155,36 @@
 bool MemTracker::transition_to(NMT_TrackingLevel level) {
   NMT_TrackingLevel current_level = tracking_level();
 
+  assert(level != NMT_off || current_level == NMT_off, "Cannot transition NMT to off");
+
   if (current_level == level) {
     return true;
   } else if (current_level > level) {
-    // Downgrade tracking level, we want to lower the tracking
-    // level first
+    // Downgrade tracking level, we want to lower the tracking level first
     _tracking_level = level;
     // Make _tracking_level visible immediately.
     OrderAccess::fence();
     VirtualMemoryTracker::transition(current_level, level);
     MallocTracker::transition(current_level, level);
-
-    if (level == NMT_minimal) _baseline.reset();
   } else {
-    VirtualMemoryTracker::transition(current_level, level);
-    MallocTracker::transition(current_level, level);
-
-    _tracking_level = level;
-    // Make _tracking_level visible immediately.
-    OrderAccess::fence();
+    // Upgrading tracking level is not supported and has never been supported.
+    // Allocating and deallocating malloc tracking structures is not thread safe and
+    // leads to inconsistencies unless a lot coarser locks are added.
   }
-
   return true;
 }
 
-void MemTracker::final_report(outputStream* output) {
-  assert(output != NULL, "No output stream");
-  if (tracking_level() >= NMT_summary) {
-    MallocMemorySnapshot* malloc_memory_snapshot =
-      MallocMemorySummary::as_snapshot();
-    malloc_memory_snapshot->make_adjustment();
-
-    VirtualMemorySnapshot* virtual_memory_snapshot =
-      VirtualMemorySummary::as_snapshot();
-
-    MemSummaryReporter rptr(malloc_memory_snapshot,
-      virtual_memory_snapshot, output);
-    rptr.report();
-    // shutdown NMT, the data no longer accurate
-    shutdown();
+void MemTracker::report(bool summary_only, outputStream* output) {
+ assert(output != NULL, "No output stream");
+  MemBaseline baseline;
+  if (baseline.baseline(summary_only)) {
+    if (summary_only) {
+      MemSummaryReporter rpt(baseline, output);
+      rpt.report();
+    } else {
+      MemDetailReporter rpt(baseline, output);
+      rpt.report();
+    }
   }
 }
 
--- a/hotspot/src/share/vm/services/memTracker.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/services/memTracker.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -70,6 +70,7 @@
   static inline void release_thread_stack(void* addr, size_t size) { }
 
   static void final_report(outputStream*) { }
+  static void error_report(outputStream*) { }
 };
 
 #else
@@ -270,13 +271,20 @@
   // other tools.
   static inline Mutex* query_lock() { return _query_lock; }
 
-  // Make a final report and shutdown.
-  // This function generates summary report without creating snapshots,
-  // to avoid additional memory allocation. It uses native memory summary
-  // counters, and makes adjustment to them, once the adjustment is made,
-  // the counters are no longer accurate. As the result, this function
-  // should only be used for final reporting before shutting down.
-  static void final_report(outputStream*);
+  // Make a final report or report for hs_err file.
+  static void error_report(outputStream* output) {
+    if (tracking_level() >= NMT_summary) {
+      report(true, output);  // just print summary for error case.
+    }
+   }
+
+  static void final_report(outputStream* output) {
+    NMT_TrackingLevel level = tracking_level();
+    if (level >= NMT_summary) {
+      report(level == NMT_summary, output);
+    }
+  }
+
 
   // Stored baseline
   static inline MemBaseline& get_baseline() {
@@ -291,6 +299,7 @@
 
  private:
   static NMT_TrackingLevel init_tracking_level();
+  static void report(bool summary_only, outputStream* output);
 
  private:
   // Tracking level
--- a/hotspot/src/share/vm/services/virtualMemoryTracker.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/services/virtualMemoryTracker.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -443,26 +443,28 @@
 bool VirtualMemoryTracker::walk_virtual_memory(VirtualMemoryWalker* walker) {
   assert(_reserved_regions != NULL, "Sanity check");
   ThreadCritical tc;
-  LinkedListNode<ReservedMemoryRegion>* head = _reserved_regions->head();
-  while (head != NULL) {
-    const ReservedMemoryRegion* rgn = head->peek();
-    if (!walker->do_allocation_site(rgn)) {
-      return false;
+  // Check that the _reserved_regions haven't been deleted.
+  if (_reserved_regions != NULL) {
+    LinkedListNode<ReservedMemoryRegion>* head = _reserved_regions->head();
+    while (head != NULL) {
+      const ReservedMemoryRegion* rgn = head->peek();
+      if (!walker->do_allocation_site(rgn)) {
+        return false;
+      }
+      head = head->next();
     }
-    head = head->next();
-  }
+   }
   return true;
 }
 
 // Transition virtual memory tracking level.
 bool VirtualMemoryTracker::transition(NMT_TrackingLevel from, NMT_TrackingLevel to) {
-  if (from == NMT_minimal) {
-    assert(to == NMT_summary || to == NMT_detail, "Just check");
-    VirtualMemorySummary::reset();
-  } else if (to == NMT_minimal) {
+  assert (from != NMT_minimal, "cannot convert from the lowest tracking level to anything");
+  if (to == NMT_minimal) {
     assert(from == NMT_summary || from == NMT_detail, "Just check");
     // Clean up virtual memory tracking data structures.
     ThreadCritical tc;
+    // Check for potential race with other thread calling transition
     if (_reserved_regions != NULL) {
       delete _reserved_regions;
       _reserved_regions = NULL;
--- a/hotspot/src/share/vm/services/virtualMemoryTracker.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/services/virtualMemoryTracker.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -62,11 +62,6 @@
     _committed -= sz;
   }
 
-  void reset() {
-    _reserved  = 0;
-    _committed = 0;
-  }
-
   inline size_t reserved()  const { return _reserved;  }
   inline size_t committed() const { return _committed; }
 };
@@ -123,12 +118,6 @@
     return amount;
   }
 
-  inline void reset() {
-    for (int index = 0; index < mt_number_of_types; index ++) {
-      _virtual_memory[index].reset();
-    }
-  }
-
   void copy_to(VirtualMemorySnapshot* s) {
     for (int index = 0; index < mt_number_of_types; index ++) {
       s->_virtual_memory[index] = _virtual_memory[index];
@@ -174,10 +163,6 @@
     as_snapshot()->copy_to(s);
   }
 
-  static inline void reset() {
-    as_snapshot()->reset();
-  }
-
   static VirtualMemorySnapshot* as_snapshot() {
     return (VirtualMemorySnapshot*)_snapshot;
   }
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Wed Jul 05 20:05:30 2017 +0200
@@ -540,7 +540,9 @@
 
 
 // The expected size in bytes of a cache line, used to pad data structures.
-#define DEFAULT_CACHE_LINE_SIZE 64
+#ifndef DEFAULT_CACHE_LINE_SIZE
+  #define DEFAULT_CACHE_LINE_SIZE 64
+#endif
 
 
 //----------------------------------------------------------------------------------------------------
--- a/hotspot/src/share/vm/utilities/vmError.cpp	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/src/share/vm/utilities/vmError.cpp	Wed Jul 05 20:05:30 2017 +0200
@@ -740,7 +740,7 @@
 
   STEP(228, "(Native Memory Tracking)" )
      if (_verbose) {
-       MemTracker::final_report(st);
+       MemTracker::error_report(st);
      }
 
   STEP(230, "" )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/arguments/CheckCompileThresholdScaling.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,359 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.oracle.java.testlibrary.*;
+
+/*
+ * @test CheckCompileThresholdScaling
+ * @bug 8059604
+ * @summary "Add CompileThresholdScalingPercentage flag to control when methods are first compiled (with +/-TieredCompilation)"
+ * @library /testlibrary
+ * @run main CheckCompileThresholdScaling
+ */
+
+public class CheckCompileThresholdScaling {
+
+    // The flag CompileThresholdScaling scales compilation thresholds
+    // in the following way:
+    //
+    // - if CompileThresholdScaling==1.0, the default threshold values
+    // are used;
+    //
+    // - if CompileThresholdScaling>1.0, threshold values are scaled
+    // up (e.g., CompileThresholdScalingPercentage=1.2 scales up
+    // thresholds by a factor of 1.2X);
+    //
+    // - if CompileThresholdScaling<1.0, threshold values are scaled
+    // down;
+    //
+    // - if CompileThresholdScaling==0, compilation is disabled
+    // (equivalent to using -Xint).
+    //
+    // With tiered compilation enabled, the values of the following
+    // flags are changed:
+    //
+    // Tier0InvokeNotifyFreqLog, Tier0BackedgeNotifyFreqLog,
+    // Tier3InvocationThreshold, Tier3MinInvocationThreshold,
+    // Tier3CompileThreshold, and Tier3BackEdgeThreshold,
+    // Tier2InvokeNotifyFreqLog, Tier2BackedgeNotifyFreqLog,
+    // Tier3InvokeNotifyFreqLog, Tier3BackedgeNotifyFreqLog,
+    // Tier23InlineeNotifyFreqLog, Tier4InvocationThreshold,
+    // Tier4MinInvocationThreshold, Tier4CompileThreshold,
+    // Tier4BackEdgeThreshold
+    //
+    // With tiered compilation disabled the value of CompileThreshold
+    // is scaled.
+    private static final String[][] NON_TIERED_ARGUMENTS = {
+        {
+            "-XX:-TieredCompilation",
+            "-XX:+PrintFlagsFinal",
+            "-XX:CompileThreshold=1000",
+            "-version"
+        },
+        {
+            "-XX:-TieredCompilation",
+            "-XX:+PrintFlagsFinal",
+            "-XX:CompileThreshold=1000",
+            "-XX:CompileThresholdScaling=1.25",
+            "-version"
+        },
+        {
+            "-XX:-TieredCompilation",
+            "-XX:+PrintFlagsFinal",
+            "-XX:CompileThreshold=1000",
+            "-XX:CompileThresholdScaling=0.75",
+            "-version"
+        },
+        {
+            "-XX:-TieredCompilation",
+            "-XX:+PrintFlagsFinal",
+            "-XX:CompileThreshold=0",
+            "-XX:CompileThresholdScaling=0.75",
+            "-version"
+        }
+
+    };
+
+    private static final String[][] NON_TIERED_EXPECTED_OUTPUTS = {
+        {
+            "intx CompileThreshold                         := 1000                                {pd product}",
+            "double CompileThresholdScaling                   = 1.000000                            {product}"
+        },
+        {
+            "intx CompileThreshold                         := 1250                                {pd product}",
+            "double CompileThresholdScaling                  := 1.250000                            {product}"
+        },
+        {
+            "intx CompileThreshold                         := 750                                 {pd product}",
+            "double CompileThresholdScaling                  := 0.750000                            {product}"
+        },
+        {
+            "intx CompileThreshold                         := 0                                   {pd product}",
+            "double CompileThresholdScaling                  := 0.750000                            {product}",
+            "interpreted mode"
+        }
+    };
+
+    private static final String[][] TIERED_ARGUMENTS = {
+        {
+            "-XX:+TieredCompilation",
+            "-XX:+PrintFlagsFinal",
+            "-XX:Tier0InvokeNotifyFreqLog=7",
+            "-XX:Tier0BackedgeNotifyFreqLog=10",
+            "-XX:Tier3InvocationThreshold=200",
+            "-XX:Tier3MinInvocationThreshold=100",
+            "-XX:Tier3CompileThreshold=2000",
+            "-XX:Tier3BackEdgeThreshold=60000",
+            "-XX:Tier2InvokeNotifyFreqLog=11",
+            "-XX:Tier2BackedgeNotifyFreqLog=14",
+            "-XX:Tier3InvokeNotifyFreqLog=10",
+            "-XX:Tier3BackedgeNotifyFreqLog=13",
+            "-XX:Tier23InlineeNotifyFreqLog=20",
+            "-XX:Tier4InvocationThreshold=5000",
+            "-XX:Tier4MinInvocationThreshold=600",
+            "-XX:Tier4CompileThreshold=15000",
+            "-XX:Tier4BackEdgeThreshold=40000",
+            "-version"
+        },
+        {
+            "-XX:+TieredCompilation",
+            "-XX:+PrintFlagsFinal",
+            "-XX:Tier0InvokeNotifyFreqLog=7",
+            "-XX:Tier0BackedgeNotifyFreqLog=10",
+            "-XX:Tier3InvocationThreshold=200",
+            "-XX:Tier3MinInvocationThreshold=100",
+            "-XX:Tier3CompileThreshold=2000",
+            "-XX:Tier3BackEdgeThreshold=60000",
+            "-XX:Tier2InvokeNotifyFreqLog=11",
+            "-XX:Tier2BackedgeNotifyFreqLog=14",
+            "-XX:Tier3InvokeNotifyFreqLog=10",
+            "-XX:Tier3BackedgeNotifyFreqLog=13",
+            "-XX:Tier23InlineeNotifyFreqLog=20",
+            "-XX:Tier4InvocationThreshold=5000",
+            "-XX:Tier4MinInvocationThreshold=600",
+            "-XX:Tier4CompileThreshold=15000",
+            "-XX:Tier4BackEdgeThreshold=40000",
+            "-XX:CompileThresholdScaling=0.75",
+            "-version"
+        },
+        {
+            "-XX:+TieredCompilation",
+            "-XX:+PrintFlagsFinal",
+            "-XX:Tier0InvokeNotifyFreqLog=7",
+            "-XX:Tier0BackedgeNotifyFreqLog=10",
+            "-XX:Tier3InvocationThreshold=200",
+            "-XX:Tier3MinInvocationThreshold=100",
+            "-XX:Tier3CompileThreshold=2000",
+            "-XX:Tier3BackEdgeThreshold=60000",
+            "-XX:Tier2InvokeNotifyFreqLog=11",
+            "-XX:Tier2BackedgeNotifyFreqLog=14",
+            "-XX:Tier3InvokeNotifyFreqLog=10",
+            "-XX:Tier3BackedgeNotifyFreqLog=13",
+            "-XX:Tier23InlineeNotifyFreqLog=20",
+            "-XX:Tier4InvocationThreshold=5000",
+            "-XX:Tier4MinInvocationThreshold=600",
+            "-XX:Tier4CompileThreshold=15000",
+            "-XX:Tier4BackEdgeThreshold=40000",
+            "-XX:CompileThresholdScaling=1.25",
+            "-version"
+        },
+        {
+            "-XX:+TieredCompilation",
+            "-XX:+PrintFlagsFinal",
+            "-XX:Tier0InvokeNotifyFreqLog=7",
+            "-XX:Tier0BackedgeNotifyFreqLog=10",
+            "-XX:Tier3InvocationThreshold=200",
+            "-XX:Tier3MinInvocationThreshold=100",
+            "-XX:Tier3CompileThreshold=2000",
+            "-XX:Tier3BackEdgeThreshold=60000",
+            "-XX:Tier2InvokeNotifyFreqLog=11",
+            "-XX:Tier2BackedgeNotifyFreqLog=14",
+            "-XX:Tier3InvokeNotifyFreqLog=10",
+            "-XX:Tier3BackedgeNotifyFreqLog=13",
+            "-XX:Tier23InlineeNotifyFreqLog=20",
+            "-XX:Tier4InvocationThreshold=5000",
+            "-XX:Tier4MinInvocationThreshold=600",
+            "-XX:Tier4CompileThreshold=15000",
+            "-XX:Tier4BackEdgeThreshold=40000",
+            "-XX:CompileThresholdScaling=2.0",
+            "-version"
+        },
+        {
+            "-XX:+TieredCompilation",
+            "-XX:+PrintFlagsFinal",
+            "-XX:Tier0InvokeNotifyFreqLog=7",
+            "-XX:Tier0BackedgeNotifyFreqLog=10",
+            "-XX:Tier3InvocationThreshold=200",
+            "-XX:Tier3MinInvocationThreshold=100",
+            "-XX:Tier3CompileThreshold=2000",
+            "-XX:Tier3BackEdgeThreshold=60000",
+            "-XX:Tier2InvokeNotifyFreqLog=11",
+            "-XX:Tier2BackedgeNotifyFreqLog=14",
+            "-XX:Tier3InvokeNotifyFreqLog=10",
+            "-XX:Tier3BackedgeNotifyFreqLog=13",
+            "-XX:Tier23InlineeNotifyFreqLog=20",
+            "-XX:Tier4InvocationThreshold=5000",
+            "-XX:Tier4MinInvocationThreshold=600",
+            "-XX:Tier4CompileThreshold=15000",
+            "-XX:Tier4BackEdgeThreshold=40000",
+            "-XX:CompileThresholdScaling=0.0",
+            "-version"
+        }
+    };
+
+    private static final String[][] TIERED_EXPECTED_OUTPUTS = {
+        {
+            "intx Tier0BackedgeNotifyFreqLog               := 10                                  {product}",
+            "intx Tier0InvokeNotifyFreqLog                 := 7                                   {product}",
+            "intx Tier23InlineeNotifyFreqLog               := 20                                  {product}",
+            "intx Tier2BackedgeNotifyFreqLog               := 14                                  {product}",
+            "intx Tier2InvokeNotifyFreqLog                 := 11                                  {product}",
+            "intx Tier3BackEdgeThreshold                   := 60000                               {product}",
+            "intx Tier3BackedgeNotifyFreqLog               := 13                                  {product}",
+            "intx Tier3CompileThreshold                    := 2000                                {product}",
+            "intx Tier3InvocationThreshold                 := 200                                 {product}",
+            "intx Tier3InvokeNotifyFreqLog                 := 10                                  {product}",
+            "intx Tier3MinInvocationThreshold              := 100                                 {product}",
+            "intx Tier4BackEdgeThreshold                   := 40000                               {product}",
+            "intx Tier4CompileThreshold                    := 15000                               {product}",
+            "intx Tier4InvocationThreshold                 := 5000                                {product}",
+            "intx Tier4MinInvocationThreshold              := 600                                 {product}",
+            "double CompileThresholdScaling                   = 1.000000                            {product}"
+        },
+        {
+            "intx Tier0BackedgeNotifyFreqLog               := 9                                   {product}",
+            "intx Tier0InvokeNotifyFreqLog                 := 6                                   {product}",
+            "intx Tier23InlineeNotifyFreqLog               := 19                                  {product}",
+            "intx Tier2BackedgeNotifyFreqLog               := 13                                  {product}",
+            "intx Tier2InvokeNotifyFreqLog                 := 10                                  {product}",
+            "intx Tier3BackEdgeThreshold                   := 45000                               {product}",
+            "intx Tier3BackedgeNotifyFreqLog               := 12                                  {product}",
+            "intx Tier3CompileThreshold                    := 1500                                {product}",
+            "intx Tier3InvocationThreshold                 := 150                                 {product}",
+            "intx Tier3InvokeNotifyFreqLog                 := 9                                   {product}",
+            "intx Tier3MinInvocationThreshold              := 75                                  {product}",
+            "intx Tier4BackEdgeThreshold                   := 30000                               {product}",
+            "intx Tier4CompileThreshold                    := 11250                               {product}",
+            "intx Tier4InvocationThreshold                 := 3750                                {product}",
+            "intx Tier4MinInvocationThreshold              := 450                                 {product}",
+            "double CompileThresholdScaling                  := 0.750000                            {product}"
+        },
+        {
+            "intx Tier0BackedgeNotifyFreqLog               := 10                                  {product}",
+            "intx Tier0InvokeNotifyFreqLog                 := 7                                   {product}",
+            "intx Tier23InlineeNotifyFreqLog               := 20                                  {product}",
+            "intx Tier2BackedgeNotifyFreqLog               := 14                                  {product}",
+            "intx Tier2InvokeNotifyFreqLog                 := 11                                  {product}",
+            "intx Tier3BackEdgeThreshold                   := 75000                               {product}",
+            "intx Tier3BackedgeNotifyFreqLog               := 13                                  {product}",
+            "intx Tier3CompileThreshold                    := 2500                                {product}",
+            "intx Tier3InvocationThreshold                 := 250                                 {product}",
+            "intx Tier3InvokeNotifyFreqLog                 := 10                                  {product}",
+            "intx Tier3MinInvocationThreshold              := 125                                 {product}",
+            "intx Tier4BackEdgeThreshold                   := 50000                               {product}",
+            "intx Tier4CompileThreshold                    := 18750                               {product}",
+            "intx Tier4InvocationThreshold                 := 6250                                {product}",
+            "intx Tier4MinInvocationThreshold              := 750                                 {product}",
+            "double CompileThresholdScaling                  := 1.250000                            {product}"
+        },
+        {
+            "intx Tier0BackedgeNotifyFreqLog               := 11                                  {product}",
+            "intx Tier0InvokeNotifyFreqLog                 := 8                                   {product}",
+            "intx Tier23InlineeNotifyFreqLog               := 21                                  {product}",
+            "intx Tier2BackedgeNotifyFreqLog               := 15                                  {product}",
+            "intx Tier2InvokeNotifyFreqLog                 := 12                                  {product}",
+            "intx Tier3BackEdgeThreshold                   := 120000                              {product}",
+            "intx Tier3BackedgeNotifyFreqLog               := 14                                  {product}",
+            "intx Tier3CompileThreshold                    := 4000                                {product}",
+            "intx Tier3InvocationThreshold                 := 400                                 {product}",
+            "intx Tier3InvokeNotifyFreqLog                 := 11                                  {product}",
+            "intx Tier3MinInvocationThreshold              := 200                                 {product}",
+            "intx Tier4BackEdgeThreshold                   := 80000                               {product}",
+            "intx Tier4CompileThreshold                    := 30000                               {product}",
+            "intx Tier4InvocationThreshold                 := 10000                               {product}",
+            "intx Tier4MinInvocationThreshold              := 1200                                {product}",
+            "double CompileThresholdScaling                  := 2.000000                            {product}"
+        },
+        {
+            "intx Tier0BackedgeNotifyFreqLog               := 0                                   {product}",
+            "intx Tier0InvokeNotifyFreqLog                 := 0                                   {product}",
+            "intx Tier23InlineeNotifyFreqLog               := 0                                   {product}",
+            "intx Tier2BackedgeNotifyFreqLog               := 0                                   {product}",
+            "intx Tier2InvokeNotifyFreqLog                 := 0                                   {product}",
+            "intx Tier3BackEdgeThreshold                   := 0                                   {product}",
+            "intx Tier3BackedgeNotifyFreqLog               := 0                                   {product}",
+            "intx Tier3CompileThreshold                    := 0                                   {product}",
+            "intx Tier3InvocationThreshold                 := 0                                   {product}",
+            "intx Tier3InvokeNotifyFreqLog                 := 0                                   {product}",
+            "intx Tier3MinInvocationThreshold              := 0                                   {product}",
+            "intx Tier4BackEdgeThreshold                   := 0                                   {product}",
+            "intx Tier4CompileThreshold                    := 0                                   {product}",
+            "intx Tier4InvocationThreshold                 := 0                                   {product}",
+            "intx Tier4MinInvocationThreshold              := 0                                   {product}",
+            "double CompileThresholdScaling                  := 0.000000                            {product}",
+            "interpreted mode"
+        }
+    };
+
+    private static void verifyValidOption(String[] arguments, String[] expected_outputs, boolean tiered) throws Exception {
+        ProcessBuilder pb;
+        OutputAnalyzer out;
+
+        pb = ProcessTools.createJavaProcessBuilder(arguments);
+        out = new OutputAnalyzer(pb.start());
+
+        try {
+            for (String expected_output : expected_outputs) {
+                out.shouldContain(expected_output);
+            }
+            out.shouldHaveExitValue(0);
+        } catch (RuntimeException e) {
+            // Check if tiered compilation is available in this JVM
+            // Version. Throw exception only if it is available.
+            if (!(tiered && out.getOutput().contains("Client VM warning: TieredCompilation is disabled in this release."))) {
+                throw new RuntimeException(e);
+            }
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+
+        if (NON_TIERED_ARGUMENTS.length != NON_TIERED_EXPECTED_OUTPUTS.length) {
+            throw new RuntimeException("Test is set up incorrectly: length of arguments and expected outputs in non-tiered mode of operation does not match.");
+        }
+
+        if (TIERED_ARGUMENTS.length != TIERED_EXPECTED_OUTPUTS.length) {
+            throw new RuntimeException("Test is set up incorrectly: length of arguments and expected outputs in tiered mode of operation.");
+        }
+
+        // Check if thresholds are scaled properly in non-tiered mode of operation
+        for (int i = 0; i < NON_TIERED_ARGUMENTS.length; i++) {
+            verifyValidOption(NON_TIERED_ARGUMENTS[i], NON_TIERED_EXPECTED_OUTPUTS[i], false);
+        }
+
+        // Check if thresholds are scaled properly in tiered mode of operation
+        for (int i = 0; i < TIERED_ARGUMENTS.length; i++) {
+            verifyValidOption(TIERED_ARGUMENTS[i], TIERED_EXPECTED_OUTPUTS[i], true);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/oracle/CheckCompileCommandOption.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,216 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.oracle.java.testlibrary.*;
+
+/*
+ * @test CheckCompileCommandOption
+ * @bug 8055286 8056964 8059847
+ * @summary "Checks parsing of -XX:+CompileCommand=option"
+ * @library /testlibrary
+ * @run main CheckCompileCommandOption
+ */
+
+public class CheckCompileCommandOption {
+
+    // Currently, two types of trailing options can be used with
+    // -XX:CompileCommand=option
+    //
+    // (1) CompileCommand=option,Klass::method,flag
+    // (2) CompileCommand=option,Klass::method,type,flag,value
+    //
+    // Type (1) is used to enable a boolean flag for a method.
+    //
+    // Type (2) is used to support flags with a value. Values can
+    // have the the following types: intx, uintx, bool, ccstr,
+    // ccstrlist, and double.
+
+    private static final String[][] TYPE_1_ARGUMENTS = {
+        {
+            "-XX:CompileCommand=option,com/oracle/Test.test,MyBoolOption1",
+            "-XX:CompileCommand=option,com/oracle/Test,test,MyBoolOption2",
+            "-XX:CompileCommand=option,com.oracle.Test::test,MyBoolOption3",
+            "-XX:CompileCommand=option,com/oracle/Test::test,MyBoolOption4",
+            "-version"
+        },
+        {
+            "-XX:CompileCommand=option,com/oracle/Test.test,MyBoolOption1,MyBoolOption2",
+            "-version"
+        },
+        {
+            "-XX:CompileCommand=option,com/oracle/Test,test,MyBoolOption1,MyBoolOption2",
+            "-version"
+        }
+    };
+
+    private static final String[][] TYPE_1_EXPECTED_OUTPUTS = {
+        {
+            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption1 = true",
+            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption2 = true",
+            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption3 = true",
+            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption4 = true"
+        },
+        {
+            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption1 = true",
+            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption2 = true",
+        },
+        {
+            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption1 = true",
+            "CompilerOracle: option com/oracle/Test.test bool MyBoolOption2 = true",
+        }
+    };
+
+    private static final String[][] TYPE_2_ARGUMENTS = {
+        {
+            "-XX:CompileCommand=option,Test::test,ccstrlist,MyListOption,_foo,_bar",
+            "-XX:CompileCommand=option,Test::test,ccstr,MyStrOption,_foo",
+            "-XX:CompileCommand=option,Test::test,bool,MyBoolOption,false",
+            "-XX:CompileCommand=option,Test::test,intx,MyIntxOption,-1",
+            "-XX:CompileCommand=option,Test::test,uintx,MyUintxOption,1",
+            "-XX:CompileCommand=option,Test::test,MyFlag",
+            "-XX:CompileCommand=option,Test::test,double,MyDoubleOption,1.123",
+            "-version"
+        },
+        {
+            "-XX:CompileCommand=option,Test.test,double,MyDoubleOption,1.123",
+            "-version"
+        },
+        {
+            "-XX:CompileCommand=option,Test::test,bool,MyBoolOption,false,intx,MyIntxOption,-1,uintx,MyUintxOption,1,MyFlag,double,MyDoubleOption,1.123",
+            "-version"
+        }
+    };
+
+    private static final String[][] TYPE_2_EXPECTED_OUTPUTS = {
+        {
+            "CompilerOracle: option Test.test const char* MyListOption = '_foo _bar'",
+            "CompilerOracle: option Test.test const char* MyStrOption = '_foo'",
+            "CompilerOracle: option Test.test bool MyBoolOption = false",
+            "CompilerOracle: option Test.test intx MyIntxOption = -1",
+            "CompilerOracle: option Test.test uintx MyUintxOption = 1",
+            "CompilerOracle: option Test.test bool MyFlag = true",
+            "CompilerOracle: option Test.test double MyDoubleOption = 1.123000"
+        },
+        {
+            "CompilerOracle: option Test.test double MyDoubleOption = 1.123000"
+        },
+        {
+            "CompilerOracle: option Test.test bool MyBoolOption = false",
+            "CompilerOracle: option Test.test intx MyIntxOption = -1",
+            "CompilerOracle: option Test.test uintx MyUintxOption = 1",
+            "CompilerOracle: option Test.test bool MyFlag = true",
+            "CompilerOracle: option Test.test double MyDoubleOption = 1.123000",
+        }
+    };
+
+    private static final String[][] TYPE_2_INVALID_ARGUMENTS = {
+        {
+            // bool flag name missing
+            "-XX:CompileCommand=option,Test::test,bool",
+            "-version"
+        },
+        {
+            // bool flag value missing
+            "-XX:CompileCommand=option,Test::test,bool,MyBoolOption",
+            "-version"
+        },
+        {
+            // wrong value for bool flag
+            "-XX:CompileCommand=option,Test::test,bool,MyBoolOption,100",
+            "-version"
+        },
+        {
+            // intx flag name missing
+            "-XX:CompileCommand=option,Test::test,bool,MyBoolOption,false,intx",
+            "-version"
+        },
+        {
+            // intx flag value missing
+            "-XX:CompileCommand=option,Test::test,bool,MyBoolOption,false,intx,MyIntOption",
+            "-version"
+        },
+        {
+            // wrong value for intx flag
+            "-XX:CompileCommand=option,Test::test,bool,MyBoolOption,false,intx,MyIntOption,true",
+            "-version"
+        },
+        {
+            // wrong value for flag double flag
+            "-XX:CompileCommand=option,Test::test,double,MyDoubleOption,1",
+            "-version"
+        }
+    };
+
+    private static void verifyValidOption(String[] arguments, String[] expected_outputs) throws Exception {
+        ProcessBuilder pb;
+        OutputAnalyzer out;
+
+        pb = ProcessTools.createJavaProcessBuilder(arguments);
+        out = new OutputAnalyzer(pb.start());
+
+        for (String expected_output : expected_outputs) {
+            out.shouldContain(expected_output);
+        }
+
+        out.shouldNotContain("CompilerOracle: unrecognized line");
+        out.shouldHaveExitValue(0);
+    }
+
+    private static void verifyInvalidOption(String[] arguments) throws Exception {
+        ProcessBuilder pb;
+        OutputAnalyzer out;
+
+        pb = ProcessTools.createJavaProcessBuilder(arguments);
+        out = new OutputAnalyzer(pb.start());
+
+        out.shouldContain("CompilerOracle: unrecognized line");
+        out.shouldHaveExitValue(0);
+    }
+
+    public static void main(String[] args) throws Exception {
+
+        if (TYPE_1_ARGUMENTS.length != TYPE_1_EXPECTED_OUTPUTS.length) {
+            throw new RuntimeException("Test is set up incorrectly: length of arguments and expected outputs for type (1) options does not match.");
+        }
+
+        if (TYPE_2_ARGUMENTS.length != TYPE_2_EXPECTED_OUTPUTS.length) {
+            throw new RuntimeException("Test is set up incorrectly: length of arguments and expected outputs for type (2) options does not match.");
+        }
+
+        // Check if type (1) options are parsed correctly
+        for (int i = 0; i < TYPE_1_ARGUMENTS.length; i++) {
+            verifyValidOption(TYPE_1_ARGUMENTS[i], TYPE_1_EXPECTED_OUTPUTS[i]);
+        }
+
+        // Check if type (2) options are parsed correctly
+        for (int i = 0; i < TYPE_2_ARGUMENTS.length; i++) {
+            verifyValidOption(TYPE_2_ARGUMENTS[i], TYPE_2_EXPECTED_OUTPUTS[i]);
+        }
+
+        // Check if error is reported for invalid type (2) options
+        // (flags with type information specified)
+        for (String[] arguments: TYPE_2_INVALID_ARGUMENTS) {
+            verifyInvalidOption(arguments);
+        }
+    }
+}
--- a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -26,7 +26,6 @@
 /**
  * @test NonTieredLevelsTest
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
- * @ignore 8046268
  * @build NonTieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/tiered/TieredLevelsTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/test/compiler/tiered/TieredLevelsTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -24,7 +24,6 @@
 /**
  * @test TieredLevelsTest
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
- * @ignore 8046268
  * @build TieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -27,7 +27,6 @@
  * @test ClearMethodStateTest
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
- * @ignore 8046268
  * @build ClearMethodStateTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -69,10 +69,12 @@
     /** Flag for verbose output, true if {@code -Dverbose} specified */
     protected static final boolean IS_VERBOSE
             = System.getProperty("verbose") != null;
-    /** count of invocation to triger compilation */
+    /** invocation count to trigger compilation */
     protected static final int THRESHOLD;
-    /** count of invocation to triger OSR compilation */
+    /** invocation count to trigger OSR compilation */
     protected static final long BACKEDGE_THRESHOLD;
+    /** invocation count to warm up method before triggering OSR compilation */
+    protected static final long OSR_WARMUP = 2000;
     /** Value of {@code java.vm.info} (interpreted|mixed|comp mode) */
     protected static final String MODE = System.getProperty("java.vm.info");
 
@@ -216,15 +218,19 @@
      *                          compilation level.
      */
     protected final void checkNotCompiled() {
-        if (WHITE_BOX.isMethodQueuedForCompilation(method)) {
-            throw new RuntimeException(method + " must not be in queue");
-        }
         if (WHITE_BOX.isMethodCompiled(method, false)) {
             throw new RuntimeException(method + " must be not compiled");
         }
         if (WHITE_BOX.getMethodCompilationLevel(method, false) != 0) {
             throw new RuntimeException(method + " comp_level must be == 0");
         }
+        checkNotOsrCompiled();
+    }
+
+    protected final void checkNotOsrCompiled() {
+        if (WHITE_BOX.isMethodQueuedForCompilation(method)) {
+            throw new RuntimeException(method + " must not be in queue");
+        }
         if (WHITE_BOX.isMethodCompiled(method, true)) {
             throw new RuntimeException(method + " must be not osr_compiled");
         }
@@ -295,12 +301,21 @@
      * Waits for completion of background compilation of {@linkplain #method}.
      */
     protected final void waitBackgroundCompilation() {
+        waitBackgroundCompilation(method);
+    }
+
+    /**
+     * Waits for completion of background compilation of the given executable.
+     *
+     * @param executable Executable
+     */
+    protected static final void waitBackgroundCompilation(Executable executable) {
         if (!BACKGROUND_COMPILATION) {
             return;
         }
         final Object obj = new Object();
         for (int i = 0; i < 10
-                && WHITE_BOX.isMethodQueuedForCompilation(method); ++i) {
+                && WHITE_BOX.isMethodQueuedForCompilation(executable); ++i) {
             synchronized (obj) {
                 try {
                     obj.wait(1000);
@@ -414,14 +429,14 @@
     /** constructor test case */
     CONSTRUCTOR_TEST(Helper.CONSTRUCTOR, Helper.CONSTRUCTOR_CALLABLE, false),
     /** method test case */
-    METOD_TEST(Helper.METHOD, Helper.METHOD_CALLABLE, false),
+    METHOD_TEST(Helper.METHOD, Helper.METHOD_CALLABLE, false),
     /** static method test case */
     STATIC_TEST(Helper.STATIC, Helper.STATIC_CALLABLE, false),
     /** OSR constructor test case */
     OSR_CONSTRUCTOR_TEST(Helper.OSR_CONSTRUCTOR,
             Helper.OSR_CONSTRUCTOR_CALLABLE, true),
     /** OSR method test case */
-    OSR_METOD_TEST(Helper.OSR_METHOD, Helper.OSR_METHOD_CALLABLE, true),
+    OSR_METHOD_TEST(Helper.OSR_METHOD, Helper.OSR_METHOD_CALLABLE, true),
     /** OSR static method test case */
     OSR_STATIC_TEST(Helper.OSR_STATIC, Helper.OSR_STATIC_CALLABLE, true);
 
@@ -483,7 +498,8 @@
                 = new Callable<Integer>() {
             @Override
             public Integer call() throws Exception {
-                return new Helper(null).hashCode();
+                int result = warmup(OSR_CONSTRUCTOR);
+                return result + new Helper(null, CompilerWhiteBoxTest.BACKEDGE_THRESHOLD).hashCode();
             }
         };
 
@@ -493,7 +509,8 @@
 
             @Override
             public Integer call() throws Exception {
-                return helper.osrMethod();
+                int result = warmup(OSR_METHOD);
+                return result + helper.osrMethod(CompilerWhiteBoxTest.BACKEDGE_THRESHOLD);
             }
         };
 
@@ -501,10 +518,66 @@
                 = new Callable<Integer>() {
             @Override
             public Integer call() throws Exception {
-                return osrStaticMethod();
+                int result = warmup(OSR_STATIC);
+                return result + osrStaticMethod(CompilerWhiteBoxTest.BACKEDGE_THRESHOLD);
             }
         };
 
+        /**
+         * Deoptimizes all non-osr versions of the given executable after
+         * compilation finished.
+         *
+         * @param e Executable
+         * @throws Exception
+         */
+        private static void waitAndDeoptimize(Executable e) throws Exception {
+            CompilerWhiteBoxTest.waitBackgroundCompilation(e);
+            if (WhiteBox.getWhiteBox().isMethodQueuedForCompilation(e)) {
+                throw new RuntimeException(e + " must not be in queue");
+            }
+            // Deoptimize non-osr versions of executable
+            WhiteBox.getWhiteBox().deoptimizeMethod(e, false);
+        }
+
+        /**
+         * Executes the method multiple times to make sure we have
+         * enough profiling information before triggering an OSR
+         * compilation. Otherwise the C2 compiler may add uncommon traps.
+         *
+         * @param m Method to be executed
+         * @return Number of times the method was executed
+         * @throws Exception
+         */
+        private static int warmup(Method m) throws Exception {
+            Helper helper = new Helper();
+            int result = 0;
+            for (long i = 0; i < CompilerWhiteBoxTest.OSR_WARMUP; ++i) {
+                result += (int)m.invoke(helper, 1);
+            }
+            // Deoptimize non-osr versions
+            waitAndDeoptimize(m);
+            return result;
+        }
+
+        /**
+         * Executes the constructor multiple times to make sure we
+         * have enough profiling information before triggering an OSR
+         * compilation. Otherwise the C2 compiler may add uncommon traps.
+         *
+         * @param c Constructor to be executed
+         * @return Number of times the constructor was executed
+         * @throws Exception
+         */
+        private static int warmup(Constructor c) throws Exception {
+            int result = 0;
+            for (long i = 0; i < CompilerWhiteBoxTest.OSR_WARMUP; ++i) {
+                result += c.newInstance(null, 1).hashCode();
+            }
+            // Deoptimize non-osr versions
+            waitAndDeoptimize(c);
+            return result;
+        }
+
         private static final Constructor CONSTRUCTOR;
         private static final Constructor OSR_CONSTRUCTOR;
         private static final Method METHOD;
@@ -521,25 +594,24 @@
             }
             try {
                 OSR_CONSTRUCTOR = Helper.class.getDeclaredConstructor(
-                        Object.class);
+                        Object.class, long.class);
             } catch (NoSuchMethodException | SecurityException e) {
                 throw new RuntimeException(
-                        "exception on getting method Helper.<init>(Object)", e);
+                        "exception on getting method Helper.<init>(Object, long)", e);
             }
             METHOD = getMethod("method");
             STATIC = getMethod("staticMethod");
-            OSR_METHOD = getMethod("osrMethod");
-            OSR_STATIC = getMethod("osrStaticMethod");
+            OSR_METHOD = getMethod("osrMethod", long.class);
+            OSR_STATIC = getMethod("osrStaticMethod", long.class);
         }
 
-        private static Method getMethod(String name) {
+        private static Method getMethod(String name, Class<?>... parameterTypes) {
             try {
-                return Helper.class.getDeclaredMethod(name);
+                return Helper.class.getDeclaredMethod(name, parameterTypes);
             } catch (NoSuchMethodException | SecurityException e) {
                 throw new RuntimeException(
                         "exception on getting method Helper." + name, e);
             }
-
         }
 
         private static int staticMethod() {
@@ -550,17 +622,17 @@
             return 42;
         }
 
-        private static int osrStaticMethod() {
+        private static int osrStaticMethod(long limit) {
             int result = 0;
-            for (long i = 0; i < CompilerWhiteBoxTest.BACKEDGE_THRESHOLD; ++i) {
+            for (long i = 0; i < limit; ++i) {
                 result += staticMethod();
             }
             return result;
         }
 
-        private int osrMethod() {
+        private int osrMethod(long limit) {
             int result = 0;
-            for (long i = 0; i < CompilerWhiteBoxTest.BACKEDGE_THRESHOLD; ++i) {
+            for (long i = 0; i < limit; ++i) {
                 result += method();
             }
             return result;
@@ -574,9 +646,9 @@
         }
 
         // for OSR constructor test case
-        private Helper(Object o) {
+        private Helper(Object o, long limit) {
             int result = 0;
-            for (long i = 0; i < CompilerWhiteBoxTest.BACKEDGE_THRESHOLD; ++i) {
+            for (long i = 0; i < limit; ++i) {
                 result += method();
             }
             x = result;
--- a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -25,7 +25,6 @@
  * @test DeoptimizeAllTest
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
- * @ignore 8046268
  * @build DeoptimizeAllTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -25,7 +25,6 @@
  * @test DeoptimizeMethodTest
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
- * @ignore 8046268
  * @build DeoptimizeMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -25,7 +25,6 @@
  * @test EnqueueMethodForCompilationTest
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
- * @ignore 8046268
  * @build EnqueueMethodForCompilationTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/GetNMethodTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/test/compiler/whitebox/GetNMethodTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -28,7 +28,6 @@
  * @test GetNMethodTest
  * @bug 8038240
  * @library /testlibrary /testlibrary/whitebox
- * @ignore 8046268
  * @build GetNMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -25,7 +25,6 @@
  * @test MakeMethodNotCompilableTest
  * @bug 8012322 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
- * @ignore 8046268
  * @build MakeMethodNotCompilableTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -140,7 +139,7 @@
         }
 
         compile();
-        checkNotCompiled();
+        checkNotOsrCompiled();
         if (isCompilable()) {
             throw new RuntimeException(method + " must be not compilable");
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/gc/g1/TestG1TraceReclaimDeadHumongousObjectsAtYoungGC.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test TestG1TraceReclaimDeadHumongousObjectsAtYoungGC
+ * @bug 8058801
+ * @summary Ensure that the output for a G1TraceReclaimDeadHumongousObjectsAtYoungGC
+ * includes the expected necessary messages.
+ * @key gc
+ * @library /testlibrary
+ */
+
+import com.oracle.java.testlibrary.ProcessTools;
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import java.util.LinkedList;
+
+public class TestG1TraceReclaimDeadHumongousObjectsAtYoungGC {
+  public static void main(String[] args) throws Exception {
+    testGCLogs();
+    testHumongousObjectGCLogs();
+  }
+
+  private static void testGCLogs() throws Exception {
+
+    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+                                               "-Xms128M",
+                                               "-Xmx128M",
+                                               "-Xmn16M",
+                                               "-XX:G1HeapRegionSize=1M",
+                                               "-XX:+PrintGC",
+                                               "-XX:+UnlockExperimentalVMOptions",
+                                               "-XX:G1LogLevel=finest",
+                                               "-XX:+G1TraceReclaimDeadHumongousObjectsAtYoungGC",
+                                               GCTest.class.getName());
+
+    OutputAnalyzer output = new OutputAnalyzer(pb.start());
+
+    // As G1ReclaimDeadHumongousObjectsAtYoungGC is set(default), below logs should be displayed.
+    // And GCTest doesn't have humongous objects, so values should be zero.
+    output.shouldContain("[Humongous Reclaim");
+    output.shouldContain("[Humongous Total: 0]");
+    output.shouldContain("[Humongous Candidate: 0]");
+    output.shouldContain("[Humongous Reclaimed: 0]");
+
+    output.shouldHaveExitValue(0);
+  }
+
+  private static void testHumongousObjectGCLogs() throws Exception {
+    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+                                               "-Xms128M",
+                                               "-Xmx128M",
+                                               "-Xmn16M",
+                                               "-XX:G1HeapRegionSize=1M",
+                                               "-XX:+PrintGC",
+                                               "-XX:+UnlockExperimentalVMOptions",
+                                               "-XX:G1LogLevel=finest",
+                                               "-XX:+G1TraceReclaimDeadHumongousObjectsAtYoungGC",
+                                               GCWithHumongousObjectTest.class.getName());
+
+    OutputAnalyzer output = new OutputAnalyzer(pb.start());
+
+    // As G1ReclaimDeadHumongousObjectsAtYoungGC is set(default), below logs should be displayed.
+    output.shouldContain("[Humongous Reclaim");
+    output.shouldContain("[Humongous Total");
+    output.shouldContain("[Humongous Candidate");
+    output.shouldContain("[Humongous Reclaimed");
+
+    // As G1TraceReclaimDeadHumongousObjectsAtYoungGC is set and GCWithHumongousObjectTest has humongous objects,
+    // these logs should be displayed.
+    output.shouldContain("Live humongous");
+    output.shouldContain("Reclaim humongous region");
+    output.shouldHaveExitValue(0);
+  }
+
+  static class GCTest {
+    private static byte[] garbage;
+
+    public static void main(String [] args) {
+      System.out.println("Creating garbage");
+      // create 128MB of garbage. This should result in at least one GC
+      for (int i = 0; i < 1024; i++) {
+        garbage = new byte[128 * 1024];
+      }
+      System.out.println("Done");
+    }
+  }
+
+  static class GCWithHumongousObjectTest {
+
+    public static final int M = 1024*1024;
+    public static LinkedList<Object> garbageList = new LinkedList<Object>();
+    // A large object referenced by a static.
+    static int[] filler = new int[10 * M];
+
+    public static void genGarbage() {
+      for (int i = 0; i < 32*1024; i++) {
+        garbageList.add(new int[100]);
+      }
+      garbageList.clear();
+    }
+
+    public static void main(String[] args) {
+
+      int[] large = new int[M];
+      Object ref = large;
+
+      System.out.println("Creating garbage");
+      for (int i = 0; i < 100; i++) {
+        // A large object that will be reclaimed eagerly.
+        large = new int[6*M];
+        genGarbage();
+        // Make sure that the compiler cannot completely remove
+        // the allocation of the large object until here.
+        System.out.println(large);
+      }
+
+      // Keep the reference to the first object alive.
+      System.out.println(ref);
+      System.out.println("Done");
+    }
+  }
+}
--- a/hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java	Wed Jul 05 20:05:30 2017 +0200
@@ -53,8 +53,8 @@
 
     // a zero in refinement thread numbers indicates that the value in ParallelGCThreads should be used.
     // Additionally use at least one thread.
-    int expectedNumRefinementThreads = refinementThreads == 0 ? workerThreads : refinementThreads;
-    expectedNumRefinementThreads = Math.max(1, expectedNumRefinementThreads);
+    int expectedNumRefinementThreads = refinementThreads;
+
     // create the pattern made up of n copies of a floating point number pattern
     String numberPattern = String.format("%0" + expectedNumRefinementThreads + "d", 0)
       .replace("0", "\\s+\\d+\\.\\d+");
@@ -73,9 +73,9 @@
       return;
     }
     // different valid combinations of number of refinement and gc worker threads
-    runTest(0, 0);
-    runTest(0, 5);
-    runTest(5, 0);
+    runTest(1, 1);
+    runTest(1, 5);
+    runTest(5, 1);
     runTest(10, 10);
     runTest(1, 2);
     runTest(4, 3);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8050167
+ * @summary Test that error is not occurred during printing problematic frame
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @run driver ProblematicFrameTest
+ */
+
+import com.oracle.java.testlibrary.*;
+
+import sun.misc.Unsafe;
+import com.oracle.java.testlibrary.Utils;
+
+public class ProblematicFrameTest {
+    private static class Crasher {
+        public static void main(String[] args) {
+            Utils.getUnsafe().getInt(0);
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+            "-Xmx64m", "-XX:-TransmitErrorReport", Crasher.class.getName());
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        output.shouldNotMatch("error occurred during error reporting \\(printing problematic frame\\)");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/NMT/ChangeTrackingLevel.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8059100
+ * @summary Test that you can decrease NMT tracking level but not increase it.
+ * @key nmt
+ * @library /testlibrary /testlibrary/whitebox
+ * @build ChangeTrackingLevel
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ChangeTrackingLevel
+ */
+
+import com.oracle.java.testlibrary.*;
+import sun.hotspot.WhiteBox;
+
+public class ChangeTrackingLevel {
+
+    public static WhiteBox wb = WhiteBox.getWhiteBox();
+    public static void main(String args[]) throws Exception {
+        boolean testChangeLevel = wb.NMTChangeTrackingLevel();
+        if (testChangeLevel) {
+            System.out.println("NMT level change test passed.");
+        } else {
+            // it also fails if the VM asserts.
+            throw new RuntimeException("NMT level change test failed");
+        }
+    }
+};
--- a/hotspot/test/runtime/NMT/PrintNMTStatistics.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/test/runtime/NMT/PrintNMTStatistics.java	Wed Jul 05 20:05:30 2017 +0200
@@ -24,43 +24,40 @@
 /*
  * @test
  * @key nmt regression
- * @bug 8005936
- * @summary Make sure PrintNMTStatistics works on normal JVM exit
- * @library /testlibrary /testlibrary/whitebox
- * @build PrintNMTStatistics
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main PrintNMTStatistics
+ * @bug 8005936 8058606
+ * @summary Verify PrintNMTStatistics on normal JVM exit for detail and summary tracking level
+ * @library /testlibrary
  */
 
 import com.oracle.java.testlibrary.*;
 
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import sun.hotspot.WhiteBox;
-
 public class PrintNMTStatistics {
 
-  public static void main(String args[]) throws Exception {
-
-    // We start a new java process running with an argument and use WB API to ensure
-    // we have data for NMT on VM exit
-    if (args.length > 0) {
-      return;
-    }
+    public static void main(String args[]) throws Exception {
 
     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
-        "-XX:+UnlockDiagnosticVMOptions",
-        "-Xbootclasspath/a:.",
-        "-XX:+WhiteBoxAPI",
-        "-XX:NativeMemoryTracking=summary",
-        "-XX:+PrintNMTStatistics",
-        "PrintNMTStatistics",
-        "test");
+      "-XX:+UnlockDiagnosticVMOptions",
+      "-XX:+PrintNMTStatistics",
+      "-XX:NativeMemoryTracking=detail",
+      "-version");
+
+    OutputAnalyzer output_detail = new OutputAnalyzer(pb.start());
+    output_detail.shouldContain("Virtual memory map:");
+    output_detail.shouldContain("Details:");
+    output_detail.shouldNotContain("error");
+    output_detail.shouldHaveExitValue(0);
 
-    OutputAnalyzer output = new OutputAnalyzer(pb.start());
-    output.shouldContain("Java Heap (reserved=");
-    output.shouldNotContain("error");
-    output.shouldHaveExitValue(0);
-  }
+    ProcessBuilder pb1 = ProcessTools.createJavaProcessBuilder(
+      "-XX:+UnlockDiagnosticVMOptions",
+      "-XX:+PrintNMTStatistics",
+      "-XX:NativeMemoryTracking=summary",
+      "-version");
+
+    OutputAnalyzer output_summary = new OutputAnalyzer(pb1.start());
+    output_summary.shouldContain("Java Heap (reserved=");
+    output_summary.shouldNotContain("Virtual memory map:");
+    output_summary.shouldNotContain("Details:");
+    output_summary.shouldNotContain("error");
+    output_summary.shouldHaveExitValue(0);
+    }
 }
--- a/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java	Wed Jul 05 20:05:30 2017 +0200
@@ -101,6 +101,7 @@
   public native void NMTOverflowHashBucket(long num);
   public native long NMTMallocWithPseudoStack(long size, int index);
   public native boolean NMTIsDetailSupported();
+  public native boolean NMTChangeTrackingLevel();
 
   // Compiler
   public native void    deoptimizeAll();
--- a/jaxp/.hgtags	Wed Jul 05 20:04:47 2017 +0200
+++ b/jaxp/.hgtags	Wed Jul 05 20:05:30 2017 +0200
@@ -278,3 +278,4 @@
 46b360454dadbb329d42c59bb8192daeb9d59875 jdk9-b33
 6b343b9b7a7008f5f699a2d99881163cab7a2986 jdk9-b34
 b9370464572fc663a38956047aa612d6e7854c3d jdk9-b35
+61b4c9acaa58e482db6601ec5dc4fc3d2d8dbb55 jdk9-b36
--- a/jaxp/src/java.xml/share/classes/com/sun/xml/internal/stream/util/BufferAllocator.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jaxp/src/java.xml/share/classes/com/sun/xml/internal/stream/util/BufferAllocator.java	Wed Jul 05 20:05:30 2017 +0200
@@ -35,9 +35,9 @@
  * @author Santiago.PericasGeertsen@sun.com
  */
 public class BufferAllocator {
-    public static int SMALL_SIZE_LIMIT = 128;
-    public static int MEDIUM_SIZE_LIMIT = 2048;
-    public static int LARGE_SIZE_LIMIT = 8192;
+    private static final int SMALL_SIZE_LIMIT = 128;
+    private static final int MEDIUM_SIZE_LIMIT = 2048;
+    private static final int LARGE_SIZE_LIMIT = 8192;
 
     char[] smallCharBuffer;
     char[] mediumCharBuffer;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/TEST.ROOT	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,3 @@
+# This file identifies the root of the test-suite hierarchy.
+# It also contains test-suite configuration information.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/TEST.properties	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,9 @@
+# This file identifies root(s) of the test-ng hierarchy.
+
+TestNG.dirs = .
+
+lib.dirs = /javax/xml/jaxp/libs
+
+# Tests that must run in othervm mode
+othervm.dirs= /javax/xml/jaxp/functional
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/DOMResultTest01.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform.ptests;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TransformerHandler;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.w3c.dom.Attr;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * DOM parse on test file to be compared with golden output file. No Exception
+ * is expected.
+ */
+public class DOMResultTest01 {
+    /**
+     * Unit test for simple DOM parsing.
+     */
+    @Test
+    public void testcase01() {
+        String resultFile = CLASS_DIR  + "domresult01.out";
+        String goldFile = GOLDEN_DIR  + "domresult01GF.out";
+        String xsltFile = XML_DIR + "cities.xsl";
+        String xmlFile = XML_DIR + "cities.xml";
+
+        try {
+            XMLReader reader = XMLReaderFactory.createXMLReader();
+            SAXTransformerFactory saxTFactory
+                    = (SAXTransformerFactory) TransformerFactory.newInstance();
+            SAXSource saxSource = new SAXSource(new InputSource(xsltFile));
+            TransformerHandler handler
+                    = saxTFactory.newTransformerHandler(saxSource);
+
+            DOMResult result = new DOMResult();
+
+            handler.setResult(result);
+            reader.setContentHandler(handler);
+            reader.parse(xmlFile);
+
+            Node node = result.getNode();
+            try (BufferedWriter writer = new BufferedWriter(new FileWriter(resultFile))) {
+                writeNodes(node, writer);
+            }
+            assertTrue(compareWithGold(goldFile, resultFile));
+        } catch (SAXException | TransformerConfigurationException
+                | IllegalArgumentException | IOException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path resultPath = Paths.get(resultFile);
+                if(Files.exists(resultPath))
+                    Files.delete(resultPath);
+            } catch (IOException ex) {
+                failCleanup(ex, resultFile);
+            }
+        }
+    }
+
+    /**
+     * Prints all node names, attributes to file
+     * @param node a node that need to be recursively access.
+     * @param bWriter file writer.
+     * @throws IOException if writing file failed.
+     */
+    private void writeNodes(Node node, BufferedWriter bWriter) throws IOException {
+        String str = "Node: " + node.getNodeName();
+        bWriter.write( str, 0,str.length());
+        bWriter.newLine();
+
+        NamedNodeMap nnm = node.getAttributes();
+        if (nnm != null && nnm.getLength() > 0)
+            for (int i=0; i<nnm.getLength(); i++) {
+                str = "AttributeName:" + ((Attr) nnm.item(i)).getName() +
+                      ", AttributeValue:" +((Attr) nnm.item(i)).getValue();
+                bWriter.write( str, 0,str.length());
+                bWriter.newLine();
+            }
+
+        NodeList kids = node.getChildNodes();
+        if (kids != null)
+            for (int i=0; i<kids.getLength(); i++)
+                writeNodes(kids.item(i), bWriter);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/ErrorListenerTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform.ptests;
+
+import java.io.File;
+import javax.xml.transform.ErrorListener;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.stream.StreamSource;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.fail;
+import org.testng.annotations.Test;
+
+/**
+ * Class containing the test cases for ErrorListener interface
+ */
+public class ErrorListenerTest implements ErrorListener {
+    /**
+     * Define ErrorListener's status.
+     */
+    private static enum ListenerStatus{NOT_INVOKED, ERROR, WARNING, FATAL};
+
+    /**
+     * No ErrorListener invoked at the beginning.
+     */
+    private volatile ListenerStatus status = ListenerStatus.NOT_INVOKED;
+
+    /**
+     * Expect a TransformerConfigurationException when transforming a file
+     * invalid.xsl that has some well-formedness error.
+     */
+    @Test
+    public void errorListener01() {
+        ErrorListenerTest listener = new ErrorListenerTest();
+        try {
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+            tfactory.setErrorListener (listener);
+            tfactory.newTransformer(new StreamSource(
+                                        new File(XML_DIR + "invalid.xsl")));
+            fail("We expect an Exception here");
+        } catch (TransformerConfigurationException ex) {
+            assertEquals(listener.status, ListenerStatus.FATAL);
+        }
+    }
+
+    /**
+     * Set status as ERROR when receiving notification of a recoverable error.
+     * @param e The error information encapsulated in a transformer exception.
+     */
+    @Override
+    public void error (TransformerException e) {
+        this.status = ListenerStatus.ERROR;
+    }
+
+    /**
+     * Set status as WARNING when receiving notification of a warning.
+     * @param e The error information encapsulated in a transformer exception.
+     */
+    @Override
+    public void warning (TransformerException e) {
+        this.status = ListenerStatus.WARNING;
+    }
+
+    /**
+     * Set status as FATAL when receiving notification of a non-recoverable error.
+     * @param e The error information encapsulated in a transformer exception.
+     */
+    @Override
+    public void fatalError (TransformerException e) {
+        this.status = ListenerStatus.FATAL;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXSourceTest01.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform.ptests;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.dom.DOMSource;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamSource;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNull;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+
+/**
+ * Unit test for SAXSource sourceToInputSource API.
+ */
+public class SAXSourceTest01 {
+    /**
+     * Test file name
+     */
+    private final String TEST_FILE = XML_DIR + "cities.xsl";
+
+    /**
+     * Test obtaining a SAX InputSource object from a Source object.
+     */
+    @Test
+    public void source2inputsource01() {
+        try {
+            StreamSource streamSource = new StreamSource (
+                                new FileInputStream (TEST_FILE));
+            assertNotNull(SAXSource.sourceToInputSource(streamSource));
+        } catch (FileNotFoundException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * This test case tries to get InputSource from DOMSource using
+     * sourceToInputSource method. It is not possible and hence null is
+     * expected. This is a negative test case
+     */
+    @Test
+    public void source2inputsource02() {
+        try {
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            dbf.newDocumentBuilder().parse(new File(TEST_FILE));
+            assertNull(SAXSource.sourceToInputSource(new DOMSource(null)));
+        } catch (ParserConfigurationException | SAXException | IOException ex) {
+            failUnexpected(ex);
+        }
+
+    }
+
+    /**
+     * This test case tries to get InputSource from SAXSource using
+     * sourceToInputSource method. This will also check if the systemId
+     * remained the same. This is a positive test case.
+     */
+    @Test
+    public void source2inputsource03() {
+        String SYSTEM_ID = "file:///" + XML_DIR;
+        try {
+            SAXSource saxSource =
+                    new SAXSource(new InputSource(new FileInputStream(TEST_FILE)));
+            saxSource.setSystemId(SYSTEM_ID);
+            assertEquals(SAXSource.sourceToInputSource(saxSource).getSystemId(),
+                    SYSTEM_ID);
+        } catch (FileNotFoundException ex) {
+            failUnexpected(ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXTFactoryTest001.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform.ptests;
+
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.transform.Result;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Test newTransformerhandler() method which takes StreamSource as argument can
+ * be set to XMLReader.
+ */
+public class SAXTFactoryTest001 {
+    /**
+     * SAXTFactory.newTransformerhandler() method which takes SAXSource as
+     * argument can be set to XMLReader. SAXSource has input XML file as its
+     * input source. XMLReader has a transformer handler which write out the
+     * result to output file. Test verifies output file is same as golden file.
+     */
+    @Test
+    public void testcase01() {
+        String outputFile = CLASS_DIR + "saxtf001.out";
+        String goldFile = GOLDEN_DIR + "saxtf001GF.out";
+        String xsltFile = XML_DIR + "cities.xsl";
+        String xmlFile = XML_DIR + "cities.xml";
+
+        try (FileOutputStream fos = new FileOutputStream(outputFile)) {
+            XMLReader reader = XMLReaderFactory.createXMLReader();
+            SAXTransformerFactory saxTFactory
+                    = (SAXTransformerFactory) TransformerFactory.newInstance();
+            TransformerHandler handler = saxTFactory.newTransformerHandler(
+                    new StreamSource(xsltFile));
+            Result result = new StreamResult(fos);
+            handler.setResult(result);
+            reader.setContentHandler(handler);
+            reader.parse(xmlFile);
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (SAXException | TransformerConfigurationException | IOException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXTFactoryTest002.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.transform.Result;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stream.StreamResult;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Test newTransformerhandler() method which takes SAXSource as argument can
+ * be set to XMLReader.
+ */
+public class SAXTFactoryTest002 {
+    /**
+     * SAXTFactory.newTransformerhandler() method which takes SAXSource as
+     * argument can be set to XMLReader. SAXSource has input XML file as its
+     * input source. XMLReader has a content handler which write out the result
+     * to output file. Test verifies output file is same as golden file.
+     */
+    @Test
+    public void testcase01() {
+        String outputFile = CLASS_DIR + "saxtf002.out";
+        String goldFile = GOLDEN_DIR + "saxtf002GF.out";
+        String xsltFile = XML_DIR + "cities.xsl";
+        String xmlFile = XML_DIR + "cities.xml";
+
+        try (FileOutputStream fos = new FileOutputStream(outputFile);
+                FileInputStream fis = new FileInputStream(xsltFile)) {
+            XMLReader reader = XMLReaderFactory.createXMLReader();
+            SAXTransformerFactory saxTFactory
+                    = (SAXTransformerFactory) TransformerFactory.newInstance();
+            SAXSource ss = new SAXSource();
+            ss.setInputSource(new InputSource(fis));
+
+            TransformerHandler handler = saxTFactory.newTransformerHandler(ss);
+            Result result = new StreamResult(fos);
+            handler.setResult(result);
+            reader.setContentHandler(handler);
+            reader.parse(xmlFile);
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (SAXException | IOException | TransformerConfigurationException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXTFactoryTest003.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Result;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stream.StreamResult;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Test newTransformerhandler() method which takes DOMSource as argument can
+ * be set to XMLReader.
+ */
+public class SAXTFactoryTest003 {
+    /**
+     * Unit test for newTransformerhandler(Source). DcoumentBuilderFactory is
+     * namespace awareness, DocumentBuilder parse xslt file as DOMSource.
+     */
+    @Test
+    public void testcase01() {
+        String outputFile = CLASS_DIR + "saxtf003.out";
+        String goldFile = GOLDEN_DIR + "saxtf003GF.out";
+        String xsltFile = XML_DIR + "cities.xsl";
+        String xmlFile = XML_DIR + "cities.xml";
+
+        try (FileOutputStream fos = new FileOutputStream(outputFile)) {
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+            Document document = docBuilder.parse(new File(xsltFile));
+            Node node = (Node)document;
+            DOMSource domSource= new DOMSource(node);
+
+            XMLReader reader = XMLReaderFactory.createXMLReader();
+            SAXTransformerFactory saxTFactory
+                    = (SAXTransformerFactory)TransformerFactory.newInstance();
+            TransformerHandler handler =
+                        saxTFactory.newTransformerHandler(domSource);
+            Result result = new StreamResult(fos);
+            handler.setResult(result);
+            reader.setContentHandler(handler);
+            reader.parse(xmlFile);
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (TransformerConfigurationException | ParserConfigurationException
+                | SAXException | IOException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXTFactoryTest004.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.File;
+import java.io.IOException;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/*
+ * TransformerConfigurationException expected when there is relative URI is used
+ * in citiesinclude.xsl file
+ */
+public class SAXTFactoryTest004 {
+    /**
+     * Negative test for newTransformerHandler when relative URI is in XML file.
+     * @throws TransformerConfigurationException If for some reason the
+     * TransformerHandler can not be created.
+     */
+    @Test(expectedExceptions = TransformerConfigurationException.class)
+    public void transformerHandlerTest01() throws TransformerConfigurationException {
+        try {
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+            Document document = docBuilder.parse(new File(XML_DIR + "citiesinclude.xsl"));
+            DOMSource domSource= new DOMSource(document);
+            SAXTransformerFactory saxTFactory
+                    = (SAXTransformerFactory)TransformerFactory.newInstance();
+            saxTFactory.newTransformerHandler(domSource);
+        } catch (ParserConfigurationException | IOException | SAXException ex) {
+            failUnexpected(ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXTFactoryTest005.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Result;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stream.StreamResult;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Test SAXSource API when relative URI is used in xsl file and SystemId was set
+ */
+public class SAXTFactoryTest005 {
+    /**
+     * Unit test for XMLReader parsing when relative URI is used in xsl file and
+     * SystemId was set.
+     */
+    @Test
+    public void testcase01() {
+        String outputFile = CLASS_DIR + "saxtf005.out";
+        String goldFile = GOLDEN_DIR + "saxtf005GF.out";
+        String xsltFile = XML_DIR + "citiesinclude.xsl";
+        String xmlFile = XML_DIR + "cities.xml";
+
+        try (FileOutputStream fos = new FileOutputStream(outputFile)) {
+            XMLReader reader = XMLReaderFactory.createXMLReader();
+            SAXTransformerFactory saxTFactory
+                    = (SAXTransformerFactory)TransformerFactory.newInstance();
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+            Document document = docBuilder.parse(new File(xsltFile));
+            Node node = (Node)document;
+            DOMSource domSource= new DOMSource(node);
+
+            domSource.setSystemId("file:///" + XML_DIR);
+
+            TransformerHandler handler =
+                        saxTFactory.newTransformerHandler(domSource);
+            Result result = new StreamResult(fos);
+
+            handler.setResult(result);
+            reader.setContentHandler(handler);
+            reader.parse(xmlFile);
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (TransformerConfigurationException | ParserConfigurationException
+                | SAXException | IOException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXTFactoryTest006.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Result;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stream.StreamResult;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Test newTransformerHandler with a DOMSource and StreamResult set.
+ */
+public class SAXTFactoryTest006 extends TransformerTestConst{
+    /**
+     * Unit test newTransformerHandler with a DOMSource.
+     */
+    @Test
+    public void testcase01() {
+        String outputFile = CLASS_DIR + "saxtf006.out";
+        String goldFile = GOLDEN_DIR + "saxtf006GF.out";
+        String xsltFile = XML_DIR + "citiesinclude.xsl";
+        String xmlFile = XML_DIR + "cities.xml";
+
+        try (FileOutputStream fos = new FileOutputStream(outputFile)) {
+            XMLReader reader = XMLReaderFactory.createXMLReader();
+            SAXTransformerFactory saxTFactory
+                    = (SAXTransformerFactory)TransformerFactory.newInstance();
+
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+            Node node = (Node)docBuilder.parse(new File(xsltFile));
+
+            DOMSource domSource = new DOMSource(node, "file:///" + XML_DIR);
+            TransformerHandler handler =
+                        saxTFactory.newTransformerHandler(domSource);
+
+            Result result = new StreamResult(fos);
+            handler.setResult(result);
+            reader.setContentHandler(handler);
+            reader.parse(xmlFile);
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (TransformerConfigurationException | ParserConfigurationException
+                | SAXException | IOException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXTFactoryTest008.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.transform.Result;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TemplatesHandler;
+import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stream.StreamResult;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Test newTransformerHandler with a Template Handler.
+ */
+public class SAXTFactoryTest008 {
+    /**
+     * Test newTransformerHandler with a Template Handler.
+     */
+    public void testcase01() {
+        String outputFile = CLASS_DIR + "saxtf008.out";
+        String goldFile = GOLDEN_DIR + "saxtf008GF.out";
+        String xsltFile = XML_DIR + "cities.xsl";
+        String xmlFile = XML_DIR + "cities.xml";
+
+        try (FileOutputStream fos = new FileOutputStream(outputFile)) {
+            XMLReader reader = XMLReaderFactory.createXMLReader();
+            SAXTransformerFactory saxTFactory
+                    = (SAXTransformerFactory)TransformerFactory.newInstance();
+
+            TemplatesHandler thandler = saxTFactory.newTemplatesHandler();
+            reader.setContentHandler(thandler);
+            reader.parse(xsltFile);
+            TransformerHandler tfhandler
+                    = saxTFactory.newTransformerHandler(thandler.getTemplates());
+
+            Result result = new StreamResult(fos);
+            tfhandler.setResult(result);
+
+            reader.setContentHandler(tfhandler);
+            reader.parse(xmlFile);
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (SAXException | IOException | TransformerConfigurationException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+  }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXTFactoryTest009.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.transform.Result;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TemplatesHandler;
+import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stream.StreamResult;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Test newTransformerHandler with a Template Handler along with a relative URI
+ * in the xslt file.
+ */
+public class SAXTFactoryTest009 {
+    /**
+     * Test newTransformerHandler with a Template Handler along with a relative
+     * URI in the xslt file.
+     */
+    @Test
+    public void testcase01() {
+        String outputFile = CLASS_DIR + "saxtf009.out";
+        String goldFile = GOLDEN_DIR + "saxtf009GF.out";
+        String xsltFile = XML_DIR + "citiesinclude.xsl";
+        String xmlFile = XML_DIR + "cities.xml";
+
+        try (FileOutputStream fos = new FileOutputStream(outputFile)) {
+            XMLReader reader = XMLReaderFactory.createXMLReader();
+            SAXTransformerFactory saxTFactory
+                    = (SAXTransformerFactory)TransformerFactory.newInstance();
+
+            TemplatesHandler thandler = saxTFactory.newTemplatesHandler();
+            thandler.setSystemId("file:///" + XML_DIR);
+            reader.setContentHandler(thandler);
+            reader.parse(xsltFile);
+            TransformerHandler tfhandler=
+                saxTFactory.newTransformerHandler(thandler.getTemplates());
+            Result result = new StreamResult(fos);
+            tfhandler.setResult(result);
+            reader.setContentHandler(tfhandler);
+            reader.parse(xmlFile);
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (SAXException | IOException | TransformerConfigurationException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXTFactoryTest010.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.stream.StreamSource;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLFilter;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Test XMLFilter parse InputSource along with customized ContentHandler.
+ */
+public class SAXTFactoryTest010 {
+    /**
+     * Unit test for contentHandler setter/getter along reader as handler's
+     * parent.
+     */
+    @Test
+    public void testcase01() {
+        String outputFile = CLASS_DIR + "saxtf010.out";
+        String goldFile = GOLDEN_DIR + "saxtf010GF.out";
+        String xsltFile = XML_DIR + "cities.xsl";
+        String xmlFile = XML_DIR + "cities.xml";
+
+        try {
+            // The transformer will use a SAX parser as it's reader.
+            XMLReader reader = XMLReaderFactory.createXMLReader();
+
+            SAXTransformerFactory saxTFactory
+                    = (SAXTransformerFactory)TransformerFactory.newInstance();
+            XMLFilter filter =
+                saxTFactory.newXMLFilter(new StreamSource(xsltFile));
+
+            filter.setParent(reader);
+            filter.setContentHandler(new MyContentHandler(outputFile));
+
+            // Now, when you call transformer.parse, it will set itself as
+            // the content handler for the parser object (it's "parent"), and
+            // will then call the parse method on the parser.
+            filter.parse(new InputSource(xmlFile));
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (SAXException | IOException | TransformerConfigurationException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXTFactoryTest011.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLFilter;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Test XMLFilter parse InputSource along with customized ContentHandler by
+ * using SAX parser as it's reader.
+ */
+public class SAXTFactoryTest011 {
+    /**
+     * Unit test for contentHandler setter/getter with parent.
+     */
+    @Test
+    public void testcase01() {
+        String outputFile = CLASS_DIR + "saxtf011.out";
+        String goldFile = GOLDEN_DIR + "saxtf011GF.out";
+        String xsltFile = XML_DIR + "cities.xsl";
+        String xmlFile = XML_DIR + "cities.xml";
+
+        try {
+            // The transformer will use a SAX parser as it's reader.
+            XMLReader reader = XMLReaderFactory.createXMLReader();
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+            Document document = docBuilder.parse(new File(xsltFile));
+            Node node = (Node)document;
+            DOMSource domSource= new DOMSource(node);
+
+            SAXTransformerFactory saxTFactory
+                    = (SAXTransformerFactory)TransformerFactory.newInstance();
+            XMLFilter filter = saxTFactory.newXMLFilter(domSource);
+
+            filter.setParent(reader);
+            filter.setContentHandler(new MyContentHandler(outputFile));
+
+            // Now, when you call transformer.parse, it will set itself as
+            // the content handler for the parser object (it's "parent"), and
+            // will then call the parse method on the parser.
+            filter.parse(new InputSource(xmlFile));
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (SAXException | IOException | TransformerConfigurationException
+                | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXTFactoryTest012.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLFilter;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Test XMLFilter parse InputSource along with customized ContentHandler by
+ * using SAX parser as it's reader.
+ */
+public class SAXTFactoryTest012 {
+    /**
+     * Unit test for contentHandler setter/getter.
+     */
+    @Test
+    public void testcase01() {
+        String outputFile = CLASS_DIR + "saxtf012.out";
+        String goldFile = GOLDEN_DIR + "saxtf012GF.out";
+        String xsltFile = XML_DIR + "cities.xsl";
+        String xmlFile = XML_DIR + "cities.xml";
+        try {
+            // The transformer will use a SAX parser as it's reader.
+            XMLReader reader = XMLReaderFactory.createXMLReader();
+
+            InputSource is = new InputSource(new FileInputStream(xsltFile));
+            SAXSource saxSource = new SAXSource();
+            saxSource.setInputSource(is);
+
+            SAXTransformerFactory saxTFactory = (SAXTransformerFactory)TransformerFactory.newInstance();
+            XMLFilter filter = saxTFactory.newXMLFilter(saxSource);
+
+            filter.setParent(reader);
+            filter.setContentHandler(new MyContentHandler(outputFile));
+
+            // Now, when you call transformer.parse, it will set itself as
+            // the content handler for the parser object (it's "parent"), and
+            // will then call the parse method on the parser.
+            filter.parse(new InputSource(xmlFile));
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (SAXException | IOException | TransformerConfigurationException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXTFactoryTest013.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TemplatesHandler;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLFilter;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Test XMLFilter parse InputSource along with TemplatesHandler.
+ */
+public class SAXTFactoryTest013 {
+    /**
+     * Unit test for TemplatesHandler setter/getter.
+     */
+    @Test
+    public  void testcase01() {
+        String outputFile = CLASS_DIR + "saxtf013.out";
+        String goldFile = GOLDEN_DIR + "saxtf013GF.out";
+        String xsltFile = XML_DIR + "cities.xsl";
+        String xmlFile = XML_DIR + "cities.xml";
+
+        try {
+            // The transformer will use a SAX parser as it's reader.
+            XMLReader reader = XMLReaderFactory.createXMLReader();
+
+            SAXTransformerFactory saxTFactory
+                    = (SAXTransformerFactory) TransformerFactory.newInstance();
+            TemplatesHandler thandler = saxTFactory.newTemplatesHandler();
+            // I have put this as it was complaining about systemid
+            thandler.setSystemId("file:///" + CLASS_DIR);
+
+            reader.setContentHandler(thandler);
+            reader.parse(xsltFile);
+            XMLFilter filter
+                    = saxTFactory.newXMLFilter(thandler.getTemplates());
+            filter.setParent(reader);
+
+            filter.setContentHandler(
+                    new MyContentHandler(outputFile));
+            filter.parse(new InputSource(new FileInputStream(xmlFile)));
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (SAXException | IOException | TransformerConfigurationException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/StreamResultTest01.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Properties;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/**
+ * Test a StreamResult using a file name that contains URL characters that need
+ * to be encoded.
+ */
+public class StreamResultTest01 {
+    /**
+     * Unit test for StreamResult.
+     */
+    @Test
+    public void testcase01() {
+        // Set Transformer properties
+        Properties transformProperties = new Properties();
+        transformProperties.put("method", "xml");
+        transformProperties.put("encoding", "UTF-8");
+        transformProperties.put("omit-xml-declaration", "yes");
+        transformProperties.put("{http://xml.apache.org/xslt}indent-amount", "0");
+        transformProperties.put("indent", "no");
+        transformProperties.put("standalone", "no");
+        transformProperties.put("version", "1.0");
+        transformProperties.put("media-type", "text/xml");
+
+        String[] fileNames = {
+            "StreamResult01.out",
+            "StreamResult 02.out",
+            "StreamResult#03.out"
+        };
+
+        String xslFile = XML_DIR + "cities.xsl";
+        String xmlFile = XML_DIR + "cities.xml";
+
+        Arrays.stream(fileNames).forEach(file -> {
+            try {
+                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+                dbf.setNamespaceAware(true);
+                DocumentBuilder db = dbf.newDocumentBuilder();
+                Document document = db.parse(new File(xslFile));
+                DOMSource domSource = new DOMSource(document);
+                StreamSource streamSource = new StreamSource(new FileInputStream(xmlFile));
+
+                File streamResultFile = new File(CLASS_DIR + file);
+                StreamResult streamResult = new StreamResult(streamResultFile);
+
+                Transformer transformer = TransformerFactory.newInstance().newTransformer(domSource);
+                transformer.setOutputProperties(transformProperties);
+                transformer.transform(streamSource, streamResult);
+            } catch (SAXException | IOException | ParserConfigurationException
+                    | TransformerException ex) {
+                failUnexpected(ex);
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TfClearParamTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,264 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamSource;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * Class containing the test cases for SAXParserFactory API
+ */
+public class TfClearParamTest {
+    /**
+     * Test xslt file.
+     */
+    private final String XSL_FILE = XML_DIR + "cities.xsl";
+
+    /**
+     * Long parameter name embedded with a URI.
+     */
+    private final String LONG_PARAM_NAME = "{http://xyz.foo.com/yada/baz.html}foo";
+
+    /**
+     * Short parameter name.
+     */
+    private final String SHORT_PARAM_NAME = "foo";
+
+    /**
+     * Parameter value.
+     */
+    private final String PARAM_VALUE = "xyz";
+
+    /**
+     * Obtains transformer's parameter with the same name that set before. Value
+     * should be same as set one.
+     */
+    @Test
+    public void clear01() {
+        try {
+            Transformer transformer = TransformerFactory.newInstance().newTransformer();
+            transformer.setParameter(LONG_PARAM_NAME, PARAM_VALUE);
+            assertEquals(transformer.getParameter(LONG_PARAM_NAME).toString(), PARAM_VALUE);
+        } catch (TransformerConfigurationException ex) {
+            failUnexpected(ex);
+        }
+
+    }
+
+    /**
+     * Obtains transformer's parameter with the a name that wasn't set before.
+     * Null is expected.
+     */
+    @Test
+    public void clear02() {
+        try {
+            Transformer transformer = TransformerFactory.newInstance().newTransformer();
+            transformer.setParameter(LONG_PARAM_NAME, PARAM_VALUE);
+            transformer.clearParameters();
+            assertNull(transformer.getParameter(LONG_PARAM_NAME));
+        } catch (TransformerConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Obtains transformer's parameter whose initiated with a stream source with
+     * the a name that set before. Value should be same as set one.
+     */
+    @Test
+    public void clear03() {
+        try {
+            Transformer transformer = TransformerFactory.newInstance().
+                    newTransformer(new StreamSource(new File(XSL_FILE)));
+
+            transformer.setParameter(LONG_PARAM_NAME, PARAM_VALUE);
+            assertEquals(transformer.getParameter(LONG_PARAM_NAME), PARAM_VALUE);
+        } catch (TransformerConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Obtains transformer's parameter whose initiated with a stream source with
+     * the a name that wasn't set before. Null is expected.
+     */
+    @Test
+    public void clear04() {
+        try {
+            Transformer transformer = TransformerFactory.newInstance().
+                    newTransformer(new StreamSource(new File(XSL_FILE)));
+            transformer.setParameter(LONG_PARAM_NAME, PARAM_VALUE);
+            transformer.clearParameters();
+            assertNull(transformer.getParameter(LONG_PARAM_NAME));
+        } catch (TransformerConfigurationException ex){
+            failUnexpected(ex);
+        }
+
+    }
+
+    /**
+     * Obtains transformer's parameter whose initiated with a sax source with
+     * the a name that set before. Value should be same as set one.
+     */
+    @Test
+    public void clear05() {
+        try {
+            InputSource is = new InputSource(new FileInputStream(XSL_FILE));
+            SAXSource saxSource = new SAXSource();
+            saxSource.setInputSource(is);
+
+            Transformer transformer = TransformerFactory.newInstance().newTransformer(saxSource);
+
+            transformer.setParameter(LONG_PARAM_NAME, PARAM_VALUE);
+            assertEquals(transformer.getParameter(LONG_PARAM_NAME), PARAM_VALUE);
+        } catch (FileNotFoundException | TransformerConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Obtains transformer's parameter whose initiated with a sax source with
+     * the a name that wasn't set before. Null is expected.
+     */
+    @Test
+    public void clear06() {
+        try {
+            InputSource is = new InputSource(new FileInputStream(XSL_FILE));
+            SAXSource saxSource = new SAXSource();
+            saxSource.setInputSource(is);
+
+            Transformer transformer = TransformerFactory.newInstance().newTransformer(saxSource);
+
+            transformer.setParameter(LONG_PARAM_NAME, PARAM_VALUE);
+            transformer.clearParameters();
+            assertNull(transformer.getParameter(LONG_PARAM_NAME));
+        } catch (FileNotFoundException | TransformerConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Obtains transformer's parameter whose initiated with a dom source with
+     * the a name that set before. Value should be same as set one.
+     */
+    @Test
+    public void clear07() {
+        try {
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            Document document = db.parse(new File(XSL_FILE));
+            DOMSource domSource = new DOMSource((Node)document);
+
+            Transformer transformer = tfactory.newTransformer(domSource);
+
+            transformer.setParameter(LONG_PARAM_NAME, PARAM_VALUE);
+            assertEquals(transformer.getParameter(LONG_PARAM_NAME), PARAM_VALUE);
+        } catch (IOException | ParserConfigurationException
+                | TransformerConfigurationException | SAXException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Obtains transformer's parameter whose initiated with a dom source with
+     * the a name that wasn't set before. Null is expected.
+     */
+    @Test
+    public void clear08() {
+        try {
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            Document document = db.parse(new File(XSL_FILE));
+            DOMSource domSource = new DOMSource((Node)document);
+
+            Transformer transformer = tfactory.newTransformer(domSource);
+            transformer.setParameter(LONG_PARAM_NAME, PARAM_VALUE);
+            transformer.clearParameters();
+            assertNull(transformer.getParameter(LONG_PARAM_NAME));
+        } catch (IOException | ParserConfigurationException
+                | TransformerConfigurationException | SAXException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Obtains transformer's parameter with a short name that set before. Value
+     * should be same as set one.
+     */
+    @Test
+    public void clear09() {
+        try {
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+            Transformer transformer = tfactory.newTransformer();
+
+            transformer.setParameter(SHORT_PARAM_NAME, PARAM_VALUE);
+            assertEquals(transformer.getParameter(SHORT_PARAM_NAME).toString(), PARAM_VALUE);
+        } catch (TransformerConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Obtains transformer's parameter with a short name that set with an integer
+     * object before. Value should be same as the set integer object.
+     */
+    @Test
+    public void clear10() {
+        try {
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+            Transformer transformer = tfactory.newTransformer();
+
+            int intObject = 5;
+            transformer.setParameter(SHORT_PARAM_NAME, intObject);
+            assertEquals(transformer.getParameter(SHORT_PARAM_NAME), intObject);
+        } catch (TransformerConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerExcpTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.File;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.stream.StreamSource;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.fail;
+import org.testng.annotations.Test;
+
+/**
+ *  Basic test for TransformerException specification.
+ */
+public class TransformerExcpTest {
+    /**
+     * Transform an unformatted xslt file. TransformerException is thrown.
+     */
+    @Test
+    public void tfexception() {
+        try {
+            // invalid.xsl has well-formedness error. Therefore transform throws
+            // TransformerException
+            StreamSource streamSource
+                    = new StreamSource(new File(XML_DIR + "invalid.xsl"));
+            TransformerFactory tFactory = TransformerFactory.newInstance();
+            Transformer transformer = tFactory.newTransformer(streamSource);
+            transformer.transform(
+                    new StreamSource(new File(XML_DIR + "cities.xml")),
+                    new SAXResult());
+            fail("TransformerException is not thrown as expected");
+        } catch (TransformerException e) {
+            assertNotNull(e.getCause());
+            assertNotNull(e.getException());
+            assertNull(e.getLocationAsString());
+            assertEquals(e.getMessageAndLocation(),e.getMessage());
+        }
+    }
+
+
+    /**
+     * Spec says, "if the throwable was created with
+     * TransformerException(Throwable), initCause should throw
+     * IllegalStateException
+     */
+    @Test(expectedExceptions = IllegalStateException.class)
+    public void tfexception06() {
+        TransformerException te = new TransformerException(new Throwable());
+        te.initCause(null);
+    }
+
+    /**
+     * Spec says, "if the throwable was created with TransformerException(String,
+     * Throwable), initCause should throw IllegalStateException
+     */
+    @Test(expectedExceptions = IllegalStateException.class)
+    public void tfexception07() {
+        TransformerException te = new TransformerException("MyMessage", new Throwable());
+        te.initCause(null);
+    }
+
+    /**
+     * Tests if initCause(null) is allowed in other case.
+     */
+    @Test
+    public void tfexception08() {
+        TransformerException te = new TransformerException("My Message");
+        assertNotNull(te.initCause(null));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerFactoryTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.*;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.parsers.*;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.*;
+import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.stream.*;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.w3c.dom.*;
+import org.xml.sax.SAXException;
+
+/**
+ * Class containing the test cases for TransformerFactory API's
+ * getAssociatedStyleSheet method.
+ */
+public class TransformerFactoryTest {
+    /**
+     * This test case checks for the getAssociatedStylesheet method
+     * of TransformerFactory.
+     * The style sheet returned is then copied to an tfactory01.out
+     * It will then be verified to see if it matches the golden files
+     */
+    @Test
+    public void tfactory01() {
+        String outputFile = CLASS_DIR + "tfactory01.out";
+        String goldFile = GOLDEN_DIR + "tfactory01GF.out";
+        String xmlFile = XML_DIR + "TransformerFactoryTest.xml";
+        String xmlURI = "file:///" + XML_DIR;
+
+        try {
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            Document doc = db.parse(new FileInputStream(xmlFile), xmlURI);
+            DOMSource domSource = new DOMSource(doc);
+            domSource.setSystemId(xmlURI);
+            StreamResult streamResult =new StreamResult(
+                new FileOutputStream(outputFile));
+            TransformerFactory tFactory = TransformerFactory.newInstance();
+
+            Source s = tFactory.getAssociatedStylesheet(domSource,"screen",
+                                           "Modern",null);
+            Transformer t = tFactory.newTransformer();
+            t.transform(s,streamResult);
+            assertTrue(compareWithGold(goldFile, outputFile));
+        }catch (IOException | ParserConfigurationException
+                | TransformerException | SAXException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,220 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Properties;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.ErrorListener;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamSource;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * Basic test cases for Transformer API
+ */
+public class TransformerTest {
+    /**
+     * XSLT file serves every test method.
+     */
+    private final static String TEST_XSL = XML_DIR + "cities.xsl";
+
+    /**
+     * This tests if newTransformer(StreamSource) method returns Transformer
+     */
+    @Test
+    public void transformer01() {
+        try {
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+            StreamSource streamSource = new StreamSource(
+                                        new File(TEST_XSL));
+            Transformer transformer = tfactory.newTransformer(streamSource);
+            assertNotNull(transformer);
+        } catch (TransformerConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * This tests if newTransformer(SAXSource) method returns Transformer
+     */
+    @Test
+    public void transformer02() {
+        try {
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+            InputSource is = new InputSource(
+                        new FileInputStream(TEST_XSL));
+            SAXSource saxSource = new SAXSource(is);
+            Transformer transformer = tfactory.newTransformer(saxSource);
+            assertNotNull(transformer);
+        } catch (TransformerConfigurationException | FileNotFoundException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * This tests if newTransformer(DOMSource) method returns Transformer
+     */
+    @Test
+    public void transformer03() {
+        try {
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            Document document = db.parse(new File(TEST_XSL));
+            DOMSource domSource = new DOMSource(document);
+
+            Transformer transformer = tfactory.newTransformer(domSource);
+            assertNotNull(transformer);
+        } catch (TransformerConfigurationException | IOException
+                | ParserConfigurationException | SAXException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * This tests set/get ErrorListener methods of Transformer
+     */
+    @Test
+    public void transformer04() {
+        try {
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            Document document = db.parse(new File(TEST_XSL));
+            DOMSource domSource = new DOMSource(document);
+
+            Transformer transformer = TransformerFactory.newInstance()
+                    .newTransformer(domSource);
+            transformer.setErrorListener(new MyErrorListener());
+            assertNotNull(transformer.getErrorListener());
+            assertTrue(transformer.getErrorListener() instanceof MyErrorListener);
+        } catch (IOException | IllegalArgumentException | ParserConfigurationException
+                | TransformerConfigurationException | SAXException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * This tests getOutputProperties() method of Transformer
+     */
+    @Test
+    public void transformer05() {
+        try {
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            Document document = db.parse(new File(TEST_XSL));
+            DOMSource domSource = new DOMSource(document);
+
+            Transformer transformer = TransformerFactory.newInstance().
+                    newTransformer(domSource);
+            Properties prop = transformer.getOutputProperties();
+
+            assertEquals(prop.getProperty("indent"), "yes");
+            assertEquals(prop.getProperty("method"), "xml");
+            assertEquals(prop.getProperty("encoding"), "UTF-8");
+            assertEquals(prop.getProperty("standalone"), "no");
+            assertEquals(prop.getProperty("version"), "1.0");
+            assertEquals(prop.getProperty("omit-xml-declaration"), "no");
+        } catch (ParserConfigurationException | SAXException | IOException
+                | TransformerConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * This tests getOutputProperty() method of Transformer
+     */
+    @Test
+    public void transformer06() {
+        try {
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            Document document = db.parse(new File(TEST_XSL));
+            DOMSource domSource = new DOMSource(document);
+
+            Transformer transformer = tfactory.newTransformer(domSource);
+            assertEquals(transformer.getOutputProperty("method"), "xml");
+        } catch (ParserConfigurationException | SAXException | IOException
+                | TransformerConfigurationException | IllegalArgumentException ex){
+            failUnexpected(ex);
+        }
+    }
+}
+
+/**
+ * Simple ErrorListener print out all exception.
+ */
+class MyErrorListener implements ErrorListener {
+    /**
+     * Prints exception when notification of a recoverable error.
+     * @param e exception of a recoverable error.
+     */
+    @Override
+    public void error (TransformerException e) {
+        System.out.println(" In error" + e);
+    }
+
+    /**
+     * Prints exception when notification of a warning.
+     * @param e exception of a warning.
+     */
+    @Override
+    public void warning (TransformerException e) {
+        System.out.println(" In warning");
+    }
+
+    /**
+     * Prints exception when notification of a fatal error.
+     * @param e exception of a fatal error.
+     */
+    @Override
+    public void fatalError (TransformerException e) throws
+                TransformerException {
+        System.out.println(" In fatal");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerTest02.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+
+/**
+ * Here a transformer is created using DOMSource. Some specific output property
+ * is set on transformer. Then transform(StreamSource, StreamResult) is tested.
+ */
+public class TransformerTest02 {
+    /**
+     * Unit test for transform(StreamSource, StreamResult).
+     */
+    @Test
+    public void testcase01() {
+        String outputFile = CLASS_DIR + "transformer02.out";
+        String goldFile = GOLDEN_DIR + "transformer02GF.out";
+        String xsltFile = XML_DIR + "cities.xsl";
+        String xmlFile = XML_DIR + "cities.xml";
+
+        try (FileInputStream fis = new FileInputStream(xmlFile);
+                FileOutputStream fos = new FileOutputStream(outputFile)) {
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            Document document = db.parse(new File(xsltFile));
+            DOMSource domSource = new DOMSource(document);
+
+            Transformer transformer = TransformerFactory.newInstance().
+                    newTransformer(domSource);
+            StreamSource streamSource = new StreamSource(fis);
+            StreamResult streamResult = new StreamResult(fos);
+
+            transformer.setOutputProperty("indent", "no");
+            transformer.transform( streamSource, streamResult);
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (IOException | IllegalArgumentException
+                | ParserConfigurationException | TransformerException
+                | SAXException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerTest03.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Properties;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/**
+ * Here Properties Object is populated with required properties.A transformer
+ * is created using DOMSource. Using setOutputProperties(), Properties are set
+ * for transformer. Then transform(StreamSource, StreamResult) is used for
+ * transformation. This tests the setOutputProperties() method.
+ */
+public class TransformerTest03 {
+    /**
+     * Test for Transformer.setOutputProperties method.
+     */
+    @Test
+    public void testcase01() {
+        String outputFile = CLASS_DIR + "transformer03.out";
+        String goldFile = GOLDEN_DIR + "transformer03GF.out";
+        String xsltFile = XML_DIR + "cities.xsl";
+        String xmlFile = XML_DIR + "cities.xml";
+
+        try (FileInputStream fis = new FileInputStream(xmlFile);
+                FileOutputStream fos = new FileOutputStream(outputFile)) {
+            Properties properties = new Properties();
+            properties.put("method", "xml");
+            properties.put("encoding", "UTF-8");
+            properties.put("omit-xml-declaration", "yes");
+            properties.put("{http://xml.apache.org/xslt}indent-amount", "0");
+            properties.put("indent", "no");
+            properties.put("standalone", "no");
+            properties.put("version", "1.0");
+            properties.put("media-type", "text/xml");
+
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            Document document = db.parse(new File(xsltFile));
+            DOMSource domSource = new DOMSource(document);
+
+            Transformer transformer = TransformerFactory.newInstance().
+                    newTransformer(domSource);
+            StreamSource streamSource = new StreamSource(fis);
+            StreamResult streamResult = new StreamResult(fos);
+
+            transformer.setOutputProperties(properties);
+            transformer.transform( streamSource, streamResult);
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (ParserConfigurationException | SAXException
+                | IOException | TransformerException ex){
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/URIResolverTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,275 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.URIResolver;
+import javax.xml.transform.dom.DOMSource;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import static jaxp.library.JAXPTestUtilities.FILE_SEP;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertEquals;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * URIResolver should be invoked when transform happens.
+ */
+public class URIResolverTest implements URIResolver {
+    /**
+     * System ID constant.
+     */
+    private final static String SYSTEM_ID = "file:///" + XML_DIR;
+
+    /**
+     * XML file include link file.
+     */
+    private final static String XSL_INCLUDE_FILE = XML_DIR + "citiesinclude.xsl";
+
+    /**
+     * XML file import link file.
+     */
+    private final static String XSL_IMPORT_FILE = XML_DIR + "citiesimport.xsl";
+
+    /**
+     * TEMP XML file.
+     */
+    private final static String XSL_TEMP_FILE = "temp/cities.xsl";
+
+
+    /**
+     * expected Href.
+     */
+    private final String validateHref;
+
+    /**
+     * expected Base URI.
+     */
+    private final String validateBase;
+
+    /**
+     * Constructor for setting expected Href and expected Base URI.
+     * @param validateHref expected Href
+     * @param validateBase expected Base URI
+     */
+    public URIResolverTest(String validateHref, String validateBase){
+        this.validateHref = validateHref;
+        this.validateBase = validateBase;
+    }
+
+    /**
+     * Called by the processor when it encounters an xsl:include, xsl:import,
+     * or document() function.
+     * @param href An href attribute, which may be relative or absolute.
+     * @param base The base URI against which the first argument will be made
+     * absolute if the absolute URI is required.
+     * @return null always.
+     */
+    @Override
+    public Source resolve(String href, String base) {
+        assertEquals(href, validateHref);
+        assertEquals(base, validateBase);
+        return null;
+    }
+
+    /**
+     * This is to test the URIResolver.resolve() method when a transformer is
+     * created using StreamSource. xsl file has xsl:include in it
+     */
+    @Test
+    public static void resolver01() {
+        try {
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+            URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
+            tfactory.setURIResolver(resolver);
+
+            StreamSource streamSource = new StreamSource(new FileInputStream(XSL_INCLUDE_FILE));
+            streamSource.setSystemId(SYSTEM_ID);
+
+            Transformer transformer = tfactory.newTransformer(streamSource);
+        } catch (FileNotFoundException | TransformerConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * This is to test the URIResolver.resolve() method when a transformer is
+     * created using DOMSource. xsl file has xsl:include in it
+     */
+    @Test
+    public static void resolver02() {
+        try {
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+            URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
+            tfactory.setURIResolver(resolver);
+
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            Document document = db.parse(XSL_INCLUDE_FILE);
+            DOMSource domSource = new DOMSource(document, SYSTEM_ID);
+
+            Transformer transformer = tfactory.newTransformer(domSource);
+        } catch (IOException | ParserConfigurationException
+                | TransformerConfigurationException | SAXException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * This is to test the URIResolver.resolve() method when a transformer is
+     * created using SAXSource. xsl file has xsl:include in it
+     */
+    @Test
+    public static void resolver03() {
+        try {
+            URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+            tfactory.setURIResolver(resolver);
+            InputSource is = new InputSource(new FileInputStream(XSL_INCLUDE_FILE));
+            is.setSystemId(SYSTEM_ID);
+            SAXSource saxSource = new SAXSource(is);
+
+            Transformer transformer = tfactory.newTransformer(saxSource);
+        } catch (FileNotFoundException |  TransformerConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * This is to test the URIResolver.resolve() method when a transformer is
+     * created using StreamSource. xsl file has xsl:import in it
+     */
+    @Test
+    public static void resolver04() {
+        try {
+            URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+            tfactory.setURIResolver(resolver);
+
+            StreamSource streamSource = new StreamSource(new FileInputStream(XSL_IMPORT_FILE));
+            streamSource.setSystemId(SYSTEM_ID);
+
+            Transformer transformer = tfactory.newTransformer(streamSource);
+        } catch (FileNotFoundException | TransformerConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * This is to test the URIResolver.resolve() method when a transformer is
+     * created using DOMSource. xsl file has xsl:import in it
+     */
+    @Test
+    public static void resolver05() {
+        try {
+            URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+            tfactory.setURIResolver(resolver);
+
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            Document document = db.parse(new File(XSL_IMPORT_FILE));
+            DOMSource domSource = new DOMSource(document, SYSTEM_ID);
+
+            Transformer transformer = tfactory.newTransformer(domSource);
+        } catch (ParserConfigurationException | SAXException | IOException
+                | TransformerConfigurationException ex){
+            failUnexpected(ex);
+        }
+
+    }
+
+    /**
+     * This is to test the URIResolver.resolve() method when a transformer is
+     * created using SAXSource. xsl file has xsl:import in it
+     */
+    @Test
+    public static void resolver06() {
+        try {
+            URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+            tfactory.setURIResolver(resolver);
+
+            InputSource is = new InputSource(new FileInputStream(XSL_IMPORT_FILE));
+            is.setSystemId(SYSTEM_ID);
+            SAXSource saxSource = new SAXSource(is);
+
+            Transformer transformer = tfactory.newTransformer(saxSource);
+        } catch (FileNotFoundException | TransformerConfigurationException ex){
+            failUnexpected(ex);
+        }
+
+    }
+
+    /**
+     * This is to test the URIResolver.resolve() method when there is an error
+     * in the file.
+     */
+    @Test
+    public static void docResolver01() {
+        try {
+            URIResolverTest resolver = new URIResolverTest("temp/colors.xml", SYSTEM_ID);
+            TransformerFactory tfactory = TransformerFactory.newInstance();
+
+            StreamSource streamSource = new StreamSource(
+                    new FileInputStream(XML_DIR + FILE_SEP + "doctest.xsl"));
+            streamSource.setSystemId(SYSTEM_ID);
+            System.err.println(streamSource.getSystemId());
+
+            Transformer transformer = tfactory.newTransformer(streamSource);
+            transformer.setURIResolver(resolver);
+
+            File f = new File(XML_DIR + FILE_SEP + "myFake.xml");
+            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+            DocumentBuilder builder = factory.newDocumentBuilder();
+            Document document = builder.parse(f);
+
+            // Use a Transformer for output
+            DOMSource source = new DOMSource(document);
+            System.err.println("Ignore the following output -- just dumping it here");
+            StreamResult result = new StreamResult(System.err);
+            transformer.transform(source, result);
+        } catch (IOException | ParserConfigurationException | SAXException
+                | TransformerException ex) {
+            failUnexpected(ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/othervm/TFCErrorTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests.othervm;
+
+import javax.xml.transform.*;
+import org.testng.annotations.Test;
+
+/**
+ * Negative test for set invalid TransformerFactory property.
+ */
+public class TFCErrorTest{
+    @Test(expectedExceptions = ClassNotFoundException.class)
+    public void tfce01() throws Exception {
+        try{
+            System.setProperty("javax.xml.transform.TransformerFactory","xx");
+            TransformerFactory tFactory = TransformerFactory.newInstance();
+        } catch (TransformerFactoryConfigurationError error) {
+            throw error.getException();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/TransformerFactoryTest.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="TransformerFactoryTest.xsl" media="screen" title="Modern" ?>
+<Review>
+	<About>
+		<Text> Richard Schelunberg reviews the Pasedena Shakesperares Compnay Henry IV
+		</Text>
+
+	</About>
+</Review>
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/TransformerFactoryTest.xsl	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:template match="/">
+		<html> 
+		<xsl:apply-templates/>
+		</html>
+</xsl:template>
+<xsl:template match="Review">
+		<body>
+	        <xsl:apply-templates select="//About"/>
+		</body>
+</xsl:template>
+<xsl:template match="About">
+	<xsl:for-each select="Text">
+<Br>
+	<li>
+		<font size ="4" color ="Blue">
+<xsl:value-of select="."/>
+		</font>
+		</li>
+	</Br>
+		<xsl:apply-templates/>
+		</xsl:for-each>
+</xsl:template>
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/cities.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,13 @@
+<?xml version="1.0" standalone="yes" ?>
+<cities>
+	<city name="Paris" country="France"/>
+	<city name="Roma" country="Italia"/>
+	<city name="Nice" country="France"/>
+	<city name="Madrid" country="Espana"/>
+	<city name="Milano" country="Italia"/>
+	<city name="Firenze" country="Italia"/>
+	<city name="Napoli" country="Italia"/>
+	<city name="Lyon" country="France"/>
+	<city name="Barcelona" country="Espana"/>
+</cities>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/cities.xsl	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,21 @@
+<?xml version="1.0" ?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:output method="xml" indent="yes"/>
+<xsl:template match="/">
+<xsl:variable name="unique-countries"
+	select="/cities
+		/city[not(@country=preceding-sibling::city/@country)]
+		/@country"
+/>
+    <countries>
+	<xsl:for-each select="$unique-countries">
+	  <country name="{.}">
+		<xsl:for-each select="//city[@country=current()]">
+		  <city><xsl:value-of select="@name"/></city>
+		</xsl:for-each>
+	  </country> 
+	</xsl:for-each>
+    </countries>
+</xsl:template>
+</xsl:stylesheet>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/citiesimport.xsl	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,5 @@
+<?xml version="1.0" ?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+	<xsl:import href="temp/cities.xsl"/>
+</xsl:stylesheet>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/citiesinclude.xsl	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,5 @@
+<?xml version="1.0" ?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+	<xsl:include href="temp/cities.xsl"/>
+</xsl:stylesheet>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/doctest.xsl	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:output method="html" version="4.0" indent="yes" encoding="iso-8859-1"/>
+
+<xsl:template match="/">
+<html>
+<body>
+<xsl:variable name="colors" select="document('temp/colors.xml')/colors"/>
+<p>Nodes in color <xsl:value-of select="count($colors)"/></p>
+<xsl:apply-templates/>
+</body>
+</html>
+</xsl:template>
+
+</xsl:stylesheet>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/invalid.xsl	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,20 @@
+<?xml version="1.0" ?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:output method="xml" indent="yes"/>
+<xsl:template match="/">
+<xsl:variable name="unique-countries"
+	select="/cities
+		/city[not(@country=preceding-sibling::city/@country)]
+		/@country"
+/>
+    <countries>
+	<xsl:for-each select="$unique-countries">
+	  <country name="{.}">
+		<xsl:for-each select="//city[@country=current()]">
+		  <city><xsl:value-of select="@name"/></city>
+		</xsl:for-each>
+	  </country> 
+	</xsl:for-each>
+</xsl:template>
+</xsl:stylesheet>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/lexical.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,24 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE document PUBLIC "-//mkrishna mohan//DTD//music pub//EN/"
+		"http://sc11152338.us.oracle.com:8080/xmlsqe/jaxp/web/testfiles/JAXPREP/publishers.dtd">
+<document>
+	Publishers of the Music of New York Women Composers
+	<title>The Publishers <![CDATA[<?xml>]]> </title>
+	<!--This is a comment -->
+	<publisher>
+		<name>ACA</name>
+		<email>info@composers.com </email>
+		<homepage>http://www.composers.com/</homepage>
+		<address>
+			<street>170 West 74th St.</street>
+			<city>NY</city>
+			<state>NY</state>
+			<zip>10023</zip>
+		</address>
+		<voice>212-362-8900</voice>
+		<fax>212-874-8605</fax>
+		<!--This comment is for LexicalHandler -->
+		&familytree;
+	</publisher>
+</document>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/myFake.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,4 @@
+<?xml version="1.0" standalone="yes" ?>
+<cities>
+	<!-- this file is just used for invoking transform method -->
+</cities>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/doctypeGF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE document PUBLIC "-//mkrishna mohan//DTD//music pub//EN/" "http://sc11152338.us.oracle.com:8080/xmlsqe/jaxp/web/testfiles/publishers.dtd">
+<document>
+	Publishers of the Music of New York Women Composers
+	<title>The Publishers </title>
+	<publisher>
+		<name>ACA</name>
+		<email>info@composers.com </email>
+		<homepage>http://www.composers.com/</homepage>
+		<address>
+			<street>170 West 74th St.</street>
+			<city>NY</city>
+			<state>NY</state>
+			<zip>10023</zip>
+		</address>
+		<voice>212-362-8900</voice>
+		<fax>212-874-8605</fax>
+		<!-- This comment is for LexicalHandler -->
+		
+	</publisher>
+</document>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/domresult01GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,26 @@
+Node: #document
+Node: countries
+Node: country
+AttributeName:name, AttributeValue:France
+Node: city
+Node: #text
+Node: city
+Node: #text
+Node: city
+Node: #text
+Node: country
+AttributeName:name, AttributeValue:Italia
+Node: city
+Node: #text
+Node: city
+Node: #text
+Node: city
+Node: #text
+Node: city
+Node: #text
+Node: country
+AttributeName:name, AttributeValue:Espana
+Node: city
+Node: #text
+Node: city
+Node: #text
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/lexicalGF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,4 @@
+In startCDATA
+In endCDATA
+In Comment:This is a comment 
+In Comment:This comment is for LexicalHandler 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/saxtf001GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?><countries>
+<country name="France">
+<city>Paris</city>
+<city>Nice</city>
+<city>Lyon</city>
+</country>
+<country name="Italia">
+<city>Roma</city>
+<city>Milano</city>
+<city>Firenze</city>
+<city>Napoli</city>
+</country>
+<country name="Espana">
+<city>Madrid</city>
+<city>Barcelona</city>
+</country>
+</countries>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/saxtf002GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?><countries>
+<country name="France">
+<city>Paris</city>
+<city>Nice</city>
+<city>Lyon</city>
+</country>
+<country name="Italia">
+<city>Roma</city>
+<city>Milano</city>
+<city>Firenze</city>
+<city>Napoli</city>
+</country>
+<country name="Espana">
+<city>Madrid</city>
+<city>Barcelona</city>
+</country>
+</countries>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/saxtf003GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?><countries>
+<country name="France">
+<city>Paris</city>
+<city>Nice</city>
+<city>Lyon</city>
+</country>
+<country name="Italia">
+<city>Roma</city>
+<city>Milano</city>
+<city>Firenze</city>
+<city>Napoli</city>
+</country>
+<country name="Espana">
+<city>Madrid</city>
+<city>Barcelona</city>
+</country>
+</countries>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/saxtf005GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?><countries>
+<country name="France">
+<city>Paris</city>
+<city>Nice</city>
+<city>Lyon</city>
+</country>
+<country name="Italia">
+<city>Roma</city>
+<city>Milano</city>
+<city>Firenze</city>
+<city>Napoli</city>
+</country>
+<country name="Espana">
+<city>Madrid</city>
+<city>Barcelona</city>
+</country>
+</countries>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/saxtf006GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?><countries>
+<country name="France">
+<city>Paris</city>
+<city>Nice</city>
+<city>Lyon</city>
+</country>
+<country name="Italia">
+<city>Roma</city>
+<city>Milano</city>
+<city>Firenze</city>
+<city>Napoli</city>
+</country>
+<country name="Espana">
+<city>Madrid</city>
+<city>Barcelona</city>
+</country>
+</countries>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/saxtf008GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?><countries>
+<country name="France">
+<city>Paris</city>
+<city>Nice</city>
+<city>Lyon</city>
+</country>
+<country name="Italia">
+<city>Roma</city>
+<city>Milano</city>
+<city>Firenze</city>
+<city>Napoli</city>
+</country>
+<country name="Espana">
+<city>Madrid</city>
+<city>Barcelona</city>
+</country>
+</countries>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/saxtf009GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?><countries>
+<country name="France">
+<city>Paris</city>
+<city>Nice</city>
+<city>Lyon</city>
+</country>
+<country name="Italia">
+<city>Roma</city>
+<city>Milano</city>
+<city>Firenze</city>
+<city>Napoli</city>
+</country>
+<country name="Espana">
+<city>Madrid</city>
+<city>Barcelona</city>
+</country>
+</countries>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/saxtf010GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,37 @@
+startDocument
+startElement: , , countries
+startElement: , , country, name
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+endElement: , , country
+startElement: , , country, name
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+endElement: , , country
+startElement: , , country, name
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+endElement: , , country
+endElement: , , countries
+endDocument
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/saxtf011GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,37 @@
+startDocument
+startElement: , , countries
+startElement: , , country, name
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+endElement: , , country
+startElement: , , country, name
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+endElement: , , country
+startElement: , , country, name
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+endElement: , , country
+endElement: , , countries
+endDocument
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/saxtf012GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,37 @@
+startDocument
+startElement: , , countries
+startElement: , , country, name
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+endElement: , , country
+startElement: , , country, name
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+endElement: , , country
+startElement: , , country, name
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+endElement: , , country
+endElement: , , countries
+endDocument
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/saxtf013GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,37 @@
+startDocument
+startElement: , , countries
+startElement: , , country, name
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+endElement: , , country
+startElement: , , country, name
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+endElement: , , country
+startElement: , , country, name
+startElement: , , city
+characters
+endElement: , , city
+startElement: , , city
+characters
+endElement: , , city
+endElement: , , country
+endElement: , , countries
+endDocument
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/tfactory01GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:template match="/">
+		<html> 
+		<xsl:apply-templates/>
+		</html>
+</xsl:template>
+<xsl:template match="Review">
+		<body>
+	        <xsl:apply-templates select="//About"/>
+		</body>
+</xsl:template>
+<xsl:template match="About">
+	<xsl:for-each select="Text">
+<Br>
+	<li>
+		<font size="4" color="Blue">
+<xsl:value-of select="."/>
+		</font>
+		</li>
+	</Br>
+		<xsl:apply-templates/>
+		</xsl:for-each>
+</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/tfactory02GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:template match="/">
+		<html> 
+		<xsl:apply-templates/>
+		</html>
+</xsl:template>
+<xsl:template match="Review">
+		<body>
+	        <xsl:apply-templates select="//About"/>
+		</body>
+</xsl:template>
+<xsl:template match="About">
+	<xsl:for-each select="Text">
+<Br>
+	<li>
+		<font size="4" color="Blue">
+<xsl:value-of select="."/>
+		</font>
+		</li>
+	</Br>
+		<xsl:apply-templates/>
+		</xsl:for-each>
+</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/transformer02GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,1 @@
+<?xml version="1.0" encoding="UTF-8"?><countries><country name="France"><city>Paris</city><city>Nice</city><city>Lyon</city></country><country name="Italia"><city>Roma</city><city>Milano</city><city>Firenze</city><city>Napoli</city></country><country name="Espana"><city>Madrid</city><city>Barcelona</city></country></countries>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/out/transformer03GF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,1 @@
+<countries><country name="France"><city>Paris</city><city>Nice</city><city>Lyon</city></country><country name="Italia"><city>Roma</city><city>Milano</city><city>Firenze</city><city>Napoli</city></country><country name="Espana"><city>Madrid</city><city>Barcelona</city></country></countries>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/publish2.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,23 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE document PUBLIC "-//mkrishna mohan//DTD//music pub//EN/"
+		"http://sc11152338.us.oracle.com:8080/xmlsqe/jaxp/web/testfiles/JAXPREP/publishers.dtd">
+<document>
+	Publishers of the Music of New York Women Composers
+	<title>The Publishers </title>
+	<publisher>
+		<name>ACA</name>
+		<email>info@composers.com </email>
+		<homepage>http://www.composers.com/</homepage>
+		<address>
+			<street>170 West 74th St.</street>
+			<city>NY</city>
+			<state>NY</state>
+			<zip>10023</zip>
+		</address>
+		<voice>212-362-8900</voice>
+		<fax>212-874-8605</fax>
+		<!-- This comment is for LexicalHandler -->
+		&familytree;
+	</publisher>
+</document>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/temp/cities.xsl	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,21 @@
+<?xml version="1.0" ?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:output method="xml" indent="yes"/>
+<xsl:template match="/">
+<xsl:variable name="unique-countries"
+	select="/cities
+		/city[not(@country=preceding-sibling::city/@country)]
+		/@country"
+/>
+    <countries>
+	<xsl:for-each select="$unique-countries">
+	  <country name="{.}">
+		<xsl:for-each select="//city[@country=current()]">
+		  <city><xsl:value-of select="@name"/></city>
+		</xsl:for-each>
+	  </country> 
+	</xsl:for-each>
+    </countries>
+</xsl:template>
+</xsl:stylesheet>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/xmlfiles/temp/colors.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<colors>
+<dark>
+ <container name="book">
+  <category name="developer" version="1">088ea6</category>
+  <category name="default" version="1">0839a6</category>
+ </container>
+</dark>
+</colors>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/xpath/ptests/XPathExpressionTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,529 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.xpath.ptests;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import static javax.xml.xpath.XPathConstants.BOOLEAN;
+import static javax.xml.xpath.XPathConstants.NODE;
+import static javax.xml.xpath.XPathConstants.NODESET;
+import static javax.xml.xpath.XPathConstants.NUMBER;
+import static javax.xml.xpath.XPathConstants.STRING;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import static javax.xml.xpath.ptests.XPathTestConst.XML_DIR;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertEquals;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * Class containing the test cases for XPathExpression API.
+ */
+public class XPathExpressionTest {
+    /**
+     * Document object for testing XML file.
+     */
+    private Document document;
+
+    /**
+     * A XPath for evaluation environment and expressions.
+     */
+    private XPath xpath;
+
+    /**
+     * A QName using default name space.
+     */
+    private static final QName TEST_QNAME = new QName(XMLConstants.XML_NS_URI, "");
+
+    /**
+     * XML File Path.
+     */
+    private static final Path XML_PATH = Paths.get(XML_DIR + "widgets.xml");
+
+    /**
+     * An expression name which locate at "/widgets/widget[@name='a']/@quantity"
+     */
+    private static final String EXPRESSION_NAME_A = "/widgets/widget[@name='a']/@quantity";
+
+    /**
+     * An expression name which locate at "/widgets/widget[@name='b']/@quantity"
+     */
+    private static final String EXPRESSION_NAME_B = "/widgets/widget[@name='b']/@quantity";
+
+    /**
+     * Create Document object and XPath object for every time
+     * @throws ParserConfigurationException If the factory class cannot be
+     *                                      loaded, instantiated
+     * @throws SAXException If any parse errors occur.
+     * @throws IOException If operation on xml file failed.
+     */
+    @BeforeTest
+    public void setup() throws ParserConfigurationException, SAXException, IOException {
+        document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(XML_PATH.toFile());
+        xpath = XPathFactory.newInstance().newXPath();
+    }
+
+    /**
+     * Test for evaluate(java.lang.Object item,QName returnType)throws
+     * XPathExpressionException.
+     */
+    @Test
+    public void testCheckXPathExpression01() {
+        try {
+            assertEquals(xpath.compile(EXPRESSION_NAME_A).
+                    evaluate(document, STRING), "6");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(java.lang.Object item,QName returnType) throws NPE if input
+     * source is null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPathExpression02() {
+        try {
+            xpath.compile(EXPRESSION_NAME_A).evaluate(null, STRING);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(java.lang.Object item,QName returnType) throws NPE if returnType
+     * is null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPathExpression03() {
+        try {
+            xpath.compile(EXPRESSION_NAME_A).evaluate(document, null);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for method evaluate(java.lang.Object item,QName returnType).If a
+     * request is made to evaluate the expression in the absence of a context
+     * item, simple expressions, such as "1+1", can be evaluated.
+     */
+    @Test
+    public void testCheckXPathExpression04() {
+        try {
+            assertEquals(xpath.compile("1+1").evaluate(document, STRING), "2");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(java.lang.Object item,QName returnType) throws IAE If returnType
+     * is not one of the types defined in XPathConstants.
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testCheckXPathExpression05() {
+        try {
+            xpath.compile(EXPRESSION_NAME_A).evaluate(document, TEST_QNAME);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(java.lang.Object item,QName returnType) return correct boolean
+     * value if returnType is Boolean.
+     */
+    @Test
+    public void testCheckXPathExpression06() {
+        try {
+            assertEquals(xpath.compile(EXPRESSION_NAME_A).
+                evaluate(document, BOOLEAN), true);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(java.lang.Object item,QName returnType) return correct boolean
+     * value if returnType is Boolean.
+     */
+    @Test
+    public void testCheckXPathExpression07() {
+        try {
+            assertEquals(xpath.compile(EXPRESSION_NAME_B).
+                evaluate(document, BOOLEAN), false);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(java.lang.Object item,QName returnType) return correct number
+     * value when return type is Double.
+     */
+    @Test
+    public void testCheckXPathExpression08() {
+        try {
+            assertEquals(xpath.compile(EXPRESSION_NAME_A).
+                evaluate(document, NUMBER), 6d);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(java.lang.Object item,QName returnType) evaluate an attribute
+     * value which returnType is Node.
+     */
+    @Test
+    public void testCheckXPathExpression09() {
+        try {
+            Attr attr = (Attr) xpath.compile(EXPRESSION_NAME_A).
+                    evaluate(document, NODE);
+            assertEquals(attr.getValue(), "6");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(java.lang.Object item,QName returnType) evaluate an attribute
+     * value which returnType is NodeList.
+     */
+    @Test
+    public void testCheckXPathExpression10() {
+        try {
+            NodeList nodeList = (NodeList) xpath.compile(EXPRESSION_NAME_A).
+                    evaluate(document, NODESET);
+            Attr attr = (Attr) nodeList.item(0);
+            assertEquals(attr.getValue(), "6");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for evaluate(java.lang.Object item) when returnType is left off of
+     * the XPath.evaluate method, all expressions are evaluated to a String
+     * value.
+     */
+    @Test
+    public void testCheckXPathExpression11() {
+        try {
+            assertEquals(xpath.compile(EXPRESSION_NAME_A).evaluate(document), "6");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(java.lang.Object item) throws NPE if expression is null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPathExpression12() {
+        try {
+            xpath.compile(null).evaluate(document);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(java.lang.Object item) when a request is made to evaluate the
+     * expression in the absence of a context item, simple expressions, such as
+     * "1+1", can be evaluated.
+     */
+    @Test
+    public void testCheckXPathExpression13() {
+        try {
+            assertEquals(xpath.compile("1+1").evaluate(document), "2");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(java.lang.Object item) throws NPE if document is null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPathExpression14() {
+        try {
+            xpath.compile(EXPRESSION_NAME_A).evaluate(null);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * valuate(InputSource source) return a string value if return type is
+     * String.
+     */
+    @Test
+    public void testCheckXPathExpression15() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            assertEquals(xpath.compile(EXPRESSION_NAME_A).
+                    evaluate(new InputSource(is)), "6");
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(InputSource source) throws NPE if input source is null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPathExpression16() {
+        try {
+            xpath.compile(EXPRESSION_NAME_A).evaluate(null);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(InputSource source) throws NPE if expression is null
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPathExpression17() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.compile(null).evaluate(new InputSource(is));
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(InputSource source) throws XPathExpressionException if
+     * returnType is String junk characters.
+     *
+     * @throws XPathExpressionException
+     */
+    @Test(expectedExceptions = XPathExpressionException.class)
+    public void testCheckXPathExpression18() throws XPathExpressionException {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.compile("-*&").evaluate(new InputSource(is));
+        } catch (IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(InputSource source) throws XPathExpressionException if
+     * expression is a blank string " ".
+     *
+     * @throws XPathExpressionException
+     */
+    @Test(expectedExceptions = XPathExpressionException.class)
+    public void testCheckXPathExpression19() throws XPathExpressionException {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.compile(" ").evaluate(new InputSource(is));
+        } catch (IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for evaluate(InputSource source,QName returnType) returns a string
+     * value if returnType is String.
+     */
+    @Test
+    public void testCheckXPathExpression20() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            assertEquals(xpath.compile(EXPRESSION_NAME_A).
+                evaluate(new InputSource(is), STRING), "6");
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(InputSource source,QName returnType) throws NPE if source is
+     * null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPathExpression21() {
+        try {
+            xpath.compile(EXPRESSION_NAME_A).evaluate(null, STRING);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(InputSource source,QName returnType) throws NPE if expression is
+     * null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPathExpression22() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.compile(null).evaluate(new InputSource(is), STRING);
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(InputSource source,QName returnType) throws NPE if returnType is
+     * null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPathExpression23() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.compile(EXPRESSION_NAME_A).evaluate(new InputSource(is), null);
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(InputSource source,QName returnType) throws
+     * XPathExpressionException if expression is junk characters.
+     *
+     * @throws XPathExpressionException
+     */
+    @Test(expectedExceptions = XPathExpressionException.class)
+    public void testCheckXPathExpression24() throws XPathExpressionException {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.compile("-*&").evaluate(new InputSource(is), STRING);
+        } catch (IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(InputSource source,QName returnType) throws
+     * XPathExpressionException if expression is blank " ".
+     *
+     * @throws XPathExpressionException
+     */
+    @Test(expectedExceptions = XPathExpressionException.class)
+    public void testCheckXPathExpression25() throws XPathExpressionException {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.compile(" ").evaluate(new InputSource(is), STRING);
+        } catch (IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(InputSource source,QName returnType) throws
+     * IllegalArgumentException if returnType is not one of the types defined
+     * in XPathConstants.
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testCheckXPathExpression26() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.compile(EXPRESSION_NAME_A).evaluate(new InputSource(is), TEST_QNAME);
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(InputSource source,QName returnType) return a correct boolean
+     * value if returnType is Boolean.
+     */
+    @Test
+    public void testCheckXPathExpression27() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            assertEquals(xpath.compile(EXPRESSION_NAME_A).
+                evaluate(new InputSource(is), BOOLEAN), true);
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(InputSource source,QName returnType) return a correct boolean
+     * value if returnType is Boolean.
+     */
+    @Test
+    public void testCheckXPathExpression28() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            assertEquals(xpath.compile(EXPRESSION_NAME_B).
+                evaluate(new InputSource(is), BOOLEAN), false);
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * evaluate(InputSource source,QName returnType) return a correct number
+     * value if returnType is Number.
+     */
+    @Test
+    public void testCheckXPathExpression29() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            assertEquals(xpath.compile(EXPRESSION_NAME_A).
+                evaluate(new InputSource(is), NUMBER), 6d);
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for evaluate(InputSource source,QName returnType) returns a node if
+     * returnType is Node.
+     */
+    @Test
+    public void testCheckXPathExpression30() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            Attr attr = (Attr) xpath.compile(EXPRESSION_NAME_A).
+                evaluate(new InputSource(is), NODE);
+            assertEquals(attr.getValue(), "6");
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for evaluate(InputSource source,QName returnType) return a node list
+     * if returnType is NodeList.
+     */
+    @Test
+    public void testCheckXPathExpression31() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            NodeList nodeList = (NodeList) xpath.compile(EXPRESSION_NAME_A).
+                evaluate(new InputSource(is), NODESET);
+            assertEquals(((Attr) nodeList.item(0)).getValue(), "6");
+        } catch (XPathExpressionException | IOException  ex) {
+            failUnexpected(ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/xpath/ptests/XPathFactoryTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.xpath.ptests;
+
+import static javax.xml.xpath.XPathConstants.DOM_OBJECT_MODEL;
+import javax.xml.xpath.XPathFactory;
+import javax.xml.xpath.XPathFactoryConfigurationException;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.AssertJUnit.assertNotNull;
+import org.testng.annotations.Test;
+
+/**
+ * Class containing the test cases for XPathFactory API.
+ */
+public class XPathFactoryTest {
+    /**
+     * Valid URL for creating a XPath factory.
+     */
+    private static final String VALID_URL = "http://java.sun.com/jaxp/xpath/dom";
+
+    /**
+     * Invalid URL not able to create a XPath factory.
+     */
+    private static final String INVALID_URL = "http://java.sun.com/jaxp/xpath/dom1";
+
+    /**
+     * Test for constructor - XPathFactory.newInstance().
+     */
+    @Test
+    public void testCheckXPathFactory01() {
+        assertNotNull(XPathFactory.newInstance());
+    }
+
+    /**
+     * XPathFactory.newInstance(String uri) throws NPE if uri is null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    private void testCheckXPathFactory02() {
+        try {
+            XPathFactory.newInstance(null);
+        } catch (XPathFactoryConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPathFactory.newInstance(String uri) throws XPFCE if uri is just a blank
+     * string.
+     *
+     * @throws XPathFactoryConfigurationException
+     */
+    @Test(expectedExceptions = XPathFactoryConfigurationException.class)
+    public void testCheckXPathFactory03() throws XPathFactoryConfigurationException {
+        XPathFactory.newInstance(" ");
+    }
+
+    /**
+     * Test for constructor - XPathFactory.newInstance(String uri) with valid
+     * url - "http://java.sun.com/jaxp/xpath/dom".
+     */
+    @Test
+    public void testCheckXPathFactory04() {
+        try {
+            assertNotNull(XPathFactory.newInstance(VALID_URL));
+        } catch (XPathFactoryConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for constructor - XPathFactory.newInstance(String uri) with invalid
+     * url - "http://java.sun.com/jaxp/xpath/dom1".
+     *
+     * @throws XPathFactoryConfigurationException
+     */
+    @Test(expectedExceptions = XPathFactoryConfigurationException.class)
+    public void testCheckXPathFactory05() throws XPathFactoryConfigurationException {
+        XPathFactory.newInstance(INVALID_URL);
+    }
+
+    /**
+     * Test for constructor - XPathFactory.newInstance() and creating XPath with
+     * newXPath().
+     */
+    @Test
+    public void testCheckXPathFactory06() {
+        assertNotNull(XPathFactory.newInstance().newXPath());
+    }
+
+    /**
+     * Test for constructor - XPathFactory.newInstance(String uri) with valid
+     * url - "http://java.sun.com/jaxp/xpath/dom" and creating XPath with
+     * newXPath().
+     */
+    @Test
+    public void testCheckXPathFactory07() {
+        try {
+            assertNotNull(XPathFactory.newInstance(VALID_URL).newXPath());
+        } catch (XPathFactoryConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for constructor - XPathFactory.newInstance(String uri) with valid
+     * uri - DOM_OBJECT_MODEL.toString().
+     */
+    @Test
+    public void testCheckXPathFactory08() {
+        try {
+            assertNotNull(XPathFactory.newInstance(DOM_OBJECT_MODEL));
+        } catch (XPathFactoryConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/xpath/ptests/XPathFunctionResolverTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.xpath.ptests;
+
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertEquals;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+/**
+ * Class containing the test cases for XPathFunctionResolver.
+ */
+public class XPathFunctionResolverTest {
+    /**
+     * A XPath for evaluation environment and expressions.
+     */
+    private XPath xpath;
+
+    /**
+     * Create XPath object before every test. Make sure function resolver has
+     * been set for XPath object.
+     */
+    @BeforeTest
+    public void setup() {
+        xpath = XPathFactory.newInstance().newXPath();
+        if (xpath.getXPathFunctionResolver() == null) {
+            xpath.setXPathFunctionResolver((functionName,arity) -> null);
+        }
+    }
+    /**
+     * Test for resolveFunction(QName functionName,int arity). evaluate will
+     * continue as long as functionName is meaningful.
+     */
+    @Test
+    public void testCheckXPathFunctionResolver01() {
+        try {
+            assertEquals(xpath.evaluate("round(1.7)", (Object)null), "2");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for resolveFunction(QName functionName,int arity); evaluate throws
+     * NPE if functionName  is null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPathFunctionResolver02() {
+        try {
+            assertEquals(xpath.evaluate(null, "5"), "2");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/xpath/ptests/XPathTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,805 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.xpath.ptests;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Iterator;
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import static javax.xml.xpath.XPathConstants.BOOLEAN;
+import static javax.xml.xpath.XPathConstants.NODE;
+import static javax.xml.xpath.XPathConstants.NODESET;
+import static javax.xml.xpath.XPathConstants.NUMBER;
+import static javax.xml.xpath.XPathConstants.STRING;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import static javax.xml.xpath.ptests.XPathTestConst.XML_DIR;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * Class containing the test cases for XPath API.
+ */
+public class XPathTest {
+    /**
+     * Document object for testing XML file.
+     */
+    private Document document;
+
+    /**
+     * A XPath for evaluation environment and expressions.
+     */
+    private XPath xpath;
+
+    /**
+     * A QName using default name space.
+     */
+    private static final QName TEST_QNAME = new QName(XMLConstants.XML_NS_URI, "");
+
+    /**
+     * XML File Path.
+     */
+    private static final Path XML_PATH = Paths.get(XML_DIR + "widgets.xml");
+
+    /**
+     * An expression name which locate at "/widgets/widget[@name='a']/@quantity"
+     */
+    private static final String EXPRESSION_NAME_A = "/widgets/widget[@name='a']/@quantity";
+
+    /**
+     * An expression name which locate at "/widgets/widget[@name='b']/@quantity"
+     */
+    private static final String EXPRESSION_NAME_B = "/widgets/widget[@name='b']/@quantity";
+
+    /**
+     * Create Document object and XPath object for every time
+     * @throws ParserConfigurationException If the factory class cannot be
+     *                                      loaded, instantiated
+     * @throws SAXException If any parse errors occur.
+     * @throws IOException If operation on xml file failed.
+     */
+    @BeforeTest
+    public void setup() throws ParserConfigurationException, SAXException, IOException {
+        document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(XML_PATH.toFile());
+        xpath = XPathFactory.newInstance().newXPath();
+    }
+
+    /**
+     * Test for XPath.evaluate(java.lang.String expression, java.lang.Object
+     * item, QName returnType) which return type is String.
+     */
+    @Test
+    public void testCheckXPath01() {
+        try {
+            assertEquals(xpath.evaluate(EXPRESSION_NAME_A, document, STRING), "6");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+
+    /**
+     * Test for XPath.compile(java.lang.String expression) and then
+     * evaluate(java.lang.Object item, QName returnType).
+     */
+    @Test
+    public void testCheckXPath02() {
+        try {
+            assertEquals(xpath.compile(EXPRESSION_NAME_A).evaluate(document, STRING), "6");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for XPath.evaluate(java.lang.String expression, java.lang.Object
+     * item) when the third argument is left off of the XPath.evaluate method,
+     * all expressions are evaluated to a String value.
+     */
+    @Test
+    public void testCheckXPath03() {
+        try {
+            assertEquals(xpath.evaluate(EXPRESSION_NAME_A, document), "6");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for XPath.compile(java.lang.String expression). If expression is
+     * null, should throw NPE.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPath04() {
+        try {
+            xpath.compile(null);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for XPath.compile(java.lang.String expression). If expression cannot
+     * be compiled junk characters, should throw XPathExpressionException.
+     *
+     * @throws XPathExpressionException
+     */
+    @Test(expectedExceptions = XPathExpressionException.class)
+    public void testCheckXPath05() throws XPathExpressionException {
+        xpath.compile("-*&");
+    }
+
+    /**
+     * Test for XPath.compile(java.lang.String expression). If expression is
+     * blank, should throw XPathExpressionException
+     *
+     * @throws XPathExpressionException
+     */
+    @Test(expectedExceptions = XPathExpressionException.class)
+    public void testCheckXPath06() throws XPathExpressionException {
+        xpath.compile(" ");
+    }
+
+    /**
+     * Test for XPath.compile(java.lang.String expression). The expression
+     * cannot be evaluated as this does not exist.
+     */
+    @Test
+    public void testCheckXPath07() {
+        try {
+            assertEquals(xpath.compile(EXPRESSION_NAME_B).evaluate(document, STRING), "");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+
+    }
+
+
+    /**
+     * Test for XPath.evaluate(java.lang.String expression, java.lang.Object
+     * item, QName returnType). If String expression is null, should throw NPE
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPath08() {
+        try {
+            xpath.evaluate(null, document, STRING);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for XPath.evaluate(java.lang.String expression, java.lang.Object
+     * item, QName returnType). If item is null, should throw NPE.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPath09() {
+        try {
+            xpath.evaluate(EXPRESSION_NAME_A, null, STRING);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for XPath.evaluate(java.lang.String expression, java.lang.Object
+     * item, QName returnType). If returnType is null, should throw NPE.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPath10() {
+        try {
+            xpath.evaluate(EXPRESSION_NAME_A, document, null);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for XPath.evaluate(java.lang.String expression, java.lang.Object
+     * item, QName returnType). If a request is made to evaluate the expression
+     * in the absence of a context item, simple expressions, such as "1+1", can
+     * be evaluated.
+     */
+    @Test
+    public void testCheckXPath11() {
+        try {
+            assertEquals(xpath.evaluate("1+1", document, STRING), "2");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, java.lang.Object item, QName
+     * returnType) throws XPathExpressionException if expression is a empty
+     * string "".
+     * .
+     *
+     * @throws XPathExpressionException
+     */
+    @Test(expectedExceptions = XPathExpressionException.class)
+    public void testCheckXPath12() throws XPathExpressionException {
+        xpath.evaluate("", document, STRING);
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, java.lang.Object item, QName
+     * returnType) throws IllegalArgumentException if returnType is not one of
+     * the types defined in XPathConstants.
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testCheckXPath13() {
+        try {
+            xpath.evaluate(EXPRESSION_NAME_A, document, TEST_QNAME);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, java.lang.Object item, QName
+     * returnType) returns correct boolean value if returnType is Boolean.
+     */
+    @Test
+    public void testCheckXPath14() {
+        try {
+            assertEquals(xpath.evaluate(EXPRESSION_NAME_A, document, BOOLEAN), true);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, java.lang.Object item, QName
+     * returnType) returns false as  expression is not successful in evaluating
+     * to any result if returnType is Boolean.
+     */
+    @Test
+    public void testCheckXPath15() {
+        try {
+            assertEquals(xpath.evaluate(EXPRESSION_NAME_B, document, BOOLEAN), false);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, java.lang.Object item, QName
+     * returnType) returns correct number value if return type is Number.
+     */
+    @Test
+    public void testCheckXPath16() {
+        try {
+            assertEquals(xpath.evaluate(EXPRESSION_NAME_A, document, NUMBER), 6d);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+
+    /**
+     * XPath.evaluate(java.lang.String expression, java.lang.Object item, QName
+     * returnType) returns correct string value if return type is Node.
+     */
+    @Test
+    public void testCheckXPath17() {
+        try {
+            assertEquals(((Attr)xpath.evaluate(EXPRESSION_NAME_A, document, NODE)).getValue(), "6");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for XPath.evaluate(java.lang.String expression, java.lang.Object
+     * item, QName returnType). If return type is NodeList,the evaluated value
+     * equals to "6" as expected.
+     */
+    @Test
+    public void testCheckXPath18() {
+        try {
+            NodeList nodeList = (NodeList)xpath.evaluate(EXPRESSION_NAME_A, document, NODESET);
+            assertEquals(((Attr) nodeList.item(0)).getValue(), "6");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for XPath.evaluate(java.lang.String expression, java.lang.Object
+     * item). If expression is null, should throw NPE.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPath19() {
+        try {
+            xpath.evaluate(null, document);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for XPath.evaluate(java.lang.String expression, java.lang.Object
+     * item). If a request is made to evaluate the expression in the absence of
+     * a context item, simple expressions, such as "1+1", can be evaluated.
+     */
+    @Test
+    public void testCheckXPath20() {
+        try {
+            assertEquals(xpath.evaluate("1+1", document), "2");
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, java.lang.Object item) throws
+     * NPE if InputSource is null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPath21() {
+        try {
+            xpath.evaluate(EXPRESSION_NAME_A, null);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource source) return
+     * correct value by looking for Node.
+     */
+    @Test
+    public void testCheckXPath22() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            assertEquals(xpath.evaluate(EXPRESSION_NAME_A, new InputSource(is)), "6");
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource source) throws
+     * NPE if InputSource is null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPath23() {
+        try {
+            xpath.evaluate(EXPRESSION_NAME_A, null);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource source) throws
+     * NPE if String expression is null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPath24() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.evaluate(null, new InputSource(is));
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for XPath.evaluate(java.lang.String expression, InputSource source).
+     * If expression is junk characters, expression cannot be evaluated, should
+     * throw XPathExpressionException.
+     *
+     * @throws XPathExpressionException
+     */
+    @Test(expectedExceptions = XPathExpressionException.class)
+    public void testCheckXPath25() throws XPathExpressionException {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.evaluate("-*&", new InputSource(is));
+        } catch (IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource source) throws
+     * XPathExpressionException if expression is blank " ".
+     *
+     * @throws XPathExpressionException
+     */
+    @Test(expectedExceptions = XPathExpressionException.class)
+    public void testCheckXPath26() throws XPathExpressionException {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.evaluate(" ", new InputSource(is));
+        } catch (IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource source, QName
+     * returnType) returns correct string value which return type is String.
+     */
+    @Test
+    public void testCheckXPath27() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            assertEquals(xpath.evaluate(EXPRESSION_NAME_A, new InputSource(is), STRING), "6");
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource source, QName
+     * returnType) throws NPE if source is null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPath28() {
+        try {
+            xpath.evaluate(EXPRESSION_NAME_A, null, STRING);
+        } catch (XPathExpressionException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource source, QName
+     * returnType) throws NPE if expression is null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPath29() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.evaluate(null, new InputSource(is), STRING);
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource source,
+     * QName returnType) throws NPE if returnType is null .
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPath30() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.evaluate(EXPRESSION_NAME_A, new InputSource(is), null);
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource source, QName
+     * returnType) throws XPathExpressionException if expression is junk characters.
+     *
+     * @throws XPathExpressionException
+     */
+    @Test(expectedExceptions = XPathExpressionException.class)
+    public void testCheckXPath31() throws XPathExpressionException {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.evaluate("-*&", new InputSource(is), STRING);
+        } catch (IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource source, QName
+     * returnType) throws XPathExpressionException if expression is blank " ".
+     *
+     * @throws XPathExpressionException
+     */
+    @Test(expectedExceptions = XPathExpressionException.class)
+    public void testCheckXPath32() throws XPathExpressionException {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.evaluate(" ", new InputSource(is), STRING);
+        } catch (IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource source,
+     * QName returnType) throws IllegalArgumentException if returnType is not
+     * one of the types defined in XPathConstants.
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testCheckXPath33() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            xpath.evaluate(EXPRESSION_NAME_A, new InputSource(is), TEST_QNAME);
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource source,
+     * QName returnType) return correct boolean value if return type is Boolean.
+     */
+    @Test
+    public void testCheckXPath34() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            assertEquals(xpath.evaluate(EXPRESSION_NAME_A, new InputSource(is),
+                BOOLEAN), true);
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource source,
+     * QName returnType) return correct boolean value if return type is Boolean.
+     */
+    @Test
+    public void testCheckXPath35() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            assertEquals(xpath.evaluate(EXPRESSION_NAME_B, new InputSource(is),
+                BOOLEAN), false);
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource source,
+     * QName returnType) return correct number value if return type is Number.
+     */
+    @Test
+    public void testCheckXPath36() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            assertEquals(xpath.evaluate(EXPRESSION_NAME_A, new InputSource(is),
+                NUMBER), 6d);
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource source,
+     * QName returnType) return correct string value if return type is Node.
+     */
+    @Test
+    public void testCheckXPath37() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            assertEquals(((Attr)xpath.evaluate(EXPRESSION_NAME_A,
+                new InputSource(is), NODE)).getValue(), "6");
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for XPath.evaluate(java.lang.String expression, InputSource source,
+     * QName returnType) which return type is NodeList.
+     */
+    @Test
+    public void testCheckXPath38() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            NodeList nodeList = (NodeList)xpath.evaluate(EXPRESSION_NAME_A,
+                new InputSource(is), NODESET);
+            assertEquals(((Attr) nodeList.item(0)).getValue(), "6");
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for XPath.evaluate(java.lang.String expression, InputSource iSource,
+     * QName returnType). If return type is Boolean, should return false as
+     * expression is not successful in evaluating to any result.
+     */
+    @Test
+    public void testCheckXPath52() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            assertEquals(xpath.evaluate(EXPRESSION_NAME_B, new InputSource(is),
+                BOOLEAN), false);
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource iSource, QName
+     * returnType) returns correct number value which return type is Number.
+     */
+    @Test
+    public void testCheckXPath53() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            assertEquals(xpath.evaluate(EXPRESSION_NAME_A, new InputSource(is),
+                NUMBER), 6d);
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource iSource, QName
+     * returnType) returns a node value if returnType is Node.
+     */
+    @Test
+    public void testCheckXPath54() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            assertEquals(((Attr)xpath.evaluate(EXPRESSION_NAME_A,
+                new InputSource(is), NODE)).getValue(), "6");
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XPath.evaluate(java.lang.String expression, InputSource iSource, QName
+     * returnType) returns a node list if returnType is NodeList.
+     */
+    @Test
+    public void testCheckXPath55() {
+        try (InputStream is = Files.newInputStream(XML_PATH)) {
+            NodeList nodeList = (NodeList)xpath.evaluate(EXPRESSION_NAME_A,
+                new InputSource(is), NODESET);
+            assertEquals(((Attr) nodeList.item(0)).getValue(), "6");
+        } catch (XPathExpressionException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Test for XPath.getNamespaceContext() returns the current namespace
+     * context, null is returned if no namespace context is in effect.
+     */
+    @Test
+    public void testCheckXPath56() {
+        // CR 6376058 says that an impl will be provided, but by
+        // default we still return null here
+        assertNull(xpath.getNamespaceContext());
+    }
+
+    /**
+     * Test for XPath.setNamespaceContext(NamespaceContext nsContext) Establish
+     * a namespace context. Set a valid nsContext and retrieve it using
+     * getNamespaceContext(), should return the same.
+     */
+    @Test
+    public void testCheckXPath57() {
+        MyNamespaceContext myNamespaceContext = new MyNamespaceContext();
+        xpath.setNamespaceContext(myNamespaceContext);
+        assertEquals(xpath.getNamespaceContext(), myNamespaceContext);
+    }
+
+    /**
+     * Test for XPath.setNamespaceContext(NamespaceContext nsContext) Establish
+     * a namespace context. NullPointerException is thrown if nsContext is null.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPath58() {
+        xpath.setNamespaceContext(null);
+    }
+
+    /**
+     * Test for XPath.getXPathFunctionResolver() Return the current function
+     * resolver. Null is returned if no function resolver is in effect.
+     */
+    @Test
+    public void testCheckXPath59() {
+        assertNull(xpath.getXPathFunctionResolver());
+    }
+
+    /**
+     * Test for XPath.setXPathFunctionResolver(XPathFunctionResolver resolver).
+     * Set a valid resolver and retrieve it using getXPathFunctionResolver(),
+     * should return the same.
+     */
+    @Test
+    public void testCheckXPath60() {
+        xpath.setXPathFunctionResolver((functionName, arity) -> null);
+        assertNotNull(xpath.getXPathFunctionResolver());
+    }
+
+    /**
+     * Test for XPath.setXPathFunctionResolver(XPathFunctionResolver resolver).
+     * set resolver as null, should throw NPE.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPath61() {
+        xpath.setXPathFunctionResolver(null);
+    }
+
+    /**
+     * Test for XPath.getXPathVariableResolver() Return the current variable
+     * resolver. null is returned if no variable resolver is in effect.
+     */
+    @Test
+    public void testCheckXPath62() {
+        assertNull(xpath.getXPathVariableResolver());
+    }
+
+    /**
+     * Test for XPath.setXPathVariableResolver(XPathVariableResolver resolver).
+     * Set a valid resolver and retrieve it using getXPathVariableResolver(),
+     * should return the same.
+     */
+    @Test
+    public void testCheckXPath63() {
+        xpath.setXPathVariableResolver(qname -> null);
+        assertNotNull(xpath.getXPathVariableResolver());
+    }
+
+    /**
+     * Test for XPath.setXPathVariableResolver(XPathVariableResolver resolver).
+     * Set resolver as null, should throw NPE.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testCheckXPath64() {
+        xpath.setXPathVariableResolver(null);
+    }
+
+    /**
+     * Customized NamespaceContext used for test
+     */
+    private class MyNamespaceContext implements NamespaceContext {
+        /**
+         * et Namespace URI bound to a prefix in the current scope.
+         * @param prefix prefix to look up
+         * @return a Namespace URI identical to prefix
+         */
+        @Override
+        public String getNamespaceURI(String prefix) {
+            return prefix;
+        }
+
+        /**
+         * Get prefix bound to Namespace URI in the current scope.
+         * @param namespaceURI URI of Namespace to lookup
+         * @return prefix identical to URI of Namespace
+         */
+        @Override
+        public String getPrefix(String namespaceURI) {
+            return namespaceURI;
+        }
+
+        /**
+         * Get all prefixes bound to a Namespace URI in the current scope.
+         * @param namespaceURI URI of Namespace to lookup
+         * @return null
+         */
+        @Override
+        public Iterator getPrefixes(String namespaceURI) {
+            return null;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/xpath/xmlfiles/widgets.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,8 @@
+<?xml version="1.0" standalone="yes"?>
+<widgets>
+	<widget name="a" style="red" quantity="6"/>
+	<widget name="b" style="blue"/>
+	<widget name="c">
+		<style>green</style>
+	</widget>
+</widgets>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/AttrImplTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+import org.testng.annotations.Test;
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ * Class containing the test cases for AttributesImpl API.
+ */
+public class AttrImplTest {
+    private static final String CAR_URI = "http://www.cars.com/xml";
+
+    private static final String CAR_LOCALNAME = "part";
+
+    private static final String CAR_QNAME = "p";
+
+    private static final String CAR_TYPE = "abc";
+
+    private static final String CAR_VALUE = "Merc";
+
+    private static final String JEEP_URI = "http://www.jeeps.com/xml";
+
+    private static final String JEEP_LOCALNAME = "wheel";
+
+    private static final String JEEP_QNAME = "w";
+
+    private static final String JEEP_TYPE = "xyz";
+
+    private static final String JEEP_VALUE = "Mit";
+
+    /**
+     * Basic test for getIndex(String).
+     */
+    @Test
+    public void testcase01() {
+        AttributesImpl attr = new AttributesImpl();
+        attr.addAttribute(CAR_URI, CAR_LOCALNAME, CAR_QNAME, CAR_TYPE, CAR_VALUE);
+        attr.addAttribute(JEEP_URI, JEEP_LOCALNAME, JEEP_QNAME, JEEP_TYPE,
+                JEEP_VALUE);
+        assertEquals(attr.getIndex(CAR_QNAME), 0);
+        assertEquals(attr.getIndex(JEEP_QNAME), 1);
+    }
+
+    /**
+     * Basic test for getIndex(String, String).
+     */
+    @Test
+    public void testcase02() {
+        AttributesImpl attr = new AttributesImpl();
+        attr.addAttribute(CAR_URI, CAR_LOCALNAME, CAR_QNAME, CAR_TYPE, CAR_VALUE);
+        attr.addAttribute(JEEP_URI, JEEP_LOCALNAME, JEEP_QNAME, JEEP_TYPE,
+                JEEP_VALUE);
+        assertEquals(attr.getIndex(JEEP_URI, JEEP_LOCALNAME), 1);
+    }
+
+    /**
+     * getIndex(String, String) returns -1 if none matches.
+     */
+    @Test
+    public void testcase03() {
+        AttributesImpl attr = new AttributesImpl();
+        assertEquals(attr.getIndex(JEEP_URI, "whl"), -1);
+    }
+
+    /**
+     * Basic test for getType(int) and getType(String).
+     */
+    @Test
+    public void testcase04() {
+        AttributesImpl attr = new AttributesImpl();
+        attr.addAttribute(CAR_URI, CAR_LOCALNAME, CAR_QNAME, CAR_TYPE, CAR_VALUE);
+        attr.addAttribute(JEEP_URI, JEEP_LOCALNAME, JEEP_QNAME, JEEP_TYPE,
+                JEEP_VALUE);
+        assertEquals(attr.getType(1), JEEP_TYPE);
+        assertEquals(attr.getType(JEEP_QNAME), JEEP_TYPE);
+    }
+
+    /**
+     * Basic test for getValue(int), getValue(String) and getValue(String, String).
+     */
+    @Test
+    public void testcase05() {
+        AttributesImpl attr = new AttributesImpl();
+        attr.addAttribute(CAR_URI, CAR_LOCALNAME, CAR_QNAME, CAR_TYPE, CAR_VALUE);
+        attr.addAttribute(JEEP_URI, JEEP_LOCALNAME, JEEP_QNAME, JEEP_TYPE,
+                JEEP_VALUE);
+        assertEquals(attr.getValue(1), JEEP_VALUE);
+        assertEquals(attr.getValue(attr.getQName(1)), JEEP_VALUE);
+        assertEquals(attr.getValue(attr.getURI(1), attr.getLocalName(1)), JEEP_VALUE);
+    }
+
+    /**
+     * Basic test for getLocalName(int), getQName(int), getType(int),
+     * getType(String) and getURI(int).
+     */
+    @Test
+    public void testcase06() {
+        AttributesImpl attr = new AttributesImpl();
+        attr.addAttribute(CAR_URI, CAR_LOCALNAME, CAR_QNAME, CAR_TYPE, CAR_VALUE);
+        attr.addAttribute(JEEP_URI, JEEP_LOCALNAME, JEEP_QNAME, JEEP_TYPE,
+                JEEP_VALUE);
+        attr.setAttribute(1, "www.megginson.com", "author", "meg", "s", "SAX2");
+        assertEquals(attr.getLocalName(1), "author");
+        assertEquals(attr.getQName(1), "meg");
+        assertEquals(attr.getType(1), "s");
+        assertEquals(attr.getType("meg"), "s");
+        assertEquals(attr.getURI(1), "www.megginson.com");
+    }
+
+    /**
+     * Basic test for setLocalName(int, String), setQName(int, String),
+     * setType(int, String), setValue(int, String) and setURI(int, String).
+     */
+    @Test
+    public void testcase07() {
+        AttributesImpl attr = new AttributesImpl();
+        attr.addAttribute(CAR_URI, CAR_LOCALNAME, CAR_QNAME, CAR_TYPE, CAR_VALUE);
+        attr.addAttribute(JEEP_URI, JEEP_LOCALNAME, JEEP_QNAME, JEEP_TYPE,
+                JEEP_VALUE);
+        attr.setLocalName(1, "speclead");
+        attr.setQName(1, "megi");
+        attr.setType(1, "sax");
+        attr.setValue(1, "SAX01");
+        attr.setURI(1, "www.megginson.com/sax/sax01");
+
+        assertEquals(attr.getLocalName(1), "speclead");
+        assertEquals(attr.getQName(1), "megi");
+        assertEquals(attr.getType(1), "sax");
+        assertEquals(attr.getType("megi"), "sax");
+        assertEquals(attr.getURI(1), "www.megginson.com/sax/sax01");
+    }
+
+    /**
+     * Basic test for getLength().
+     */
+    @Test
+    public void testcase08() {
+        AttributesImpl attr = new AttributesImpl();
+        assertEquals(attr.getLength(), 0);
+        attr.addAttribute(CAR_URI, CAR_LOCALNAME, CAR_QNAME, CAR_TYPE, CAR_VALUE);
+        attr.addAttribute(JEEP_URI, JEEP_LOCALNAME, JEEP_QNAME, JEEP_TYPE,
+                JEEP_VALUE);
+        assertEquals(attr.getLength(), 2);
+    }
+
+    /**
+     * Javadoc says getLocalName returns null if the index if out of range.
+     */
+    @Test
+    public void testcase09() {
+        AttributesImpl attr = new AttributesImpl();
+        attr.addAttribute(CAR_URI, CAR_LOCALNAME, CAR_QNAME, CAR_TYPE, CAR_VALUE);
+        attr.addAttribute(JEEP_URI, JEEP_LOCALNAME, JEEP_QNAME, JEEP_TYPE,
+                JEEP_VALUE);
+        attr.removeAttribute(1);
+        assertNull(attr.getLocalName(1));
+    }
+
+    /**
+     * Javadoc says java.lang.ArrayIndexOutOfBoundsException is thrown When the
+     * supplied index does not point to an attribute in the list.
+     */
+    @Test(expectedExceptions = ArrayIndexOutOfBoundsException.class)
+    public void testcase10() {
+        AttributesImpl attr = new AttributesImpl();
+        attr.addAttribute(CAR_URI, CAR_LOCALNAME, CAR_QNAME, CAR_TYPE, CAR_VALUE);
+        attr.addAttribute(JEEP_URI, JEEP_LOCALNAME, JEEP_QNAME, JEEP_TYPE,
+                JEEP_VALUE);
+        attr.removeAttribute(1);
+        attr.removeAttribute(1);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/AttributesNSTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+import static org.xml.sax.ptests.SAXTestConst.CLASS_DIR;
+import static org.xml.sax.ptests.SAXTestConst.GOLDEN_DIR;
+import static org.xml.sax.ptests.SAXTestConst.XML_DIR;
+
+/**
+ * This tests the Attributes interface. Here the startElement() callback of
+ * ContentHandler has Attributes as one of its arguments. Attributes
+ * pertaining to an element are taken into this argument and various methods
+ * of Attributes interfaces are tested. This program uses Namespace processing
+ * with namespaces in xml file. This program does not use Validation
+ */
+public class AttributesNSTest {
+    /**
+     * Test for Attribute Interface's setter/getter.
+     */
+    @Test
+    public void testcase01() {
+        String outputFile = CLASS_DIR + "AttributesNS.out";
+        String goldFile = GOLDEN_DIR + "AttributesNSGF.out";
+        String xmlFile = XML_DIR + "namespace1.xml";
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            // http://www.saxproject.com/?selected=namespaces namespace-prefixes
+            //set to false to supress xmlns attributes
+            spf.setFeature("http://xml.org/sax/features/namespace-prefixes",
+                                        false);
+            SAXParser saxParser = spf.newSAXParser();
+            MyAttrCHandler myAttrCHandler = new MyAttrCHandler(outputFile);
+            saxParser.parse(new File(xmlFile), myAttrCHandler);
+            myAttrCHandler.flushAndClose();
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (IOException | ParserConfigurationException | SAXException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/AttributesTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+import static org.xml.sax.ptests.SAXTestConst.CLASS_DIR;
+import static org.xml.sax.ptests.SAXTestConst.GOLDEN_DIR;
+import static org.xml.sax.ptests.SAXTestConst.XML_DIR;
+
+/**
+ * This tests the Attributes interface. Here the startElement() callback of
+ * ContentHandler has Attributes as one of its arguments. Attributes
+ * pertaining to an element are taken into this argument and various methods
+ * of Attributes interfaces are tested.
+ * This program uses Namespace processing without any namepsaces in xml file.
+ * This program uses Validation
+ */
+public class AttributesTest {
+    /**
+     * Unit test for Attributes interface. Prints all attributes into output
+     * file. Check it with golden file.
+     */
+    @Test
+    public void testcase01() {
+        String outputFile = CLASS_DIR + "Attributes.out";
+        String goldFile = GOLDEN_DIR + "AttributesGF.out";
+        String xmlFile = XML_DIR + "family.xml";
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            spf.setFeature("http://xml.org/sax/features/namespace-prefixes",
+                                        true);
+            spf.setValidating(true);
+            SAXParser saxParser = spf.newSAXParser();
+            MyAttrCHandler myAttrCHandler = new MyAttrCHandler(outputFile);
+            saxParser.parse(new File(xmlFile), myAttrCHandler);
+            myAttrCHandler.flushAndClose();
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (IOException | ParserConfigurationException | SAXException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/ContentHandlerTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,261 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import java.io.BufferedWriter;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLFilterImpl;
+import static org.xml.sax.ptests.SAXTestConst.CLASS_DIR;
+import static org.xml.sax.ptests.SAXTestConst.GOLDEN_DIR;
+import static org.xml.sax.ptests.SAXTestConst.XML_DIR;
+
+/**
+ * Class registers a content event handler to XMLReader. Content event handler
+ * transverses XML and print all visited node  when XMLreader parses XML. Test
+ * verifies output is same as the golden file.
+ */
+public class ContentHandlerTest {
+    /**
+     * Content event handler visit all nodes to print to output file.
+     */
+    @Test
+    public void testcase01() {
+        String outputFile = CLASS_DIR + "Content.out";
+        String goldFile = GOLDEN_DIR + "ContentGF.out";
+        String xmlFile = XML_DIR + "namespace1.xml";
+
+        try(FileInputStream instream = new FileInputStream(xmlFile)) {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+            ContentHandler cHandler = new MyContentHandler(outputFile);
+            xmlReader.setContentHandler(cHandler);
+            InputSource is = new InputSource(instream);
+            xmlReader.parse(is);
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch( IOException | SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
+
+/**
+ * A content write out handler.
+ */
+class MyContentHandler extends XMLFilterImpl {
+    /**
+     * Prefix to every exception.
+     */
+    private final static String WRITE_ERROR = "bWriter error";
+
+    /**
+     * FileWriter to write string to output file.
+     */
+    private final BufferedWriter bWriter;
+
+    /**
+     * Default document locator.
+     */
+    private Locator locator;
+
+    /**
+     * Initiate FileWriter when construct a MyContentHandler.
+     * @param outputFileName output file name.
+     * @throws SAXException creation of FileWriter failed.
+     */
+    public MyContentHandler(String outputFileName) throws SAXException {
+        try {
+            bWriter = new BufferedWriter(new FileWriter(outputFileName));
+        } catch (IOException ex) {
+            throw new SAXException(ex);
+        }
+    }
+
+    /**
+     * Write characters tag along with content of characters when meet
+     * characters event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void characters(char[] ch, int start, int length) throws SAXException {
+        String s = new String(ch, start, length);
+        println("characters...\n" + s);
+    }
+
+    /**
+     * Write endDocument tag then flush the content and close the file when meet
+     * endDocument event.
+     * @throws IOException error happen when writing file or closing file.
+     */
+    @Override
+    public void endDocument() throws SAXException {
+        try {
+            println("endDocument...");
+            bWriter.flush();
+            bWriter.close();
+        } catch (IOException ex) {
+            throw new SAXException(WRITE_ERROR, ex);
+        }
+    }
+
+    /**
+     * Write endElement tag with namespaceURI, localName, qName to the file when
+     * meet endElement event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void endElement(String namespaceURI,String localName,String qName) throws SAXException{
+        println("endElement...\n" + "namespaceURI: " + namespaceURI +
+                " localName: "+ localName + " qName: " + qName);
+    }
+
+    /**
+     * Write endPrefixMapping tag along with prefix to the file when meet
+     * endPrefixMapping event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void endPrefixMapping(String prefix) throws SAXException {
+        println("endPrefixMapping...\n" + "prefix: " + prefix);
+    }
+
+    /**
+     * Write ignorableWhitespace tag along with white spaces when meet
+     * ignorableWhitespace event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
+        String s = new String(ch, start, length);
+        println("ignorableWhitespace...\n" + s +
+                " ignorable white space string length: " + s.length());
+    }
+
+    /**
+     * Write processingInstruction tag along with target name and target data
+     * when meet processingInstruction event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void processingInstruction(String target, String data) throws SAXException {
+        println("processingInstruction...target:" + target +
+                " data: " + data);
+    }
+
+    /**
+     * Write setDocumentLocator tag when meet setDocumentLocator event.
+     */
+    @Override
+    public void setDocumentLocator(Locator locator) {
+        try {
+            this.locator = locator;
+            println("setDocumentLocator...");
+        } catch (SAXException ex) {
+            System.err.println(WRITE_ERROR + ex);
+        }
+    }
+
+    /**
+     * Write skippedEntity tag along with entity name when meet skippedEntity
+     * event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void skippedEntity(String name) throws SAXException {
+        println("skippedEntity...\n" + "name: " + name);
+    }
+
+    /**
+     * Write startDocument tag when meet startDocument event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void startDocument() throws SAXException {
+        println("startDocument...");
+    }
+
+    /**
+     * Write startElement tag along with namespaceURI, localName, qName, number
+     * of attributes and line number when meet startElement event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void startElement(String namespaceURI, String localName,
+                        String qName, Attributes atts) throws SAXException {
+        println("startElement...\n" + "namespaceURI: " +  namespaceURI +
+                " localName: " + localName +  " qName: " + qName +
+                " Number of Attributes: " + atts.getLength() +
+                " Line# " + locator.getLineNumber());
+    }
+
+    /**
+     * Write startPrefixMapping tag along with prefix and uri when meet
+     * startPrefixMapping event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void startPrefixMapping(String prefix, String uri) throws SAXException {
+        println("startPrefixMapping...\n" + "prefix: " + prefix +
+                " uri: " + uri);
+    }
+
+    /**
+     * Write outString to file.
+     * @param outString String to be written to File
+     * @throws SAXException if write file failed
+     */
+    private void println(String outString) throws SAXException {
+        try {
+            bWriter.write( outString, 0, outString.length());
+            bWriter.newLine();
+        } catch (IOException ex) {
+            throw new SAXException(WRITE_ERROR, ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/DefaultHandlerTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,283 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+import static org.xml.sax.ptests.SAXTestConst.CLASS_DIR;
+import static org.xml.sax.ptests.SAXTestConst.GOLDEN_DIR;
+import static org.xml.sax.ptests.SAXTestConst.XML_DIR;
+
+/**
+ * XMLReader parse XML with default handler that transverses XML and
+ * print all visited node. Test verifies output is same as the golden file.
+ */
+public class DefaultHandlerTest {
+    /**
+     * Test default handler that transverses XML and  print all visited node.
+     */
+    @Test
+    public void testDefaultHandler() {
+        String outputFile = CLASS_DIR + "DefaultHandler.out";
+        String goldFile = GOLDEN_DIR + "DefaultHandlerGF.out";
+        String xmlFile = XML_DIR + "namespace1.xml";
+
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            SAXParser saxparser = spf.newSAXParser();
+
+            MyDefaultHandler handler = new MyDefaultHandler(outputFile);
+            File file = new File(xmlFile);
+            String Absolutepath = file.getAbsolutePath();
+            String newAbsolutePath = Absolutepath;
+            if (File.separatorChar == '\\')
+                    newAbsolutePath = Absolutepath.replace('\\', '/');
+            String uri = "file:///" + newAbsolutePath;
+            saxparser.parse(uri, handler);
+        } catch (IOException | ParserConfigurationException | SAXException ex) {
+            failUnexpected(ex);
+        }
+        // Need close the output file before we compare it with golden file.
+        try {
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (IOException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
+
+class MyDefaultHandler extends DefaultHandler {
+    /**
+     * Prefix to every exception.
+     */
+    private final static String WRITE_ERROR = "bWrite error";
+
+    /**
+     * FileWriter to write string to output file.
+     */
+    private final BufferedWriter bWriter;
+
+    /**
+     * Initiate FileWriter when construct a MyContentHandler.
+     * @param outputFileName output file name.
+     * @throws SAXException creation of FileWriter failed.
+     */
+    MyDefaultHandler(String outputFileName) throws SAXException {
+        try {
+            bWriter = new BufferedWriter(new FileWriter(outputFileName));
+        } catch (IOException ex) {
+            throw new SAXException(ex);
+        }
+    }
+
+    /**
+     * Write characters tag along with content of characters when meet
+     * characters event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void characters(char[] ch, int start, int length) throws SAXException {
+        println("characters...\n" + new String(ch, start, length));
+    }
+
+    /**
+     * Write endDocument tag then flush the content and close the file when meet
+     * endDocument event.
+     * @throws IOException error happen when writing file or closing file.
+     */
+    @Override
+    public void endDocument() throws SAXException {
+        try {
+            println("endDocument...");
+            bWriter.flush();
+            bWriter.close();
+        } catch (IOException ex) {
+            throw new SAXException(WRITE_ERROR, ex);
+        }
+    }
+
+    /**
+     * Write endElement tag with namespaceURI, localName, qName to the file when
+     * meet endElement event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void endElement(String namespaceURI,String localName,String qName) throws SAXException{
+        println("endElement...\n" + "namespaceURI: " + namespaceURI +
+                " localName: "+ localName + " qName: " + qName);
+    }
+
+    /**
+     * Write endPrefixMapping tag along with prefix to the file when meet
+     * endPrefixMapping event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void endPrefixMapping(String prefix) throws SAXException {
+        println("endPrefixmapping .." + prefix);
+    }
+
+    /**
+     * Write error tag along with exception to the file when meet recoverable
+     * error event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void error(SAXParseException e) throws SAXException {
+        println("error: " + e.getMessage());
+    }
+
+    /**
+     * Write fatalError tag along with exception to the file when meet
+     * unrecoverable error event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void fatalError(SAXParseException e) throws SAXException {
+        println("fatal error: ");
+    }
+
+    /**
+     * Write warning tag along with exception to the file when meet warning event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void warning(SAXParseException e) throws SAXException {
+        println("warning : ");
+    }
+
+    /**
+     * Write ignorableWhitespace tag along with white spaces when meet
+     * ignorableWhitespace event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
+        String s = new String(ch, start, length);
+        println("ignorableWhitespace...\n" + s +
+                " ignorable white space string length: " + s.length());
+    }
+
+    /**
+     * Write processingInstruction tag along with target name and target data
+     * when meet processingInstruction event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void processingInstruction(String target, String data) throws SAXException {
+        println("processingInstruction...target:" + target +
+                        " data: " + data);
+    }
+
+    @Override
+    public void setDocumentLocator(Locator locator) {
+        try {
+            println("setDocumentLocator...");
+        } catch (SAXException ex) {
+            System.err.println(WRITE_ERROR + ex);
+        }
+    }
+
+    /**
+     * Write skippedEntity tag along with entity name when meet skippedEntity
+     * event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void skippedEntity(String name) throws SAXException {
+        println("skippedEntity...\n" + "name: " + name);
+    }
+
+    /**
+     * Write startDocument tag when meet startDocument event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void startDocument() throws SAXException {
+        println("startDocument...");
+    }
+
+    /**
+     * Write startElement tag along with namespaceURI, localName, qName, number
+     * of attributes and line number when meet startElement event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void startElement(String namespaceURI, String localName,
+                                        String qName, Attributes atts) throws SAXException {
+        println("startElement...\n" + "namespaceURI: " +  namespaceURI +
+                        " localName: " + localName +  " qName: " + qName +
+                        " Number of Attributes: " + atts.getLength());
+    }
+
+    /**
+     * Write startPrefixMapping tag along with prefix and uri when meet
+     * startPrefixMapping event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void startPrefixMapping(String prefix, String uri) throws SAXException {
+        println("startPrefixMapping...\n" + "prefix: " + prefix + " uri: " + uri);
+    }
+
+    /**
+     * Write outString to file.
+     * @param outString String to be written to File
+     * @throws SAXException if write file failed
+     */
+    private void println(String outString) throws SAXException {
+        try {
+            bWriter.write( outString, 0, outString.length());
+            bWriter.newLine();
+        } catch (IOException ex) {
+            throw new SAXException(WRITE_ERROR, ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/EHFatalTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import java.io.BufferedWriter;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLFilterImpl;
+import static org.xml.sax.ptests.SAXTestConst.CLASS_DIR;
+import static org.xml.sax.ptests.SAXTestConst.GOLDEN_DIR;
+import static org.xml.sax.ptests.SAXTestConst.XML_DIR;
+
+/**
+ * ErrorHandler unit test. Set a ErrorHandle to XMLReader. Capture fatal error
+ * events in ErrorHandler.
+ */
+public class EHFatalTest {
+    /**
+     * Error Handler to capture all error events to output file. Verifies the
+     * output file is same as golden file.
+     */
+    @Test
+    public void testEHFatal() {
+        String outputFile = CLASS_DIR + "EHFatal.out";
+        String goldFile = GOLDEN_DIR + "EHFatalGF.out";
+        String xmlFile = XML_DIR + "invalid.xml";
+
+        try(MyErrorHandler eHandler = new MyErrorHandler(outputFile);
+                FileInputStream instream = new FileInputStream(xmlFile)) {
+            SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
+            XMLReader xmlReader = saxParser.getXMLReader();
+            xmlReader.setErrorHandler(eHandler);
+            InputSource is = new InputSource(instream);
+            xmlReader.parse(is);
+        } catch (IOException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        } catch (SAXException ex) {
+            System.out.println("This is expected:" + ex);
+        }
+        // Need close the output file before we compare it with golden file.
+        try {
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (IOException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
+
+/**
+ * A fatal error event handler only capture fatal error event and write event to
+ * output file.
+ */
+class MyErrorHandler extends XMLFilterImpl implements AutoCloseable {
+    /**
+     * FileWriter to write string to output file.
+     */
+    private final BufferedWriter bWriter;
+
+    /**
+     * Initiate FileWriter when construct a MyContentHandler.
+     * @param outputFileName output file name.
+     * @throws SAXException creation of FileWriter failed.
+     */
+    MyErrorHandler(String outputFileName) throws SAXException {
+        super();
+        try {
+            bWriter = new BufferedWriter(new FileWriter(outputFileName));
+        } catch (IOException ex) {
+            throw new SAXException(ex);
+        }
+    }
+
+    /**
+     * Write fatalError tag along with exception to the file when meet
+     * unrecoverable error event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void fatalError(SAXParseException e) throws SAXException {
+        String str = "In fatalError..\nSAXParseException: " + e.getMessage();
+        try {
+            bWriter.write( str, 0,str.length());
+            bWriter.newLine();
+        } catch (IOException ex) {
+            throw new SAXException(ex);
+        }
+    }
+
+    /**
+     * Flush the content and close the file.
+     * @throws IOException error happen when writing file or closing file.
+     */
+    @Override
+    public void close() throws IOException {
+        bWriter.flush();
+        bWriter.close();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/MyAttrCHandler.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * Simple attributes handler.
+ */
+public class MyAttrCHandler extends DefaultHandler {
+    /**
+     * FileWriter to write string to output file.
+     */
+    private final BufferedWriter bWriter;
+
+    /**
+     * Initiate FileWriter
+     * @param fileName output file name.
+     * @throws IOException
+     */
+    public MyAttrCHandler(String fileName) throws IOException {
+        bWriter = new BufferedWriter(new FileWriter(fileName));
+    }
+
+    /**
+     * Write element content before start access every element.
+     * @throws org.xml.sax.SAXException
+     */
+    @Override
+    public void startElement(String uri, String localName,
+                String qName, Attributes attributes) throws SAXException {
+        try {
+            String string = "uri <" + uri + "> localName <" + localName +
+                        "> qName <" + qName + ">";
+
+            bWriter.write( string, 0, string.length());
+            bWriter.newLine();
+
+            int length = attributes.getLength();
+            string = "length: " + length;
+
+            bWriter.write( string, 0, string.length());
+            bWriter.newLine();
+
+            for (int ind=0; ind < length ; ind++) {
+                string = "For index = " + ind + "\n";
+                string += "getLocalName <" + attributes.getLocalName(ind)
+                                +">" + "\n";
+                string += "getQName <" + attributes.getQName(ind) +">" + "\n";
+                string += "getType <" + attributes.getType(ind) +">" + "\n";
+                string += "getURI <" + attributes.getURI(ind) +">" + "\n";
+                string += "getValue <" + attributes.getValue(ind) +">" + "\n";
+
+                bWriter.write( string, 0, string.length());
+                bWriter.newLine();
+
+                String gotLocalName = attributes.getLocalName(ind);
+                String gotQName = attributes.getQName(ind);
+                String gotURI = attributes.getURI(ind);
+
+                string ="Using localName, qname and uri pertaining to index = "
+                                + ind;
+                bWriter.write( string, 0, string.length());
+                bWriter.newLine();
+
+                string = "getIndex(qName) <" + attributes.getIndex(gotQName)
+                                +">" + "\n";
+                string += "getIndex(uri, localName) <" +
+                        attributes.getIndex(gotURI, gotLocalName) +">" + "\n";
+
+                string += "getType(qName) <" +
+                        attributes.getType(gotQName) +">" + "\n";
+                string += "getType(uri, localName) <" +
+                        attributes.getType(gotURI, gotLocalName) +">" + "\n";
+
+                string += "getValue(qName) <" +
+                        attributes.getValue(gotQName) +">" + "\n";
+                string += "getValue(uri, localName) <" +
+                        attributes.getValue(gotURI, gotLocalName) +">" + "\n";
+
+                bWriter.write( string, 0, string.length());
+                bWriter.newLine();
+            }
+            bWriter.newLine();
+        } catch(IOException ex){
+            throw new SAXException(ex);
+        }
+    }
+
+    /**
+     * Flush the stream and close the file.
+     * @throws IOException when writing or closing file failed.
+     */
+    public void flushAndClose() throws IOException {
+        bWriter.flush();
+        bWriter.close();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/MyNSContentHandler.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import org.xml.sax.helpers.DefaultHandler;
+import org.xml.sax.helpers.LocatorImpl;
+import org.xml.sax.Locator;
+import org.xml.sax.Attributes;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.FileWriter;
+import org.xml.sax.SAXException;
+
+class MyNSContentHandler extends DefaultHandler {
+    /**
+     * Prefix for written string.
+     */
+    private final static String WRITE_ERROR = "bWrite error";
+    /**
+     * FileWriter to write output file.
+     */
+    private final BufferedWriter bWriter;
+
+    /**
+     * Default locator.
+     */
+    Locator locator = new LocatorImpl();
+
+    /**
+     * Initiate FileWrite.
+     * @param outputFileName file name of output file.
+     * @throws SAXException when open output file failed.
+     */
+    public MyNSContentHandler(String outputFileName) throws SAXException {
+        try {
+            bWriter = new BufferedWriter(new FileWriter(outputFileName));
+        } catch (IOException ex) {
+            throw new SAXException(ex);
+        }
+    }
+
+    /**
+     * Write characters tag along with content of characters when meet
+     * characters event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void characters(char[] ch, int start, int length)
+            throws SAXException {
+        String s = new String(ch, start, length);
+        println("characters...length is:" + s.length() + "\n"
+                + "<" + s + ">");
+    }
+
+    /**
+     * Write endDocument tag then flush the content and close the file when meet
+     * endDocument event.
+     * @throws IOException error happen when writing file or closing file.
+     */
+    @Override
+    public void endDocument() throws SAXException {
+        try {
+            println("endDocument...");
+            bWriter.flush();
+            bWriter.close();
+        } catch (IOException ex) {
+            throw new SAXException(WRITE_ERROR, ex);
+        }
+    }
+
+    /**
+     * Write endElement tag with namespaceURI, localName, qName to the file when
+     * meet endElement event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void endElement(String namespaceURI, String localName, String qName)
+            throws SAXException {
+        println("endElement...\n" + "namespaceURI: <" + namespaceURI
+                + "> localName: <" + localName + "> qName: <" + qName + ">");
+    }
+
+    /**
+     * Write endPrefixMapping tag along with prefix to the file when meet
+     * endPrefixMapping event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void endPrefixMapping(String prefix) throws SAXException {
+        println("endPrefixMapping...\n" + "prefix: <" + prefix + ">");
+    }
+
+    /**
+     * Write ignorableWhitespace tag along with white spaces when meet
+     * ignorableWhitespace event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void ignorableWhitespace(char[] ch, int start, int length)
+            throws SAXException {
+        String s = new String(ch, start, length);
+        println("ignorableWhitespace...\n" + s
+                + " ignorable white space string length: " + s.length());
+    }
+
+    /**
+     * Write processingInstruction tag along with target name and target data
+     * when meet processingInstruction event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void processingInstruction(String target, String data)
+            throws SAXException {
+        println("processingInstruction...target:<" + target
+                + "> data: <" + data + ">");
+    }
+
+    /**
+     * Write setDocumentLocator tag when meet setDocumentLocator event.
+     */
+    @Override
+    public void setDocumentLocator(Locator locator) {
+        try {
+            this.locator = locator;
+            println("setDocumentLocator...");
+        } catch (SAXException ex) {
+            System.err.println(WRITE_ERROR + ex);
+        }
+    }
+
+    /**
+     * Write skippedEntity tag along with entity name when meet skippedEntity
+     * event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void skippedEntity(String name) throws SAXException {
+        println("skippedEntity...\n" + "name: <" + name + ">");
+    }
+
+    /**
+     * Write startDocument tag when meet startDocument event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void startDocument() throws SAXException {
+        println("startDocument...");
+    }
+
+    /**
+     * Write startElement tag along with namespaceURI, localName, qName, number
+     * of attributes and line number when meet startElement event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void startElement(String namespaceURI, String localName,
+            String qName, Attributes atts) throws SAXException {
+        println("startElement...\n" + "namespaceURI: <" + namespaceURI
+                + "> localName: <" + localName + "> qName: <" + qName
+                + "> Number of Attributes: <" + atts.getLength()
+                + "> Line# <" + locator.getLineNumber() + ">");
+    }
+
+    /**
+     * Write startPrefixMapping tag along with prefix and uri when meet
+     * startPrefixMapping event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void startPrefixMapping(String prefix, String uri)
+            throws SAXException {
+        println("startPrefixMapping...\n" + "prefix: <" + prefix
+                + "> uri: <" + uri + ">");
+    }
+    /**
+     * Write outString to output file.
+     * @param outString string to be written.
+     * @throws SAXException
+     */
+    private void println(String outString) throws SAXException {
+        try {
+            bWriter.write( outString, 0, outString.length());
+            bWriter.newLine();
+        } catch (IOException ex) {
+            throw new SAXException(WRITE_ERROR, ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/NSSupportTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import java.util.Enumeration;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+import org.testng.annotations.Test;
+import org.xml.sax.helpers.NamespaceSupport;
+
+/**
+ * Unit test cases for NamespaceSupport API
+ */
+public class NSSupportTest {
+    /**
+     * Empty prefix name.
+     */
+    private final static String EMPTY_PREFIX = "";
+
+    /**
+     * A URI for W3 1999 HTML sepc.
+     */
+    private final static String W3_URI = "http://www.w3.org/1999/xhtml";
+
+    /**
+     * A prefix named "dc".
+     */
+    private final static String DC_PREFIX = "dc";
+
+    /**
+     * A URI for "http://www.purl.org/dc#".
+     */
+    private final static String PURL_URI = "http://www.purl.org/dc#";
+
+    /**
+     * Test for NamespaceSupport.getDeclaredPrefixes().
+     */
+    @Test
+    public void testcase01() {
+        String[] prefixes = new String[2];
+        NamespaceSupport support = new NamespaceSupport();
+        support.pushContext();
+        support.declarePrefix(EMPTY_PREFIX, W3_URI);
+        support.declarePrefix(DC_PREFIX, PURL_URI);
+
+        Enumeration e = support.getDeclaredPrefixes();
+        int i = 0;
+        while(e.hasMoreElements()) {
+            prefixes[i++] = e.nextElement().toString();
+        }
+        support.popContext();
+
+        assertEquals(prefixes, new String[]{EMPTY_PREFIX, DC_PREFIX});
+    }
+
+    /**
+     * Test for NamespaceSupport.getDeclaredPrefixes() and support.processName().
+     */
+    @Test
+    public void testcase02() {
+        String[] parts = new String[3];
+        NamespaceSupport support = new NamespaceSupport();
+
+        support.pushContext();
+        support.declarePrefix(DC_PREFIX, PURL_URI);
+        parts = support.processName("dc:title", parts, false);
+        support.popContext();
+        assertEquals(parts, new String[]{PURL_URI, "title", "dc:title"});
+    }
+
+    /**
+     * Test for NamespaceSupport.getDeclaredPrefixes() and support.processName().
+     */
+    @Test
+    public void testcase03() {
+        String[] parts = new String[3];
+        NamespaceSupport support = new NamespaceSupport();
+        support.pushContext();
+        support.declarePrefix(EMPTY_PREFIX, W3_URI);
+        parts = support.processName("a", parts, false);
+        support.popContext();
+        assertEquals(parts, new String[]{W3_URI, "a", "a"});
+    }
+
+
+    /**
+     * Test for NamespaceSupport.popContext().
+     */
+    @Test
+    public void testcase04() {
+        NamespaceSupport support = new NamespaceSupport();
+
+        support.pushContext();
+        support.declarePrefix(EMPTY_PREFIX, W3_URI);
+        support.declarePrefix(DC_PREFIX, PURL_URI);
+
+        assertEquals(support.getURI(EMPTY_PREFIX), W3_URI);
+        assertEquals(support.getURI(DC_PREFIX), PURL_URI);
+        support.popContext();
+        assertNull(support.getURI(EMPTY_PREFIX));
+        assertNull(support.getURI(DC_PREFIX));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/NSTableTest01.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.XMLReader;
+
+/**
+ * Class containing the test cases for Namespace Table defined at
+ * http://www.megginson.com/SAX/Java/namespaces.html
+ */
+public class NSTableTest01 {
+    private static final String NAMESPACES =
+                        "http://xml.org/sax/features/namespaces";
+    private static final String NAMESPACE_PREFIXES =
+                        "http://xml.org/sax/features/namespace-prefixes";
+
+    /**
+     * Here namespace processing and namespace-prefixes are enabled.
+     * The testcase tests XMLReader for this.
+     */
+    @Test
+    public void xrNSTable01() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            SAXParser saxParser = spf.newSAXParser();
+
+            XMLReader xmlReader = saxParser.getXMLReader();
+            xmlReader.setFeature(NAMESPACE_PREFIXES, true);
+
+            assertTrue(xmlReader.getFeature(NAMESPACES));
+            assertTrue(xmlReader.getFeature(NAMESPACE_PREFIXES));
+        } catch (ParserConfigurationException | SAXException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Here namespace processing is enabled. This will make namespace-prefixes
+     * disabled. The testcase tests XMLReader for this.
+     */
+    @Test
+    public void xrNSTable02() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            SAXParser saxParser = spf.newSAXParser();
+
+            XMLReader xmlReader = saxParser.getXMLReader();
+            assertTrue(xmlReader.getFeature(NAMESPACES));
+            assertFalse(xmlReader.getFeature(NAMESPACE_PREFIXES));
+        } catch (ParserConfigurationException | SAXException ex) {
+            failUnexpected(ex);
+        }
+
+    }
+
+    /**
+     * Here namespace processing is disabled. This will make namespace-prefixes
+     * enabled. The testcase tests XMLReader for this.
+     */
+    @Test
+    public void xrNSTable03() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            SAXParser saxParser = spf.newSAXParser();
+            XMLReader xmlReader = saxParser.getXMLReader();
+            assertFalse(xmlReader.getFeature(NAMESPACES));
+            assertTrue(xmlReader.getFeature(NAMESPACE_PREFIXES));
+        } catch (ParserConfigurationException | SAXException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Here namespace processing is disabled, and namespace-prefixes is
+     * disabled. This will make namespace processing on.The testcase tests
+     * XMLReader for this.  This behavior only apply to crimson, not
+     * xerces
+     */
+    @Test
+    public void xrNSTable04() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            SAXParser saxParser = spf.newSAXParser();
+            XMLReader xmlReader = saxParser.getXMLReader();
+            xmlReader.setFeature(NAMESPACE_PREFIXES, false);
+
+            assertFalse(xmlReader.getFeature(NAMESPACE_PREFIXES));
+        } catch (ParserConfigurationException | SAXException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Here namespace processing and namespace-prefixes are enabled.
+     * The testcase tests SAXParserFactory for this.
+     */
+    @Test
+    public void spNSTable01() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            spf.setFeature(NAMESPACE_PREFIXES,true);
+            assertTrue(spf.getFeature(NAMESPACES));
+            assertTrue(spf.getFeature(NAMESPACE_PREFIXES));
+        } catch (ParserConfigurationException | SAXNotRecognizedException
+                | SAXNotSupportedException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Here namespace processing is enabled. This will make namespace-prefixes
+     * disabled. The testcase tests SAXParserFactory for this.
+     */
+    @Test
+    public void spNSTable02() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            assertTrue(spf.getFeature(NAMESPACES));
+            assertFalse(spf.getFeature(NAMESPACE_PREFIXES));
+        } catch (ParserConfigurationException | SAXNotRecognizedException
+                | SAXNotSupportedException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Here namespace processing is disabled. This will make namespace-prefixes
+     * enabled. The testcase tests SAXParserFactory for this.
+     */
+    @Test
+    public void spNSTable03() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            assertFalse(spf.getFeature(NAMESPACES));
+            assertTrue(spf.getFeature(NAMESPACE_PREFIXES));
+        } catch (ParserConfigurationException | SAXNotRecognizedException
+                | SAXNotSupportedException ex) {
+            failUnexpected(ex);
+        }
+    }
+    /**
+     * Here namespace processing is disabled, and namespace-prefixes is
+     * disabled. This will make namespace processing on.The testcase tests
+     * SAXParserFactory for this.  This behavior only apply to crimson,
+     * not xerces.
+     */
+    @Test
+    public void spNSTable04() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setFeature(NAMESPACE_PREFIXES, false);
+
+            assertFalse(spf.getFeature(NAMESPACE_PREFIXES));
+        } catch (ParserConfigurationException | SAXNotRecognizedException
+                | SAXNotSupportedException ex) {
+            failUnexpected(ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/ParserAdapterTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,279 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.ParserAdapter;
+import org.xml.sax.helpers.XMLFilterImpl;
+import org.xml.sax.helpers.XMLReaderAdapter;
+import static org.xml.sax.ptests.SAXTestConst.XML_DIR;
+
+
+/**
+ * Unit test cases for ParserAdapter API. By default the only features recognized
+ * are namespaces and namespace-prefixes.
+ */
+public class ParserAdapterTest {
+    /**
+     * namespaces feature name.
+     */
+    private static final String NAMESPACES =
+                "http://xml.org/sax/features/namespaces";
+
+    /**
+     * namespaces-prefiexs feature name.
+     */
+    private static final String NAMESPACE_PREFIXES =
+                "http://xml.org/sax/features/namespace-prefixes";
+
+    /**
+     * ParserAdapter instance to share by all tests.
+     */
+    private final ParserAdapter parserAdapter;
+
+    /**
+     * Initiate ParserAdapter.
+     * @throws ParserConfigurationException
+     * @throws SAXException
+     */
+    ParserAdapterTest() throws ParserConfigurationException, SAXException {
+        SAXParserFactory spf = SAXParserFactory.newInstance();
+        XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+        XMLReaderAdapter xmlReaderAdapter = new XMLReaderAdapter(xmlReader);
+        parserAdapter = new ParserAdapter(xmlReaderAdapter);
+    }
+
+    /**
+     * Verifies parserAdapter.getContentHandler()
+     */
+    @Test
+    public void contentHandler01() {
+        ContentHandler contentHandler = new XMLFilterImpl();
+        parserAdapter.setContentHandler(contentHandler);
+        assertNotNull(parserAdapter.getContentHandler());
+    }
+
+    /**
+     * No exception is expected when set content handler as null.
+     */
+    @Test
+    public void contentHandler02() {
+        parserAdapter.setContentHandler(null);
+    }
+
+    /**
+     * Verifies parserAdapter.getEntityResolver()
+     */
+    @Test
+    public void entity01() {
+        XMLFilterImpl xmlFilter = new XMLFilterImpl();
+        parserAdapter.setEntityResolver(xmlFilter);
+        assertNotNull(parserAdapter.getEntityResolver());
+    }
+
+    /**
+     * No exception is expected when set entity resolver as null.
+     */
+    @Test
+    public void entity02() {
+        parserAdapter.setEntityResolver(null);
+    }
+
+    /**
+     * Verifies parserAdapter.getDTDHandler()
+     */
+    @Test
+    public void dtdHandler01() {
+        XMLFilterImpl xmlFilter = new XMLFilterImpl();
+        parserAdapter.setDTDHandler(xmlFilter);
+        assertNotNull(parserAdapter.getDTDHandler());
+    }
+
+    /**
+     * No exception is expected when set DTD handler as null.
+     */
+    @Test
+    public void dtdHandler02() {
+        parserAdapter.setDTDHandler(null);
+    }
+
+    /**
+     * Verifies parserAdapter.getErrorHandler()
+     */
+    @Test
+    public void errorHandler01() {
+        XMLFilterImpl eHandler = new XMLFilterImpl();
+        parserAdapter.setErrorHandler(eHandler);
+        assertNotNull(parserAdapter.getErrorHandler());
+    }
+
+    /**
+     * No exception is expected when set error handler as null.
+     */
+    @Test
+    public void errorHandler02() {
+        parserAdapter.setErrorHandler(null);
+    }
+
+    /**
+     * parserAdapter.getFeature(NAMESPACES) returns true be default.
+     */
+    @Test
+    public void getFeature01() {
+        try {
+           assertTrue(parserAdapter.getFeature(NAMESPACES));
+        } catch (SAXNotRecognizedException | SAXNotSupportedException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * parserAdapter.getFeature(NAMESPACE_PREFIXES) returns true be default.
+     */
+    @Test
+    public void getFeature02() {
+        try {
+           assertFalse(parserAdapter.getFeature(NAMESPACE_PREFIXES));
+        } catch (SAXNotRecognizedException | SAXNotSupportedException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * SAXNotRecognizedException thrown when feature name is not known one.
+     * @throws org.xml.sax.SAXNotRecognizedException expected Exception
+     */
+    @Test(expectedExceptions = SAXNotRecognizedException.class)
+    public void getFeature03() throws SAXNotRecognizedException {
+        try {
+            parserAdapter.getFeature("no-meaning-feature");
+        } catch (SAXNotSupportedException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Obtain getFeature after it's set returns set value.
+     */
+    @Test
+    public void setFeature01() {
+        try {
+           parserAdapter.setFeature(NAMESPACES, false);
+           assertFalse(parserAdapter.getFeature(NAMESPACES));
+        } catch (SAXNotRecognizedException | SAXNotSupportedException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Obtain getFeature after it's set returns set value.
+     */
+    @Test
+    public void setFeature02() {
+        try {
+           parserAdapter.setFeature(NAMESPACE_PREFIXES, false);
+           assertFalse(parserAdapter.getFeature(NAMESPACE_PREFIXES));
+        } catch (SAXNotRecognizedException | SAXNotSupportedException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Obtain getFeature after it's set returns set value.
+     */
+    @Test
+    public void setFeature03() {
+        try {
+           parserAdapter.setFeature(NAMESPACES, true);
+           assertTrue(parserAdapter.getFeature(NAMESPACES));
+        } catch (SAXNotRecognizedException | SAXNotSupportedException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Obtain getFeature after it's set returns set value.
+     */
+    @Test
+    public void setFeature04() {
+        try {
+           parserAdapter.setFeature(NAMESPACE_PREFIXES, true);
+           assertTrue(parserAdapter.getFeature(NAMESPACE_PREFIXES));
+        } catch (SAXNotRecognizedException | SAXNotSupportedException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * NPE expected when parsing a null object by ParserAdapter.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void parse01() {
+        try {
+            parserAdapter.parse((InputSource)null);
+        } catch (IOException | SAXException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * SAXException expected when parsing a wrong-formatter XML with ParserAdapter.
+     * @throws org.xml.sax.SAXException
+     */
+    @Test(expectedExceptions = SAXException.class)
+    public void parse02() throws SAXException {
+        try(FileInputStream fis = new FileInputStream(XML_DIR + "invalid.xml")) {
+            InputSource is = new InputSource(fis);
+            parserAdapter.parse(is);
+        } catch (IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Parse a well-formatter XML with ParserAdapter.
+     */
+    @Test
+    public void parse03() {
+        try(FileInputStream fis = new FileInputStream(XML_DIR + "correct.xml")) {
+            InputSource is = new InputSource(fis);
+            parserAdapter.parse(is);
+        } catch (IOException | SAXException ex) {
+            failUnexpected(ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/ResolverTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import java.io.BufferedWriter;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLFilterImpl;
+import static org.xml.sax.ptests.SAXTestConst.CLASS_DIR;
+import static org.xml.sax.ptests.SAXTestConst.GOLDEN_DIR;
+import static org.xml.sax.ptests.SAXTestConst.XML_DIR;
+
+/**
+ * Entity resolver should be invoked in XML parse. This test verifies parsing
+ * process by checking the output with golden file.
+ */
+public class ResolverTest {
+    /**
+     * Unit test for entityResolver setter.
+     */
+    public void testResolver() {
+        String outputFile = CLASS_DIR + "EntityResolver.out";
+        String goldFile = GOLDEN_DIR + "EntityResolverGF.out";
+        String xmlFile = XML_DIR + "publish.xml";
+
+        try(FileInputStream instream = new FileInputStream(xmlFile);
+                MyEntityResolver eResolver = new MyEntityResolver(outputFile)) {
+            SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
+            XMLReader xmlReader = saxParser.getXMLReader();
+            xmlReader.setEntityResolver(eResolver);
+            InputSource is = new InputSource(instream);
+            xmlReader.parse(is);
+        } catch(IOException | SAXException | ParserConfigurationException ex ) {
+            failUnexpected(ex);
+        }
+        // Need close the output file before we compare it with golden file.
+        try {
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (IOException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
+
+/**
+ * Simple entity resolver to write every entity to an output file.
+ */
+class MyEntityResolver extends XMLFilterImpl implements AutoCloseable {
+    /**
+     * FileWriter to write string to output file.
+     */
+    private final BufferedWriter bWriter;
+
+    /**
+     * Initiate FileWriter when construct a MyContentHandler.
+     * @param outputFileName output file name.
+     * @throws SAXException creation of FileWriter failed.
+     */
+    MyEntityResolver(String outputFileName) throws SAXException {
+        super();
+        try {
+            bWriter = new BufferedWriter(new FileWriter(outputFileName));
+        } catch (IOException ex) {
+            throw new SAXException(ex);
+        }
+    }
+
+    /**
+     * Write In resolveEntity tag along with publicid and systemId when meet
+     * resolveEntity event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public InputSource resolveEntity(String publicid, String systemid)
+            throws SAXException, IOException {
+        String str = "In resolveEntity.." + " " + publicid + " " + systemid;
+        bWriter.write( str, 0,str.length());
+        bWriter.newLine();
+        return super.resolveEntity(publicid, systemid);
+    }
+
+    /**
+     * Flush the content and close the file.
+     * @throws IOException error happen when writing file or closing file.
+     */
+    @Override
+    public void close() throws IOException {
+        bWriter.flush();
+        bWriter.close();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/SAXParserNSTableTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+import static org.xml.sax.ptests.SAXTestConst.CLASS_DIR;
+import static org.xml.sax.ptests.SAXTestConst.GOLDEN_DIR;
+import static org.xml.sax.ptests.SAXTestConst.XML_DIR;
+
+/**
+ * This class contains the testcases to test SAXParser with regard to
+ * Namespace Table defined at http://www.megginson.com/SAX/Java/namespaces.html
+ */
+public class SAXParserNSTableTest {
+    /**
+     * namespace processing is enabled. namespace-prefix is also is enabled.
+     * So it is a True-True combination.
+     * The test is to test SAXParser with these conditions
+     */
+    @Test
+    public void testWithTrueTrue() {
+        String outputFile = CLASS_DIR + "SPNSTableTT.out";
+        String goldFile = GOLDEN_DIR + "NSTableTTGF.out";
+        String xmlFile = XML_DIR + "namespace1.xml";
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            spf.setFeature("http://xml.org/sax/features/namespace-prefixes",
+                                        true);
+
+            SAXParser saxParser = spf.newSAXParser();
+            saxParser.parse(new File(xmlFile), new MyNSContentHandler(outputFile));
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (ParserConfigurationException | SAXException | IOException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+    /**
+     * namespace processing is enabled. Hence namespace-prefix is
+     * expected to be automaically off. So it is a True-False combination.
+     * The test is to test SAXParser with these conditions
+     */
+    public void testWithTrueFalse() {
+        String outputFile = CLASS_DIR + "SPNSTableTF.out";
+        String goldFile = GOLDEN_DIR + "NSTableTFGF.out";
+        String xmlFile = XML_DIR + "namespace1.xml";
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            SAXParser saxParser = spf.newSAXParser();
+            saxParser.parse(new File(xmlFile), new MyNSContentHandler(outputFile));
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (ParserConfigurationException | SAXException | IOException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+
+    /**
+     * namespace processing is not enabled. Hence namespace-prefix is
+     * expected to be automaically on. So it is a False-True combination.
+     * The test is to test SAXParser with these conditions
+     */
+    public void testWithFalseTrue() {
+        String outputFile = CLASS_DIR + "SPNSTableFT.out";
+        String goldFile = GOLDEN_DIR + "NSTableFTGF.out";
+        String xmlFile = XML_DIR + "namespace1.xml";
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            SAXParser saxParser = spf.newSAXParser();
+            saxParser.parse(new File(xmlFile), new MyNSContentHandler(outputFile));
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (ParserConfigurationException | SAXException | IOException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/XMLFilterCBTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,281 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import java.io.BufferedWriter;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failCleanup;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLFilterImpl;
+import static org.xml.sax.ptests.SAXTestConst.CLASS_DIR;
+import static org.xml.sax.ptests.SAXTestConst.GOLDEN_DIR;
+import static org.xml.sax.ptests.SAXTestConst.XML_DIR;
+
+/**
+ * Set parent of XMLFilter to XMLReader. Parsing on XML file will invoke XMLFilter
+ * to write to output file. Test verifies output is same as the golden file.
+ */
+public class XMLFilterCBTest {
+    public void testXMLFilterCB() {
+        String outputFile = CLASS_DIR + "XMLFilter.out";
+        String goldFile = GOLDEN_DIR + "XMLFilterGF.out";
+        String xmlFile = XML_DIR + "namespace1.xml";
+
+        try (FileInputStream fis = new FileInputStream(xmlFile)){
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+
+            MyXMLFilter myXmlFilter = new MyXMLFilter(outputFile);
+            myXmlFilter.setParent(xmlReader);
+            InputSource is = new InputSource(fis);
+            myXmlFilter.parse(is);
+        } catch( SAXException | IOException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+        // Need close the output file before we compare it with golden file.
+        try {
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (IOException ex) {
+            failUnexpected(ex);
+        } finally {
+            try {
+                Path outputPath = Paths.get(outputFile);
+                if(Files.exists(outputPath))
+                    Files.delete(outputPath);
+            } catch (IOException ex) {
+                failCleanup(ex, outputFile);
+            }
+        }
+    }
+}
+
+/**
+ * Writer XMLFiler which write all tags to output file when event happens.
+ */
+class MyXMLFilter extends XMLFilterImpl{
+    /**
+     * FileWriter to write string to output file.
+     */
+    private final BufferedWriter bWriter;
+
+    /**
+     * Initiate FileWriter for output file.
+     * @param outputFileName output file name.
+     * @throws SAXException if open file failed.
+     */
+    MyXMLFilter(String outputFileName) throws SAXException {
+        try {
+            bWriter = new BufferedWriter(new FileWriter(outputFileName));
+        } catch (IOException ex) {
+            throw new SAXException(ex);
+        }
+    }
+
+    /**
+     * Write characters tag along with content of characters when meet
+     * characters event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void characters(char[] ch, int start, int length) throws SAXException {
+        String s = new String(ch, start, length);
+        println("characters...\n" + s);
+    }
+
+    /**
+     * Write endDocument tag then flush the content and close the file when meet
+     * endDocument event.
+     * @throws IOException error happen when writing file or closing file.
+     */
+    @Override
+    public void endDocument() throws SAXException {
+        try {
+            println("endDocument...");
+            bWriter.flush();
+            bWriter.close();
+        } catch (IOException ex) {
+            throw new SAXException(ex);
+        }
+    }
+
+    /**
+     * Write endElement tag with namespaceURI, localName, qName to the file when
+     * meet endElement event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void endElement(String namespaceURI,String localName,String qName)
+            throws SAXException{
+        println("endElement...\n" + "namespaceURI: " + namespaceURI +
+                " localName: "+ localName + " qName: " + qName);
+    }
+
+    /**
+     * Write endPrefixMapping tag along with prefix to the file when meet
+     * endPrefixMapping event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void endPrefixMapping(String prefix) throws SAXException {
+        println("endPrefixmapping .." + prefix);
+    }
+
+    /**
+     * Write error tag along with exception to the file when meet recoverable
+     * error event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void error(SAXParseException e) throws SAXException {
+        println("error: " + e.getMessage());
+    }
+
+    /**
+     * Write fatalError tag along with exception to the file when meet
+     * unrecoverable error event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void fatalError(SAXParseException e) throws SAXException {
+        println("fatal error: ");
+    }
+
+    /**
+     * Write warning tag along with exception to the file when meet warning event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void warning(SAXParseException e) throws SAXException {
+        println("warning : ");
+    }
+
+    /**
+     * Write ignorableWhitespace tag along with white spaces when meet
+     * ignorableWhitespace event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void ignorableWhitespace(char[] ch, int start, int length)
+            throws SAXException {
+        String s = new String(ch, start, length);
+        println("ignorableWhitespace...\n" + s +
+                " ignorable white space string length: " + s.length());
+    }
+
+    /**
+     * Write processingInstruction tag along with target name and target data
+     * when meet processingInstruction event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void processingInstruction(String target, String data)
+            throws SAXException {
+        println("processingInstruction...target:" + target +
+                        " data: " + data);
+    }
+
+    /**
+     * Write setDocumentLocator tag when meet setDocumentLocator event.
+     */
+    @Override
+    public void setDocumentLocator(Locator locator) {
+        try {
+            println("setDocumentLocator...");
+        } catch (SAXException ex) {
+            System.err.println(ex);
+        }
+    }
+
+    /**
+     * Write skippedEntity tag along with entity name when meet skippedEntity
+     * event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void skippedEntity(String name) throws SAXException {
+        println("skippedEntity...\n" + "name: " + name);
+    }
+
+    /**
+     * Write startDocument tag when meet startDocument event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void startDocument() throws SAXException {
+        println("startDocument...");
+    }
+
+    /**
+     * Write startElement tag along with namespaceURI, localName, qName, number
+     * of attributes and line number when meet startElement event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void startElement(String namespaceURI, String localName,
+                    String qName, Attributes atts) throws SAXException {
+        println("startElement...\n" + "namespaceURI: " +  namespaceURI +
+                        " localName: " + localName +  " qName: " + qName +
+                        " Number of Attributes: " + atts.getLength());
+    }
+
+    /**
+     * Write startPrefixMapping tag along with prefix and uri when meet
+     * startPrefixMapping event.
+     * @throws IOException error happen when writing file.
+     */
+    @Override
+    public void startPrefixMapping(String prefix, String uri) throws SAXException {
+        println("startPrefixMapping...\n" + "prefix: "
+                                + prefix + " uri: " + uri);
+    }
+
+    /**
+     * Write outString to file.
+     * @param outString String to be written to File
+     * @throws SAXException if write file failed
+     */
+    private void println(String outString) throws SAXException {
+        try {
+            bWriter.write( outString, 0, outString.length());
+            bWriter.newLine();
+        } catch (IOException ex) {
+            throw new SAXException(ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/XMLFilterTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,267 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLFilterImpl;
+import static org.xml.sax.ptests.SAXTestConst.XML_DIR;
+
+/**
+ * Unit test for XMLFilter.
+ */
+public class XMLFilterTest {
+    /**
+     * name spaces constant.
+     */
+    private static final String NAMESPACES =
+                "http://xml.org/sax/features/namespaces";
+
+    /**
+     * name spaces prefixes constant.
+     */
+    private static final String NAMESPACE_PREFIXES =
+                "http://xml.org/sax/features/namespace-prefixes";
+
+    /**
+     * No exception expected when set a correct content handler.
+     */
+    @Test
+    public void contentHandler01() {
+        XMLFilterImpl xmlFilter = new XMLFilterImpl();
+        xmlFilter.setContentHandler(xmlFilter);
+        assertNotNull(xmlFilter.getContentHandler());
+    }
+
+    /**
+     * No exception is expected when set content handler as null.
+     */
+    @Test
+    public void contentHandler02() {
+        new XMLFilterImpl().setContentHandler(null);
+    }
+
+    /**
+     * No exception expected when set a correct entity solver.
+     */
+    @Test
+    public void entity01() {
+        XMLFilterImpl xmlFilter = new XMLFilterImpl();
+        xmlFilter.setEntityResolver(xmlFilter);
+        assertNotNull(xmlFilter.getEntityResolver());
+    }
+
+    /**
+     * No exception is expected when set entity resolver as null.
+     */
+    @Test
+    public void entity02() {
+        new XMLFilterImpl().setEntityResolver(null);
+    }
+
+    /**
+     * No exception expected when set a correct DTD handler.
+     */
+    @Test
+    public void dtdHandler01() {
+        XMLFilterImpl xmlFilter = new XMLFilterImpl();
+        xmlFilter.setDTDHandler(xmlFilter);
+        assertNotNull(xmlFilter.getDTDHandler());
+    }
+
+    /**
+     * No exception is expected when set DTD handler as null.
+     */
+    @Test
+    public void dtdHandler02() {
+        new XMLFilterImpl().setDTDHandler(null);
+    }
+
+    /**
+     * No exception expected when set a correct error handler.
+     */
+    @Test
+    public void errorHandler01() {
+        XMLFilterImpl xmlFilter = new XMLFilterImpl();
+        xmlFilter.setErrorHandler(xmlFilter);
+        assertNotNull(xmlFilter.getErrorHandler());
+    }
+
+    /**
+     * No exception is expected when set error handler as null.
+     */
+    @Test
+    public void errorHandler02() {
+        new XMLFilterImpl().setErrorHandler(null);
+    }
+
+    /**
+     * By default true is expected get namespaces feature.
+     * @throws SAXException
+     */
+    @Test
+    public void getFeature01() throws SAXException {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+
+            XMLFilterImpl xmlFilter = new XMLFilterImpl();
+            xmlFilter.setParent(xmlReader);
+            assertTrue(xmlFilter.getFeature(NAMESPACES));
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * By default false is expected get namespaces-prefix feature.
+     */
+    @Test
+    public void getFeature02() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+
+            XMLFilterImpl xmlFilter = new XMLFilterImpl();
+            xmlFilter.setParent(xmlReader);
+            assertFalse(xmlFilter.getFeature(NAMESPACE_PREFIXES));
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * SAXNotRecognizedException is expected when get a feature by an invalid
+     * feature name.
+     * @throws org.xml.sax.SAXNotRecognizedException If the feature
+     *            value can't be assigned or retrieved from the parent.
+     * @throws org.xml.sax.SAXNotSupportedException When the
+     *            parent recognizes the feature name but
+     *            cannot determine its value at this time.
+     */
+    @Test(expectedExceptions = SAXNotRecognizedException.class)
+    public void getFeature03() throws SAXNotRecognizedException,
+           SAXNotSupportedException {
+        new XMLFilterImpl().getFeature("no-meaning-feature");
+    }
+
+    /**
+     * Set namespaces feature to a value to XMLFilter. it's expected same when
+     * obtain it again.
+     */
+    @Test
+    public void setFeature01() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+
+            XMLFilterImpl xmlFilter = new XMLFilterImpl();
+            xmlFilter.setParent(xmlReader);
+            xmlFilter.setFeature(NAMESPACES, false);
+            assertFalse(xmlFilter.getFeature(NAMESPACES));
+            xmlFilter.setFeature(NAMESPACES, true);
+            assertTrue(xmlFilter.getFeature(NAMESPACES));
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Set namespaces-prefix feature to a value to XMLFilter. it's expected same
+     * when obtain it again.
+     */
+    @Test
+    public void setFeature02() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+
+            XMLFilterImpl xmlFilter = new XMLFilterImpl();
+            xmlFilter.setParent(xmlReader);
+            xmlFilter.setFeature(NAMESPACE_PREFIXES, false);
+            assertFalse(xmlFilter.getFeature(NAMESPACE_PREFIXES));
+            xmlFilter.setFeature(NAMESPACE_PREFIXES, true);
+            assertTrue(xmlFilter.getFeature(NAMESPACE_PREFIXES));
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * NullPointerException is expected when parse a null InputSource.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void parse01() {
+        try {
+            new XMLFilterImpl().parse((InputSource)null);
+        } catch (IOException | SAXException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * SAXException is expected when parsing a invalid formatted XML file.
+     * @throws org.xml.sax.SAXException when parse a incorrect formatted XML
+     * file.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void parse02() throws SAXException {
+        XMLFilterImpl xmlFilter = new XMLFilterImpl();
+        try(FileInputStream fis = new FileInputStream(XML_DIR + "invalid.xml")) {
+            InputSource is = new InputSource(fis);
+            xmlFilter.parse(is);
+        } catch (IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * No exception when parse a normal XML file.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void parse03() {
+        XMLFilterImpl xmlFilter = new XMLFilterImpl();
+        try(FileInputStream fis = new FileInputStream(XML_DIR + "correct2.xml")) {
+            InputSource is = new InputSource(fis);
+            xmlFilter.parse(is);
+        } catch (IOException | SAXException ex) {
+            failUnexpected(ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/XMLReaderAdapterTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.HandlerBase;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderAdapter;
+import static org.xml.sax.ptests.SAXTestConst.XML_DIR;
+
+/**
+ * Class containing the test cases for XMLReaderAdapter API
+ */
+public class XMLReaderAdapterTest {
+    /**
+     * http://xml.org/sax/features/namespace-prefixes property name.
+     */
+    private final static String NM_PREFIXES_PROPERTY
+            = "http://xml.org/sax/features/namespace-prefixes";
+
+    /**
+     * To test the constructor that uses "org.xml.sax.driver" property
+     * @throws org.xml.sax.SAXException If the embedded driver cannot be
+     * instantiated or if the org.xml.sax.driver property is not specified.
+     */
+    @Test
+    public void constructor01() throws SAXException {
+        assertNotNull(new XMLReaderAdapter());
+    }
+
+    /**
+     * To test the constructor that uses XMLReader
+     */
+    @Test
+    public void constructor02() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+
+            assertNotNull(new XMLReaderAdapter(xmlReader));
+        } catch (ParserConfigurationException | SAXException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * To test the parse method. The specification says that this method
+     * will throw an exception if the embedded XMLReader does not support
+     * the http://xml.org/sax/features/namespace-prefixes property.
+     */
+    @Test
+    public void nsfeature01() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+            if (!xmlReader.getFeature(NM_PREFIXES_PROPERTY)) {
+                xmlReader.setFeature(NM_PREFIXES_PROPERTY, true);
+            }
+
+            assertTrue(xmlReader.getFeature(NM_PREFIXES_PROPERTY));
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * To test the parse method. The specification says that this method
+     * will throw an exception if the embedded XMLReader does not support
+     * the http://xml.org/sax/features/namespace-prefixes property.
+     */
+    @Test
+    public void parse01() {
+        try (FileInputStream fis = new FileInputStream(XML_DIR + "namespace1.xml")) {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+            if (!xmlReader.getFeature(NM_PREFIXES_PROPERTY)) {
+                xmlReader.setFeature(NM_PREFIXES_PROPERTY, true);
+            }
+            XMLReaderAdapter xmlRA = new XMLReaderAdapter(xmlReader);
+
+            InputSource is = new InputSource(fis);
+            xmlRA.setDocumentHandler(new HandlerBase());
+            xmlRA.parse(is);
+        } catch (IOException | SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/XMLReaderFactoryTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import static org.testng.Assert.assertNotNull;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Unit test for XMLReaderFactory.createXMLReader API.
+ */
+public class XMLReaderFactoryTest {
+    /**
+     * No exception expected when create XMLReader by default.
+     * @throws org.xml.sax.SAXException when xml reader creation failed.
+     */
+    @Test
+    public void createReader01() throws SAXException {
+        assertNotNull(XMLReaderFactory.createXMLReader());
+    }
+
+    /**
+     * No exception expected when create XMLReader with driver name
+     * org.apache.xerces.parsers.SAXParser
+     * or com.sun.org.apache.xerces.internal.parsers.SAXParser.
+     * @throws org.xml.sax.SAXException when xml reader creation failed.
+     */
+    @Test
+    public void createReader02() throws SAXException {
+        //Disable this test because this is only work for apache implementation.
+        /*System.setProperty("org.xml.sax.driver",
+            "org.apache.xerces.parsers.SAXParser");
+        assertNotNull(XMLReaderFactory.
+            createXMLReader("org.apache.xerces.parsers.SAXParser"));*/
+        System.setProperty("org.xml.sax.driver",
+            "com.sun.org.apache.xerces.internal.parsers.SAXParser");
+        assertNotNull(XMLReaderFactory.
+            createXMLReader("com.sun.org.apache.xerces.internal.parsers.SAXParser"));
+    }
+
+    /**
+     * SAXException expected when create XMLReader with an invalid driver name.
+     * @throws org.xml.sax.SAXException expected Exception
+     */
+    @Test(expectedExceptions = SAXException.class,
+            expectedExceptionsMessageRegExp =
+                    "SAX2 driver class org.apache.crimson.parser.ABCD not found")
+    public void createReader03() throws SAXException{
+        XMLReaderFactory.createXMLReader("org.apache.crimson.parser.ABCD");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/XMLReaderNSTableTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import static org.xml.sax.ptests.SAXTestConst.CLASS_DIR;
+import static org.xml.sax.ptests.SAXTestConst.GOLDEN_DIR;
+import static org.xml.sax.ptests.SAXTestConst.XML_DIR;
+
+/** This class contains the testcases to test XMLReader with regard to
+  * Namespace Table defined at
+  * http://www.megginson.com/SAX/Java/namespaces.html
+  */
+public class XMLReaderNSTableTest {
+    /**
+     * XML file that used to be parsed.
+     */
+    private static final String xmlFile = XML_DIR + "namespace1.xml";
+
+    /**
+     * XML namespaces prefixes.
+     */
+    private static final String NAMESPACE_PREFIXES =
+                "http://xml.org/sax/features/namespace-prefixes";
+    /**
+     * namespace processing is enabled. namespace-prefix is also is enabled.
+     * So it is a True-True combination.
+     * The test is to test XMLReader with these conditions
+     */
+    public void testWithTrueTrue() {
+        String outputFile = CLASS_DIR + "XRNSTableTT.out";
+        String goldFile = GOLDEN_DIR + "NSTableTTGF.out";
+
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            SAXParser saxParser = spf.newSAXParser();
+
+            XMLReader xmlReader = saxParser.getXMLReader();
+            xmlReader.setFeature(NAMESPACE_PREFIXES, true);
+
+            xmlReader.setContentHandler(new MyNSContentHandler(outputFile));
+            xmlReader.parse(new InputSource(new FileInputStream(xmlFile)));
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (ParserConfigurationException | SAXException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Namespace processing is enabled. Hence namespace-prefix is
+     * expected to be automaically off. So it is a True-False combination.
+     * The test is to test XMLReader with these conditions
+     */
+    public void testWithTrueFalse() {
+        String outputFile = CLASS_DIR + "XRNSTableTF.out";
+        String goldFile = GOLDEN_DIR + "NSTableTFGF.out";
+
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            SAXParser saxParser = spf.newSAXParser();
+            XMLReader xmlReader = saxParser.getXMLReader();
+
+            xmlReader.setContentHandler(new MyNSContentHandler(outputFile));
+            xmlReader.parse(new InputSource(new FileInputStream(xmlFile)));
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (ParserConfigurationException | SAXException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * namespace processing is not enabled. Hence namespace-prefix is
+     * expected to be automaically on. So it is a False-True combination.
+     * The test is to test XMLReader with these conditions
+     */
+    public void testWithFalseTrue() {
+        String outputFile = CLASS_DIR + "XRNSTableFT.out";
+        String goldFile = GOLDEN_DIR + "NSTableFTGF.out";
+
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            SAXParser saxParser = spf.newSAXParser();
+            XMLReader xmlReader = saxParser.getXMLReader();
+
+            xmlReader.setContentHandler(new MyNSContentHandler(outputFile));
+            xmlReader.parse(new InputSource(new FileInputStream(xmlFile)));
+            assertTrue(compareWithGold(goldFile, outputFile));
+        } catch (ParserConfigurationException | SAXException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/ptests/XMLReaderTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,738 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.ext.DeclHandler;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.helpers.XMLFilterImpl;
+import static org.xml.sax.ptests.SAXTestConst.XML_DIR;
+
+/**
+ * Class containing the test cases for SAXParser API
+ */
+public class XMLReaderTest {
+    /**
+     * XML namespaces.
+     */
+    private static final String NAMESPACES =
+                "http://xml.org/sax/features/namespaces";
+
+    /**
+     * XML namespaces prefixes.
+     */
+    private static final String NAMESPACE_PREFIXES =
+                "http://xml.org/sax/features/namespace-prefixes";
+
+    /**
+     * A string intern name.
+     */
+    private static final String STRING_INTERNING =
+                "http://xml.org/sax/features/string-interning";
+
+    /**
+     * Validation name.
+     */
+    private static final String VALIDATION =
+                "http://xml.org/sax/features/validation";
+
+    /**
+     * A general external entities name
+     */
+    private static final String EXTERNAL_G_ENTITIES =
+                "http://xml.org/sax/features/external-general-entities";
+
+    /**
+     * A external parameter entities name
+     */
+    private static final String EXTERNAL_P_ENTITIES =
+                "http://xml.org/sax/features/external-parameter-entities";
+
+    /**
+     * XML DOM node name.
+     */
+    private static final String DOM_NODE = "http://xml.org/sax/properties/dom-node";
+
+    /**
+     * XML String name.
+     */
+    private static final String XML_STRING = "http://xml.org/sax/properties/xml-string";
+
+    /**
+     * Declare handler name
+     */
+    private static final String DECL_HANDLER =
+                        "http://xml.org/sax/properties/declaration-handler";
+
+    /**
+     * Lexical handler name
+     */
+    private static final String LEXICAL_HANDLER =
+                        "http://xml.org/sax/properties/lexical-handler";
+
+    /**
+     * According to the SAX2 specs, All XMLReaders are required to recognize the
+     * http://xml.org/sax/features/namespaces feature names.
+     * This test case is to test this.
+     */
+    @Test
+    public void featureNS01() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            assertFalse(xmlReader.getFeature(NAMESPACES));
+        } catch (ParserConfigurationException | SAXException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * According to the SAX2 specs, All XMLReaders are required to recognize the
+     * http://xml.org/sax/features/namespaces feature names.
+     * This test case is to test this.
+     */
+    @Test
+    public void featureNS02() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            assertTrue(xmlReader.getFeature(NAMESPACES));
+        } catch (ParserConfigurationException | SAXException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Obtain http://xml.org/sax/features/namespaces feature name after it's
+     * just set. Expect it's same as set value.
+     */
+    @Test
+    public void featureNS03() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            xmlReader.setFeature(NAMESPACES, true);
+            assertTrue(xmlReader.getFeature(NAMESPACES));
+            xmlReader.setFeature(NAMESPACES, false);
+            assertFalse(xmlReader.getFeature(NAMESPACES));
+        } catch (ParserConfigurationException | SAXException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * According to the SAX2 specs, All XMLReaders are required to recognize the
+     * http://xml.org/sax/features/namespace-prefixes feature names.
+     * This test case is to test this.
+     */
+    @Test
+    public void featureNSP01() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            assertTrue(xmlReader.getFeature(NAMESPACE_PREFIXES));
+
+        } catch (ParserConfigurationException | SAXException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * According to the SAX2 specs, All XMLReaders are required to recognize the
+     * http://xml.org/sax/features/namespace-prefixes feature names.
+     * This test case is to test this.
+     */
+    @Test
+    public void featureNSP02() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            assertFalse(xmlReader.getFeature(NAMESPACE_PREFIXES));
+        } catch (ParserConfigurationException | SAXException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Obtain http://xml.org/sax/features/namespaces-prefixes feature name after
+     * it's just set. Expect it's same as set value.
+     */
+    @Test
+    public void featureNSP03() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            xmlReader.setFeature(NAMESPACE_PREFIXES, true);
+            assertTrue(xmlReader.getFeature(NAMESPACE_PREFIXES));
+            xmlReader.setFeature(NAMESPACE_PREFIXES, false);
+            assertFalse(xmlReader.getFeature(NAMESPACE_PREFIXES));
+        } catch (ParserConfigurationException | SAXException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * getFeature returns true if a feature has not been preset when namespace
+     * awareness is set.
+     */
+    @Test
+    public void featureSI01() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            assertTrue(xmlReader.getFeature(STRING_INTERNING));
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * getFeature with validation feature name returns the value that
+     * setValidation set.
+     */
+    @Test
+    public void featureV01() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            assertFalse(spf.newSAXParser().getXMLReader().getFeature(VALIDATION));
+            spf.setValidating(true);
+            assertTrue(spf.newSAXParser().getXMLReader().getFeature(VALIDATION));
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * getFeature returns the value that a feature has been preset as  when
+     * namespace awareness is set.
+     */
+    @Test
+    public void featureV02() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+
+            xmlReader.setFeature(VALIDATION, true);
+            assertTrue(xmlReader.getFeature(VALIDATION));
+
+            xmlReader.setFeature(VALIDATION, false);
+            assertFalse(xmlReader.getFeature(VALIDATION));
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * getFeature returns true if a feature has not been preset when namespace
+     * awareness is set.
+     */
+    @Test
+    public void featureEGE01() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            assertTrue(xmlReader.getFeature(EXTERNAL_G_ENTITIES));
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * getFeature returns false if a feature has been preset as false  when
+     * namespace awareness is set.
+     */
+    @Test
+    public void featureEGE02() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            xmlReader.setFeature(EXTERNAL_G_ENTITIES, false);
+            assertFalse(xmlReader.getFeature(EXTERNAL_G_ENTITIES));
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * getFeature returns true if a feature has not been preset when namespace
+     * awareness is set.
+     */
+    @Test
+    public void featureEPE01() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            assertTrue(xmlReader.getFeature(EXTERNAL_P_ENTITIES));
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * getFeature returns false if a feature has been preset as false  when
+     * namespace awareness is set.
+     */
+    @Test
+    public void featureEPE02() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+            xmlReader.setFeature(EXTERNAL_P_ENTITIES, false);
+            assertFalse(xmlReader.getFeature(EXTERNAL_P_ENTITIES));
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * getFeature with a unknown feature name throws SAXNotRecognizedException.
+     * @throws SAXNotRecognizedException If the feature value can't be assigned
+     *                                   or retrieved.
+     */
+    @Test(expectedExceptions = SAXNotRecognizedException.class)
+    public void featureNE01() throws SAXNotRecognizedException  {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            boolean noMeaningFeature = xmlReader.getFeature("no-meaning-feature");
+        } catch(SAXNotRecognizedException ex) {
+            throw ex;
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * No exception expected when set entity resolver as simple entity resolver.
+     */
+    @Test
+    public void entity01() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            XMLFilterImpl xmlFilter = new XMLFilterImpl();
+            xmlReader.setEntityResolver(xmlFilter);
+            assertNotNull(xmlReader.getEntityResolver());
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * No NPE expected when set entity resolver as null.
+     */
+    @Test
+    public void entity02() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            xmlReader.setEntityResolver(null);
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * No exception expected when set DTD handler as simple DTD handler.
+     */
+    @Test
+    public void dtdhandler01() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            XMLFilterImpl xmlFilter = new XMLFilterImpl();
+            xmlReader.setDTDHandler(xmlFilter);
+            assertNotNull(xmlReader.getDTDHandler());
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * No NPE expected when set DTD handler as null.
+     */
+    @Test
+    public void dtdhandler02() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            xmlReader.setDTDHandler(null);
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * No exception expected when set content handler as simple content handler.
+     */
+    @Test
+    public void contenthandler01() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            XMLFilterImpl xmlFilter = new XMLFilterImpl();
+            xmlReader.setContentHandler(xmlFilter);
+            assertNotNull(xmlReader.getContentHandler());
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * No NPE expected when set content handler as null.
+     */
+    @Test
+    public void contenthandler02() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            xmlReader.setContentHandler(null);
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * No exception expected when set content handler as simple error handler.
+     */
+    @Test
+    public void errorhandler01() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            xmlReader.setErrorHandler(new XMLFilterImpl());
+            assertNotNull(xmlReader.getErrorHandler());
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * No NPE expected when set error handler as null.
+     */
+    @Test
+    public void errorhandler02() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            xmlReader.setErrorHandler(null);
+        } catch (SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Parse a null input source throw NPE.
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void parse01() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            xmlReader.parse((InputSource)null);
+        } catch (SAXException | ParserConfigurationException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Unit test for parse a error-formatted file. SAXException is expected.
+     * @throws org.xml.sax.SAXException parsing failed.
+     */
+    @Test(expectedExceptions = SAXException.class)
+    public void parse02() throws SAXException {
+        try (FileInputStream fis = new FileInputStream(XML_DIR + "invalid.xml")){
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            InputSource is = new InputSource(fis);
+            xmlReader.parse(is);
+        } catch (ParserConfigurationException | IOException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Unit test for parse a well-formatted file. No exception is expected.
+     */
+    @Test
+    public void parse03(){
+        try (FileInputStream fis = new FileInputStream(XML_DIR + "correct2.xml")) {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            spf.setNamespaceAware(true);
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            InputSource is = new InputSource(fis);
+            xmlReader.parse(is);
+        } catch (IOException | SAXException | ParserConfigurationException ex) {
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * Modified by IBM
+     * Xerces does not support this feature and it is not mandatory
+     * @throws org.xml.sax.SAXNotSupportedException
+     */
+    @Test(expectedExceptions = SAXNotSupportedException.class)
+    public void xrProperty01() throws SAXNotSupportedException  {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            xmlReader.getProperty(XML_STRING);
+        } catch(SAXNotSupportedException ex) {
+            throw ex;
+        } catch (SAXException | ParserConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * SAXNotSupportedException thrown if property name is known but no value
+     * assigned to this property.
+     * @throws org.xml.sax.SAXNotSupportedException when XMLReader recognizes
+     * the property name but cannot determine its value at this time.
+     */
+    @Test(expectedExceptions = SAXNotSupportedException.class)
+    public void xrProperty02() throws SAXNotSupportedException {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            assertNull(xmlReader.getProperty(DOM_NODE));
+        } catch (SAXNotSupportedException ex) {
+            throw ex;
+        } catch (SAXException | ParserConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+
+
+    /**
+     * XMLReader.getProperty returns null if LEXICAL_HANDLER wasn't set.
+     */
+    @Test
+    public void xrProperty03() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            assertNull(xmlReader.getProperty(LEXICAL_HANDLER));
+        } catch (SAXException | ParserConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XMLReader.getProperty returns null if DECL_HANDLER wasn't set.
+     */
+    @Test
+    public void xrProperty04() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            assertNull(xmlReader.getProperty(DECL_HANDLER));
+        } catch (SAXException | ParserConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XMLReader.setProperty/getProperty for LEXICAL_HANDLER unit test.
+     */
+    @Test
+    public void xrProperty05() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            MyLexicalHandler myLexicalHandler = new MyLexicalHandler();
+            xmlReader.setProperty(LEXICAL_HANDLER, myLexicalHandler);
+            assertNotNull(xmlReader.getProperty(LEXICAL_HANDLER));
+        } catch (SAXException | ParserConfigurationException ex){
+            failUnexpected(ex);
+        }
+    }
+
+    /**
+     * XMLReader.setProperty/getProperty for DECL_HANDLER unit test.
+     */
+    @Test
+    public void xrProperty06() {
+        try {
+            SAXParserFactory spf = SAXParserFactory.newInstance();
+            XMLReader xmlReader =  spf.newSAXParser().getXMLReader();
+            MyDeclHandler myDeclHandler = new MyDeclHandler();
+            xmlReader.setProperty(DECL_HANDLER, myDeclHandler);
+            assertNotNull(xmlReader.getProperty(DECL_HANDLER));
+        } catch (ParserConfigurationException | SAXException ex){
+            failUnexpected(ex);
+        }
+    }
+}
+
+/**
+ * Simple LexicalHandler that skips every lexical event.
+ */
+class MyLexicalHandler implements LexicalHandler {
+    /**
+     * Report an XML comment anywhere in the document.
+     *
+     * @param ch An array holding the characters in the comment.
+     * @param start The starting position in the array.
+     * @param length The number of characters to use from the array.
+     */
+    @Override
+    public void comment(char[] ch, int start, int length) {
+    }
+
+    /**
+     * Report the end of a CDATA section.
+     */
+    @Override
+    public void endCDATA() {
+    }
+
+    /**
+     * Report the end of DTD declarations.
+     */
+    @Override
+    public void endDTD() {
+    }
+
+    /**
+     * Report the end of an entity.
+     *
+     * @param name The name of the entity that is ending.
+     */
+    @Override
+    public void endEntity(String name) {
+    }
+
+    /**
+     * Report the start of a CDATA section.
+     */
+    @Override
+    public void startCDATA() {
+    }
+
+    /**
+     * Report the start of DTD declarations, if any.
+     *
+     * @param name The document type name.
+     * @param publicId The declared public identifier for the external DTD subset.
+     * @param systemId The declared system identifier for the external DTD subset.
+     */
+    @Override
+    public void startDTD(String name, String publicId, String systemId) {
+    }
+
+    /**
+     * Report the beginning of some internal and external XML entities.
+     *
+     * @param name The name of the entity.
+     */
+    @Override
+    public void startEntity(String name) {
+    }
+}
+
+/**
+ * Simple DeclHandler that skips every DTD declaration event.
+ */
+class MyDeclHandler implements DeclHandler {
+    /**
+     * Report an attribute type declaration.
+     * @param eName The name of the associated element.
+     * @param aName The name of the attribute.
+     * @param type A string representing the attribute type.
+     * @param mode A string representing the attribute defaulting mode
+     *        ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if
+     *        none of these applies.
+     * @param value A string representing the attribute's default value,
+     *        or null if there is none.
+     */
+    @Override
+    public void attributeDecl(String eName, String aName, String type,
+            String valueDefault, String value) {
+    }
+
+    /**
+     * Report an element type declaration.
+     * @param name The element type name.
+     * @param model The content model as a normalized string.
+     */
+    @Override
+    public void elementDecl(String name, String model) {
+    }
+
+    /**
+     * Report a parsed external entity declaration.
+     * @param name The name of the entity.  If it is a parameter
+     *        entity, the name will begin with '%'.
+     * @param publicId The entity's public identifier, or null if none
+     *        was given.
+     * @param systemId The entity's system identifier.
+     */
+    @Override
+    public void externalEntityDecl(String name, String publicId,
+            String systemId) {
+    }
+
+    /**
+     * Report an internal entity declaration.
+     * @param name The name of the entity.  If it is a parameter
+     *        entity, the name will begin with '%'.
+     * @param value The replacement text of the entity.
+     */
+    @Override
+    public void internalEntityDecl(String name, String value) {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/correct.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,23 @@
+<?xml version="1.0" standalone="yes"?>
+<document>
+	Publishers of the Music of New York Women Composers
+
+	<title>The Publishers </title>
+	
+	<publisher>
+	Alfred Publishing 
+	15535 Morrison
+	South Oaks CA 91403
+	</publisher>
+
+	<book price="$100" author = "Herold" number = "no_11"> 
+		eXtensible Markup Language 
+	</book>
+
+  	<bookurn xmlns='urn:loc.gov:books'
+        	   xmlns:isbn='urn:ISBN:0-395-36341-6'/> 
+	<xmlns:pages />
+
+	Publishers are not noted in report by time.
+
+</document>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/correct2.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,22 @@
+<?xml version="1.0" standalone="yes"?>
+<document>
+	Publishers of the Music of New York Women Composers
+
+	<title>The Publishers </title>
+	
+	<publisher>
+	Alfred Publishing 
+	15535 Morrison
+	South Oaks CA 91403
+	</publisher>
+
+	<book price="$100" author = "Herold" number = "no_11"> 
+		eXtensible Markup Language 
+	</book>
+
+  	<bookurn xmlns='urn:loc.gov:books'
+        	   xmlns:isbn='urn:ISBN:0-395-36341-6'/> 
+
+	Publishers are not noted in report by time.
+
+</document>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/family.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,14 @@
+<?xml version="1.0" standalone="yes" ?>
+<!DOCTYPE document [
+    <!ELEMENT document (person*)>
+    <!ELEMENT person (#PCDATA)>
+    <!ATTLIST person pnumber ID #REQUIRED>
+    <!ATTLIST person father IDREF #IMPLIED>
+    <!ATTLIST person mother IDREF #IMPLIED>
+]>
+<document>
+    <person pnumber="a1">Susan</person>
+    <person pnumber="a2">Jack</person>
+    <person pnumber="a3" mother="a1" father="a2">Chelsea</person>
+    <person pnumber="a4" mother="a1" father="a2">David</person>
+</document>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/firstdtd.dtd	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,13 @@
+<!ELEMENT document ANY>
+<!ELEMENT title (#PCDATA)>
+<!ELEMENT publisher (#PCDATA)>
+<!ELEMENT book (#PCDATA)>
+<!ELEMENT bookurn (#PCDATA)>
+<!ELEMENT xmlns:pages (#PCDATA)>
+<!ATTLIST book price CDATA "$100">
+<!ATTLIST book author CDATA "Herold">
+<!ATTLIST book number ID #REQUIRED>
+<!ATTLIST bookurn xmlns CDATA "10">
+<!ATTLIST bookurn xmlns:isbn CDATA "10">
+<!ENTITY mkm "I am Krishna">
+<!ENTITY km "I am KrishnaMohan">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/invalid.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,24 @@
+<?xml version="1.0" standalone="yes"?>
+<document>
+	Publishers of the Music of New York Women Composers
+
+	<title>The Publishers </title>
+	
+	<publisher>
+	Alfred Publishing 
+	&mkm; 
+	15535 Morrison
+	South Oaks CA 91403
+	</publisher>
+
+	<book price="$100" author = "Herold" number = "no_11"> 
+		eXtensible Markup Language 
+	</book>
+
+  	<bookurn xmlns='urn:loc.gov:books'
+        	   xmlns:isbn='urn:ISBN:0-395-36341-6'/> 
+	<xmlns:pages />
+
+	Publishers are not noted in report by time.
+
+</document>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/namespace1.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<html xmlns="http://www.w3.org/TR/REC-html40"
+      xmlns:b="urn:BooksAreUs.org:BookInfo">
+  <head>
+    <title>Typography</title>
+  </head>
+
+  <body>
+    <p> Welcome to the world of typography! Here is a book that you may find useful.</p>
+    <b:title style="font-family: sans-serif;">Digital Typography</b:title>
+    <b:author>Donald Knuth</b:author>
+    <?netscape http://www.hotmail.com?>
+  </body>
+
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/ns4.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,8 @@
+<section><title>Book-Signing Event</title>
+  <signing>
+    <author title="Mr" name="Vikram Seth" />
+    <book title="A Suitable Boy" price="$22.95" /></signing>
+  <signing>
+    <author title="Dr" name="Oliver Sacks" />
+    <book title="The Island of the Color-Blind" price="$12.95" /></signing>
+  </section>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/out/AttributesGF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,135 @@
+uri <> localName <document> qName <document>
+length: 0
+
+uri <> localName <person> qName <person>
+length: 1
+For index = 0
+getLocalName <pnumber>
+getQName <pnumber>
+getType <ID>
+getURI <>
+getValue <a1>
+
+Using localName, qname and uri pertaining to index = 0
+getIndex(qName) <0>
+getIndex(uri, localName) <0>
+getType(qName) <ID>
+getType(uri, localName) <ID>
+getValue(qName) <a1>
+getValue(uri, localName) <a1>
+
+
+uri <> localName <person> qName <person>
+length: 1
+For index = 0
+getLocalName <pnumber>
+getQName <pnumber>
+getType <ID>
+getURI <>
+getValue <a2>
+
+Using localName, qname and uri pertaining to index = 0
+getIndex(qName) <0>
+getIndex(uri, localName) <0>
+getType(qName) <ID>
+getType(uri, localName) <ID>
+getValue(qName) <a2>
+getValue(uri, localName) <a2>
+
+
+uri <> localName <person> qName <person>
+length: 3
+For index = 0
+getLocalName <pnumber>
+getQName <pnumber>
+getType <ID>
+getURI <>
+getValue <a3>
+
+Using localName, qname and uri pertaining to index = 0
+getIndex(qName) <0>
+getIndex(uri, localName) <0>
+getType(qName) <ID>
+getType(uri, localName) <ID>
+getValue(qName) <a3>
+getValue(uri, localName) <a3>
+
+For index = 1
+getLocalName <mother>
+getQName <mother>
+getType <IDREF>
+getURI <>
+getValue <a1>
+
+Using localName, qname and uri pertaining to index = 1
+getIndex(qName) <1>
+getIndex(uri, localName) <1>
+getType(qName) <IDREF>
+getType(uri, localName) <IDREF>
+getValue(qName) <a1>
+getValue(uri, localName) <a1>
+
+For index = 2
+getLocalName <father>
+getQName <father>
+getType <IDREF>
+getURI <>
+getValue <a2>
+
+Using localName, qname and uri pertaining to index = 2
+getIndex(qName) <2>
+getIndex(uri, localName) <2>
+getType(qName) <IDREF>
+getType(uri, localName) <IDREF>
+getValue(qName) <a2>
+getValue(uri, localName) <a2>
+
+
+uri <> localName <person> qName <person>
+length: 3
+For index = 0
+getLocalName <pnumber>
+getQName <pnumber>
+getType <ID>
+getURI <>
+getValue <a4>
+
+Using localName, qname and uri pertaining to index = 0
+getIndex(qName) <0>
+getIndex(uri, localName) <0>
+getType(qName) <ID>
+getType(uri, localName) <ID>
+getValue(qName) <a4>
+getValue(uri, localName) <a4>
+
+For index = 1
+getLocalName <mother>
+getQName <mother>
+getType <IDREF>
+getURI <>
+getValue <a1>
+
+Using localName, qname and uri pertaining to index = 1
+getIndex(qName) <1>
+getIndex(uri, localName) <1>
+getType(qName) <IDREF>
+getType(uri, localName) <IDREF>
+getValue(qName) <a1>
+getValue(uri, localName) <a1>
+
+For index = 2
+getLocalName <father>
+getQName <father>
+getType <IDREF>
+getURI <>
+getValue <a2>
+
+Using localName, qname and uri pertaining to index = 2
+getIndex(qName) <2>
+getIndex(uri, localName) <2>
+getType(qName) <IDREF>
+getType(uri, localName) <IDREF>
+getValue(qName) <a2>
+getValue(uri, localName) <a2>
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/out/AttributesNSGF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,36 @@
+uri <http://www.w3.org/TR/REC-html40> localName <html> qName <html>
+length: 0
+
+uri <http://www.w3.org/TR/REC-html40> localName <head> qName <head>
+length: 0
+
+uri <http://www.w3.org/TR/REC-html40> localName <title> qName <title>
+length: 0
+
+uri <http://www.w3.org/TR/REC-html40> localName <body> qName <body>
+length: 0
+
+uri <http://www.w3.org/TR/REC-html40> localName <p> qName <p>
+length: 0
+
+uri <urn:BooksAreUs.org:BookInfo> localName <title> qName <b:title>
+length: 1
+For index = 0
+getLocalName <style>
+getQName <style>
+getType <CDATA>
+getURI <>
+getValue <font-family: sans-serif;>
+
+Using localName, qname and uri pertaining to index = 0
+getIndex(qName) <0>
+getIndex(uri, localName) <0>
+getType(qName) <CDATA>
+getType(uri, localName) <CDATA>
+getValue(qName) <font-family: sans-serif;>
+getValue(uri, localName) <font-family: sans-serif;>
+
+
+uri <urn:BooksAreUs.org:BookInfo> localName <author> qName <b:author>
+length: 0
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/out/ContentGF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,80 @@
+setDocumentLocator...
+startDocument...
+startPrefixMapping...
+prefix:  uri: http://www.w3.org/TR/REC-html40
+startPrefixMapping...
+prefix: b uri: urn:BooksAreUs.org:BookInfo
+startElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: html qName: html Number of Attributes: 0 Line# 3
+characters...
+
+  
+startElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: head qName: head Number of Attributes: 0 Line# 4
+characters...
+
+    
+startElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: title qName: title Number of Attributes: 0 Line# 5
+characters...
+Typography
+endElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: title qName: title
+characters...
+
+  
+endElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: head qName: head
+characters...
+
+
+  
+startElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: body qName: body Number of Attributes: 0 Line# 8
+characters...
+
+    
+startElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: p qName: p Number of Attributes: 0 Line# 9
+characters...
+ Welcome to the world of typography! Here is a book that you may find useful.
+endElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: p qName: p
+characters...
+
+    
+startElement...
+namespaceURI: urn:BooksAreUs.org:BookInfo localName: title qName: b:title Number of Attributes: 1 Line# 10
+characters...
+Digital Typography
+endElement...
+namespaceURI: urn:BooksAreUs.org:BookInfo localName: title qName: b:title
+characters...
+
+    
+startElement...
+namespaceURI: urn:BooksAreUs.org:BookInfo localName: author qName: b:author Number of Attributes: 0 Line# 11
+characters...
+Donald Knuth
+endElement...
+namespaceURI: urn:BooksAreUs.org:BookInfo localName: author qName: b:author
+characters...
+
+    
+processingInstruction...target:netscape data: http://www.hotmail.com
+characters...
+
+  
+endElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: body qName: body
+characters...
+
+
+
+endElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: html qName: html
+endPrefixMapping...
+prefix: 
+endPrefixMapping...
+prefix: b
+endDocument...
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/out/DTDHandlerGF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,2 @@
+In unparsedEntityDecl... name:logo publicId:null systemId:http://sc11152338.us.oracle.com:8080/xmlsqe/jaxp/web/testfiles/JAXPREP/images/tool.gif notationName:gif
+In notationDecl... name:gif publicId:null systemId:http://sardinia/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/out/DefaultHandlerGF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,78 @@
+setDocumentLocator...
+startDocument...
+startPrefixMapping...
+prefix:  uri: http://www.w3.org/TR/REC-html40
+startPrefixMapping...
+prefix: b uri: urn:BooksAreUs.org:BookInfo
+startElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: html qName: html Number of Attributes: 0
+characters...
+
+  
+startElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: head qName: head Number of Attributes: 0
+characters...
+
+    
+startElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: title qName: title Number of Attributes: 0
+characters...
+Typography
+endElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: title qName: title
+characters...
+
+  
+endElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: head qName: head
+characters...
+
+
+  
+startElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: body qName: body Number of Attributes: 0
+characters...
+
+    
+startElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: p qName: p Number of Attributes: 0
+characters...
+ Welcome to the world of typography! Here is a book that you may find useful.
+endElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: p qName: p
+characters...
+
+    
+startElement...
+namespaceURI: urn:BooksAreUs.org:BookInfo localName: title qName: b:title Number of Attributes: 1
+characters...
+Digital Typography
+endElement...
+namespaceURI: urn:BooksAreUs.org:BookInfo localName: title qName: b:title
+characters...
+
+    
+startElement...
+namespaceURI: urn:BooksAreUs.org:BookInfo localName: author qName: b:author Number of Attributes: 0
+characters...
+Donald Knuth
+endElement...
+namespaceURI: urn:BooksAreUs.org:BookInfo localName: author qName: b:author
+characters...
+
+    
+processingInstruction...target:netscape data: http://www.hotmail.com
+characters...
+
+  
+endElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: body qName: body
+characters...
+
+
+
+endElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: html qName: html
+endPrefixmapping ..
+endPrefixmapping ..b
+endDocument...
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/out/EHFatalGF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,2 @@
+In fatalError..
+SAXParseException: The entity "mkm" was referenced, but not declared.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/out/EntityResolverGF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,2 @@
+In resolveEntity.. -//mkrishna mohan//DTD//music pub//EN/ http://sc11152338.us.oracle.com:8080/xmlsqe/jaxp/web/testfiles/JAXPREP/publishers.dtd
+In resolveEntity.. null http://sc11152338.us.oracle.com:8080/xmlsqe/jaxp/web/testfiles/JAXPREP/familytree.dtd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/out/NSTableFTGF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,130 @@
+setDocumentLocator...
+startDocument...
+startPrefixMapping...
+prefix: <xml> uri: <http://www.w3.org/XML/1998/namespace>
+startPrefixMapping...
+prefix: <xmlns> uri: <http://www.w3.org/2000/xmlns/>
+startElement...
+namespaceURI: <> localName: <> qName: <html> Number of Attributes: <2> Line# <3>
+characters...length is:3
+<
+  >
+startPrefixMapping...
+prefix: <xml> uri: <http://www.w3.org/XML/1998/namespace>
+startPrefixMapping...
+prefix: <xmlns> uri: <http://www.w3.org/2000/xmlns/>
+startElement...
+namespaceURI: <> localName: <> qName: <head> Number of Attributes: <0> Line# <4>
+characters...length is:5
+<
+    >
+startPrefixMapping...
+prefix: <xml> uri: <http://www.w3.org/XML/1998/namespace>
+startPrefixMapping...
+prefix: <xmlns> uri: <http://www.w3.org/2000/xmlns/>
+startElement...
+namespaceURI: <> localName: <> qName: <title> Number of Attributes: <0> Line# <5>
+characters...length is:10
+<Typography>
+endElement...
+namespaceURI: <> localName: <> qName: <title>
+endPrefixMapping...
+prefix: <xml>
+endPrefixMapping...
+prefix: <xmlns>
+characters...length is:3
+<
+  >
+endElement...
+namespaceURI: <> localName: <> qName: <head>
+endPrefixMapping...
+prefix: <xml>
+endPrefixMapping...
+prefix: <xmlns>
+characters...length is:4
+<
+
+  >
+startPrefixMapping...
+prefix: <xml> uri: <http://www.w3.org/XML/1998/namespace>
+startPrefixMapping...
+prefix: <xmlns> uri: <http://www.w3.org/2000/xmlns/>
+startElement...
+namespaceURI: <> localName: <> qName: <body> Number of Attributes: <0> Line# <8>
+characters...length is:5
+<
+    >
+startPrefixMapping...
+prefix: <xml> uri: <http://www.w3.org/XML/1998/namespace>
+startPrefixMapping...
+prefix: <xmlns> uri: <http://www.w3.org/2000/xmlns/>
+startElement...
+namespaceURI: <> localName: <> qName: <p> Number of Attributes: <0> Line# <9>
+characters...length is:77
+< Welcome to the world of typography! Here is a book that you may find useful.>
+endElement...
+namespaceURI: <> localName: <> qName: <p>
+endPrefixMapping...
+prefix: <xml>
+endPrefixMapping...
+prefix: <xmlns>
+characters...length is:5
+<
+    >
+startPrefixMapping...
+prefix: <xml> uri: <http://www.w3.org/XML/1998/namespace>
+startPrefixMapping...
+prefix: <xmlns> uri: <http://www.w3.org/2000/xmlns/>
+startElement...
+namespaceURI: <> localName: <> qName: <b:title> Number of Attributes: <1> Line# <10>
+characters...length is:18
+<Digital Typography>
+endElement...
+namespaceURI: <> localName: <> qName: <b:title>
+endPrefixMapping...
+prefix: <xml>
+endPrefixMapping...
+prefix: <xmlns>
+characters...length is:1
+< >
+characters...length is:5
+<
+    >
+startPrefixMapping...
+prefix: <xml> uri: <http://www.w3.org/XML/1998/namespace>
+startPrefixMapping...
+prefix: <xmlns> uri: <http://www.w3.org/2000/xmlns/>
+startElement...
+namespaceURI: <> localName: <> qName: <b:author> Number of Attributes: <0> Line# <11>
+characters...length is:12
+<Donald Knuth>
+endElement...
+namespaceURI: <> localName: <> qName: <b:author>
+endPrefixMapping...
+prefix: <xml>
+endPrefixMapping...
+prefix: <xmlns>
+characters...length is:5
+<
+    >
+processingInstruction...target:<netscape> data: <http://www.hotmail.com>
+characters...length is:3
+<
+  >
+endElement...
+namespaceURI: <> localName: <> qName: <body>
+endPrefixMapping...
+prefix: <xml>
+endPrefixMapping...
+prefix: <xmlns>
+characters...length is:2
+<
+
+>
+endElement...
+namespaceURI: <> localName: <> qName: <html>
+endPrefixMapping...
+prefix: <xml>
+endPrefixMapping...
+prefix: <xmlns>
+endDocument...
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/out/NSTableTFGF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,80 @@
+setDocumentLocator...
+startDocument...
+startPrefixMapping...
+prefix: <> uri: <http://www.w3.org/TR/REC-html40>
+startPrefixMapping...
+prefix: <b> uri: <urn:BooksAreUs.org:BookInfo>
+startElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <html> qName: <html> Number of Attributes: <0> Line# <3>
+characters...length is:3
+<
+  >
+startElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <head> qName: <head> Number of Attributes: <0> Line# <4>
+characters...length is:5
+<
+    >
+startElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <title> qName: <title> Number of Attributes: <0> Line# <5>
+characters...length is:10
+<Typography>
+endElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <title> qName: <title>
+characters...length is:3
+<
+  >
+endElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <head> qName: <head>
+characters...length is:4
+<
+
+  >
+startElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <body> qName: <body> Number of Attributes: <0> Line# <8>
+characters...length is:5
+<
+    >
+startElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <p> qName: <p> Number of Attributes: <0> Line# <9>
+characters...length is:77
+< Welcome to the world of typography! Here is a book that you may find useful.>
+endElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <p> qName: <p>
+characters...length is:5
+<
+    >
+startElement...
+namespaceURI: <urn:BooksAreUs.org:BookInfo> localName: <title> qName: <b:title> Number of Attributes: <1> Line# <10>
+characters...length is:18
+<Digital Typography>
+endElement...
+namespaceURI: <urn:BooksAreUs.org:BookInfo> localName: <title> qName: <b:title>
+characters...length is:5
+<
+    >
+startElement...
+namespaceURI: <urn:BooksAreUs.org:BookInfo> localName: <author> qName: <b:author> Number of Attributes: <0> Line# <11>
+characters...length is:12
+<Donald Knuth>
+endElement...
+namespaceURI: <urn:BooksAreUs.org:BookInfo> localName: <author> qName: <b:author>
+characters...length is:5
+<
+    >
+processingInstruction...target:<netscape> data: <http://www.hotmail.com>
+characters...length is:3
+<
+  >
+endElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <body> qName: <body>
+characters...length is:2
+<
+
+>
+endElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <html> qName: <html>
+endPrefixMapping...
+prefix: <>
+endPrefixMapping...
+prefix: <b>
+endDocument...
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/out/NSTableTTGF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,80 @@
+setDocumentLocator...
+startDocument...
+startPrefixMapping...
+prefix: <> uri: <http://www.w3.org/TR/REC-html40>
+startPrefixMapping...
+prefix: <b> uri: <urn:BooksAreUs.org:BookInfo>
+startElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <html> qName: <html> Number of Attributes: <2> Line# <3>
+characters...length is:3
+<
+  >
+startElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <head> qName: <head> Number of Attributes: <0> Line# <4>
+characters...length is:5
+<
+    >
+startElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <title> qName: <title> Number of Attributes: <0> Line# <5>
+characters...length is:10
+<Typography>
+endElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <title> qName: <title>
+characters...length is:3
+<
+  >
+endElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <head> qName: <head>
+characters...length is:4
+<
+
+  >
+startElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <body> qName: <body> Number of Attributes: <0> Line# <8>
+characters...length is:5
+<
+    >
+startElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <p> qName: <p> Number of Attributes: <0> Line# <9>
+characters...length is:77
+< Welcome to the world of typography! Here is a book that you may find useful.>
+endElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <p> qName: <p>
+characters...length is:5
+<
+    >
+startElement...
+namespaceURI: <urn:BooksAreUs.org:BookInfo> localName: <title> qName: <b:title> Number of Attributes: <1> Line# <10>
+characters...length is:18
+<Digital Typography>
+endElement...
+namespaceURI: <urn:BooksAreUs.org:BookInfo> localName: <title> qName: <b:title>
+characters...length is:5
+<
+    >
+startElement...
+namespaceURI: <urn:BooksAreUs.org:BookInfo> localName: <author> qName: <b:author> Number of Attributes: <0> Line# <11>
+characters...length is:12
+<Donald Knuth>
+endElement...
+namespaceURI: <urn:BooksAreUs.org:BookInfo> localName: <author> qName: <b:author>
+characters...length is:5
+<
+    >
+processingInstruction...target:<netscape> data: <http://www.hotmail.com>
+characters...length is:3
+<
+  >
+endElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <body> qName: <body>
+characters...length is:2
+<
+
+>
+endElement...
+namespaceURI: <http://www.w3.org/TR/REC-html40> localName: <html> qName: <html>
+endPrefixMapping...
+prefix: <>
+endPrefixMapping...
+prefix: <b>
+endDocument...
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/out/XMLFilterGF.out	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,78 @@
+setDocumentLocator...
+startDocument...
+startPrefixMapping...
+prefix:  uri: http://www.w3.org/TR/REC-html40
+startPrefixMapping...
+prefix: b uri: urn:BooksAreUs.org:BookInfo
+startElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: html qName: html Number of Attributes: 0
+characters...
+
+  
+startElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: head qName: head Number of Attributes: 0
+characters...
+
+    
+startElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: title qName: title Number of Attributes: 0
+characters...
+Typography
+endElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: title qName: title
+characters...
+
+  
+endElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: head qName: head
+characters...
+
+
+  
+startElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: body qName: body Number of Attributes: 0
+characters...
+
+    
+startElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: p qName: p Number of Attributes: 0
+characters...
+ Welcome to the world of typography! Here is a book that you may find useful.
+endElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: p qName: p
+characters...
+
+    
+startElement...
+namespaceURI: urn:BooksAreUs.org:BookInfo localName: title qName: b:title Number of Attributes: 1
+characters...
+Digital Typography
+endElement...
+namespaceURI: urn:BooksAreUs.org:BookInfo localName: title qName: b:title
+characters...
+
+    
+startElement...
+namespaceURI: urn:BooksAreUs.org:BookInfo localName: author qName: b:author Number of Attributes: 0
+characters...
+Donald Knuth
+endElement...
+namespaceURI: urn:BooksAreUs.org:BookInfo localName: author qName: b:author
+characters...
+
+    
+processingInstruction...target:netscape data: http://www.hotmail.com
+characters...
+
+  
+endElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: body qName: body
+characters...
+
+
+
+endElement...
+namespaceURI: http://www.w3.org/TR/REC-html40 localName: html qName: html
+endPrefixmapping ..
+endPrefixmapping ..b
+endDocument...
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/parsertest.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,25 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE document SYSTEM "firstdtd.dtd">
+<document>
+	Publishers of the Music of New York Women Composers
+
+	<title>The Publishers </title>
+	
+	<publisher>
+	Alfred Publishing 
+	&mkm; 
+	15535 Morrison
+	South Oaks CA 91403
+	</publisher>
+
+	<book price="$100" author = "Herold" number = "no_11"> 
+		eXtensible Markup Language 
+	</book>
+
+  	<bookurn xmlns='urn:loc.gov:books'
+        	   xmlns:isbn='urn:ISBN:0-395-36341-6'/> 
+	<xmlns:pages />
+
+	Publishers are not noted in report by time.
+
+</document>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/publish.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE document PUBLIC "-//mkrishna mohan//DTD//music pub//EN/"
+		"http://sc11152338.us.oracle.com:8080/xmlsqe/jaxp/web/testfiles/JAXPREP/publishers.dtd">
+<document>
+	Publishers of the Music of New York Women Composers
+	<title>The Publishers </title>
+	<publisher>
+		<name>ACA</name>
+		<email>info@composers.com </email>
+		<homepage>http://www.composers.com/</homepage>
+		<address>170 West 74th St. NY NY 10023</address>
+		<voice>212-362-8900</voice>
+		<fax>212-874-8605</fax>
+		<dtdname>&familytree;</dtdname>
+	</publisher>
+</document>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/functional/org/xml/sax/xmlfiles/valid.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,24 @@
+<?xml version="1.0" standalone="yes"?>
+<document>
+	Publishers of the Music of New York Women Composers
+
+	<title>The Publishers </title>
+	
+	<publisher>
+	Alfred Publishing 
+	&mkm; 
+	15535 Morrison
+	South Oaks CA 91403
+	</publisher>
+
+	<book price="$100" author = "Herold" number = "no_11"> 
+		eXtensible Markup Language 
+	</book>
+
+  	<bookurn xmlns='urn:loc.gov:books'
+        	   xmlns:isbn='urn:ISBN:0-395-36341-6'/> 
+	<xmlns:pages />
+
+	Publishers are not noted in report by time.
+
+</document>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/libs/javax/xml/transform/ptests/MyContentHandler.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,220 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform.ptests;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.Locator;
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * A customized ContentHandler. It writes whole XML file with extra tag on every
+ * XML elements.
+ */
+public class MyContentHandler implements ContentHandler {
+    /**
+     * FileWrite to write content to.
+     */
+    private final BufferedWriter bWriter;
+
+    /**
+     * Create FileWiter for the processing.
+     * @param fileName Output file name.
+     * @throws org.xml.sax.SAXException
+     */
+    public MyContentHandler(String fileName) throws SAXException {
+        try {
+            bWriter = new BufferedWriter(new FileWriter(fileName));
+        } catch (IOException ex) {
+            throw new SAXException("Open file error", ex);
+        }
+    }
+
+    /**
+     * Do nothing when set document locator.
+     */
+    @Override
+    public void setDocumentLocator (Locator locator) {
+    }
+
+    /**
+     * Open the output file when start to process the document. Write a
+     * startDocument tag to output File if opening file successfully.
+     * @throws SAXException if file writing failed.
+     */
+    @Override
+    public void startDocument () throws SAXException {
+        //Bug # 4448884 filed. setDocumentLocator method should be called
+        //first. The bug won't be fixed. So startDocument is the next method
+        println("startDocument");
+    }
+
+    /**
+     * Write a startDocument tag to output File after processing whole document.
+     * Follow with closing the output file.
+     * @throws SAXException if file writing failed.
+     */
+    @Override
+    public void endDocument() throws SAXException {
+        println("endDocument");
+
+        try {
+            bWriter.flush();
+            bWriter.close();
+        } catch (IOException ex) {
+            throw new SAXException("Close file error", ex);
+        }
+    }
+
+    /**
+     * Write a startPrefixMapping appending with prefix and URI to output File
+     * before entering the scope of a prefix-URI mapping.
+     * @param prefix the Namespace prefix being declared.
+     * @param uri the Namespace URI the prefix is mapped to.
+     * @throws SAXException if file writing failed.
+     */
+    @Override
+    public void startPrefixMapping (String prefix, String uri)
+                throws SAXException {
+        println("startPrefixMapping: " + prefix + ", " + uri);
+    }
+
+    /**
+     * Write a endPrefixMapping appending with prefix to output File after a
+     * prefix-URI mapping.
+     * @param prefix the Namespace prefix being declared.
+     * @throws SAXException if file writing failed.
+     */
+    @Override
+    public void endPrefixMapping (String prefix) throws SAXException {
+        println("endPrefixMapping: " + prefix);
+    }
+
+    /**
+     * Write a startElement appending with namespaceURI,localName,qName and
+     * iteration on attributes to output File when start processing element.
+     * @param namespaceURI the Namespace URI.
+     * @param localName the local name (without prefix).
+     * @param qName the qualified name (with prefix).
+     * @param atts the attributes attached to the element.
+     * @throws SAXException if file writing failed.
+     */
+    @Override
+    public void startElement (String namespaceURI, String localName,
+                                String qName, Attributes atts)
+                        throws SAXException {
+        String str = "startElement: " + namespaceURI + ", " + namespaceURI +
+                         ", " + qName;
+        int n = atts.getLength();
+        for(int i = 0; i < n; i++) {
+            str = str + ", " + atts.getQName(i);
+        }
+
+        println(str);
+    }
+
+    /**
+     * Write a startElement appending with namespaceURI,qName and to output File
+     * after processing element finished.
+     * @param namespaceURI the Namespace URI.
+     * @param localName the local name (without prefix).
+     * @param qName the qualified name (with prefix).
+     * @throws SAXException if file writing failed.
+     */
+    @Override
+    public void endElement (String namespaceURI, String localName,
+                                String qName) throws SAXException {
+        println("endElement: " + namespaceURI + ", " + namespaceURI + ", " + qName);
+    }
+
+
+    /**
+     * Write characters tag to file when receive character data.
+     * @param ch the characters from the XML document
+     * @param start the start position in the array
+     * @param length the number of characters to read from the array
+     * @throws SAXException if file writing failed.
+     */
+    @Override
+    public void characters (char ch[], int start, int length)
+                        throws SAXException {
+        println("characters");
+    }
+
+    /**
+     * Write ignorableWhitespace tag to file when receive notification of
+     * ignorable whitespace in element content.
+     * @param ch an array holds all ignorable whitespace.
+     * @param start start position of ignorable whitespace.
+     * @param length length of ignorable whitespace.
+     * @throws SAXException if file writing failed.
+     */
+    @Override
+    public void ignorableWhitespace (char ch[], int start, int length)
+                throws SAXException {
+        println("ignorableWhitespace");
+    }
+
+    /**
+     * Write processingInstruction tag when receive notification of a processing
+     * instruction.
+     * @param target the processing instruction target
+     * @param data the processing instruction data, or null if none was
+     *             supplied.  The data does not include any whitespace
+     *             separating it from the target.
+     * @throws SAXException if file writing failed.
+     */
+    @Override
+    public void processingInstruction (String target, String data)
+                throws SAXException {
+        println("processingInstruction: " + target + ", " + target);
+    }
+
+    /**
+     * Write the entity name to file when receive notification of a skipped entity.
+     * @param name entity name that skipped
+     * @throws SAXException if file writing failed.
+     */
+    @Override
+    public void skippedEntity (String name) throws SAXException {
+        println("skippedEntity: " + name);
+    }
+
+    /**
+     * Print a string output to file along with a new line.
+     * @param output string needed to be written to file.
+     * @throws SAXException if file writing failed.
+     */
+    private void println(String output) throws SAXException  {
+        try {
+            bWriter.write(output, 0, output.length());
+            bWriter.newLine();
+        } catch (IOException ex) {
+            throw new SAXException("bWriter error", ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/libs/javax/xml/transform/ptests/TransformerTestConst.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.transform.ptests;
+
+import static jaxp.library.JAXPTestUtilities.FILE_SEP;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+
+/**
+ * This is the Base test class provide basic support for JAXP functional test
+ */
+public class TransformerTestConst {
+    /**
+     * Current test directory.
+     */
+    public static final String CLASS_DIR
+            = System.getProperty("test.classes", ".") + FILE_SEP;
+
+    /**
+     * Package name that separates by slash.
+     */
+    public static final String PACKAGE_NAME = FILE_SEP +
+            TransformerTestConst.class.getPackage().getName().replaceAll("[.]", FILE_SEP);
+
+    /**
+     * Test base directory. Every package has its own test package directory.
+     */
+    public static final String BASE_DIR
+            = System.getProperty("test.src", USER_DIR).replaceAll("\\" + System.getProperty("file.separator"), "/")
+                + PACKAGE_NAME + FILE_SEP + "..";
+
+    /**
+     * Source XML file directory.
+     */
+    public static final String XML_DIR = BASE_DIR + FILE_SEP + "xmlfiles" + FILE_SEP;
+
+    /**
+     * Golden output file directory. We pre-define all expected output in golden
+     * output file. Test verifies whether the standard output is same as content
+     * of golden file.
+     */
+    public static final String GOLDEN_DIR = XML_DIR + FILE_SEP + "out" + FILE_SEP;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/libs/javax/xml/xpath/ptests/XPathTestConst.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.xpath.ptests;
+
+import static jaxp.library.JAXPTestUtilities.FILE_SEP;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+
+/**
+ * This is the Base test class provide basic support for XPath functional test
+ */
+public class XPathTestConst {
+    /**
+     * Package name that separates by slash.
+     */
+    public static final String PACKAGE_NAME = FILE_SEP +
+            XPathTestConst.class.getPackage().getName().replaceAll("[.]", FILE_SEP);
+
+    /**
+     * Test base directory. Every package has its own test package directory.
+     */
+    public static final String BASE_DIR
+            = System.getProperty("test.src", USER_DIR).replaceAll("\\" + System.getProperty("file.separator"), "/")
+                + PACKAGE_NAME + FILE_SEP + "..";
+
+    /**
+     * Source XML file directory.
+     */
+    public static final String XML_DIR = BASE_DIR + FILE_SEP + "xmlfiles" + FILE_SEP;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/libs/jaxp/library/JAXPTestUtilities.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jaxp.library;
+
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import static org.testng.Assert.fail;
+
+/**
+ * This is an interface provide basic support for JAXP functional test.
+ */
+public class JAXPTestUtilities {
+    /**
+     * Prefix for error message.
+     */
+    public static final String ERROR_MSG_HEADER = "Unexcepted exception thrown:";
+
+    /**
+     * Prefix for error message on clean up block.
+     */
+    public static final String ERROR_MSG_CLEANUP = "Clean up failed on %s";
+
+    /**
+     * Force using slash as File separator as we always use cygwin to test in
+     * Windows platform.
+     */
+    public static final String FILE_SEP = "/";
+
+    /**
+     * User home.
+     */
+    public static final String USER_DIR = System.getProperty("user.dir", ".");
+
+    /**
+     * TEMP file directory.
+     */
+    public static final String TEMP_DIR = System.getProperty("java.io.tmpdir", ".");
+
+    /**
+     * Compare contents of golden file with test output file line by line.
+     * return true if they're identical.
+     * @param goldfile Golden output file name
+     * @param outputfile Test output file name
+     * @return true if two files are identical.
+     *         false if two files are not identical.
+     * @throws IOException if an I/O error occurs reading from the file or a
+     *         malformed or unmappable byte sequence is read
+     */
+    public static boolean compareWithGold(String goldfile, String outputfile)
+            throws IOException {
+        return Files.readAllLines(Paths.get(goldfile)).
+                equals(Files.readAllLines(Paths.get(outputfile)));
+    }
+
+    /**
+     * Prints error message if an exception is thrown
+     * @param ex The exception is thrown by test.
+     */
+    public static void failUnexpected(Throwable ex) {
+        fail(ERROR_MSG_HEADER, ex);
+    }
+
+    /**
+     * Prints error message if an exception is thrown when clean up a file.
+     * @param ex The exception is thrown in cleaning up a file.
+     * @param name Cleaning up file name.
+     */
+    public static void failCleanup(IOException ex, String name) {
+        fail(String.format(ERROR_MSG_CLEANUP, name), ex);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/libs/org/xml/sax/ptests/SAXTestConst.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.xml.sax.ptests;
+
+import static jaxp.library.JAXPTestUtilities.FILE_SEP;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+
+/**
+ * This is the Base test class provide basic support for JAXP SAX functional
+ * test. These are JAXP SAX functional related properties that every test suite
+ * has their own TestBase class.
+ */
+public class SAXTestConst {
+    /**
+     * Current test directory.
+     */
+    public static final String CLASS_DIR
+            = System.getProperty("test.classes", ".") + FILE_SEP;
+
+    /**
+     * Package name that separates by slash.
+     */
+    public static final String PACKAGE_NAME = FILE_SEP +
+            SAXTestConst.class.getPackage().getName().replaceAll("[.]", FILE_SEP);
+
+    /**
+     * Test base directory. Every package has its own test package directory.
+     */
+    public static final String BASE_DIR
+            = System.getProperty("test.src", USER_DIR).replaceAll("\\" + System.getProperty("file.separator"), "/")
+                + PACKAGE_NAME + FILE_SEP + "..";
+
+    /**
+     * Source XML file directory.
+     */
+    public static final String XML_DIR = BASE_DIR + FILE_SEP + "xmlfiles" + FILE_SEP;
+
+    /**
+     * Golden output file directory. We pre-define all expected output in golden
+     * output file. Test verifies whether the standard output is same as content
+     * of golden file.
+     */
+    public static final String GOLDEN_DIR = XML_DIR + FILE_SEP + "out" + FILE_SEP;
+}
--- a/jaxws/.hgtags	Wed Jul 05 20:04:47 2017 +0200
+++ b/jaxws/.hgtags	Wed Jul 05 20:05:30 2017 +0200
@@ -281,3 +281,4 @@
 77a45995dd3b6e57805475ae3111ac6f7db7749e jdk9-b33
 28ea43d925f1e5250976097a2977dd3e66e11f0b jdk9-b34
 afe0c89e2edbdfb1a7ceff3d9b3ff46c4186202f jdk9-b35
+84803c3be7f79d29c7dc40749d7743675f64107a jdk9-b36
--- a/jdk/.hgtags	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/.hgtags	Wed Jul 05 20:05:30 2017 +0200
@@ -278,3 +278,4 @@
 60fe681c30bc3821545a2506d4d3c2e04073f67c jdk9-b33
 21568031434d7a9dbb0cc6516cc3183d349c2253 jdk9-b34
 e549291a0227031310fa91c574891f892d27f959 jdk9-b35
+cdcf2e599e42935c2d1d19a24bb19e808aeb43b5 jdk9-b36
--- a/jdk/make/CompileDemos.gmk	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/make/CompileDemos.gmk	Wed Jul 05 20:05:30 2017 +0200
@@ -154,9 +154,9 @@
 	(cd $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM && \
 	$(MKDIR) -p _the.tmp/META-INF/services && \
 	$(CP) $(DEMO_SHARE_SRC)/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor _the.tmp/META-INF/services && \
-	cd _the.tmp && \
+	cd ./_the.tmp && \
 	$(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar META-INF/services/java.awt.im.spi.InputMethodDescriptor && \
-	cd META-INF/services && \
+	cd ./META-INF/services && \
 	$(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor)
 	$(RM) -r $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.tmp
 	$(TOUCH) $@
--- a/jdk/make/CreateJars.gmk	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/make/CreateJars.gmk	Wed Jul 05 20:05:30 2017 +0200
@@ -111,6 +111,7 @@
 # This value should exclude types destined for jars other than rt.jar and resources.jar.
 # When building a Profile this value augments the profile specific exclusions
 RT_JAR_EXCLUDES += \
+    com/oracle/security/ucrypto \
     com/sun/codemodel \
     com/sun/crypto/provider \
     com/sun/istack/internal/tools \
@@ -476,7 +477,6 @@
     com/sun/tools/doclint \
     com/sun/tools/example/debug/expr \
     com/sun/tools/example/debug/tty \
-    com/sun/tools/extcheck \
     com/sun/tools/hat \
     com/sun/tools/internal/jxc \
     com/sun/tools/internal/jxc/ap \
--- a/jdk/make/CreateSecurityJars.gmk	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/make/CreateSecurityJars.gmk	Wed Jul 05 20:05:30 2017 +0200
@@ -169,27 +169,25 @@
 ##########################################################################################
 
 ifeq ($(OPENJDK_TARGET_OS), solaris)
-  ifndef OPENJDK
 
-    UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar
-    UCRYPTO_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/ucrypto.jar
+  UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar
+  UCRYPTO_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/ucrypto.jar
 
-    $(eval $(call SetupArchive,BUILD_UCRYPTO_JAR, , \
-        SRCS := $(JDK_OUTPUTDIR)/modules/jdk.crypto.ucrypto, \
-        SUFFIXES := .class, \
-        INCLUDES := com/oracle/security/ucrypto, \
-        JAR := $(UCRYPTO_JAR_UNSIGNED), \
-        MANIFEST := $(JCE_MANIFEST), \
-        SKIP_METAINF := true))
+  $(eval $(call SetupArchive,BUILD_UCRYPTO_JAR, , \
+      SRCS := $(JDK_OUTPUTDIR)/modules/jdk.crypto.ucrypto, \
+      SUFFIXES := .class, \
+      INCLUDES := com/oracle/security/ucrypto, \
+      JAR := $(UCRYPTO_JAR_UNSIGNED), \
+      MANIFEST := $(JCE_MANIFEST), \
+      SKIP_METAINF := true))
 
-    $(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST)
+  $(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST)
 
-    $(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_UNSIGNED)
+  $(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_UNSIGNED)
 	$(install-file)
 
-    TARGETS += $(UCRYPTO_JAR_UNSIGNED) $(UCRYPTO_JAR_DST)
+  TARGETS += $(UCRYPTO_JAR_UNSIGNED) $(UCRYPTO_JAR_DST)
 
-  endif
 endif
 
 all: $(TARGETS)
--- a/jdk/make/Images.gmk	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/make/Images.gmk	Wed Jul 05 20:05:30 2017 +0200
@@ -94,7 +94,6 @@
 ifeq ($(PROFILE), )
   NOT_JRE_BIN_FILES := \
       appletviewer$(EXE_SUFFIX) \
-      extcheck$(EXE_SUFFIX) \
       idlj$(EXE_SUFFIX) \
       jar$(EXE_SUFFIX) \
       jarsigner$(EXE_SUFFIX) \
@@ -326,7 +325,6 @@
   JDK_MAN_PAGES = \
       $(JRE_MAN_PAGES) \
       appletviewer.1 \
-      extcheck.1 \
       idlj.1 \
       jar.1 \
       jarsigner.1 \
--- a/jdk/make/copy/Copy-java.base.gmk	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/make/copy/Copy-java.base.gmk	Wed Jul 05 20:05:30 2017 +0200
@@ -170,10 +170,7 @@
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
   POLICY_SRC_LIST += $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/conf/security/java.policy
-endif
-ifndef OPENJDK
-  # if $(OPENJDK_TARGET_OS) is windows or solaris
-  ifneq ($(findstring $(OPENJDK_TARGET_OS), windows solaris), )
+  ifndef OPENJDK
     POLICY_SRC_LIST += $(JDK_TOPDIR)/src/closed/java.base/$(OPENJDK_TARGET_OS)/conf/security/java.policy
   endif
 endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/copy/Copy-jdk.crypto.ucrypto.gmk	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,49 @@
+#
+# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+include CopyCommon.gmk
+
+################################################################################
+
+ifeq ($(OPENJDK_TARGET_OS), solaris)
+
+  UCRYPTO_CFG_SRC := $(JDK_TOPDIR)/src/jdk.crypto.ucrypto/solaris/conf/security/ucrypto-solaris.cfg
+  UCRYPTO_CFG_DST := $(JDK_OUTPUTDIR)/lib/security/ucrypto-solaris.cfg
+
+  $(UCRYPTO_CFG_DST): $(UCRYPTO_CFG_SRC)
+	$(call install-file)
+
+  SECURITY_UCRYPTO_CONF_FILES += $(UCRYPTO_CFG_DST)
+
+endif
+
+################################################################################
+
+jdk.crypto.ucrypto: $(SECURITY_UCRYPTO_CONF_FILES)
+
+all: jdk.crypto.ucrypto
+
+.PHONY: all jdk.crypto.ucrypto
+
--- a/jdk/make/launcher/Launcher-jdk.dev.gmk	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/make/launcher/Launcher-jdk.dev.gmk	Wed Jul 05 20:05:30 2017 +0200
@@ -25,9 +25,6 @@
 
 include LauncherCommon.gmk
 
-$(eval $(call SetupLauncher,extcheck, \
-    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.extcheck.Main"$(COMMA) }'))
-
 $(eval $(call SetupLauncher,jar, \
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jar.Main"$(COMMA) }'))
 
--- a/jdk/make/lib/CoreLibraries.gmk	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/make/lib/CoreLibraries.gmk	Wed Jul 05 20:05:30 2017 +0200
@@ -169,6 +169,7 @@
         -framework Foundation \
         -framework Security -framework SystemConfiguration, \
     LDFLAGS_SUFFIX_windows := -export:winFileHandleOpen -export:handleLseek \
+        -export:getLastErrorString \
         jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \
         shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \
         advapi32.lib, \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/lib/Lib-jdk.crypto.ucrypto.gmk	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,62 @@
+#
+# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+include $(SPEC)
+include $(JDK_TOPDIR)/make/lib/LibCommon.gmk
+
+################################################################################
+
+ifeq ($(OPENJDK_TARGET_OS), solaris)
+
+  LIBJ2UCRYPTO_SRC := $(JDK_TOPDIR)/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto
+
+  $(eval $(call SetupNativeCompilation,BUILD_LIBJ2UCRYPTO, \
+      LIBRARY := j2ucrypto, \
+      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
+      SRC := $(LIBJ2UCRYPTO_SRC), \
+      LANG := C, \
+      OPTIMIZATION := LOW, \
+      CFLAGS := $(CFLAGS_JDKLIB) \
+          $(addprefix -I, $(LIBJ2UCRYPTO_SRC)), \
+      MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2ucrypto/mapfile-vers, \
+      LDFLAGS := $(LDFLAGS_JDKLIB), \
+      LDFLAGS_SUFFIX := $(LIBDL), \
+      LDFLAGS_SUFFIX_solaris := -lc, \
+      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2ucrypto, \
+      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+
+  $(BUILD_LIBJ2UCRYPTO): $(BUILD_LIBJAVA)
+
+  SECURITY_UCRYPTO_LIBRARIES += $(BUILD_LIBJ2UCRYPTO)
+
+endif
+
+################################################################################
+
+jdk.crypto.ucrypto: $(SECURITY_UCRYPTO_LIBRARIES)
+
+all: jdk.crypto.ucrypto
+
+.PHONY: all jdk.crypto.ucrypto
--- a/jdk/make/mapfiles/libjava/mapfile-vers	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/make/mapfiles/libjava/mapfile-vers	Wed Jul 05 20:05:30 2017 +0200
@@ -129,13 +129,11 @@
 		Java_java_lang_ClassLoader_defineClass1;
 		Java_java_lang_ClassLoader_defineClass2;
 		Java_java_lang_ClassLoader_findLoadedClass0;
-		Java_java_lang_ClassLoader_resolveClass0;
 		Java_java_lang_ClassLoader_00024NativeLibrary_find;
 		Java_java_lang_ClassLoader_00024NativeLibrary_load;
 		Java_java_lang_ClassLoader_00024NativeLibrary_unload;
 		Java_java_lang_ClassLoader_00024NativeLibrary_findBuiltinLib;
 		Java_java_lang_ClassLoader_registerNatives;
-		Java_java_lang_Compiler_registerNatives;
 		Java_java_lang_Double_longBitsToDouble;
 		Java_java_lang_Double_doubleToRawLongBits;
 		Java_java_lang_reflect_Proxy_defineClass0;
@@ -196,8 +194,6 @@
 		Java_java_lang_Runtime_gc;
 		Java_java_lang_Runtime_runFinalization0;
 		Java_java_lang_Runtime_totalMemory;
-		Java_java_lang_Runtime_traceInstructions;
-		Java_java_lang_Runtime_traceMethodCalls;
                 Java_java_lang_Runtime_availableProcessors;
 		Java_java_lang_SecurityManager_classDepth;
 		Java_java_lang_SecurityManager_classLoaderDepth0;
@@ -280,6 +276,8 @@
 		
                 # ZipFile.c needs this one
 		throwFileNotFoundException;
+                # zip_util.c needs this one
+		getLastErrorString;
 
 	# Outcalls from libjvm done using dlsym().
 
--- a/jdk/make/mapfiles/libnet/mapfile-vers	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/make/mapfiles/libnet/mapfile-vers	Wed Jul 05 20:05:30 2017 +0200
@@ -110,6 +110,8 @@
 		NET_Bind;
 		NET_MapSocketOption;
 		NET_Wait;
+		NET_EnableFastTcpLoopback;
+		NET_ThrowNew;
                 ipv6_available;
                 initInetAddressIDs;
 
--- a/jdk/make/profile-rtjar-includes.txt	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/make/profile-rtjar-includes.txt	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -115,6 +115,7 @@
     com/sun/security/ntlm \
     com/sun/security/sasl \
     com/sun/tracing \
+    jdk/management/cmm \
     java/lang/instrument \
     java/lang/management \
     java/security/acl \
--- a/jdk/src/bsd/doc/man/extcheck.1	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-'\" t
-.\"  Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-.\"
-.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-.\"
-.\" This code is free software; you can redistribute it and/or modify it
-.\" under the terms of the GNU General Public License version 2 only, as
-.\" published by the Free Software Foundation.
-.\"
-.\" This code is distributed in the hope that it will be useful, but WITHOUT
-.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-.\" version 2 for more details (a copy is included in the LICENSE file that
-.\" accompanied this code).
-.\"
-.\" You should have received a copy of the GNU General Public License version
-.\" 2 along with this work; if not, write to the Free Software Foundation,
-.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-.\"
-.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-.\" or visit www.oracle.com if you need additional information or have any
-.\" questions.
-.\"
-.\"     Arch: generic
-.\"     Software: JDK 8
-.\"     Date: 21 November 2013
-.\"     SectDesc: Basic Tools
-.\"     Title: extcheck.1
-.\"
-.if n .pl 99999
-.TH extcheck 1 "21 November 2013" "JDK 8" "Basic Tools"
-.\" -----------------------------------------------------------------
-.\" * Define some portability stuff
-.\" -----------------------------------------------------------------
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" http://bugs.debian.org/507673
-.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.ie \n(.g .ds Aq \(aq
-.el       .ds Aq '
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
-
-.SH NAME    
-extcheck \- Detects version conflicts between a target Java Archive (JAR) file and currently installed extension JAR files\&.
-.SH SYNOPSIS    
-.sp     
-.nf     
-
-\fBextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
-.fi     
-.sp     
-.TP     
-\fIoptions\fR
-The command-line options\&. See Options\&.
-.TP     
-\fItargetfile\&.jar\fR
-The target JAR file against which the currently installed extension JAR files are compared to detect version conflicts\&.
-.SH DESCRIPTION    
-The \f3extcheck\fR command checks a specified JAR file for title and version conflicts with any extensions installed in the Java SE SDK\&. Before installing an extension, you can use this utility to see whether the same or a more recent version of the extension is already installed\&.
-.PP
-The \f3extcheck\fR command compares the Specification-title and Specification-version headers in the manifest of the \f3targetfile\&.jar\fR file against the corresponding headers in all JAR files currently installed in the extension directory\&. By default, the extension directory is \f3jre/lib/ext\fR on Oracle Solaris and \f3\ejre\elib\eext\fR on Windows\&. The \f3extcheck\fR command compares version numbers in the same way as the \f3java\&.lang\&.Package\&.isCompatibleWith\fR method\&.
-.PP
-If no conflict is detected, then the return code is 0\&.
-.PP
-If the manifest of any JAR file in the extensions directory has the same \f3Specification-title\fR and the same or a newer \f3Specification-version\fR number, then a non-zero error code is returned\&. A non-zero error code is also returned when \f3targetfile\&.jar\fR does not have the \f3Specification-title\fR or \f3Specification-version\fR attributes in its manifest file\&.
-.SH OPTIONS    
-.TP
--verbose
-.br
-Lists JAR files in the extension directory as they are checked\&. Additionally, manifest attributes of the target JAR file and any conflicting JAR files are also reported\&.
-.TP
--J\fIoption\fR
-.br
-Passes \fIoption\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
-.SH SEE\ ALSO    
-.TP 0.2i    
-\(bu
-jar(1)
-.RE
-.br
-'pl 8.5i
-'bp
--- a/jdk/src/bsd/doc/man/ja/extcheck.1	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-." Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
-." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-."
-." This code is free software; you can redistribute it and/or modify it
-." under the terms of the GNU General Public License version 2 only, as
-." published by the Free Software Foundation.
-."
-." This code is distributed in the hope that it will be useful, but WITHOUT
-." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-." FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-." version 2 for more details (a copy is included in the LICENSE file that
-." accompanied this code).
-."
-." You should have received a copy of the GNU General Public License version
-." 2 along with this work; if not, write to the Free Software Foundation,
-." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-."
-." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-." or visit www.oracle.com if you need additional information or have any
-." questions.
-."
-.TH extcheck 1 "07 May 2011"
-
-.LP
--- a/jdk/src/java.base/macosx/native/include/jvm_md.h	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/macosx/native/include/jvm_md.h	Wed Jul 05 20:05:30 2017 +0200
@@ -70,7 +70,6 @@
 #define JVM_O_O_APPEND   O_APPEND
 #define JVM_O_EXCL       O_EXCL
 #define JVM_O_CREAT      O_CREAT
-#define JVM_O_DELETE     0x10000
 
 /* Signals */
 
--- a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -956,11 +956,11 @@
      * @see  #defineClass(String, byte[], int, int)
      */
     protected final void resolveClass(Class<?> c) {
-        resolveClass0(c);
+        if (c == null) {
+            throw new NullPointerException();
+        }
     }
 
-    private native void resolveClass0(Class<?> c);
-
     /**
      * Finds a class with the specified <a href="#name">binary name</a>,
      * loading it if necessary.
--- a/jdk/src/java.base/share/classes/java/lang/Compiler.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/Compiler.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,40 +47,6 @@
 public final class Compiler  {
     private Compiler() {}               // don't make instances
 
-    private static native void initialize();
-
-    private static native void registerNatives();
-
-    static {
-        registerNatives();
-        java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction<Void>() {
-                public Void run() {
-                    boolean loaded = false;
-                    String jit = System.getProperty("java.compiler");
-                    if ((jit != null) && (!jit.equals("NONE")) &&
-                        (!jit.equals("")))
-                    {
-                        try {
-                            System.loadLibrary(jit);
-                            initialize();
-                            loaded = true;
-                        } catch (UnsatisfiedLinkError e) {
-                            System.err.println("Warning: JIT compiler \"" +
-                              jit + "\" not found. Will use interpreter.");
-                        }
-                    }
-                    String info = System.getProperty("java.vm.info");
-                    if (loaded) {
-                        System.setProperty("java.vm.info", info + ", " + jit);
-                    } else {
-                        System.setProperty("java.vm.info", info + ", nojit");
-                    }
-                    return null;
-                }
-            });
-    }
-
     /**
      * Compiles the specified class.
      *
@@ -93,7 +59,9 @@
      * @throws  NullPointerException
      *          If {@code clazz} is {@code null}
      */
-    public static native boolean compileClass(Class<?> clazz);
+    public static boolean compileClass(Class<?> clazz) {
+        return false;
+    }
 
     /**
      * Compiles all classes whose name matches the specified string.
@@ -107,7 +75,9 @@
      * @throws  NullPointerException
      *          If {@code string} is {@code null}
      */
-    public static native boolean compileClasses(String string);
+    public static boolean compileClasses(String string) {
+        return false;
+    }
 
     /**
      * Examines the argument type and its fields and perform some documented
@@ -122,15 +92,17 @@
      * @throws  NullPointerException
      *          If {@code any} is {@code null}
      */
-    public static native Object command(Object any);
+    public static Object command(Object any) {
+        return null;
+    }
 
     /**
      * Cause the Compiler to resume operation.
      */
-    public static native void enable();
+    public static void enable() { }
 
     /**
      * Cause the Compiler to cease operation.
      */
-    public static native void disable();
+    public static void disable() { }
 }
--- a/jdk/src/java.base/share/classes/java/lang/Runtime.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/Runtime.java	Wed Jul 05 20:05:30 2017 +0200
@@ -730,7 +730,7 @@
      * @param   on   <code>true</code> to enable instruction tracing;
      *               <code>false</code> to disable this feature.
      */
-    public native void traceInstructions(boolean on);
+    public void traceInstructions(boolean on) { }
 
     /**
      * Enables/Disables tracing of method calls.
@@ -748,7 +748,7 @@
      * @param   on   <code>true</code> to enable instruction tracing;
      *               <code>false</code> to disable this feature.
      */
-    public native void traceMethodCalls(boolean on);
+    public void traceMethodCalls(boolean on) { }
 
     /**
      * Loads the native library specified by the filename argument.  The filename
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java	Wed Jul 05 20:05:30 2017 +0200
@@ -889,11 +889,6 @@
      *     with MHs.eCE.
      *  3a. unboxing conversions can be followed by the full matrix of primitive conversions
      *  3b. unboxing of null is permitted (creates a zero primitive value)
-     *     Most unboxing conversions, like {@code Object->int}, has potentially
-     *     different behaviors for asType vs. MHs.eCE, because the dynamic value
-     *     might be a wrapper of a type that requires narrowing, like {@code (Object)1L->byte}.
-     *     The equivalence is only certain if the static src type is a wrapper,
-     *     and the conversion will be a widening one.
      * Other than interfaces, reference-to-reference conversions are the same.
      * Boxing primitives to references is the same for both operators.
      */
@@ -904,11 +899,8 @@
             // Or a boxing conversion, which is always to an exact wrapper class.
             return canConvert(src, dst);
         } else if (dst.isPrimitive()) {
-            Wrapper dw = Wrapper.forPrimitiveType(dst);
-            // Watch out:  If src is Number or Object, we could get dynamic narrowing conversion.
-            // The conversion is known to be widening only if the wrapper type is statically visible.
-            return (Wrapper.isWrapperType(src) &&
-                    dw.isConvertibleFrom(Wrapper.forWrapperType(src)));
+            // Unboxing behavior is different between MHs.eCA & MH.asType (see 3b).
+            return false;
         } else {
             // R->R always works, but we have to avoid a check-cast to an interface.
             return !dst.isInterface() || dst.isAssignableFrom(src);
--- a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 
 package java.security;
 
+import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -447,24 +448,37 @@
     /**
      * Used for storing ProtectionDomains as keys in a Map.
      */
-    final class Key {}
+    final static class Key {}
+
+    // A cache of ProtectionDomains and their Permissions
+    private static class PDCache implements ProtectionDomainCache {
+        // We must wrap the PermissionCollection in a WeakReference as there
+        // are some PermissionCollections which contain strong references
+        // back to a ProtectionDomain and otherwise would never be removed
+        // from the WeakHashMap
+        private final Map<Key, WeakReference<PermissionCollection>>
+            map = new WeakHashMap<>();
+
+        @Override
+        public synchronized void put(ProtectionDomain pd,
+                                     PermissionCollection pc) {
+            map.put(pd == null ? null : pd.key, new WeakReference<>(pc));
+        }
+
+        @Override
+        public synchronized PermissionCollection get(ProtectionDomain pd) {
+            WeakReference<PermissionCollection> ref =
+                map.get(pd == null ? null : pd.key);
+            return ref == null ? null : ref.get();
+        }
+    }
 
     static {
         SharedSecrets.setJavaSecurityProtectionDomainAccess(
             new JavaSecurityProtectionDomainAccess() {
+                @Override
                 public ProtectionDomainCache getProtectionDomainCache() {
-                    return new ProtectionDomainCache() {
-                        private final Map<Key, PermissionCollection> map =
-                            Collections.synchronizedMap
-                                (new WeakHashMap<Key, PermissionCollection>());
-                        public void put(ProtectionDomain pd,
-                            PermissionCollection pc) {
-                            map.put((pd == null ? null : pd.key), pc);
-                        }
-                        public PermissionCollection get(ProtectionDomain pd) {
-                            return pd == null ? map.get(null) : map.get(pd.key);
-                        }
-                    };
+                    return new PDCache();
                 }
             });
     }
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1858,7 +1858,7 @@
             break;
         case 'B': // pointer to CONSTANT_Byte
             av.visit(name,
-                    new Byte((byte) readInt(items[readUnsignedShort(v)])));
+                    (byte) readInt(items[readUnsignedShort(v)]));
             v += 2;
             break;
         case 'Z': // pointer to CONSTANT_Boolean
@@ -1868,13 +1868,13 @@
             v += 2;
             break;
         case 'S': // pointer to CONSTANT_Short
-            av.visit(name, new Short(
-                    (short) readInt(items[readUnsignedShort(v)])));
+            av.visit(name,
+                    (short) readInt(items[readUnsignedShort(v)]));
             v += 2;
             break;
         case 'C': // pointer to CONSTANT_Char
-            av.visit(name, new Character(
-                    (char) readInt(items[readUnsignedShort(v)])));
+            av.visit(name,
+                    (char) readInt(items[readUnsignedShort(v)]));
             v += 2;
             break;
         case 's': // pointer to CONSTANT_Utf8
@@ -2498,13 +2498,13 @@
         int index = items[item];
         switch (b[index - 1]) {
         case ClassWriter.INT:
-            return new Integer(readInt(index));
+            return readInt(index);
         case ClassWriter.FLOAT:
-            return new Float(Float.intBitsToFloat(readInt(index)));
+            return Float.intBitsToFloat(readInt(index));
         case ClassWriter.LONG:
-            return new Long(readLong(index));
+            return readLong(index);
         case ClassWriter.DOUBLE:
-            return new Double(Double.longBitsToDouble(readLong(index)));
+            return Double.longBitsToDouble(readLong(index));
         case ClassWriter.CLASS:
             return Type.getObjectType(readUTF8(index, buf));
         case ClassWriter.STR:
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/TypePath.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/TypePath.java	Wed Jul 05 20:05:30 2017 +0200
@@ -181,6 +181,9 @@
                     typeArg = typeArg * 10 + c - '0';
                     i += 1;
                 }
+                if (i < n && typePath.charAt(i) == ';') {
+                    i += 1;
+                }
                 out.put11(TYPE_ARGUMENT, typeArg);
             }
         }
@@ -193,7 +196,7 @@
      * ARRAY_ELEMENT} steps are represented with '[', {@link #INNER_TYPE
      * INNER_TYPE} steps with '.', {@link #WILDCARD_BOUND WILDCARD_BOUND} steps
      * with '*' and {@link #TYPE_ARGUMENT TYPE_ARGUMENT} steps with their type
-     * argument index in decimal form.
+     * argument index in decimal form followed by ';'.
      */
     @Override
     public String toString() {
@@ -211,7 +214,7 @@
                 result.append('*');
                 break;
             case TYPE_ARGUMENT:
-                result.append(getStepArgument(i));
+                result.append(getStepArgument(i)).append(';');
                 break;
             default:
                 result.append('_');
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/commons/GeneratorAdapter.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/commons/GeneratorAdapter.java	Wed Jul 05 20:05:30 2017 +0200
@@ -408,7 +408,7 @@
         } else if (value >= Short.MIN_VALUE && value <= Short.MAX_VALUE) {
             mv.visitIntInsn(Opcodes.SIPUSH, value);
         } else {
-            mv.visitLdcInsn(new Integer(value));
+            mv.visitLdcInsn(value);
         }
     }
 
@@ -422,7 +422,7 @@
         if (value == 0L || value == 1L) {
             mv.visitInsn(Opcodes.LCONST_0 + (int) value);
         } else {
-            mv.visitLdcInsn(new Long(value));
+            mv.visitLdcInsn(value);
         }
     }
 
@@ -437,7 +437,7 @@
         if (bits == 0L || bits == 0x3f800000 || bits == 0x40000000) { // 0..2
             mv.visitInsn(Opcodes.FCONST_0 + (int) value);
         } else {
-            mv.visitLdcInsn(new Float(value));
+            mv.visitLdcInsn(value);
         }
     }
 
@@ -452,7 +452,7 @@
         if (bits == 0L || bits == 0x3ff0000000000000L) { // +0.0d and 1.0d
             mv.visitInsn(Opcodes.DCONST_0 + (int) value);
         } else {
-            mv.visitLdcInsn(new Double(value));
+            mv.visitLdcInsn(value);
         }
     }
 
@@ -1647,11 +1647,13 @@
      */
     public void catchException(final Label start, final Label end,
             final Type exception) {
+        Label doCatch = new Label();
         if (exception == null) {
-            mv.visitTryCatchBlock(start, end, mark(), null);
+            mv.visitTryCatchBlock(start, end, doCatch, null);
         } else {
-            mv.visitTryCatchBlock(start, end, mark(),
+            mv.visitTryCatchBlock(start, end, doCatch,
                     exception.getInternalName());
         }
+        mark(doCatch);
     }
 }
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/commons/InstructionAdapter.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/commons/InstructionAdapter.java	Wed Jul 05 20:05:30 2017 +0200
@@ -737,7 +737,7 @@
         } else if (cst >= Short.MIN_VALUE && cst <= Short.MAX_VALUE) {
             mv.visitIntInsn(Opcodes.SIPUSH, cst);
         } else {
-            mv.visitLdcInsn(new Integer(cst));
+            mv.visitLdcInsn(cst);
         }
     }
 
@@ -745,7 +745,7 @@
         if (cst == 0L || cst == 1L) {
             mv.visitInsn(Opcodes.LCONST_0 + (int) cst);
         } else {
-            mv.visitLdcInsn(new Long(cst));
+            mv.visitLdcInsn(cst);
         }
     }
 
@@ -754,7 +754,7 @@
         if (bits == 0L || bits == 0x3f800000 || bits == 0x40000000) { // 0..2
             mv.visitInsn(Opcodes.FCONST_0 + (int) cst);
         } else {
-            mv.visitLdcInsn(new Float(cst));
+            mv.visitLdcInsn(cst);
         }
     }
 
@@ -763,7 +763,7 @@
         if (bits == 0L || bits == 0x3ff0000000000000L) { // +0.0d and 1.0d
             mv.visitInsn(Opcodes.DCONST_0 + (int) cst);
         } else {
-            mv.visitLdcInsn(new Double(cst));
+            mv.visitLdcInsn(cst);
         }
     }
 
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/commons/SerialVersionUIDAdder.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/commons/SerialVersionUIDAdder.java	Wed Jul 05 20:05:30 2017 +0200
@@ -366,8 +366,7 @@
 
     protected void addSVUID(long svuid) {
         FieldVisitor fv = super.visitField(Opcodes.ACC_FINAL
-                + Opcodes.ACC_STATIC, "serialVersionUID", "J", null, new Long(
-                svuid));
+                + Opcodes.ACC_STATIC, "serialVersionUID", "J", null, svuid);
         if (fv != null) {
             fv.visitEnd();
         }
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/tree/AnnotationNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/tree/AnnotationNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -247,11 +247,13 @@
                 an.accept(av.visitAnnotation(name, an.desc));
             } else if (value instanceof List) {
                 AnnotationVisitor v = av.visitArray(name);
-                List<?> array = (List<?>) value;
-                for (int j = 0; j < array.size(); ++j) {
-                    accept(v, null, array.get(j));
+                if (v != null) {
+                    List<?> array = (List<?>) value;
+                    for (int j = 0; j < array.size(); ++j) {
+                        accept(v, null, array.get(j));
+                    }
+                    v.visitEnd();
                 }
-                v.visitEnd();
             } else {
                 av.visit(name, value);
             }
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/tree/LookupSwitchInsnNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/tree/LookupSwitchInsnNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -110,7 +110,7 @@
                 : labels.length);
         if (keys != null) {
             for (int i = 0; i < keys.length; ++i) {
-                this.keys.add(new Integer(keys[i]));
+                this.keys.add(keys[i]);
             }
         }
         if (labels != null) {
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/tree/MethodInsnNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/tree/MethodInsnNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -160,6 +160,7 @@
     @Override
     public void accept(final MethodVisitor mv) {
         mv.visitMethodInsn(opcode, owner, name, desc, itf);
+        acceptAnnotations(mv);
     }
 
     @Override
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/util/CheckMethodAdapter.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/util/CheckMethodAdapter.java	Wed Jul 05 20:05:30 2017 +0200
@@ -802,7 +802,7 @@
         if (labels.get(label) != null) {
             throw new IllegalArgumentException("Already visited label");
         }
-        labels.put(label, new Integer(insnCount));
+        labels.put(label, insnCount);
         super.visitLabel(label);
     }
 
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/util/Textifier.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/util/Textifier.java	Wed Jul 05 20:05:30 2017 +0200
@@ -732,7 +732,7 @@
         Textifier t = createTextifier();
         text.add(t.getText());
         text.add(visible ? ") // parameter " : ") // invisible, parameter ");
-        text.add(new Integer(parameter));
+        text.add(parameter);
         text.add("\n");
         return t;
     }
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/version.txt	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/version.txt	Wed Jul 05 20:05:30 2017 +0200
@@ -1,12 +1,12 @@
 Path: .
-Working Copy Root Path: /hudson/jobs/objectweb-pull/workspace/asm-svn-2014-06-19
+Working Copy Root Path: /hudson/jobs/objectweb-init/workspace/asm-svn-2014-10-15
 URL: file:///svnroot/asm/trunk/asm
 Repository Root: file:///svnroot/asm
 Repository UUID: 271bd773-ee82-43a6-9b2b-1890ed8ce7f9
-Revision: 1750
+Revision: 1772
 Node Kind: directory
 Schedule: normal
-Last Changed Author: forax
-Last Changed Rev: 1750
-Last Changed Date: 2014-06-06 00:31:02 +0200 (Fri, 06 Jun 2014)
+Last Changed Author: ebruneton
+Last Changed Rev: 1772
+Last Changed Date: 2014-09-06 09:13:07 +0200 (Sat, 06 Sep 2014)
 
--- a/jdk/src/java.base/share/classes/sun/invoke/util/Wrapper.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/invoke/util/Wrapper.java	Wed Jul 05 20:05:30 2017 +0200
@@ -26,19 +26,19 @@
 package sun.invoke.util;
 
 public enum Wrapper {
-    BOOLEAN(Boolean.class, boolean.class, 'Z', (Boolean)false, new boolean[0], Format.unsigned(1)),
+    //        wrapperType    primitiveType  char            zero         emptyArray          format
+    BOOLEAN(  Boolean.class, boolean.class, 'Z',      (Boolean)false, new boolean[0], Format.unsigned( 1)),
     // These must be in the order defined for widening primitive conversions in JLS 5.1.2
-    BYTE(Byte.class, byte.class, 'B', (Byte)(byte)0, new byte[0], Format.signed(8)),
-    SHORT(Short.class, short.class, 'S', (Short)(short)0, new short[0], Format.signed(16)),
-    CHAR(Character.class, char.class, 'C', (Character)(char)0, new char[0], Format.unsigned(16)),
-    INT(Integer.class, int.class, 'I', (Integer)/*(int)*/0, new int[0], Format.signed(32)),
-    LONG(Long.class, long.class, 'J', (Long)(long)0, new long[0], Format.signed(64)),
-    FLOAT(Float.class, float.class, 'F', (Float)(float)0, new float[0], Format.floating(32)),
-    DOUBLE(Double.class, double.class, 'D', (Double)(double)0, new double[0], Format.floating(64)),
-    //NULL(Null.class, null.class, 'N', null, null, Format.other(1)),
-    OBJECT(Object.class, Object.class, 'L', null, new Object[0], Format.other(1)),
+    BYTE   (     Byte.class,    byte.class, 'B',       (Byte)(byte)0, new    byte[0], Format.signed(   8)),
+    SHORT  (    Short.class,   short.class, 'S',     (Short)(short)0, new   short[0], Format.signed(  16)),
+    CHAR   (Character.class,    char.class, 'C',  (Character)(char)0, new    char[0], Format.unsigned(16)),
+    INT    (  Integer.class,     int.class, 'I', (Integer)/*(int)*/0, new     int[0], Format.signed(  32)),
+    LONG   (     Long.class,    long.class, 'J',       (Long)(long)0, new    long[0], Format.signed(  64)),
+    FLOAT  (    Float.class,   float.class, 'F',     (Float)(float)0, new   float[0], Format.floating(32)),
+    DOUBLE (   Double.class,  double.class, 'D',   (Double)(double)0, new  double[0], Format.floating(64)),
+    OBJECT (   Object.class,  Object.class, 'L',                null, new  Object[0], Format.other(    1)),
     // VOID must be the last type, since it is "assignable" from any other type:
-    VOID(Void.class, void.class, 'V', null, null, Format.other(0)),
+    VOID   (     Void.class,    void.class, 'V',                null,           null, Format.other(    0)),
     ;
 
     private final Class<?> wrapperType;
--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1046,7 +1046,7 @@
             try {
                 URI uri = ParseUtil.toURI(url);
                 if (uri != null) {
-                    cachedResponse = cacheHandler.get(uri, getRequestMethod(), requests.getHeaders(EXCLUDE_HEADERS));
+                    cachedResponse = cacheHandler.get(uri, getRequestMethod(), getUserSetHeaders().getHeaders());
                     if ("https".equalsIgnoreCase(uri.getScheme())
                         && !(cachedResponse instanceof SecureCacheResponse)) {
                         cachedResponse = null;
--- a/jdk/src/java.base/share/classes/sun/nio/ch/Net.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/nio/ch/Net.java	Wed Jul 05 20:05:30 2017 +0200
@@ -50,30 +50,8 @@
     // set to true if exclusive binding is on for Windows
     private static final boolean exclusiveBind;
 
-    static {
-        int availLevel = isExclusiveBindAvailable();
-        if (availLevel >= 0) {
-            String exclBindProp =
-                java.security.AccessController.doPrivileged(
-                    new PrivilegedAction<String>() {
-                        @Override
-                        public String run() {
-                            return System.getProperty(
-                                    "sun.net.useExclusiveBind");
-                        }
-                    });
-            if (exclBindProp != null) {
-                exclusiveBind = exclBindProp.length() == 0 ?
-                        true : Boolean.parseBoolean(exclBindProp);
-            } else if (availLevel == 1) {
-                exclusiveBind = true;
-            } else {
-                exclusiveBind = false;
-            }
-        } else {
-            exclusiveBind = false;
-        }
-    }
+    // set to true if the fast tcp loopback should be enabled on Windows
+    private static final boolean fastLoopback;
 
     // -- Miscellaneous utilities --
 
@@ -391,6 +369,23 @@
         }
     }
 
+    public static boolean isFastTcpLoopbackRequested() {
+        String loopbackProp = java.security.AccessController.doPrivileged(
+            new PrivilegedAction<String>() {
+                @Override
+                public String run() {
+                    return System.getProperty("jdk.net.useFastTcpLoopback");
+                }
+            });
+        boolean enable;
+        if ("".equals(loopbackProp)) {
+            enable = true;
+        } else {
+            enable = Boolean.parseBoolean(loopbackProp);
+        }
+        return enable;
+    }
+
     // -- Socket operations --
 
     private static native boolean isIPv6Available0();
@@ -413,15 +408,16 @@
         throws IOException {
         boolean preferIPv6 = isIPv6Available() &&
             (family != StandardProtocolFamily.INET);
-        return IOUtil.newFD(socket0(preferIPv6, stream, false));
+        return IOUtil.newFD(socket0(preferIPv6, stream, false, fastLoopback));
     }
 
     static FileDescriptor serverSocket(boolean stream) {
-        return IOUtil.newFD(socket0(isIPv6Available(), stream, true));
+        return IOUtil.newFD(socket0(isIPv6Available(), stream, true, fastLoopback));
     }
 
     // Due to oddities SO_REUSEADDR on windows reuse is ignored
-    private static native int socket0(boolean preferIPv6, boolean stream, boolean reuse);
+    private static native int socket0(boolean preferIPv6, boolean stream, boolean reuse,
+                                      boolean fastLoopback);
 
     public static void bind(FileDescriptor fd, InetAddress addr, int port)
         throws IOException
@@ -634,4 +630,30 @@
         POLLCONN   = pollconnValue();
     }
 
+    static {
+        int availLevel = isExclusiveBindAvailable();
+        if (availLevel >= 0) {
+            String exclBindProp =
+                java.security.AccessController.doPrivileged(
+                    new PrivilegedAction<String>() {
+                        @Override
+                        public String run() {
+                            return System.getProperty(
+                                    "sun.net.useExclusiveBind");
+                        }
+                    });
+            if (exclBindProp != null) {
+                exclusiveBind = exclBindProp.length() == 0 ?
+                        true : Boolean.parseBoolean(exclBindProp);
+            } else if (availLevel == 1) {
+                exclusiveBind = true;
+            } else {
+                exclusiveBind = false;
+            }
+        } else {
+            exclusiveBind = false;
+        }
+
+        fastLoopback = isFastTcpLoopbackRequested();
+    }
 }
--- a/jdk/src/java.base/share/conf/security/java.policy	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/conf/security/java.policy	Wed Jul 05 20:05:30 2017 +0200
@@ -25,6 +25,18 @@
         permission java.security.AllPermission;
 };
 
+grant codeBase "file:${java.home}/lib/ext/ucrypto.jar" {
+        permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
+        permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
+        permission java.lang.RuntimePermission "loadLibrary.j2ucrypto";
+        // need "com.oracle.security.ucrypto.debug" for debugging
+        permission java.util.PropertyPermission "*", "read";
+        permission java.security.SecurityPermission "putProviderProperty.OracleUcrypto";
+        permission java.security.SecurityPermission "clearProviderProperties.OracleUcrypto";
+        permission java.security.SecurityPermission "removeProviderProperty.OracleUcrypto";
+        permission java.io.FilePermission "${java.home}/lib/security/ucrypto-solaris.cfg", "read";
+};
+
 grant codeBase "file:${java.home}/lib/ext/sunec.jar" {
         permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
         permission java.lang.RuntimePermission "loadLibrary.sunec";
--- a/jdk/src/java.base/share/native/include/jvm.h	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/native/include/jvm.h	Wed Jul 05 20:05:30 2017 +0200
@@ -111,19 +111,11 @@
 JNIEXPORT jobject JNICALL
 JVM_InitProperties(JNIEnv *env, jobject p);
 
-/*
- * java.io.File
- */
-JNIEXPORT void JNICALL
-JVM_OnExit(void (*func)(void));
 
 /*
  * java.lang.Runtime
  */
 JNIEXPORT void JNICALL
-JVM_Exit(jint code);
-
-JNIEXPORT void JNICALL
 JVM_Halt(jint code);
 
 JNIEXPORT void JNICALL
@@ -146,12 +138,6 @@
 JNIEXPORT jlong JNICALL
 JVM_MaxObjectInspectionAge(void);
 
-JNIEXPORT void JNICALL
-JVM_TraceInstructions(jboolean on);
-
-JNIEXPORT void JNICALL
-JVM_TraceMethodCalls(jboolean on);
-
 JNIEXPORT jlong JNICALL
 JVM_TotalMemory(void);
 
@@ -177,12 +163,6 @@
 JVM_IsSupportedJNIVersion(jint version);
 
 /*
- * java.lang.Float and java.lang.Double
- */
-JNIEXPORT jboolean JNICALL
-JVM_IsNaN(jdouble d);
-
-/*
  * java.lang.Throwable
  */
 JNIEXPORT void JNICALL
@@ -195,30 +175,6 @@
 JVM_GetStackTraceElement(JNIEnv *env, jobject throwable, jint index);
 
 /*
- * java.lang.Compiler
- */
-JNIEXPORT void JNICALL
-JVM_InitializeCompiler (JNIEnv *env, jclass compCls);
-
-JNIEXPORT jboolean JNICALL
-JVM_IsSilentCompiler(JNIEnv *env, jclass compCls);
-
-JNIEXPORT jboolean JNICALL
-JVM_CompileClass(JNIEnv *env, jclass compCls, jclass cls);
-
-JNIEXPORT jboolean JNICALL
-JVM_CompileClasses(JNIEnv *env, jclass cls, jstring jname);
-
-JNIEXPORT jobject JNICALL
-JVM_CompilerCommand(JNIEnv *env, jclass compCls, jobject arg);
-
-JNIEXPORT void JNICALL
-JVM_EnableCompiler(JNIEnv *env, jclass compCls);
-
-JNIEXPORT void JNICALL
-JVM_DisableCompiler(JNIEnv *env, jclass compCls);
-
-/*
  * java.lang.Thread
  */
 JNIEXPORT void JNICALL
@@ -304,25 +260,9 @@
  * java.io.ObjectInputStream
  */
 JNIEXPORT jobject JNICALL
-JVM_AllocateNewObject(JNIEnv *env, jobject obj, jclass currClass,
-                      jclass initClass);
-
-JNIEXPORT jobject JNICALL
-JVM_AllocateNewArray(JNIEnv *env, jobject obj, jclass currClass,
-                     jint length);
-
-JNIEXPORT jobject JNICALL
 JVM_LatestUserDefinedLoader(JNIEnv *env);
 
 /*
- * This function has been deprecated and should not be considered
- * part of the specified JVM interface.
- */
-JNIEXPORT jclass JNICALL
-JVM_LoadClass0(JNIEnv *env, jobject obj, jclass currClass,
-               jstring currClassName);
-
-/*
  * java.lang.reflect.Array
  */
 JNIEXPORT jint JNICALL
@@ -373,11 +313,6 @@
 JNIEXPORT jclass JNICALL
 JVM_FindPrimitiveClass(JNIEnv *env, const char *utf);
 
-/*
- * Link the class
- */
-JNIEXPORT void JNICALL
-JVM_ResolveClass(JNIEnv *env, jclass cls);
 
 /*
  * Find a class from a boot class loader. Returns NULL if class not found.
@@ -1101,43 +1036,6 @@
  PART 3: I/O and Network Support
  ************************************************************************/
 
-/* Note that the JVM IO functions are expected to return JVM_IO_ERR
- * when there is any kind of error. The caller can then use the
- * platform specific support (e.g., errno) to get the detailed
- * error info.  The JVM_GetLastErrorString procedure may also be used
- * to obtain a descriptive error string.
- */
-#define JVM_IO_ERR  (-1)
-
-/* For interruptible IO. Returning JVM_IO_INTR indicates that an IO
- * operation has been disrupted by Thread.interrupt. There are a
- * number of technical difficulties related to interruptible IO that
- * need to be solved. For example, most existing programs do not handle
- * InterruptedIOExceptions specially, they simply treat those as any
- * IOExceptions, which typically indicate fatal errors.
- *
- * There are also two modes of operation for interruptible IO. In the
- * resumption mode, an interrupted IO operation is guaranteed not to
- * have any side-effects, and can be restarted. In the termination mode,
- * an interrupted IO operation corrupts the underlying IO stream, so
- * that the only reasonable operation on an interrupted stream is to
- * close that stream. The resumption mode seems to be impossible to
- * implement on Win32 and Solaris. Implementing the termination mode is
- * easier, but it's not clear that's the right semantics.
- *
- * Interruptible IO is not supported on Win32.It can be enabled/disabled
- * using a compile-time flag on Solaris. Third-party JVM ports do not
- * need to implement interruptible IO.
- */
-#define JVM_IO_INTR (-2)
-
-/* Write a string into the given buffer, in the platform's local encoding,
- * that describes the most recent system-level error to occur in this thread.
- * Return the length of the string or zero if no error occurred.
- */
-JNIEXPORT jint JNICALL
-JVM_GetLastErrorString(char *buf, int len);
-
 /*
  * Convert a pathname into native format.  This function does syntactic
  * cleanup, such as removing redundant separator characters.  It modifies
@@ -1147,150 +1045,6 @@
 JVM_NativePath(char *);
 
 /*
- * JVM I/O error codes
- */
-#define JVM_EEXIST       -100
-
-/*
- * Open a file descriptor. This function returns a negative error code
- * on error, and a non-negative integer that is the file descriptor on
- * success.
- */
-JNIEXPORT jint JNICALL
-JVM_Open(const char *fname, jint flags, jint mode);
-
-/*
- * Close a file descriptor. This function returns -1 on error, and 0
- * on success.
- *
- * fd        the file descriptor to close.
- */
-JNIEXPORT jint JNICALL
-JVM_Close(jint fd);
-
-/*
- * Read data from a file decriptor into a char array.
- *
- * fd        the file descriptor to read from.
- * buf       the buffer where to put the read data.
- * nbytes    the number of bytes to read.
- *
- * This function returns -1 on error, and 0 on success.
- */
-JNIEXPORT jint JNICALL
-JVM_Read(jint fd, char *buf, jint nbytes);
-
-/*
- * Write data from a char array to a file decriptor.
- *
- * fd        the file descriptor to read from.
- * buf       the buffer from which to fetch the data.
- * nbytes    the number of bytes to write.
- *
- * This function returns -1 on error, and 0 on success.
- */
-JNIEXPORT jint JNICALL
-JVM_Write(jint fd, char *buf, jint nbytes);
-
-/*
- * Returns the number of bytes available for reading from a given file
- * descriptor
- */
-JNIEXPORT jint JNICALL
-JVM_Available(jint fd, jlong *pbytes);
-
-/*
- * Move the file descriptor pointer from whence by offset.
- *
- * fd        the file descriptor to move.
- * offset    the number of bytes to move it by.
- * whence    the start from where to move it.
- *
- * This function returns the resulting pointer location.
- */
-JNIEXPORT jlong JNICALL
-JVM_Lseek(jint fd, jlong offset, jint whence);
-
-/*
- * Set the length of the file associated with the given descriptor to the given
- * length.  If the new length is longer than the current length then the file
- * is extended; the contents of the extended portion are not defined.  The
- * value of the file pointer is undefined after this procedure returns.
- */
-JNIEXPORT jint JNICALL
-JVM_SetLength(jint fd, jlong length);
-
-/*
- * Synchronize the file descriptor's in memory state with that of the
- * physical device.  Return of -1 is an error, 0 is OK.
- */
-JNIEXPORT jint JNICALL
-JVM_Sync(jint fd);
-
-/*
- * Networking library support
- */
-
-JNIEXPORT jint JNICALL
-JVM_InitializeSocketLibrary(void);
-
-struct sockaddr;
-
-JNIEXPORT jint JNICALL
-JVM_Socket(jint domain, jint type, jint protocol);
-
-JNIEXPORT jint JNICALL
-JVM_SocketClose(jint fd);
-
-JNIEXPORT jint JNICALL
-JVM_SocketShutdown(jint fd, jint howto);
-
-JNIEXPORT jint JNICALL
-JVM_Recv(jint fd, char *buf, jint nBytes, jint flags);
-
-JNIEXPORT jint JNICALL
-JVM_Send(jint fd, char *buf, jint nBytes, jint flags);
-
-JNIEXPORT jint JNICALL
-JVM_Timeout(int fd, long timeout);
-
-JNIEXPORT jint JNICALL
-JVM_Listen(jint fd, jint count);
-
-JNIEXPORT jint JNICALL
-JVM_Connect(jint fd, struct sockaddr *him, jint len);
-
-JNIEXPORT jint JNICALL
-JVM_Bind(jint fd, struct sockaddr *him, jint len);
-
-JNIEXPORT jint JNICALL
-JVM_Accept(jint fd, struct sockaddr *him, jint *len);
-
-JNIEXPORT jint JNICALL
-JVM_RecvFrom(jint fd, char *buf, int nBytes,
-                  int flags, struct sockaddr *from, int *fromlen);
-
-JNIEXPORT jint JNICALL
-JVM_SendTo(jint fd, char *buf, int len,
-                int flags, struct sockaddr *to, int tolen);
-
-JNIEXPORT jint JNICALL
-JVM_SocketAvailable(jint fd, jint *result);
-
-
-JNIEXPORT jint JNICALL
-JVM_GetSockName(jint fd, struct sockaddr *him, int *len);
-
-JNIEXPORT jint JNICALL
-JVM_GetSockOpt(jint fd, int level, int optname, char *optval, int *optlen);
-
-JNIEXPORT jint JNICALL
-JVM_SetSockOpt(jint fd, int level, int optname, const char *optval, int optlen);
-
-JNIEXPORT int JNICALL
-JVM_GetHostName(char* name, int namelen);
-
-/*
  * The standard printing functions supported by the Java VM. (Should they
  * be renamed to JVM_* in the future?
  */
@@ -1355,39 +1109,6 @@
 JNIEXPORT jobjectArray JNICALL
 JVM_GetEnclosingMethodInfo(JNIEnv* env, jclass ofClass);
 
-/*
- * Java thread state support
- */
-enum {
-    JAVA_THREAD_STATE_NEW           = 0,
-    JAVA_THREAD_STATE_RUNNABLE      = 1,
-    JAVA_THREAD_STATE_BLOCKED       = 2,
-    JAVA_THREAD_STATE_WAITING       = 3,
-    JAVA_THREAD_STATE_TIMED_WAITING = 4,
-    JAVA_THREAD_STATE_TERMINATED    = 5,
-    JAVA_THREAD_STATE_COUNT         = 6
-};
-
-/*
- * Returns an array of the threadStatus values representing the
- * given Java thread state.  Returns NULL if the VM version is
- * incompatible with the JDK or doesn't support the given
- * Java thread state.
- */
-JNIEXPORT jintArray JNICALL
-JVM_GetThreadStateValues(JNIEnv* env, jint javaThreadState);
-
-/*
- * Returns an array of the substate names representing the
- * given Java thread state.  Returns NULL if the VM version is
- * incompatible with the JDK or the VM doesn't support
- * the given Java thread state.
- * values must be the jintArray returned from JVM_GetThreadStateValues
- * and javaThreadState.
- */
-JNIEXPORT jobjectArray JNICALL
-JVM_GetThreadStateNames(JNIEnv* env, jint javaThreadState, jintArray values);
-
 /* =========================================================================
  * The following defines a private JVM interface that the JDK can query
  * for the JVM version and capabilities.  sun.misc.Version defines
--- a/jdk/src/java.base/share/native/libjava/ClassLoader.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/native/libjava/ClassLoader.c	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -224,18 +224,6 @@
     return result;
 }
 
-JNIEXPORT void JNICALL
-Java_java_lang_ClassLoader_resolveClass0(JNIEnv *env, jobject this,
-                                         jclass cls)
-{
-    if (cls == NULL) {
-        JNU_ThrowNullPointerException(env, 0);
-        return;
-    }
-
-    JVM_ResolveClass(env, cls);
-}
-
 /*
  * Returns NULL if class not found.
  */
--- a/jdk/src/java.base/share/native/libjava/Compiler.c	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 1995, 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "jvm.h"
-#include "jni.h"
-#include "java_lang_Compiler.h"
-
-static JNINativeMethod methods[] = {
-    {"compileClass",
-     "(Ljava/lang/Class;)Z",
-     (void *)&JVM_CompileClass},
-    {"compileClasses",
-     "(Ljava/lang/String;)Z",
-     (void *)&JVM_CompileClasses},
-    {"command",
-     "(Ljava/lang/Object;)Ljava/lang/Object;",
-     (void *)&JVM_CompilerCommand},
-    {"enable",
-     "()V",
-     (void *)&JVM_EnableCompiler},
-    {"disable",
-     "()V",
-     (void *)&JVM_DisableCompiler}
-};
-
-JNIEXPORT void JNICALL
-Java_java_lang_Compiler_registerNatives(JNIEnv *env, jclass compCls)
-{
-    (*env)->RegisterNatives(env, compCls, methods,
-                            sizeof methods / sizeof methods[0]);
-}
--- a/jdk/src/java.base/share/native/libjava/Runtime.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/native/libjava/Runtime.c	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,18 +66,6 @@
 }
 
 JNIEXPORT void JNICALL
-Java_java_lang_Runtime_traceInstructions(JNIEnv *env, jobject this, jboolean on)
-{
-    JVM_TraceInstructions(on);
-}
-
-JNIEXPORT void JNICALL
-Java_java_lang_Runtime_traceMethodCalls(JNIEnv *env, jobject this, jboolean on)
-{
-    JVM_TraceMethodCalls(on);
-}
-
-JNIEXPORT void JNICALL
 Java_java_lang_Runtime_runFinalization0(JNIEnv *env, jobject this)
 {
     jclass cl;
--- a/jdk/src/java.base/share/native/libjava/io_util.h	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/native/libjava/io_util.h	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,6 @@
                 jint len, jboolean append, jfieldID fid);
 void fileOpen(JNIEnv *env, jobject this, jstring path, jfieldID fid, int flags);
 void throwFileNotFoundException(JNIEnv *env, jstring path);
-size_t getLastErrorString(char *buf, size_t len);
 
 /*
  * Macros for managing platform strings.  The typical usage pattern is:
--- a/jdk/src/java.base/share/native/libjava/jni_util.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/native/libjava/jni_util.c	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -157,7 +157,7 @@
                              const char *defaultDetail)
 {
     char buf[256];
-    int n = JVM_GetLastErrorString(buf, sizeof(buf));
+    int n = getLastErrorString(buf, sizeof(buf));
 
     if (n > 0) {
         jstring s = JNU_NewStringPlatform(env, buf);
--- a/jdk/src/java.base/share/native/libjava/jni_util.h	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/native/libjava/jni_util.h	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -387,6 +387,7 @@
 void buildJniFunctionName(const char *sym, const char *cname,
                           char *jniEntryName);
 
+extern size_t getLastErrorString(char *buf, size_t len);
 #ifdef __cplusplus
 } /* extern "C" */
 #endif /* __cplusplus */
--- a/jdk/src/java.base/share/native/libnet/net_util.h	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/native/libnet/net_util.h	Wed Jul 05 20:05:30 2017 +0200
@@ -184,9 +184,13 @@
 JNIEXPORT int JNICALL
 NET_MapSocketOptionV6(jint cmd, int *level, int *optname);
 
+JNIEXPORT jint JNICALL
+NET_EnableFastTcpLoopback(int fd);
+
 int getScopeID (struct sockaddr *);
 
 int cmpScopeID (unsigned int, struct sockaddr *);
 
 unsigned short in_cksum(unsigned short *addr, int len);
+
 #endif /* NET_UTILS_H */
--- a/jdk/src/java.base/share/native/libzip/ZipFile.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/native/libzip/ZipFile.c	Wed Jul 05 20:05:30 2017 +0200
@@ -93,24 +93,27 @@
     jzfile *zip = 0;
 
     if (mode & OPEN_READ) flag |= O_RDONLY;
-    if (mode & OPEN_DELETE) flag |= JVM_O_DELETE;
 
     if (path != 0) {
         zip = ZIP_Get_From_Cache(path, &msg, lastModified);
         if (zip == 0 && msg == 0) {
             ZFILE zfd = 0;
 #ifdef WIN32
+            if (mode & OPEN_DELETE) flag |= O_TEMPORARY;
             zfd = winFileHandleOpen(env, name, flag);
             if (zfd == -1) {
                 /* Exception already pending. */
                 goto finally;
             }
 #else
-            zfd = JVM_Open(path, flag, 0);
+            zfd = open(path, flag, 0);
             if (zfd < 0) {
                 throwFileNotFoundException(env, name);
                 goto finally;
             }
+            if (mode & OPEN_DELETE) {
+                unlink(path);
+            }
 #endif
             zip = ZIP_Put_In_Cache0(path, zfd, &msg, lastModified, usemmap);
         }
--- a/jdk/src/java.base/share/native/libzip/zip_util.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/share/native/libzip/zip_util.c	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -123,7 +123,7 @@
         flagsAndAttributes, /* flags and attributes */
         NULL);
 #else
-    return JVM_Open(fname, flags, 0);
+    return open(fname, flags, 0);
 #endif
 }
 
@@ -136,7 +136,7 @@
 #ifdef WIN32
     CloseHandle((HANDLE) zfd);
 #else
-    JVM_Close(zfd);
+    close(zfd);
 #endif
 }
 
@@ -145,14 +145,6 @@
 #ifdef WIN32
     return (int) IO_Read(zfd, buf, nbytes);
 #else
-    /*
-     * Calling JVM_Read will return JVM_IO_INTR when Thread.interrupt is called
-     * only on Solaris. Continue reading jar file in this case is the best
-     * thing to do since zip file reading is relatively fast and it is very onerous
-     * for a interrupted thread to deal with this kind of hidden I/O. However, handling
-     * JVM_IO_INTR is tricky and could cause undesired side effect. So we decided
-     * to simply call "read" on Solaris/Linux. See details in bug 6304463.
-     */
     return read(zfd, buf, nbytes);
 #endif
 }
@@ -198,9 +190,8 @@
         if (n > 0) {
             bp += n;
             len -= n;
-        } else if (n == JVM_IO_ERR && errno == EINTR) {
-          /* Retry after EINTR (interrupted by signal).
-             We depend on the fact that JVM_IO_ERR == -1. */
+        } else if (n == -1 && errno == EINTR) {
+          /* Retry after EINTR (interrupted by signal). */
             continue;
         } else { /* EOF or IO error */
             return -1;
@@ -828,7 +819,7 @@
     zip->lastModified = lastModified;
 
     if (zfd == -1) {
-        if (pmsg && JVM_GetLastErrorString(errbuf, sizeof(errbuf)) > 0)
+        if (pmsg && getLastErrorString(errbuf, sizeof(errbuf)) > 0)
             *pmsg = strdup(errbuf);
         freeZip(zip);
         return NULL;
@@ -849,7 +840,7 @@
                 *pmsg = strdup("zip file is empty");
             }
         } else { /* error */
-            if (pmsg && JVM_GetLastErrorString(errbuf, sizeof(errbuf)) > 0)
+            if (pmsg && getLastErrorString(errbuf, sizeof(errbuf)) > 0)
                 *pmsg = strdup(errbuf);
         }
         ZFILE_Close(zfd);
--- a/jdk/src/java.base/unix/native/include/jvm_md.h	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/unix/native/include/jvm_md.h	Wed Jul 05 20:05:30 2017 +0200
@@ -75,7 +75,6 @@
 #define JVM_O_O_APPEND   O_APPEND
 #define JVM_O_EXCL       O_EXCL
 #define JVM_O_CREAT      O_CREAT
-#define JVM_O_DELETE     0x10000
 
 /* Signals */
 
--- a/jdk/src/java.base/unix/native/libjava/io_util_md.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/unix/native/libjava/io_util_md.c	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -211,18 +211,3 @@
     RESTARTABLE(ftruncate64(fd, length), result);
     return result;
 }
-
-size_t
-getLastErrorString(char *buf, size_t len)
-{
-    if (errno == 0 || len < 1) return 0;
-
-    const char *err = strerror(errno);
-    size_t n = strlen(err);
-    if (n >= len)
-        n = len - 1;
-
-    strncpy(buf, err, n);
-    buf[n] = '\0';
-    return n;
-}
--- a/jdk/src/java.base/unix/native/libjava/jni_util_md.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/unix/native/libjava/jni_util_md.c	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
  * questions.
  */
 
+#include <errno.h>
 #include <string.h>
 
 #include "jni.h"
@@ -51,3 +52,17 @@
     }
 }
 
+size_t
+getLastErrorString(char *buf, size_t len)
+{
+    if (errno == 0 || len < 1) return 0;
+
+    const char *err = strerror(errno);
+    size_t n = strlen(err);
+    if (n >= len)
+        n = len - 1;
+
+    strncpy(buf, err, n);
+    buf[n] = '\0';
+    return n;
+}
--- a/jdk/src/java.base/unix/native/libnet/net_util_md.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/unix/native/libnet/net_util_md.c	Wed Jul 05 20:05:30 2017 +0200
@@ -790,6 +790,11 @@
 #endif
 }
 
+JNIEXPORT jint JNICALL
+NET_EnableFastTcpLoopback(int fd) {
+    return 0;
+}
+
 /* In the case of an IPv4 Inetaddress this method will return an
  * IPv4 mapped address where IPv6 is available and v4MappedAddress is TRUE.
  * Otherwise it will return a sockaddr_in structure for an IPv4 InetAddress.
--- a/jdk/src/java.base/unix/native/libnio/ch/Net.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/unix/native/libnio/ch/Net.c	Wed Jul 05 20:05:30 2017 +0200
@@ -188,7 +188,7 @@
 
 JNIEXPORT int JNICALL
 Java_sun_nio_ch_Net_socket0(JNIEnv *env, jclass cl, jboolean preferIPv6,
-                            jboolean stream, jboolean reuse)
+                            jboolean stream, jboolean reuse, jboolean ignored)
 {
     int fd;
     int type = (stream ? SOCK_STREAM : SOCK_DGRAM);
--- a/jdk/src/java.base/windows/native/include/jvm_md.h	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/windows/native/include/jvm_md.h	Wed Jul 05 20:05:30 2017 +0200
@@ -97,7 +97,6 @@
 #define JVM_O_O_APPEND   O_APPEND
 #define JVM_O_EXCL       O_EXCL
 #define JVM_O_CREAT      O_CREAT
-#define JVM_O_DELETE     O_TEMPORARY
 
 /* Signals */
 
--- a/jdk/src/java.base/windows/native/libjava/io_util_md.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/windows/native/libjava/io_util_md.c	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -576,77 +576,3 @@
     }
     return long_to_jlong(pos.QuadPart);
 }
-
-size_t
-getLastErrorString(char *utf8_jvmErrorMsg, size_t cbErrorMsg)
-{
-    size_t n = 0;
-    if (cbErrorMsg > 0) {
-        BOOLEAN noError = FALSE;
-        WCHAR *utf16_osErrorMsg = (WCHAR *)malloc(cbErrorMsg*sizeof(WCHAR));
-        if (utf16_osErrorMsg == NULL) {
-            // OOM accident
-            strncpy(utf8_jvmErrorMsg, "Out of memory", cbErrorMsg);
-            // truncate if too long
-            utf8_jvmErrorMsg[cbErrorMsg - 1] = '\0';
-            n = strlen(utf8_jvmErrorMsg);
-        } else {
-            DWORD errval = GetLastError();
-            if (errval != 0) {
-                // WIN32 error
-                n = (size_t)FormatMessageW(
-                    FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
-                    NULL,
-                    errval,
-                    0,
-                    utf16_osErrorMsg,
-                    (DWORD)cbErrorMsg,
-                    NULL);
-                if (n > 3) {
-                    // Drop final '.', CR, LF
-                    if (utf16_osErrorMsg[n - 1] == L'\n') --n;
-                    if (utf16_osErrorMsg[n - 1] == L'\r') --n;
-                    if (utf16_osErrorMsg[n - 1] == L'.') --n;
-                    utf16_osErrorMsg[n] = L'\0';
-                }
-            } else if (errno != 0) {
-                // C runtime error that has no corresponding WIN32 error code
-                const WCHAR *rtError = _wcserror(errno);
-                if (rtError != NULL) {
-                    wcsncpy(utf16_osErrorMsg, rtError, cbErrorMsg);
-                    // truncate if too long
-                    utf16_osErrorMsg[cbErrorMsg - 1] = L'\0';
-                    n = wcslen(utf16_osErrorMsg);
-                }
-            } else
-                noError = TRUE; //OS has no error to report
-
-            if (!noError) {
-                if (n > 0) {
-                    n = WideCharToMultiByte(
-                        CP_UTF8,
-                        0,
-                        utf16_osErrorMsg,
-                        n,
-                        utf8_jvmErrorMsg,
-                        cbErrorMsg,
-                        NULL,
-                        NULL);
-
-                    // no way to die
-                    if (n > 0)
-                        utf8_jvmErrorMsg[min(cbErrorMsg - 1, n)] = '\0';
-                }
-
-                if (n <= 0) {
-                    strncpy(utf8_jvmErrorMsg, "Secondary error while OS message extraction", cbErrorMsg);
-                    // truncate if too long
-                    utf8_jvmErrorMsg[cbErrorMsg - 1] = '\0';
-                    n = strlen(utf8_jvmErrorMsg);
-                }
-            }
-            free(utf16_osErrorMsg);
-        }
-    }
-    return n;
-}
--- a/jdk/src/java.base/windows/native/libjava/jni_util_md.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/windows/native/libjava/jni_util_md.c	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2014 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,3 +73,77 @@
     }
     return;
 }
+
+size_t
+getLastErrorString(char *utf8_jvmErrorMsg, size_t cbErrorMsg)
+{
+    size_t n = 0;
+    if (cbErrorMsg > 0) {
+        BOOLEAN noError = FALSE;
+        WCHAR *utf16_osErrorMsg = (WCHAR *)malloc(cbErrorMsg*sizeof(WCHAR));
+        if (utf16_osErrorMsg == NULL) {
+            // OOM accident
+            strncpy(utf8_jvmErrorMsg, "Out of memory", cbErrorMsg);
+            // truncate if too long
+            utf8_jvmErrorMsg[cbErrorMsg - 1] = '\0';
+            n = strlen(utf8_jvmErrorMsg);
+        } else {
+            DWORD errval = GetLastError();
+            if (errval != 0) {
+                // WIN32 error
+                n = (size_t)FormatMessageW(
+                    FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
+                    NULL,
+                    errval,
+                    0,
+                    utf16_osErrorMsg,
+                    (DWORD)cbErrorMsg,
+                    NULL);
+                if (n > 3) {
+                    // Drop final '.', CR, LF
+                    if (utf16_osErrorMsg[n - 1] == L'\n') --n;
+                    if (utf16_osErrorMsg[n - 1] == L'\r') --n;
+                    if (utf16_osErrorMsg[n - 1] == L'.') --n;
+                    utf16_osErrorMsg[n] = L'\0';
+                }
+            } else if (errno != 0) {
+                // C runtime error that has no corresponding WIN32 error code
+                const WCHAR *rtError = _wcserror(errno);
+                if (rtError != NULL) {
+                    wcsncpy(utf16_osErrorMsg, rtError, cbErrorMsg);
+                    // truncate if too long
+                    utf16_osErrorMsg[cbErrorMsg - 1] = L'\0';
+                    n = wcslen(utf16_osErrorMsg);
+                }
+            } else
+                noError = TRUE; //OS has no error to report
+
+            if (!noError) {
+                if (n > 0) {
+                    n = WideCharToMultiByte(
+                        CP_UTF8,
+                        0,
+                        utf16_osErrorMsg,
+                        n,
+                        utf8_jvmErrorMsg,
+                        cbErrorMsg,
+                        NULL,
+                        NULL);
+
+                    // no way to die
+                    if (n > 0)
+                        utf8_jvmErrorMsg[min(cbErrorMsg - 1, n)] = '\0';
+                }
+
+                if (n <= 0) {
+                    strncpy(utf8_jvmErrorMsg, "Secondary error while OS message extraction", cbErrorMsg);
+                    // truncate if too long
+                    utf8_jvmErrorMsg[cbErrorMsg - 1] = '\0';
+                    n = strlen(utf8_jvmErrorMsg);
+                }
+            }
+            free(utf16_osErrorMsg);
+        }
+    }
+    return n;
+}
--- a/jdk/src/java.base/windows/native/libnet/net_util_md.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/windows/native/libnet/net_util_md.c	Wed Jul 05 20:05:30 2017 +0200
@@ -29,6 +29,9 @@
 #include "net_util.h"
 #include "jni.h"
 
+// Taken from mstcpip.h in Windows SDK 8.0 or newer.
+#define SIO_LOOPBACK_FAST_PATH              _WSAIOW(IOC_VENDOR,16)
+
 #ifndef IPTOS_TOS_MASK
 #define IPTOS_TOS_MASK 0x1e
 #endif
@@ -844,6 +847,25 @@
     }
 }
 
+/**
+ * Enables SIO_LOOPBACK_FAST_PATH
+ */
+JNIEXPORT jint JNICALL
+NET_EnableFastTcpLoopback(int fd) {
+    int enabled = 1;
+    DWORD result_byte_count = -1;
+    int result = WSAIoctl(fd,
+                          SIO_LOOPBACK_FAST_PATH,
+                          &enabled,
+                          sizeof(enabled),
+                          NULL,
+                          0,
+                          &result_byte_count,
+                          NULL,
+                          NULL);
+    return result == SOCKET_ERROR ? WSAGetLastError() : 0;
+}
+
 /* If address types is IPv6, then IPv6 must be available. Otherwise
  * no address can be generated. In the case of an IPv4 Inetaddress this
  * method will return an IPv4 mapped address where IPv6 is available and
--- a/jdk/src/java.base/windows/native/libnio/ch/Net.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.base/windows/native/libnio/ch/Net.c	Wed Jul 05 20:05:30 2017 +0200
@@ -127,7 +127,7 @@
 
 JNIEXPORT jint JNICALL
 Java_sun_nio_ch_Net_socket0(JNIEnv *env, jclass cl, jboolean preferIPv6,
-                            jboolean stream, jboolean reuse)
+                            jboolean stream, jboolean reuse, jboolean fastLoopback)
 {
     SOCKET s;
     int domain = (preferIPv6) ? AF_INET6 : AF_INET;
@@ -152,6 +152,20 @@
         NET_ThrowNew(env, WSAGetLastError(), "socket");
     }
 
+    if (stream && fastLoopback) {
+        static int loopback_available = 1;
+        if (loopback_available) {
+            int rv = NET_EnableFastTcpLoopback((jint)s);
+            if (rv) {
+                if (rv == WSAEOPNOTSUPP) {
+                    loopback_available = 0;
+                } else {
+                    NET_ThrowNew(env, rv, "fastLoopback");
+                }
+            }
+        }
+    }
+
     return (jint)s;
 }
 
--- a/jdk/src/java.logging/share/classes/java/util/logging/FileHandler.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.logging/share/classes/java/util/logging/FileHandler.java	Wed Jul 05 20:05:30 2017 +0200
@@ -150,7 +150,7 @@
 public class FileHandler extends StreamHandler {
     private MeteredStream meter;
     private boolean append;
-    private int limit;       // zero => no limit.
+    private long limit;       // zero => no limit.
     private int count;
     private String pattern;
     private String lockFileName;
@@ -164,11 +164,11 @@
      * (a) forwards all its output to a target stream
      * (b) keeps track of how many bytes have been written
      */
-    private class MeteredStream extends OutputStream {
+    private static final class MeteredStream extends OutputStream {
         final OutputStream out;
-        int written;
+        long written;
 
-        MeteredStream(OutputStream out, int written) {
+        MeteredStream(OutputStream out, long written) {
             this.out = out;
             this.written = written;
         }
@@ -203,9 +203,9 @@
     }
 
     private void open(File fname, boolean append) throws IOException {
-        int len = 0;
+        long len = 0;
         if (append) {
-            len = (int)fname.length();
+            len = fname.length();
         }
         FileOutputStream fout = new FileOutputStream(fname.toString(), append);
         BufferedOutputStream bout = new BufferedOutputStream(fout);
@@ -223,7 +223,7 @@
         String cname = getClass().getName();
 
         pattern = manager.getStringProperty(cname + ".pattern", "%h/java%u.log");
-        limit = manager.getIntProperty(cname + ".limit", 0);
+        limit = manager.getLongProperty(cname + ".limit", 0);
         if (limit < 0) {
             limit = 0;
         }
@@ -395,6 +395,39 @@
      */
     public FileHandler(String pattern, int limit, int count, boolean append)
                                         throws IOException, SecurityException {
+        this(pattern, (long)limit, count, append);
+    }
+
+    /**
+     * Initialize a {@code FileHandler} to write to a set of files
+     * with optional append.  When (approximately) the given limit has
+     * been written to one file, another file will be opened.  The
+     * output will cycle through a set of count files.
+     * <p>
+     * The {@code FileHandler} is configured based on {@code LogManager}
+     * properties (or their default values) except that the given pattern
+     * argument is used as the filename pattern, the file limit is
+     * set to the limit argument, and the file count is set to the
+     * given count argument, and the append mode is set to the given
+     * {@code append} argument.
+     * <p>
+     * The count must be at least 1.
+     *
+     * @param pattern  the pattern for naming the output file
+     * @param limit  the maximum number of bytes to write to any one file
+     * @param count  the number of files to use
+     * @param append  specifies append mode
+     * @exception  IOException if there are IO problems opening the files.
+     * @exception  SecurityException  if a security manager exists and if
+     *             the caller does not have {@code LoggingPermission("control")}.
+     * @exception  IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
+     * @exception  IllegalArgumentException if pattern is an empty string
+     *
+     * @since 1.9
+     *
+     */
+    public FileHandler(String pattern, long limit, int count, boolean append)
+                                        throws IOException {
         if (limit < 0 || count < 1 || pattern.length() < 1) {
             throw new IllegalArgumentException();
         }
@@ -690,7 +723,7 @@
         }
         super.publish(record);
         flush();
-        if (limit > 0 && meter.written >= limit) {
+        if (limit > 0 && (meter.written >= limit || meter.written < 0)) {
             // We performed access checks in the "init" method to make sure
             // we are only initialized from trusted code.  So we assume
             // it is OK to write the target files, even if we are
--- a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1387,6 +1387,21 @@
         }
     }
 
+    // Package private method to get a long property.
+    // If the property is not defined or cannot be parsed
+    // we return the given default value.
+    long getLongProperty(String name, long defaultValue) {
+        String val = getProperty(name);
+        if (val == null) {
+            return defaultValue;
+        }
+        try {
+            return Long.parseLong(val.trim());
+        } catch (Exception ex) {
+            return defaultValue;
+        }
+    }
+
     // Package private method to get a boolean property.
     // If the property is not defined or cannot be parsed
     // we return the given default value.
--- a/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java	Wed Jul 05 20:05:30 2017 +0200
@@ -52,6 +52,7 @@
 import java.security.PrivilegedExceptionAction;
 import javax.management.JMX;
 import sun.management.ManagementFactoryHelper;
+import sun.management.ExtendedPlatformComponent;
 
 /**
  * The {@code ManagementFactory} class is a factory class for getting
@@ -489,6 +490,12 @@
             for (Map.Entry<ObjectName, DynamicMBean> e : dynmbeans.entrySet()) {
                 addDynamicMBean(platformMBeanServer, e.getValue(), e.getKey());
             }
+            for (final PlatformManagedObject o :
+                                       ExtendedPlatformComponent.getMXBeans()) {
+                if (!platformMBeanServer.isRegistered(o.getObjectName())) {
+                    addMXBean(platformMBeanServer, o);
+                }
+            }
         }
         return platformMBeanServer;
     }
@@ -655,9 +662,14 @@
     public static <T extends PlatformManagedObject>
             T getPlatformMXBean(Class<T> mxbeanInterface) {
         PlatformComponent pc = PlatformComponent.getPlatformComponent(mxbeanInterface);
-        if (pc == null)
+        if (pc == null) {
+            T mbean = ExtendedPlatformComponent.getMXBean(mxbeanInterface);
+            if (mbean != null) {
+                return mbean;
+            }
             throw new IllegalArgumentException(mxbeanInterface.getName() +
                 " is not a platform management interface");
+        }
         if (!pc.isSingleton())
             throw new IllegalArgumentException(mxbeanInterface.getName() +
                 " can have zero or more than one instances");
@@ -690,9 +702,14 @@
     public static <T extends PlatformManagedObject> List<T>
             getPlatformMXBeans(Class<T> mxbeanInterface) {
         PlatformComponent pc = PlatformComponent.getPlatformComponent(mxbeanInterface);
-        if (pc == null)
+        if (pc == null) {
+            T mbean = ExtendedPlatformComponent.getMXBean(mxbeanInterface);
+            if (mbean != null) {
+                return Collections.singletonList(mbean);
+            }
             throw new IllegalArgumentException(mxbeanInterface.getName() +
                 " is not a platform management interface");
+        }
         return Collections.unmodifiableList(pc.getMXBeans(mxbeanInterface));
     }
 
@@ -737,9 +754,17 @@
         throws java.io.IOException
     {
         PlatformComponent pc = PlatformComponent.getPlatformComponent(mxbeanInterface);
-        if (pc == null)
+        if (pc == null) {
+            T mbean = ExtendedPlatformComponent.getMXBean(mxbeanInterface);
+            if (mbean != null) {
+                ObjectName on = mbean.getObjectName();
+                return ManagementFactory.newPlatformMXBeanProxy(connection,
+                                                                on.getCanonicalName(),
+                                                                mxbeanInterface);
+            }
             throw new IllegalArgumentException(mxbeanInterface.getName() +
                 " is not a platform management interface");
+        }
         if (!pc.isSingleton())
             throw new IllegalArgumentException(mxbeanInterface.getName() +
                 " can have zero or more than one instances");
@@ -781,6 +806,13 @@
     {
         PlatformComponent pc = PlatformComponent.getPlatformComponent(mxbeanInterface);
         if (pc == null) {
+            T mbean = ExtendedPlatformComponent.getMXBean(mxbeanInterface);
+            if (mbean != null) {
+                ObjectName on = mbean.getObjectName();
+                T proxy = ManagementFactory.newPlatformMXBeanProxy(connection,
+                            on.getCanonicalName(), mxbeanInterface);
+                return Collections.singletonList(proxy);
+            }
             throw new IllegalArgumentException(mxbeanInterface.getName() +
                 " is not a platform management interface");
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.management/share/classes/sun/management/ExtendedPlatformComponent.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.management;
+
+import java.util.Collections;
+import java.util.List;
+import java.lang.management.PlatformManagedObject;
+
+/**
+ * Class to allow for an extended set of platform MXBeans
+ */
+public final class ExtendedPlatformComponent {
+    private ExtendedPlatformComponent() {} // Don't create any instances
+
+    /**
+     * Get the extended set of platform MXBeans that should be registered in the
+     * platform MBeanServer, or an empty list if there are no such MXBeans.
+     */
+    public static List<? extends PlatformManagedObject> getMXBeans() {
+        return Collections.emptyList();
+    }
+
+    /**
+     * Returns the extended platform MXBean implementing the given
+     * mxbeanInterface, or null if there is no such MXBean.
+     */
+    public static <T extends PlatformManagedObject>
+            T getMXBean(Class<T> mxbeanInterface) {
+        return null;
+    }
+}
--- a/jdk/src/java.management/share/native/libmanagement/DiagnosticCommandImpl.c	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.management/share/native/libmanagement/DiagnosticCommandImpl.c	Wed Jul 05 20:05:30 2017 +0200
@@ -65,6 +65,11 @@
                                                    dcmd_arg_info_array);
   dcmdArgInfoCls = (*env)->FindClass(env,
                                      "sun/management/DiagnosticCommandArgumentInfo");
+  if ((*env)->ExceptionCheck(env)) {
+    free(dcmd_arg_info_array);
+    return NULL;
+  }
+
   result = (*env)->NewObjectArray(env, num_arg, dcmdArgInfoCls, NULL);
   if (result == NULL) {
     free(dcmd_arg_info_array);
@@ -91,9 +96,16 @@
   }
   free(dcmd_arg_info_array);
   arraysCls = (*env)->FindClass(env, "java/util/Arrays");
+  if ((*env)->ExceptionCheck(env)) {
+    return NULL;
+  }
   mid = (*env)->GetStaticMethodID(env, arraysCls,
                                   "asList", "([Ljava/lang/Object;)Ljava/util/List;");
   resultList = (*env)->CallStaticObjectMethod(env, arraysCls, mid, result);
+  if ((*env)->ExceptionCheck(env)) {
+    // Make sure we return NULL in case of OOM inside Java
+    return NULL;
+  }
   return resultList;
 }
 
@@ -121,6 +133,10 @@
   num_commands = (*env)->GetArrayLength(env, commands);
   dcmdInfoCls = (*env)->FindClass(env,
                                   "sun/management/DiagnosticCommandInfo");
+  if ((*env)->ExceptionCheck(env)) {
+    return NULL;
+  }
+
   result = (*env)->NewObjectArray(env, num_commands, dcmdInfoCls, NULL);
   if (result == NULL) {
       JNU_ThrowOutOfMemoryError(env, 0);
--- a/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetWarning.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetWarning.java	Wed Jul 05 20:05:30 2017 +0200
@@ -56,11 +56,6 @@
 public class RowSetWarning extends SQLException {
 
     /**
-     * RowSetWarning object handle.
-     */
-     private RowSetWarning rwarning;
-
-    /**
      * Constructs a <code>RowSetWarning</code> object
      * with the given value for the reason; SQLState defaults to null,
      * and vendorCode defaults to 0.
@@ -128,7 +123,15 @@
      * @see #setNextWarning
      */
     public RowSetWarning getNextWarning() {
-        return rwarning;
+        SQLException warning = getNextException();
+        if (  warning == null || warning instanceof RowSetWarning) {
+            return (RowSetWarning)warning;
+        } else {
+            // The chained value isn't a RowSetWarning.
+            // This is a programming error by whoever added it to
+            // the RowSetWarning chain.  We throw a Java "Error".
+            throw new Error("RowSetWarning chain holds value that is not a RowSetWarning: ");
+        }
     }
 
     /**
@@ -141,7 +144,7 @@
      * @see #getNextWarning
      */
     public void setNextWarning(RowSetWarning warning) {
-        rwarning = warning;
+        setNextException(warning);
     }
 
     static final long serialVersionUID = 6678332766434564774L;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/CipherContextRef.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.security.ucrypto;
+
+import java.nio.ByteBuffer;
+import java.util.Set;
+import java.util.Arrays;
+import java.util.concurrent.ConcurrentSkipListSet;
+import java.lang.ref.*;
+
+import java.security.*;
+import java.security.spec.*;
+import javax.crypto.*;
+
+import javax.crypto.spec.SecretKeySpec;
+import javax.crypto.spec.IvParameterSpec;
+
+/**
+ * Internal class for context resource clean up.
+ *
+ * @since 1.9
+ */
+final class CipherContextRef extends PhantomReference<NativeCipher>
+    implements Comparable<CipherContextRef> {
+
+    private static ReferenceQueue<NativeCipher> refQueue =
+        new ReferenceQueue<NativeCipher>();
+
+    // Needed to keep these references from being GC'ed until when their
+    // referents are GC'ed so we can do post-mortem processing
+    private static Set<CipherContextRef> refList =
+        new ConcurrentSkipListSet<CipherContextRef>();
+
+    final long id;
+    final boolean encrypt;
+
+    private static void drainRefQueueBounded() {
+        while (true) {
+            CipherContextRef next = (CipherContextRef) refQueue.poll();
+            if (next == null) break;
+            next.dispose(true);
+        }
+    }
+
+    CipherContextRef(NativeCipher nc, long id, boolean encrypt) {
+        super(nc, refQueue);
+        this.id = id;
+        this.encrypt = encrypt;
+        refList.add(this);
+        UcryptoProvider.debug("Resource: trace CipherCtxt " + this.id);
+        drainRefQueueBounded();
+    }
+
+    public int compareTo(CipherContextRef other) {
+        if (this.id == other.id) {
+            return 0;
+        } else {
+            return (this.id < other.id) ? -1 : 1;
+        }
+    }
+
+    void dispose(boolean doCancel) {
+        refList.remove(this);
+        try {
+            if (doCancel) {
+                UcryptoProvider.debug("Resource: cancel CipherCtxt " + id);
+                int k = NativeCipher.nativeFinal(id, encrypt, null, 0);
+                if (k < 0) {
+                    UcryptoProvider.debug
+                        ("Resource: error cancelling CipherCtxt " + id +
+                        " " + new UcryptoException(-k).getMessage());
+                }
+            } else {
+                UcryptoProvider.debug("Resource: untrace CipherCtxt " + id);
+            }
+        } finally {
+            this.clear();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/Config.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,219 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.security.ucrypto;
+
+import java.io.*;
+import static java.io.StreamTokenizer.*;
+import java.math.BigInteger;
+import java.util.*;
+
+import java.security.*;
+
+import sun.security.action.GetPropertyAction;
+import sun.security.util.PropertyExpander;
+
+import sun.security.pkcs11.wrapper.*;
+
+/**
+ * Configuration container and file parsing.
+ *
+ * Currently, there is only one supported entry "disabledServices"
+ * for disabling crypto services. Its syntax is as follows:
+ *
+ * disabledServices = {
+ * <ServiceType>.<Algorithm>
+ * ...
+ * }
+ *
+ * where <Service> can be "MessageDigest", "Cipher", etc. and <Algorithm>
+ * reprepresents the value that's passed into the various getInstance() calls.
+ *
+ * @since   1.9
+ */
+final class Config {
+
+    // Reader and StringTokenizer used during parsing
+    private Reader reader;
+
+    private StreamTokenizer st;
+
+    private Set<String> parsedKeywords;
+
+    // set of disabled crypto services, e.g. MessageDigest.SHA1, or
+    // Cipher.AES/ECB/PKCS5Padding
+    private Set<String> disabledServices;
+
+    Config(String filename) throws IOException {
+        FileInputStream in = new FileInputStream(expand(filename));
+        reader = new BufferedReader(new InputStreamReader(in));
+        parsedKeywords = new HashSet<String>();
+        st = new StreamTokenizer(reader);
+        setupTokenizer();
+        parse();
+    }
+
+    String[] getDisabledServices() {
+        if (disabledServices != null) {
+            return disabledServices.toArray(new String[disabledServices.size()]);
+        } else {
+            return new String[0];
+        }
+    }
+
+    private static String expand(final String s) throws IOException {
+        try {
+            return PropertyExpander.expand(s);
+        } catch (Exception e) {
+            throw new RuntimeException(e.getMessage());
+        }
+    }
+
+    private void setupTokenizer() {
+        st.resetSyntax();
+        st.wordChars('a', 'z');
+        st.wordChars('A', 'Z');
+        st.wordChars('0', '9');
+        st.wordChars(':', ':');
+        st.wordChars('.', '.');
+        st.wordChars('_', '_');
+        st.wordChars('-', '-');
+        st.wordChars('/', '/');
+        st.wordChars('\\', '\\');
+        st.wordChars('$', '$');
+        st.wordChars('{', '{'); // need {} for property subst
+        st.wordChars('}', '}');
+        st.wordChars('*', '*');
+        st.wordChars('+', '+');
+        st.wordChars('~', '~');
+        // XXX check ASCII table and add all other characters except special
+
+        // special: #="(),
+        st.whitespaceChars(0, ' ');
+        st.commentChar('#');
+        st.eolIsSignificant(true);
+        st.quoteChar('\"');
+    }
+
+    private ConfigException excToken(String msg) {
+        return new ConfigException(msg + " " + st);
+    }
+
+    private ConfigException excLine(String msg) {
+        return new ConfigException(msg + ", line " + st.lineno());
+    }
+
+    private void parse() throws IOException {
+        while (true) {
+            int token = nextToken();
+            if (token == TT_EOF) {
+                break;
+            }
+            if (token == TT_EOL) {
+                continue;
+            }
+            if (token != TT_WORD) {
+                throw excToken("Unexpected token:");
+            }
+            String word = st.sval;
+            if (word.equals("disabledServices")) {
+                parseDisabledServices(word);
+            } else {
+                throw new ConfigException
+                        ("Unknown keyword '" + word + "', line " + st.lineno());
+            }
+            parsedKeywords.add(word);
+        }
+        reader.close();
+        reader = null;
+        st = null;
+        parsedKeywords = null;
+    }
+
+    //
+    // Parsing helper methods
+    //
+    private int nextToken() throws IOException {
+        int token = st.nextToken();
+        return token;
+    }
+
+    private void parseEquals() throws IOException {
+        int token = nextToken();
+        if (token != '=') {
+            throw excToken("Expected '=', read");
+        }
+    }
+
+    private void parseOpenBraces() throws IOException {
+        while (true) {
+            int token = nextToken();
+            if (token == TT_EOL) {
+                continue;
+            }
+            if ((token == TT_WORD) && st.sval.equals("{")) {
+                return;
+            }
+            throw excToken("Expected '{', read");
+        }
+    }
+
+    private boolean isCloseBraces(int token) {
+        return (token == TT_WORD) && st.sval.equals("}");
+    }
+
+    private void checkDup(String keyword) throws IOException {
+        if (parsedKeywords.contains(keyword)) {
+            throw excLine(keyword + " must only be specified once");
+        }
+    }
+
+    private void parseDisabledServices(String keyword) throws IOException {
+        checkDup(keyword);
+        disabledServices = new HashSet<String>();
+        parseEquals();
+        parseOpenBraces();
+        while (true) {
+            int token = nextToken();
+            if (isCloseBraces(token)) {
+                break;
+            }
+            if (token == TT_EOL) {
+                continue;
+            }
+            if (token != TT_WORD) {
+                throw excToken("Expected mechanism, read");
+            }
+            disabledServices.add(st.sval);
+        }
+    }
+}
+
+class ConfigException extends IOException {
+    private static final long serialVersionUID = 254492758127673194L;
+    ConfigException(String msg) {
+        super(msg);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/GCMParameters.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.security.ucrypto;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.security.AlgorithmParametersSpi;
+import java.security.spec.AlgorithmParameterSpec;
+import java.security.spec.InvalidParameterSpecException;
+import javax.crypto.spec.GCMParameterSpec;
+import sun.security.util.*;
+
+/**
+ * This class implements the parameter set used with GCM mode
+ * which is defined in RFC5084 as follows:
+ *
+ * <pre>
+ * GCMParameters ::= SEQUENCE {
+ *   aes-nonce        OCTET STRING, -- recommended size is 12 octets
+ *   aes-ICVlen       AES-GCM-ICVlen DEFAULT 12 }
+ *
+ * where
+ * AES-GCM-ICVlen ::= INTEGER (12 | 13 | 14 | 15 | 16)
+ * NOTE: however, NIST 800-38D also lists 4 (32bit) and 8 (64bit)
+ * as possible AES-GCM-ICVlen values, so we allow all 6 values.
+ * </pre>
+ *
+ * @since 1.9
+ */
+public final class GCMParameters extends AlgorithmParametersSpi {
+
+    private byte[] iv; // i.e. aes-nonce
+    private int tLen; // i.e. aes-ICVlen, in bytes
+
+    public GCMParameters() {}
+
+    private void setValues(byte[] iv, int tLen) throws IOException {
+        if (iv == null) {
+            throw new IOException("IV cannot be null");
+        }
+        if (tLen != 4 && tLen != 8 && (tLen < 12 || tLen > 16)) {
+            throw new IOException("Unsupported tag length: " + tLen);
+        }
+        this.iv = iv;
+        this.tLen = tLen;
+    }
+
+    protected byte[] engineGetEncoded() throws IOException {
+        DerOutputStream out = new DerOutputStream();
+        DerOutputStream bytes = new DerOutputStream();
+
+        bytes.putOctetString(iv);
+        bytes.putInteger(tLen);
+        out.write(DerValue.tag_Sequence, bytes);
+        return out.toByteArray();
+    }
+
+    protected byte[] engineGetEncoded(String format) throws IOException {
+        // ignore format for now
+        return engineGetEncoded();
+    }
+
+    protected <T extends AlgorithmParameterSpec>
+            T engineGetParameterSpec(Class<T> paramSpec)
+        throws InvalidParameterSpecException {
+        if (GCMParameterSpec.class.isAssignableFrom(paramSpec)) {
+            return paramSpec.cast(new GCMParameterSpec(tLen*8, iv.clone()));
+        } else {
+            throw new InvalidParameterSpecException
+                ("Inappropriate parameter specification");
+        }
+    }
+
+    protected void engineInit(AlgorithmParameterSpec paramSpec)
+        throws InvalidParameterSpecException {
+        if (!(paramSpec instanceof GCMParameterSpec)) {
+            throw new InvalidParameterSpecException
+                ("Inappropriate parameter specification");
+        }
+        GCMParameterSpec gcmSpec = (GCMParameterSpec) paramSpec;
+        try {
+            setValues(gcmSpec.getIV(), gcmSpec.getTLen()/8);
+        } catch (IOException ioe) {
+            throw new InvalidParameterSpecException(ioe.getMessage());
+        }
+    }
+
+    protected void engineInit(byte[] encoded) throws IOException {
+        DerValue val = new DerValue(encoded);
+        if (val.tag == DerValue.tag_Sequence) {
+            val.data.reset();
+            setValues(val.data.getOctetString(), val.data.getInteger());
+        } else {
+            throw new IOException("GCM parameter parsing error: SEQ tag expected");
+        }
+    }
+
+    protected void engineInit(byte[] encoded, String format)
+        throws IOException {
+        // ignore format for now
+        engineInit(encoded);
+    }
+
+    protected String engineToString() {
+        return ("IV=" + Arrays.toString(iv) + ", tLen=" + tLen * 8);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipher.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,588 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.security.ucrypto;
+
+import java.nio.ByteBuffer;
+import java.util.Set;
+import java.util.Arrays;
+import java.util.concurrent.ConcurrentSkipListSet;
+import java.lang.ref.*;
+
+import java.security.*;
+import java.security.spec.*;
+import javax.crypto.*;
+
+import javax.crypto.spec.SecretKeySpec;
+import javax.crypto.spec.IvParameterSpec;
+
+/**
+ * Cipher wrapper class utilizing ucrypto APIs. This class currently supports
+ * - AES/ECB/NOPADDING
+ * - AES/CBC/NOPADDING
+ * - AES/CTR/NOPADDING
+ * - AES/CFB128/NOPADDING
+ * (Support for GCM mode is inside the child class NativeGCMCipher)
+ *
+ * @since 1.9
+ */
+class NativeCipher extends CipherSpi {
+
+    // public implementation classes
+    public static final class AesEcbNoPadding extends NativeCipher {
+        public AesEcbNoPadding() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_AES_ECB);
+        }
+    }
+    public static final class AesCbcNoPadding extends NativeCipher {
+        public AesCbcNoPadding() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_AES_CBC);
+        }
+    }
+    public static final class AesCtrNoPadding extends NativeCipher {
+        public AesCtrNoPadding() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_AES_CTR);
+        }
+    }
+    public static final class AesCfb128NoPadding extends NativeCipher {
+        public AesCfb128NoPadding() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_AES_CFB128);
+        }
+    }
+
+    // public implementation classes with fixed key sizes
+    public static final class Aes128EcbNoPadding extends NativeCipher {
+        public Aes128EcbNoPadding() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_AES_ECB, 16);
+        }
+    }
+    public static final class Aes128CbcNoPadding extends NativeCipher {
+        public Aes128CbcNoPadding() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_AES_CBC, 16);
+        }
+    }
+    public static final class Aes192EcbNoPadding extends NativeCipher {
+        public Aes192EcbNoPadding() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_AES_ECB, 24);
+        }
+    }
+    public static final class Aes192CbcNoPadding extends NativeCipher {
+        public Aes192CbcNoPadding() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_AES_CBC, 24);
+        }
+    }
+    public static final class Aes256EcbNoPadding extends NativeCipher {
+        public Aes256EcbNoPadding() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_AES_ECB, 32);
+        }
+    }
+    public static final class Aes256CbcNoPadding extends NativeCipher {
+        public Aes256CbcNoPadding() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_AES_CBC, 32);
+        }
+    }
+
+    // ok as constants since AES is all we support
+    public static final int AES_BLOCK_SIZE = 16;
+    public static final String AES_KEY_ALGO = "AES";
+
+    // fields set in constructor
+    protected final UcryptoMech mech;
+    protected String keyAlgo;
+    protected int blockSize;
+    protected int fixedKeySize;
+
+    //
+    // fields (re)set in every init()
+    //
+    protected CipherContextRef pCtxt = null;
+    protected byte[] keyValue = null;
+    protected byte[] iv = null;
+    protected boolean initialized = false;
+    protected boolean encrypt = true;
+    protected int bytesBuffered = 0;
+
+    // private utility methods for key re-construction
+    private static final PublicKey constructPublicKey(byte[] encodedKey,
+                                              String encodedKeyAlgorithm)
+        throws InvalidKeyException, NoSuchAlgorithmException {
+
+        PublicKey key = null;
+        try {
+            KeyFactory keyFactory =
+                KeyFactory.getInstance(encodedKeyAlgorithm);
+            X509EncodedKeySpec keySpec = new X509EncodedKeySpec(encodedKey);
+            key = keyFactory.generatePublic(keySpec);
+        } catch (NoSuchAlgorithmException nsae) {
+            throw new NoSuchAlgorithmException("No provider found for " +
+                                               encodedKeyAlgorithm +
+                                               " KeyFactory");
+        } catch (InvalidKeySpecException ikse) {
+            // Should never happen
+            throw new InvalidKeyException("Cannot construct public key", ikse);
+        }
+        return key;
+    }
+
+    private static final PrivateKey constructPrivateKey(byte[] encodedKey,
+                                                String encodedKeyAlgorithm)
+        throws InvalidKeyException, NoSuchAlgorithmException {
+
+        PrivateKey key = null;
+        try {
+            KeyFactory keyFactory =
+                KeyFactory.getInstance(encodedKeyAlgorithm);
+            PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(encodedKey);
+            key = keyFactory.generatePrivate(keySpec);
+        } catch (NoSuchAlgorithmException nsae) {
+            throw new NoSuchAlgorithmException("No provider found for " +
+                                               encodedKeyAlgorithm +
+                                               " KeyFactory");
+        } catch (InvalidKeySpecException ikse) {
+            // Should never happen
+            throw new InvalidKeyException("Cannot construct private key", ikse);
+        }
+        return key;
+    }
+
+    private static final SecretKey constructSecretKey(byte[] encodedKey,
+                                              String encodedKeyAlgorithm) {
+        return new SecretKeySpec(encodedKey, encodedKeyAlgorithm);
+    }
+
+    // package-private utility method for general key re-construction
+    static final Key constructKey(int keyType, byte[] encodedKey,
+                                  String encodedKeyAlgorithm)
+        throws InvalidKeyException, NoSuchAlgorithmException {
+        Key result = null;
+        switch (keyType) {
+        case Cipher.SECRET_KEY:
+            result = constructSecretKey(encodedKey,
+                                        encodedKeyAlgorithm);
+            break;
+        case Cipher.PRIVATE_KEY:
+            result = constructPrivateKey(encodedKey,
+                                         encodedKeyAlgorithm);
+            break;
+        case Cipher.PUBLIC_KEY:
+            result = constructPublicKey(encodedKey,
+                                        encodedKeyAlgorithm);
+            break;
+        }
+        return result;
+    }
+
+    NativeCipher(UcryptoMech mech, int fixedKeySize) throws NoSuchAlgorithmException {
+        this.mech = mech;
+        // defaults to AES - the only supported symmetric cipher algo
+        this.blockSize = AES_BLOCK_SIZE;
+        this.keyAlgo = AES_KEY_ALGO;
+        this.fixedKeySize = fixedKeySize;
+    }
+
+    NativeCipher(UcryptoMech mech) throws NoSuchAlgorithmException {
+        this(mech, -1);
+    }
+
+    @Override
+    protected void engineSetMode(String mode) throws NoSuchAlgorithmException {
+        // Disallow change of mode for now since currently it's explicitly
+        // defined in transformation strings
+        throw new NoSuchAlgorithmException("Unsupported mode " + mode);
+    }
+
+    // see JCE spec
+    @Override
+    protected void engineSetPadding(String padding)
+            throws NoSuchPaddingException {
+        // Disallow change of padding for now since currently it's explicitly
+        // defined in transformation strings
+        throw new NoSuchPaddingException("Unsupported padding " + padding);
+    }
+
+    // see JCE spec
+    @Override
+    protected int engineGetBlockSize() {
+        return blockSize;
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized int engineGetOutputSize(int inputLen) {
+        return getOutputSizeByOperation(inputLen, true);
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized byte[] engineGetIV() {
+        return (iv != null? iv.clone() : null);
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized AlgorithmParameters engineGetParameters() {
+        AlgorithmParameters params = null;
+        try {
+            if (iv != null) {
+                IvParameterSpec ivSpec = new IvParameterSpec(iv.clone());
+                params = AlgorithmParameters.getInstance(keyAlgo);
+                params.init(ivSpec);
+            }
+        } catch (GeneralSecurityException e) {
+            // NoSuchAlgorithmException, NoSuchProviderException
+            // InvalidParameterSpecException
+            throw new UcryptoException("Could not encode parameters", e);
+        }
+        return params;
+    }
+
+    @Override
+    protected int engineGetKeySize(Key key) throws InvalidKeyException {
+        return checkKey(key) * 8;
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized void engineInit(int opmode, Key key,
+            SecureRandom random) throws InvalidKeyException {
+        try {
+            engineInit(opmode, key, (AlgorithmParameterSpec)null, random);
+        } catch (InvalidAlgorithmParameterException e) {
+            throw new InvalidKeyException("init() failed", e);
+        }
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized void engineInit(int opmode, Key key,
+            AlgorithmParameterSpec params, SecureRandom random)
+            throws InvalidKeyException, InvalidAlgorithmParameterException {
+        checkKey(key);
+        if (opmode != Cipher.ENCRYPT_MODE &&
+            opmode != Cipher.DECRYPT_MODE &&
+            opmode != Cipher.WRAP_MODE &&
+            opmode != Cipher.UNWRAP_MODE) {
+            throw new InvalidAlgorithmParameterException
+                ("Unsupported mode: " + opmode);
+        }
+        boolean doEncrypt =
+                (opmode == Cipher.ENCRYPT_MODE || opmode == Cipher.WRAP_MODE);
+
+        byte[] ivBytes = null;
+        if (mech == UcryptoMech.CRYPTO_AES_ECB) {
+            if (params != null) {
+                throw new InvalidAlgorithmParameterException
+                        ("No Parameters for ECB mode");
+            }
+        } else {
+            if (params != null) {
+                if (!(params instanceof IvParameterSpec)) {
+                    throw new InvalidAlgorithmParameterException
+                            ("IvParameterSpec required");
+                } else {
+                    ivBytes = ((IvParameterSpec) params).getIV();
+                    if (ivBytes.length != blockSize) {
+                        throw new InvalidAlgorithmParameterException
+                             ("Wrong IV length: must be " + blockSize +
+                              " bytes long");
+                    }
+                }
+            } else {
+                if (encrypt) {
+                    // generate IV if none supplied for encryption
+                    ivBytes = new byte[blockSize];
+                    new SecureRandom().nextBytes(ivBytes);
+                } else {
+                    throw new InvalidAlgorithmParameterException
+                            ("Parameters required for decryption");
+                }
+            }
+        }
+        init(doEncrypt, key.getEncoded().clone(), ivBytes);
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized void engineInit(int opmode, Key key,
+            AlgorithmParameters params, SecureRandom random)
+            throws InvalidKeyException, InvalidAlgorithmParameterException {
+        AlgorithmParameterSpec spec = null;
+        if (params != null) {
+            try {
+                spec = params.getParameterSpec(IvParameterSpec.class);
+            } catch (InvalidParameterSpecException iaps) {
+                throw new InvalidAlgorithmParameterException(iaps);
+            }
+        }
+        engineInit(opmode, key, spec, random);
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized byte[] engineUpdate(byte[] in, int ofs, int len) {
+        byte[] out = new byte[getOutputSizeByOperation(len, false)];
+        int n = update(in, ofs, len, out, 0);
+        if (n == 0) {
+            return null;
+        } else if (out.length != n) {
+            out = Arrays.copyOf(out, n);
+        }
+        return out;
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized int engineUpdate(byte[] in, int inOfs, int inLen,
+        byte[] out, int outOfs) throws ShortBufferException {
+        int min = getOutputSizeByOperation(inLen, false);
+        if (out.length - outOfs < min) {
+            throw new ShortBufferException("min " + min + "-byte buffer needed");
+        }
+        return update(in, inOfs, inLen, out, outOfs);
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized void engineUpdateAAD(byte[] src, int ofs, int len)
+            throws IllegalStateException {
+        throw new IllegalStateException("No AAD can be supplied");
+    }
+
+    // see JCE spec
+    @Override
+    protected void engineUpdateAAD(ByteBuffer src)
+            throws IllegalStateException {
+        throw new IllegalStateException("No AAD can be supplied");
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized byte[] engineDoFinal(byte[] in, int ofs, int len)
+            throws IllegalBlockSizeException, BadPaddingException {
+        byte[] out = new byte[getOutputSizeByOperation(len, true)];
+        try {
+            // delegate to the other engineDoFinal(...) method
+            int k = engineDoFinal(in, ofs, len, out, 0);
+            if (out.length != k) {
+                out = Arrays.copyOf(out, k);
+            }
+            return out;
+        } catch (ShortBufferException e) {
+            throw new UcryptoException("Internal Error", e);
+        }
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized int engineDoFinal(byte[] in, int inOfs, int inLen,
+                                             byte[] out, int outOfs)
+            throws ShortBufferException, IllegalBlockSizeException,
+            BadPaddingException {
+        int k = 0;
+        int min = getOutputSizeByOperation(inLen, true);
+        if (out.length - outOfs < min) {
+            throw new ShortBufferException("min " + min + "-byte buffer needed");
+        }
+        if (inLen > 0) {
+            k = update(in, inOfs, inLen, out, outOfs);
+            outOfs += k;
+        }
+        k += doFinal(out, outOfs);
+        return k;
+    }
+
+
+    // see JCE spec
+    @Override
+    protected synchronized byte[] engineWrap(Key key)
+            throws IllegalBlockSizeException, InvalidKeyException {
+        byte[] result = null;
+        try {
+            byte[] encodedKey = key.getEncoded();
+            if ((encodedKey == null) || (encodedKey.length == 0)) {
+                throw new InvalidKeyException("Cannot get an encoding of " +
+                                              "the key to be wrapped");
+            }
+            result = engineDoFinal(encodedKey, 0, encodedKey.length);
+        } catch (BadPaddingException e) {
+            // Should never happen for key wrapping
+            throw new UcryptoException("Internal Error" , e);
+        }
+        return result;
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized Key engineUnwrap(byte[] wrappedKey,
+            String wrappedKeyAlgorithm, int wrappedKeyType)
+            throws InvalidKeyException, NoSuchAlgorithmException {
+
+        byte[] encodedKey;
+        Key result = null;
+        try {
+            encodedKey = engineDoFinal(wrappedKey, 0,
+                                       wrappedKey.length);
+        } catch (Exception e) {
+            throw (InvalidKeyException)
+                (new InvalidKeyException()).initCause(e);
+        }
+
+        return constructKey(wrappedKeyType, encodedKey, wrappedKeyAlgorithm);
+    }
+
+    final int checkKey(Key key) throws InvalidKeyException {
+        if (key == null || key.getEncoded() == null) {
+            throw new InvalidKeyException("Key cannot be null");
+        } else {
+            // check key algorithm and format
+            if (!keyAlgo.equalsIgnoreCase(key.getAlgorithm())) {
+                throw new InvalidKeyException("Key algorithm must be " +
+                    keyAlgo);
+            }
+            if (!"RAW".equalsIgnoreCase(key.getFormat())) {
+                throw new InvalidKeyException("Key format must be RAW");
+            }
+            int keyLen = key.getEncoded().length;
+            if (fixedKeySize == -1) {
+                // all 3 AES key lengths are allowed
+                if (keyLen != 16 && keyLen != 24 && keyLen != 32) {
+                    throw new InvalidKeyException("Key size is not valid");
+                }
+            } else {
+                if (keyLen != fixedKeySize) {
+                    throw new InvalidKeyException("Only " + fixedKeySize +
+                        "-byte keys are accepted");
+                }
+            }
+            // return the validated key length in bytes
+            return keyLen;
+        }
+    }
+
+    protected void reset(boolean doCancel) {
+        initialized = false;
+        bytesBuffered = 0;
+        if (pCtxt != null) {
+            pCtxt.dispose(doCancel);
+            pCtxt = null;
+        }
+    }
+
+    /**
+     * calls ucrypto_encrypt_init(...) or ucrypto_decrypt_init(...)
+     * @return pointer to the context
+     */
+    protected native static long nativeInit(int mech, boolean encrypt,
+                                            byte[] key, byte[] iv,
+                                            int tagLen, byte[] aad);
+
+    /**
+     * calls ucrypto_encrypt_update(...) or ucrypto_decrypt_update(...)
+     * @returns the length of output or if negative, an error status code
+     */
+    private native static int nativeUpdate(long pContext, boolean encrypt,
+                                           byte[] in, int inOfs, int inLen,
+                                           byte[] out, int outOfs);
+
+    /**
+     * calls ucrypto_encrypt_final(...) or ucrypto_decrypt_final(...)
+     * @returns the length of output or if negative, an error status code
+     */
+    native static int nativeFinal(long pContext, boolean encrypt,
+                                          byte[] out, int outOfs);
+
+    protected void ensureInitialized() {
+        if (!initialized) {
+            init(encrypt, keyValue, iv);
+            if (!initialized) {
+                throw new UcryptoException("Cannot initialize Cipher");
+            }
+        }
+    }
+
+    protected int getOutputSizeByOperation(int inLen, boolean isDoFinal) {
+        if (inLen <= 0) {
+            inLen = 0;
+        }
+        if (!isDoFinal && (inLen == 0)) {
+            return 0;
+        }
+        return inLen + bytesBuffered;
+    }
+
+    // actual init() implementation - caller should clone key and iv if needed
+    protected void init(boolean encrypt, byte[] keyVal, byte[] ivVal) {
+        reset(true);
+        this.encrypt = encrypt;
+        this.keyValue = keyVal;
+        this.iv = ivVal;
+        long pCtxtVal = nativeInit(mech.value(), encrypt, keyValue, iv, 0, null);
+        initialized = (pCtxtVal != 0L);
+        if (initialized) {
+            pCtxt = new CipherContextRef(this, pCtxtVal, encrypt);
+        } else {
+            throw new UcryptoException("Cannot initialize Cipher");
+        }
+    }
+
+    // Caller MUST check and ensure output buffer has enough capacity
+    private int update(byte[] in, int inOfs, int inLen, byte[] out, int outOfs) {
+        ensureInitialized();
+        if (inLen <= 0) { return 0; }
+
+        int k = nativeUpdate(pCtxt.id, encrypt, in, inOfs, inLen, out, outOfs);
+        if (k < 0) {
+            reset(false);
+            // cannot throw ShortBufferException here since it's too late
+            // native context is invalid upon any failure
+            throw new UcryptoException(-k);
+        }
+        bytesBuffered += (inLen - k);
+        return k;
+    }
+
+    // Caller MUST check and ensure output buffer has enough capacity
+    private int doFinal(byte[] out, int outOfs) throws IllegalBlockSizeException,
+            BadPaddingException {
+        try {
+            ensureInitialized();
+
+            int k = nativeFinal(pCtxt.id, encrypt, out, outOfs);
+            if (k < 0) {
+                String cause = UcryptoException.getErrorMessage(-k);
+                if (cause.endsWith("_LEN_RANGE")) {
+                    throw new IllegalBlockSizeException(cause);
+                } else if (cause.endsWith("_DATA_INVALID")) {
+                    throw new BadPaddingException(cause);
+                } else {
+                    throw new UcryptoException(-k);
+                }
+            }
+            return k;
+        } finally {
+            reset(false);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipherWithJavaPadding.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,464 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.security.ucrypto;
+
+import java.nio.ByteBuffer;
+import java.util.Set;
+import java.util.Arrays;
+import java.util.concurrent.ConcurrentSkipListSet;
+import java.lang.ref.*;
+
+import java.security.AlgorithmParameters;
+import java.security.GeneralSecurityException;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.InvalidKeyException;
+import java.security.Key;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+
+
+import java.security.spec.AlgorithmParameterSpec;
+import java.security.spec.InvalidParameterSpecException;
+
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.CipherSpi;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.ShortBufferException;
+
+import javax.crypto.spec.IvParameterSpec;
+
+/**
+ * Wrapper class which uses NativeCipher class and Java impls of padding scheme.
+ * This class currently supports
+ * - AES/ECB/PKCS5PADDING
+ * - AES/CBC/PKCS5PADDING
+ * - AES/CFB128/PKCS5PADDING
+ *
+ * @since 1.9
+ */
+public class NativeCipherWithJavaPadding extends CipherSpi {
+
+    private static interface Padding {
+        // ENC: generate and return the necessary padding bytes
+        int getPadLen(int dataLen);
+
+        // ENC: generate and return the necessary padding bytes
+        byte[] getPaddingBytes(int dataLen);
+
+        // DEC: process the decrypted data and buffer up the potential padding
+        // bytes
+        byte[] bufferBytes(byte[] intermediateData);
+
+        // DEC: return the length of internally buffered pad bytes
+        int getBufferedLength();
+
+        // DEC: unpad and place the output in 'out', starting from outOfs
+        // and return the number of bytes unpadded into 'out'.
+        int unpad(byte[] paddedData, byte[] out, int outOfs)
+                throws BadPaddingException, IllegalBlockSizeException,
+                ShortBufferException;
+
+        // DEC: Clears the padding object to the initial state
+        void clear();
+    }
+
+    private static class PKCS5Padding implements Padding {
+        private final int blockSize;
+        // buffer for storing the the potential padding bytes
+        private ByteBuffer trailingBytes = null;
+
+        PKCS5Padding(int blockSize)
+            throws NoSuchPaddingException {
+            if (blockSize == 0) {
+                throw new NoSuchPaddingException
+                        ("PKCS#5 padding not supported with stream ciphers");
+            }
+            this.blockSize = blockSize;
+        }
+
+        public int getPadLen(int dataLen) {
+            return (blockSize - (dataLen & (blockSize - 1)));
+        }
+
+        public byte[] getPaddingBytes(int dataLen) {
+            byte padValue = (byte) getPadLen(dataLen);
+            byte[] paddingBytes = new byte[padValue];
+            Arrays.fill(paddingBytes, padValue);
+            return paddingBytes;
+        }
+
+        public byte[] bufferBytes(byte[] dataFromUpdate) {
+            if (dataFromUpdate == null || dataFromUpdate.length == 0) {
+                return null;
+            }
+            byte[] result = null;
+            if (trailingBytes == null) {
+                trailingBytes = ByteBuffer.wrap(new byte[blockSize]);
+            }
+            int tbSize = trailingBytes.position();
+            if (dataFromUpdate.length > trailingBytes.remaining()) {
+                int totalLen = dataFromUpdate.length + tbSize;
+                int newTBSize = totalLen % blockSize;
+                if (newTBSize == 0) {
+                    newTBSize = blockSize;
+                }
+                if (tbSize == 0) {
+                    result = Arrays.copyOf(dataFromUpdate, totalLen - newTBSize);
+                } else {
+                    // combine 'trailingBytes' and 'dataFromUpdate'
+                    result = Arrays.copyOf(trailingBytes.array(),
+                                           totalLen - newTBSize);
+                    if (result.length != tbSize) {
+                        System.arraycopy(dataFromUpdate, 0, result, tbSize,
+                                         result.length - tbSize);
+                    }
+                }
+                // update 'trailingBytes' w/ remaining bytes in 'dataFromUpdate'
+                trailingBytes.clear();
+                trailingBytes.put(dataFromUpdate,
+                                  dataFromUpdate.length - newTBSize, newTBSize);
+            } else {
+                trailingBytes.put(dataFromUpdate);
+            }
+            return result;
+        }
+
+        public int getBufferedLength() {
+            if (trailingBytes != null) {
+                return trailingBytes.position();
+            }
+            return 0;
+        }
+
+        public int unpad(byte[] lastData, byte[] out, int outOfs)
+                throws BadPaddingException, IllegalBlockSizeException,
+                ShortBufferException {
+            int tbSize = (trailingBytes == null? 0:trailingBytes.position());
+            int dataLen = tbSize + lastData.length;
+            // check total length
+            if ((dataLen < 1) || (dataLen % blockSize != 0)) {
+                UcryptoProvider.debug("PKCS5Padding: unpad, buffered " + tbSize +
+                                 " bytes, last block " + lastData.length + " bytes");
+
+                throw new IllegalBlockSizeException
+                    ("Input length must be multiples of " + blockSize);
+            }
+
+            // check padding bytes
+            if (lastData.length == 0) {
+                if (tbSize != 0) {
+                    // work on 'trailingBytes' directly
+                    lastData = Arrays.copyOf(trailingBytes.array(), tbSize);
+                    trailingBytes.clear();
+                    tbSize = 0;
+                } else {
+                    throw new BadPaddingException("No pad bytes found!");
+                }
+            }
+            byte padValue = lastData[lastData.length - 1];
+            if (padValue < 1 || padValue > blockSize) {
+                UcryptoProvider.debug("PKCS5Padding: unpad, lastData: " + Arrays.toString(lastData));
+                UcryptoProvider.debug("PKCS5Padding: unpad, padValue=" + padValue);
+                throw new BadPaddingException("Invalid pad value!");
+            }
+
+            // sanity check padding bytes
+            int padStartIndex = lastData.length - padValue;
+            for (int i = padStartIndex; i < lastData.length; i++) {
+                if (lastData[i] != padValue) {
+                    UcryptoProvider.debug("PKCS5Padding: unpad, lastData: " + Arrays.toString(lastData));
+                    UcryptoProvider.debug("PKCS5Padding: unpad, padValue=" + padValue);
+                    throw new BadPaddingException("Invalid padding bytes!");
+                }
+            }
+
+            int actualOutLen = dataLen - padValue;
+            // check output buffer capacity
+            if (out.length - outOfs < actualOutLen) {
+                throw new ShortBufferException("Output buffer too small, need " + actualOutLen +
+                    ", got " + (out.length - outOfs));
+            }
+            try {
+                if (tbSize != 0) {
+                    trailingBytes.rewind();
+                    if (tbSize < actualOutLen) {
+                        trailingBytes.get(out, outOfs, tbSize);
+                        outOfs += tbSize;
+                    } else {
+                        // copy from trailingBytes and we are done
+                        trailingBytes.get(out, outOfs, actualOutLen);
+                        return actualOutLen;
+                    }
+                }
+                if (lastData.length > padValue) {
+                    System.arraycopy(lastData, 0, out, outOfs,
+                                     lastData.length - padValue);
+                }
+                return actualOutLen;
+            } finally {
+                clear();
+            }
+        }
+
+        public void clear() {
+            if (trailingBytes != null) trailingBytes.clear();
+        }
+    }
+
+    public static final class AesEcbPKCS5 extends NativeCipherWithJavaPadding {
+        public AesEcbPKCS5() throws NoSuchAlgorithmException, NoSuchPaddingException {
+            super(new NativeCipher.AesEcbNoPadding(), "PKCS5Padding");
+        }
+    }
+
+    public static final class AesCbcPKCS5 extends NativeCipherWithJavaPadding {
+        public AesCbcPKCS5() throws NoSuchAlgorithmException, NoSuchPaddingException {
+            super(new NativeCipher.AesCbcNoPadding(), "PKCS5Padding");
+        }
+    }
+
+    public static final class AesCfb128PKCS5 extends NativeCipherWithJavaPadding {
+        public AesCfb128PKCS5() throws NoSuchAlgorithmException, NoSuchPaddingException {
+            super(new NativeCipher.AesCfb128NoPadding(), "PKCS5Padding");
+        }
+    }
+
+    // fields (re)set in every init()
+    private final NativeCipher nc;
+    private final Padding padding;
+    private final int blockSize;
+    private int lastBlockLen = 0;
+
+    // Only ECB, CBC, CTR, and CFB128 modes w/ NOPADDING for now
+    NativeCipherWithJavaPadding(NativeCipher nc, String paddingScheme)
+        throws NoSuchAlgorithmException, NoSuchPaddingException {
+        this.nc = nc;
+        this.blockSize = nc.engineGetBlockSize();
+        if (paddingScheme.toUpperCase().equals("PKCS5PADDING")) {
+            padding = new PKCS5Padding(blockSize);
+        } else {
+            throw new NoSuchAlgorithmException("Unsupported padding scheme: " + paddingScheme);
+        }
+    }
+
+    void reset() {
+        padding.clear();
+        lastBlockLen = 0;
+    }
+
+    @Override
+    protected synchronized void engineSetMode(String mode) throws NoSuchAlgorithmException {
+        nc.engineSetMode(mode);
+    }
+
+    // see JCE spec
+    @Override
+    protected void engineSetPadding(String padding)
+            throws NoSuchPaddingException {
+        // Disallow change of padding for now since currently it's explicitly
+        // defined in transformation strings
+        throw new NoSuchPaddingException("Unsupported padding " + padding);
+    }
+
+    // see JCE spec
+    @Override
+    protected int engineGetBlockSize() {
+        return blockSize;
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized int engineGetOutputSize(int inputLen) {
+        int result = nc.engineGetOutputSize(inputLen);
+        if (nc.encrypt) {
+            result += padding.getPadLen(result);
+        } else {
+            result += padding.getBufferedLength();
+        }
+        return result;
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized byte[] engineGetIV() {
+        return nc.engineGetIV();
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized AlgorithmParameters engineGetParameters() {
+        return nc.engineGetParameters();
+    }
+
+    @Override
+    protected int engineGetKeySize(Key key) throws InvalidKeyException {
+        return nc.engineGetKeySize(key);
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized void engineInit(int opmode, Key key, SecureRandom random)
+            throws InvalidKeyException {
+        reset();
+        nc.engineInit(opmode, key, random);
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized void engineInit(int opmode, Key key,
+            AlgorithmParameterSpec params, SecureRandom random)
+            throws InvalidKeyException, InvalidAlgorithmParameterException {
+        reset();
+        nc.engineInit(opmode, key, params, random);
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized void engineInit(int opmode, Key key, AlgorithmParameters params,
+            SecureRandom random)
+            throws InvalidKeyException, InvalidAlgorithmParameterException {
+        reset();
+        nc.engineInit(opmode, key, params, random);
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized byte[] engineUpdate(byte[] in, int inOfs, int inLen) {
+        if (nc.encrypt) {
+            lastBlockLen += inLen;
+            lastBlockLen &= (blockSize - 1);
+            return nc.engineUpdate(in, inOfs, inLen);
+        } else {
+            return padding.bufferBytes(nc.engineUpdate(in, inOfs, inLen));
+        }
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized int engineUpdate(byte[] in, int inOfs, int inLen, byte[] out,
+            int outOfs) throws ShortBufferException {
+        if (nc.encrypt) {
+            lastBlockLen += inLen;
+            lastBlockLen &= (blockSize - 1);
+            return nc.engineUpdate(in, inOfs, inLen, out, outOfs);
+        } else {
+            byte[] result = padding.bufferBytes(nc.engineUpdate(in, inOfs, inLen));
+            if (result != null) {
+                System.arraycopy(result, 0, out, outOfs, result.length);
+                return result.length;
+            } else return 0;
+        }
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized byte[] engineDoFinal(byte[] in, int inOfs, int inLen)
+            throws IllegalBlockSizeException, BadPaddingException {
+        int estimatedOutLen = engineGetOutputSize(inLen);
+        byte[] out = new byte[estimatedOutLen];
+        try {
+            int actualOut = this.engineDoFinal(in, inOfs, inLen, out, 0);
+            // truncate off extra bytes
+            if (actualOut != out.length) {
+                out = Arrays.copyOf(out, actualOut);
+            }
+        } catch (ShortBufferException sbe) {
+            throw new UcryptoException("Internal Error");
+        } finally {
+            reset();
+        }
+        return out;
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized int engineDoFinal(byte[] in, int inOfs, int inLen, byte[] out,
+                                             int outOfs)
+        throws ShortBufferException, IllegalBlockSizeException,
+               BadPaddingException {
+        int estimatedOutLen = engineGetOutputSize(inLen);
+
+        if (out.length - outOfs < estimatedOutLen) {
+            throw new ShortBufferException();
+        }
+        try {
+            if (nc.encrypt) {
+                int k = nc.engineUpdate(in, inOfs, inLen, out, outOfs);
+                lastBlockLen += inLen;
+                lastBlockLen &= (blockSize - 1);
+                byte[] padBytes = padding.getPaddingBytes(lastBlockLen);
+                k += nc.engineDoFinal(padBytes, 0, padBytes.length, out, (outOfs + k));
+                return k;
+            } else {
+                byte[] tempOut = nc.engineDoFinal(in, inOfs, inLen);
+                int len = padding.unpad(tempOut, out, outOfs);
+                return len;
+            }
+        } finally {
+            reset();
+        }
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized byte[] engineWrap(Key key) throws IllegalBlockSizeException,
+                                                InvalidKeyException {
+        byte[] result = null;
+        try {
+            byte[] encodedKey = key.getEncoded();
+            if ((encodedKey == null) || (encodedKey.length == 0)) {
+                throw new InvalidKeyException("Cannot get an encoding of " +
+                                              "the key to be wrapped");
+            }
+            result = engineDoFinal(encodedKey, 0, encodedKey.length);
+        } catch (BadPaddingException e) {
+            // Should never happen for key wrapping
+            throw new UcryptoException("Internal Error", e);
+        }
+        return result;
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm,
+                               int wrappedKeyType)
+        throws InvalidKeyException, NoSuchAlgorithmException {
+
+        byte[] encodedKey;
+        try {
+            encodedKey = engineDoFinal(wrappedKey, 0,
+                                       wrappedKey.length);
+        } catch (Exception e) {
+            throw (InvalidKeyException)
+                (new InvalidKeyException()).initCause(e);
+        }
+
+        return NativeCipher.constructKey(wrappedKeyType, encodedKey,
+                                         wrappedKeyAlgorithm);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeDigest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,243 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.security.ucrypto;
+
+import java.lang.ref.*;
+
+import java.io.ByteArrayOutputStream;
+import java.util.*;
+import java.util.concurrent.ConcurrentSkipListSet;
+import java.security.*;
+
+/**
+ * MessageDigest implementation class. This class currently supports
+ * MD5, SHA1, SHA256, SHA384, and SHA512
+ *
+ * @since 1.9
+ */
+public abstract class NativeDigest extends MessageDigestSpi
+        implements Cloneable {
+
+    private static final int MECH_MD5 = 1;
+    private static final int MECH_SHA1 = 2;
+    private static final int MECH_SHA256 = 3;
+    private static final int MECH_SHA224 = 4;
+    private static final int MECH_SHA384 = 5;
+    private static final int MECH_SHA512 = 6;
+
+    private final int digestLen;
+    private final int mech;
+
+    // field for ensuring native memory is freed
+    private DigestContextRef pCtxt = null;
+
+    private static class DigestContextRef extends PhantomReference<NativeDigest>
+        implements Comparable<DigestContextRef> {
+
+        private static ReferenceQueue<NativeDigest> refQueue =
+            new ReferenceQueue<NativeDigest>();
+
+        // Needed to keep these references from being GC'ed until when their
+        // referents are GC'ed so we can do post-mortem processing
+        private static Set<DigestContextRef> refList =
+            new ConcurrentSkipListSet<DigestContextRef>();
+            //            Collections.synchronizedSortedSet(new TreeSet<DigestContextRef>());
+
+        private final long id;
+        private final int mech;
+
+        private static void drainRefQueueBounded() {
+            while (true) {
+                DigestContextRef next = (DigestContextRef) refQueue.poll();
+                if (next == null) break;
+                next.dispose(true);
+            }
+        }
+
+        DigestContextRef(NativeDigest nc, long id, int mech) {
+            super(nc, refQueue);
+            this.id = id;
+            this.mech = mech;
+            refList.add(this);
+            UcryptoProvider.debug("Resource: track Digest Ctxt " + this.id);
+            drainRefQueueBounded();
+        }
+
+        public int compareTo(DigestContextRef other) {
+            if (this.id == other.id) {
+                return 0;
+            } else {
+                return (this.id < other.id) ? -1 : 1;
+            }
+        }
+
+        void dispose(boolean needFree) {
+            refList.remove(this);
+            try {
+                if (needFree) {
+                    UcryptoProvider.debug("Resource: free Digest Ctxt " + this.id);
+                    NativeDigest.nativeFree(mech, id);
+                } else UcryptoProvider.debug("Resource: stop tracking Digest Ctxt " + this.id);
+            } finally {
+                this.clear();
+            }
+        }
+    }
+
+    NativeDigest(int mech, int digestLen) {
+        this.digestLen = digestLen;
+        this.mech = mech;
+    }
+
+    // see JCA spec
+    protected int engineGetDigestLength() {
+        return digestLen;
+    }
+
+    // see JCA spec
+    protected synchronized void engineReset() {
+        if (pCtxt != null) {
+            pCtxt.dispose(true);
+            pCtxt = null;
+        }
+    }
+
+    // see JCA spec
+    protected synchronized byte[] engineDigest() {
+        byte[] digest = new byte[digestLen];
+        try {
+            int len = engineDigest(digest, 0, digestLen);
+            if (len != digestLen) {
+                throw new UcryptoException("Digest length mismatch");
+            }
+            return digest;
+        } catch (DigestException de) {
+            throw new UcryptoException("Internal error", de);
+        }
+    }
+
+    // see JCA spec
+    protected synchronized int engineDigest(byte[] out, int ofs, int len)
+            throws DigestException {
+        if (len < digestLen) {
+            throw new DigestException("Output buffer must be at least " +
+                                      digestLen + " bytes long");
+        }
+        if ((ofs < 0) || (len < 0) || (ofs > out.length - len)) {
+            throw new DigestException("Buffer too short to store digest");
+        }
+
+        if (pCtxt == null) {
+            pCtxt = new DigestContextRef(this, nativeInit(mech), mech);
+        }
+        try {
+            int status = nativeDigest(mech, pCtxt.id, out, ofs, digestLen);
+            if (status != 0) {
+                throw new DigestException("Internal error: " + status);
+            }
+        } finally {
+            pCtxt.dispose(false);
+            pCtxt = null;
+        }
+        return digestLen;
+    }
+
+    // see JCA spec
+    protected synchronized void engineUpdate(byte in) {
+        byte[] temp = { in };
+        engineUpdate(temp, 0, 1);
+    }
+
+    // see JCA spec
+    protected synchronized void engineUpdate(byte[] in, int ofs, int len) {
+        if (len == 0) {
+            return;
+        }
+        if ((ofs < 0) || (len < 0) || (ofs > in.length - len)) {
+            throw new ArrayIndexOutOfBoundsException();
+        }
+        if (pCtxt == null) {
+            pCtxt = new DigestContextRef(this, nativeInit(mech), mech);
+        }
+        nativeUpdate(mech, pCtxt.id, in, ofs, len);
+    }
+
+    /**
+     * Clone this digest.
+     */
+    public synchronized Object clone() throws CloneNotSupportedException {
+        NativeDigest copy = (NativeDigest) super.clone();
+        // re-work the fields that cannot be copied over
+        if (pCtxt != null) {
+            copy.pCtxt = new DigestContextRef(this, nativeClone(mech, pCtxt.id), mech);
+        }
+        return copy;
+    }
+
+    // return pointer to the context
+    protected static native long nativeInit(int mech);
+    // return status code; always 0
+    protected static native int nativeUpdate(int mech, long pCtxt, byte[] in, int ofs, int inLen);
+    // return status code; always 0
+    protected static native int nativeDigest(int mech, long pCtxt, byte[] out, int ofs, int digestLen);
+    // return pointer to the duplicated context
+    protected static native long nativeClone(int mech, long pCtxt);
+    // free the specified context
+    private native static void nativeFree(int mech, long id);
+
+
+    public static final class MD5 extends NativeDigest {
+        public MD5() {
+            super(MECH_MD5, 16);
+        }
+    }
+
+    public static final class SHA1 extends NativeDigest {
+        public SHA1() {
+            super(MECH_SHA1, 20);
+        }
+    }
+
+    public static final class SHA256 extends NativeDigest {
+        public SHA256() {
+            super(MECH_SHA256, 32);
+        }
+    }
+
+
+    public static final class SHA384 extends NativeDigest {
+        public SHA384() {
+            super(MECH_SHA384, 48);
+        }
+    }
+
+
+    public static final class SHA512 extends NativeDigest {
+        public SHA512() {
+            super(MECH_SHA512, 64);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeGCMCipher.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,422 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.security.ucrypto;
+
+import java.io.ByteArrayOutputStream;
+import java.nio.ByteBuffer;
+
+import java.util.Set;
+import java.util.Arrays;
+import java.security.*;
+import java.security.spec.*;
+import javax.crypto.*;
+import javax.crypto.spec.SecretKeySpec;
+import javax.crypto.spec.GCMParameterSpec;
+
+/**
+ * Cipher wrapper class utilizing ucrypto APIs. This class currently supports
+ * - AES/GCM/NoPADDING
+ *
+ * @since 1.9
+ */
+class NativeGCMCipher extends NativeCipher {
+
+    public static final class AesGcmNoPadding extends NativeGCMCipher {
+        public AesGcmNoPadding() throws NoSuchAlgorithmException {
+            super(-1);
+        }
+    }
+    public static final class Aes128GcmNoPadding extends NativeGCMCipher {
+        public Aes128GcmNoPadding() throws NoSuchAlgorithmException {
+            super(16);
+        }
+    }
+    public static final class Aes192GcmNoPadding extends NativeGCMCipher {
+        public Aes192GcmNoPadding() throws NoSuchAlgorithmException {
+            super(24);
+        }
+    }
+    public static final class Aes256GcmNoPadding extends NativeGCMCipher {
+        public Aes256GcmNoPadding() throws NoSuchAlgorithmException {
+            super(32);
+        }
+    }
+
+    private static final int DEFAULT_TAG_LEN = 128; // same as SunJCE provider
+
+    // buffer for storing AAD data; if null, meaning buffer content has been
+    // supplied to native context
+    private ByteArrayOutputStream aadBuffer = new ByteArrayOutputStream();
+
+    // buffer for storing input in decryption, not used for encryption
+    private ByteArrayOutputStream ibuffer = null;
+
+    private int tagLen = DEFAULT_TAG_LEN;
+
+    /*
+     * variables used for performing the GCM (key+iv) uniqueness check.
+     * To use GCM mode safely, the cipher object must be re-initialized
+     * with a different combination of key + iv values for each
+     * ENCRYPTION operation. However, checking all past key + iv values
+     * isn't feasible. Thus, we only do a per-instance check of the
+     * key + iv values used in previous encryption.
+     * For decryption operations, no checking is necessary.
+     */
+    private boolean requireReinit = false;
+    private byte[] lastEncKey = null;
+    private byte[] lastEncIv = null;
+
+    NativeGCMCipher(int fixedKeySize) throws NoSuchAlgorithmException {
+        super(UcryptoMech.CRYPTO_AES_GCM, fixedKeySize);
+    }
+
+    @Override
+    protected void ensureInitialized() {
+        if (!initialized) {
+            if (aadBuffer != null && aadBuffer.size() > 0) {
+                init(encrypt, keyValue, iv, tagLen, aadBuffer.toByteArray());
+                aadBuffer = null;
+            } else {
+                init(encrypt, keyValue, iv, tagLen, null);
+            }
+            if (!initialized) {
+                throw new UcryptoException("Cannot initialize Cipher");
+            }
+        }
+    }
+
+    @Override
+    protected int getOutputSizeByOperation(int inLen, boolean isDoFinal) {
+        if (inLen < 0) return 0;
+
+        if (!isDoFinal && (inLen == 0)) {
+            return 0;
+        }
+
+        int result = inLen + bytesBuffered;
+        if (encrypt) {
+            if (isDoFinal) {
+                result += tagLen/8;
+            }
+        } else {
+            if (ibuffer != null) {
+                result += ibuffer.size();
+            }
+            if (isDoFinal) {
+                result -= tagLen/8;
+            }
+        }
+        if (result < 0) {
+            result = 0;
+        }
+        return result;
+    }
+
+    @Override
+    protected void reset(boolean doCancel) {
+        super.reset(doCancel);
+        if (aadBuffer == null) {
+            aadBuffer = new ByteArrayOutputStream();
+        } else {
+            aadBuffer.reset();
+        }
+
+        if (ibuffer != null) {
+            ibuffer.reset();
+        }
+        if (!encrypt) requireReinit = false;
+    }
+
+    // actual init() implementation - caller should clone key and iv if needed
+    protected void init(boolean encrypt, byte[] keyVal, byte[] ivVal, int tLen, byte[] aad) {
+        reset(true);
+        this.encrypt = encrypt;
+        this.keyValue = keyVal;
+        this.iv = ivVal;
+        long pCtxtVal = NativeCipher.nativeInit(mech.value(), encrypt, keyValue, iv,
+            tLen, aad);
+        initialized = (pCtxtVal != 0L);
+        if (initialized) {
+            pCtxt = new CipherContextRef(this, pCtxtVal, encrypt);
+        } else {
+            throw new UcryptoException("Cannot initialize Cipher");
+        }
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized AlgorithmParameters engineGetParameters() {
+        AlgorithmParameters params = null;
+        try {
+            if (iv != null) {
+                GCMParameterSpec gcmSpec = new GCMParameterSpec(tagLen, iv.clone());
+                params = AlgorithmParameters.getInstance("GCM");
+                params.init(gcmSpec);
+            }
+        } catch (GeneralSecurityException e) {
+            // NoSuchAlgorithmException, NoSuchProviderException
+            // InvalidParameterSpecException
+            throw new UcryptoException("Could not encode parameters", e);
+        }
+        return params;
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized void engineInit(int opmode, Key key,
+            AlgorithmParameterSpec params, SecureRandom random)
+            throws InvalidKeyException, InvalidAlgorithmParameterException {
+        checkKey(key);
+        if (opmode != Cipher.ENCRYPT_MODE &&
+            opmode != Cipher.DECRYPT_MODE &&
+            opmode != Cipher.WRAP_MODE &&
+            opmode != Cipher.UNWRAP_MODE) {
+            throw new InvalidAlgorithmParameterException
+                ("Unsupported mode: " + opmode);
+        }
+        boolean doEncrypt = (opmode == Cipher.ENCRYPT_MODE || opmode == Cipher.WRAP_MODE);
+        byte[] keyBytes = key.getEncoded().clone();
+        byte[] ivBytes = null;
+        if (params != null) {
+            if (!(params instanceof GCMParameterSpec)) {
+                throw new InvalidAlgorithmParameterException("GCMParameterSpec required");
+            } else {
+                tagLen = ((GCMParameterSpec) params).getTLen();
+                ivBytes = ((GCMParameterSpec) params).getIV();
+            }
+        } else {
+            if (doEncrypt) {
+                tagLen = DEFAULT_TAG_LEN;
+
+                // generate IV if none supplied for encryption
+                ivBytes = new byte[blockSize];
+                new SecureRandom().nextBytes(ivBytes);
+            } else {
+                throw new InvalidAlgorithmParameterException("Parameters required for decryption");
+            }
+        }
+        if (doEncrypt) {
+            requireReinit = Arrays.equals(ivBytes, lastEncIv) &&
+                Arrays.equals(keyBytes, lastEncKey);
+            if (requireReinit) {
+                throw new InvalidAlgorithmParameterException
+                    ("Cannot reuse iv for GCM encryption");
+            }
+            lastEncIv = ivBytes;
+            lastEncKey = keyBytes;
+        } else {
+            requireReinit = false;
+            ibuffer = new ByteArrayOutputStream();
+        }
+        init(doEncrypt, keyBytes, ivBytes, tagLen, null);
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized void engineInit(int opmode, Key key, AlgorithmParameters params,
+            SecureRandom random)
+            throws InvalidKeyException, InvalidAlgorithmParameterException {
+        AlgorithmParameterSpec spec = null;
+        if (params != null) {
+            try {
+                // mech must be UcryptoMech.CRYPTO_AES_GCM
+                spec = params.getParameterSpec(GCMParameterSpec.class);
+            } catch (InvalidParameterSpecException iaps) {
+                throw new InvalidAlgorithmParameterException(iaps);
+            }
+        }
+        engineInit(opmode, key, spec, random);
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized byte[] engineUpdate(byte[] in, int inOfs, int inLen) {
+        if (aadBuffer != null && aadBuffer.size() > 0) {
+            // init again with AAD data
+            init(encrypt, keyValue, iv, tagLen, aadBuffer.toByteArray());
+            aadBuffer = null;
+        }
+        if (requireReinit) {
+            throw new IllegalStateException
+                ("Must use either different key or iv for GCM encryption");
+        }
+        if (inLen > 0) {
+            if (!encrypt) {
+                ibuffer.write(in, inOfs, inLen);
+                return null;
+            }
+            return super.engineUpdate(in, inOfs, inLen);
+        } else return null;
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized int engineUpdate(byte[] in, int inOfs, int inLen, byte[] out,
+            int outOfs) throws ShortBufferException {
+        int len = getOutputSizeByOperation(inLen, false);
+        if (out.length - outOfs < len) {
+            throw new ShortBufferException("Output buffer must be "
+                                           + "(at least) " + len
+                                           + " bytes long");
+        }
+        if (aadBuffer != null && aadBuffer.size() > 0) {
+            // init again with AAD data
+            init(encrypt, keyValue, iv, tagLen, aadBuffer.toByteArray());
+            aadBuffer = null;
+        }
+        if (requireReinit) {
+            throw new IllegalStateException
+                ("Must use either different key or iv for GCM encryption");
+        }
+        if (inLen > 0) {
+            if (!encrypt) {
+                ibuffer.write(in, inOfs, inLen);
+                return 0;
+            } else {
+                return super.engineUpdate(in, inOfs, inLen, out, outOfs);
+            }
+        }
+        return 0;
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized void engineUpdateAAD(byte[] src, int srcOfs, int srcLen)
+            throws IllegalStateException {
+
+        if ((src == null) || (srcOfs < 0) || (srcOfs + srcLen > src.length)) {
+            throw new IllegalArgumentException("Invalid AAD");
+        }
+        if (keyValue == null) {
+            throw new IllegalStateException("Need to initialize Cipher first");
+        }
+        if (requireReinit) {
+            throw new IllegalStateException
+                ("Must use either different key or iv for GCM encryption");
+        }
+        if (aadBuffer != null) {
+            aadBuffer.write(src, srcOfs, srcLen);
+        } else {
+            // update has already been called
+            throw new IllegalStateException
+                ("Update has been called; no more AAD data");
+        }
+    }
+
+    // see JCE spec
+    @Override
+    protected void engineUpdateAAD(ByteBuffer src)
+            throws IllegalStateException {
+        if (src == null) {
+            throw new IllegalArgumentException("Invalid AAD");
+        }
+        if (keyValue == null) {
+            throw new IllegalStateException("Need to initialize Cipher first");
+        }
+        if (requireReinit) {
+            throw new IllegalStateException
+                ("Must use either different key or iv for GCM encryption");
+        }
+        if (aadBuffer != null) {
+            if (src.hasRemaining()) {
+                byte[] srcBytes = new byte[src.remaining()];
+                src.get(srcBytes);
+                aadBuffer.write(srcBytes, 0, srcBytes.length);
+            }
+        } else {
+            // update has already been called
+            throw new IllegalStateException
+                ("Update has been called; no more AAD data");
+        }
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized byte[] engineDoFinal(byte[] in, int inOfs, int inLen)
+            throws IllegalBlockSizeException, BadPaddingException {
+        byte[] out = new byte[getOutputSizeByOperation(inLen, true)];
+        try {
+            // delegate to the other engineDoFinal(...) method
+            int k = engineDoFinal(in, inOfs, inLen, out, 0);
+            if (out.length != k) {
+                out = Arrays.copyOf(out, k);
+            }
+            return out;
+        } catch (ShortBufferException e) {
+            throw new UcryptoException("Internal Error", e);
+        }
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized int engineDoFinal(byte[] in, int inOfs, int inLen,
+                                             byte[] out, int outOfs)
+        throws ShortBufferException, IllegalBlockSizeException,
+               BadPaddingException {
+        int len = getOutputSizeByOperation(inLen, true);
+        if (out.length - outOfs < len) {
+            throw new ShortBufferException("Output buffer must be "
+                                           + "(at least) " + len
+                                           + " bytes long");
+        }
+        if (aadBuffer != null && aadBuffer.size() > 0) {
+            // init again with AAD data
+            init(encrypt, keyValue, iv, tagLen, aadBuffer.toByteArray());
+            aadBuffer = null;
+        }
+        if (requireReinit) {
+            throw new IllegalStateException
+                ("Must use either different key or iv for GCM encryption");
+        }
+        if (!encrypt) {
+            if (inLen > 0) {
+                ibuffer.write(in, inOfs, inLen);
+            }
+            inLen = ibuffer.size();
+            if (inLen < tagLen/8) {
+                // Otherwise, Solaris lib will error out w/ CRYPTO_BUFFER_TOO_SMALL
+                // when ucrypto_decrypt_final() is called
+                throw new AEADBadTagException("Input too short - need tag");
+            }
+            // refresh 'in' to all buffered-up bytes
+            in = ibuffer.toByteArray();
+            inOfs = 0;
+            ibuffer.reset();
+        }
+        try {
+            return super.engineDoFinal(in, inOfs, inLen, out, outOfs);
+        } catch (UcryptoException ue) {
+            if (ue.getMessage().equals("CRYPTO_INVALID_MAC")) {
+                throw new AEADBadTagException("Tag does not match");
+            } else {
+                // pass it up
+                throw ue;
+            }
+        } finally {
+            requireReinit = encrypt;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeKey.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.security.ucrypto;
+
+import java.util.Set;
+import java.util.Arrays;
+import java.util.concurrent.ConcurrentSkipListSet;
+import java.lang.ref.*;
+
+import java.math.BigInteger;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.security.Key;
+import java.security.PublicKey;
+import java.security.PrivateKey;
+import java.security.KeyFactorySpi;
+import java.security.interfaces.RSAPrivateCrtKey;
+import java.security.interfaces.RSAPublicKey;
+
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.KeySpec;
+import java.security.spec.RSAPrivateCrtKeySpec;
+import java.security.spec.RSAPublicKeySpec;
+
+/**
+ * Wrapper class for native keys needed for using ucrypto APIs.
+ * This class currently supports native RSA private/public keys.
+ *
+ * @since 1.9
+ */
+abstract class NativeKey implements Key {
+
+    private static final long serialVersionUID = 6812507588904302830L;
+
+    private final int numComponents;
+
+    NativeKey(int numComponents) {
+        this.numComponents = numComponents;
+    }
+
+    abstract long value();
+
+    int length() {
+        return numComponents;
+    }
+
+    public String getAlgorithm() { return "RSA"; }
+    public String getFormat() { return "RAW"; }
+    public byte[] getEncoded() {
+        // not used; so not generated
+        return null;
+    }
+
+    private native static void nativeFree(long id, int numComponents);
+
+    static byte[] getMagnitude(BigInteger bi) {
+        byte[] b = bi.toByteArray();
+        if ((b.length > 1) && (b[0] == 0)) {
+            int n = b.length - 1;
+            byte[] newarray = new byte[n];
+            System.arraycopy(b, 1, newarray, 0, n);
+            b = newarray;
+        }
+        return b;
+    }
+
+    static final class RSAPrivateCrt extends NativeKey implements RSAPrivateCrtKey {
+
+        private static final long serialVersionUID = 6812507588904302831L;
+
+        private final RSAPrivateCrtKeySpec keySpec;
+        private final long keyId;
+
+        RSAPrivateCrt(KeySpec keySpec) throws InvalidKeySpecException {
+            super(8);
+            long pKey = 0L;
+            if (keySpec instanceof RSAPrivateCrtKeySpec) {
+                RSAPrivateCrtKeySpec ks = (RSAPrivateCrtKeySpec) keySpec;
+                BigInteger mod = ks.getModulus();
+                BigInteger publicExp =  ks.getPublicExponent();
+                BigInteger privateExp =  ks.getPrivateExponent();
+                BigInteger primeP = ks.getPrimeP();
+                BigInteger primeQ = ks.getPrimeQ();
+                BigInteger primeExpP = ks.getPrimeExponentP();
+                BigInteger primeExpQ = ks.getPrimeExponentQ();
+                BigInteger crtCoeff = ks.getCrtCoefficient();
+                pKey = nativeInit(NativeKey.getMagnitude(mod),
+                                  NativeKey.getMagnitude(publicExp),
+                                  NativeKey.getMagnitude(privateExp),
+                                  NativeKey.getMagnitude(primeP),
+                                  NativeKey.getMagnitude(primeQ),
+                                  NativeKey.getMagnitude(primeExpP),
+                                  NativeKey.getMagnitude(primeExpQ),
+                                  NativeKey.getMagnitude(crtCoeff));
+            } else {
+                throw new InvalidKeySpecException("Only supports RSAPrivateCrtKeySpec");
+            }
+            if (pKey == 0L) {
+                throw new UcryptoException("Error constructing RSA PrivateKey");
+            }
+            // track native resource clean up
+            new KeyRef(this, pKey);
+            this.keySpec = (RSAPrivateCrtKeySpec) keySpec;
+            this.keyId = pKey;
+        }
+
+        long value() { return keyId; }
+        public BigInteger getModulus() { return keySpec.getModulus(); };
+        public BigInteger getPublicExponent() { return keySpec.getPublicExponent(); };
+        public BigInteger getPrivateExponent() { return keySpec.getPrivateExponent(); };
+        public BigInteger getPrimeP() { return keySpec.getPrimeP(); };
+        public BigInteger getPrimeQ() { return keySpec.getPrimeQ(); };
+        public BigInteger getPrimeExponentP() { return keySpec.getPrimeExponentP(); };
+        public BigInteger getPrimeExponentQ() { return keySpec.getPrimeExponentQ(); };
+        public BigInteger getCrtCoefficient() { return keySpec.getCrtCoefficient(); };
+
+        private native static long nativeInit(byte[] mod, byte[] pubExp, byte[] privExp,
+                                      byte[] p, byte[] q,
+                                      byte[] expP, byte[] expQ, byte[] crtCoeff);
+    }
+
+    static final class RSAPublic extends NativeKey implements RSAPublicKey {
+
+        private static final long serialVersionUID = 6812507588904302832L;
+
+        private final RSAPublicKeySpec keySpec;
+        private final long keyId;
+
+        RSAPublic(KeySpec keySpec) throws InvalidKeySpecException {
+            super(2);
+            long pKey = 0L;
+            if (keySpec instanceof RSAPublicKeySpec) {
+                RSAPublicKeySpec ks = (RSAPublicKeySpec) keySpec;
+                BigInteger mod = ks.getModulus();
+                BigInteger publicExp = ks.getPublicExponent();
+                pKey = nativeInit(NativeKey.getMagnitude(mod),
+                                  NativeKey.getMagnitude(publicExp));
+            } else {
+                throw new InvalidKeySpecException("Only supports RSAPublicKeySpec");
+            }
+            if (pKey == 0L) {
+                throw new UcryptoException("Error constructing RSA PublicKey");
+            }
+            // track native resource clean up
+            new KeyRef(this, pKey);
+            this.keySpec = (RSAPublicKeySpec) keySpec;
+            this.keyId = pKey;
+        }
+
+        long value() { return keyId; }
+        public BigInteger getModulus() { return keySpec.getModulus(); };
+        public BigInteger getPublicExponent() { return keySpec.getPublicExponent(); };
+
+        private native static long nativeInit(byte[] mod, byte[] pubExp);
+    }
+
+    // internal class for native resource cleanup
+    private static class KeyRef extends PhantomReference<NativeKey>
+        implements Comparable<KeyRef> {
+
+        private static ReferenceQueue<NativeKey> refQueue =
+            new ReferenceQueue<NativeKey>();
+
+        // Needed to keep these references from being GC'ed until when their
+        // referents are GC'ed so we can do post-mortem processing
+        private static Set<KeyRef> refList =
+            new ConcurrentSkipListSet<KeyRef>();
+
+        private final long id;
+        private final int length;
+
+        private static void drainRefQueueBounded() {
+            while (true) {
+                KeyRef next = (KeyRef) refQueue.poll();
+                if (next == null) break;
+                next.dispose();
+            }
+        }
+
+        KeyRef(NativeKey nk, long id) {
+            super(nk, refQueue);
+            this.id = id;
+            this.length = nk.length();
+            refList.add(this);
+            UcryptoProvider.debug("Resource: track NativeKey " + this.id);
+            drainRefQueueBounded();
+        }
+
+        public int compareTo(KeyRef other) {
+            if (this.id == other.id) {
+                return 0;
+            } else {
+                return (this.id < other.id) ? -1 : 1;
+            }
+        }
+
+        void dispose() {
+            refList.remove(this);
+            UcryptoProvider.debug("Resource: free NativeKey " + this.id);
+            try {
+                NativeKey.nativeFree(id, length);
+            } finally {
+                this.clear();
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,448 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.security.ucrypto;
+
+import java.util.Arrays;
+import java.util.WeakHashMap;
+import java.util.Collections;
+import java.util.Map;
+
+import java.security.AlgorithmParameters;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.InvalidKeyException;
+import java.security.Key;
+import java.security.PublicKey;
+import java.security.PrivateKey;
+import java.security.spec.RSAPrivateCrtKeySpec;
+import java.security.spec.RSAPublicKeySpec;
+import java.security.interfaces.RSAKey;
+import java.security.interfaces.RSAPrivateCrtKey;
+import java.security.interfaces.RSAPublicKey;
+
+import java.security.KeyFactory;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+
+import java.security.spec.AlgorithmParameterSpec;
+import java.security.spec.InvalidParameterSpecException;
+import java.security.spec.InvalidKeySpecException;
+
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.CipherSpi;
+import javax.crypto.SecretKey;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.ShortBufferException;
+
+import javax.crypto.spec.SecretKeySpec;
+
+import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec;
+import sun.security.util.KeyUtil;
+
+/**
+ * Asymmetric Cipher wrapper class utilizing ucrypto APIs. This class
+ * currently supports
+ * - RSA/ECB/NOPADDING
+ * - RSA/ECB/PKCS1PADDING
+ *
+ * @since 1.9
+ */
+public class NativeRSACipher extends CipherSpi {
+    // fields set in constructor
+    private final UcryptoMech mech;
+    private final int padLen;
+    private final NativeRSAKeyFactory keyFactory;
+    private AlgorithmParameterSpec spec;
+    private SecureRandom random;
+
+    // Keep a cache of RSA keys and their RSA NativeKey for reuse.
+    // When the RSA key is gc'ed, we let NativeKey phatom references cleanup
+    // the native allocation
+    private static final Map<Key, NativeKey> keyList =
+            Collections.synchronizedMap(new WeakHashMap<Key, NativeKey>());
+
+    //
+    // fields (re)set in every init()
+    //
+    private NativeKey key = null;
+    private int outputSize = 0; // e.g. modulus size in bytes
+    private boolean encrypt = true;
+    private byte[] buffer;
+    private int bufOfs = 0;
+
+    // public implementation classes
+    public static final class NoPadding extends NativeRSACipher {
+        public NoPadding() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_RSA_X_509, 0);
+        }
+    }
+
+    public static final class PKCS1Padding extends NativeRSACipher {
+        public PKCS1Padding() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_RSA_PKCS, 11);
+        }
+    }
+
+    NativeRSACipher(UcryptoMech mech, int padLen)
+        throws NoSuchAlgorithmException {
+        this.mech = mech;
+        this.padLen = padLen;
+        this.keyFactory = new NativeRSAKeyFactory();
+    }
+
+    @Override
+    protected void engineSetMode(String mode) throws NoSuchAlgorithmException {
+        // Disallow change of mode for now since currently it's explicitly
+        // defined in transformation strings
+        throw new NoSuchAlgorithmException("Unsupported mode " + mode);
+    }
+
+    // see JCE spec
+    @Override
+    protected void engineSetPadding(String padding)
+            throws NoSuchPaddingException {
+        // Disallow change of padding for now since currently it's explicitly
+        // defined in transformation strings
+        throw new NoSuchPaddingException("Unsupported padding " + padding);
+    }
+
+    // see JCE spec
+    @Override
+    protected int engineGetBlockSize() {
+        return 0;
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized int engineGetOutputSize(int inputLen) {
+        return outputSize;
+    }
+
+    // see JCE spec
+    @Override
+    protected byte[] engineGetIV() {
+        return null;
+    }
+
+    // see JCE spec
+    @Override
+    protected AlgorithmParameters engineGetParameters() {
+        return null;
+    }
+
+    @Override
+    protected int engineGetKeySize(Key key) throws InvalidKeyException {
+        if (!(key instanceof RSAKey)) {
+            throw new InvalidKeyException("RSAKey required");
+        }
+        int n = ((RSAKey)key).getModulus().bitLength();
+        // strip off the leading extra 0x00 byte prefix
+        int realByteSize = (n + 7) >> 3;
+        return realByteSize * 8;
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized void engineInit(int opmode, Key key, SecureRandom random)
+            throws InvalidKeyException {
+        try {
+            engineInit(opmode, key, (AlgorithmParameterSpec)null, random);
+        } catch (InvalidAlgorithmParameterException e) {
+            throw new InvalidKeyException("init() failed", e);
+        }
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized void engineInit(int opmode, Key newKey,
+            AlgorithmParameterSpec params, SecureRandom random)
+            throws InvalidKeyException, InvalidAlgorithmParameterException {
+        if (newKey == null) {
+            throw new InvalidKeyException("Key cannot be null");
+        }
+        if (opmode != Cipher.ENCRYPT_MODE &&
+            opmode != Cipher.DECRYPT_MODE &&
+            opmode != Cipher.WRAP_MODE &&
+            opmode != Cipher.UNWRAP_MODE) {
+            throw new InvalidAlgorithmParameterException
+                ("Unsupported mode: " + opmode);
+        }
+        if (params != null) {
+            if (!(params instanceof TlsRsaPremasterSecretParameterSpec)) {
+                throw new InvalidAlgorithmParameterException(
+                        "No Parameters can be specified");
+            }
+            spec = params;
+            this.random = random;   // for TLS RSA premaster secret
+        }
+        boolean doEncrypt = (opmode == Cipher.ENCRYPT_MODE || opmode == Cipher.WRAP_MODE);
+
+        // Make sure the proper opmode uses the proper key
+        if (doEncrypt && (!(newKey instanceof RSAPublicKey))) {
+            throw new InvalidKeyException("RSAPublicKey required for encryption");
+        } else if (!doEncrypt && (!(newKey instanceof RSAPrivateCrtKey))) {
+            throw new InvalidKeyException("RSAPrivateCrtKey required for decryption");
+        }
+
+        NativeKey nativeKey = null;
+        // Check keyList cache for a nativeKey
+        nativeKey = keyList.get(newKey);
+        if (nativeKey == null) {
+            // With no existing nativeKey for this newKey, create one
+            if (doEncrypt) {
+                RSAPublicKey publicKey = (RSAPublicKey) newKey;
+                try {
+                    nativeKey = (NativeKey) keyFactory.engineGeneratePublic
+                        (new RSAPublicKeySpec(publicKey.getModulus(), publicKey.getPublicExponent()));
+                } catch (InvalidKeySpecException ikse) {
+                    throw new InvalidKeyException(ikse);
+                }
+            } else {
+                RSAPrivateCrtKey privateKey = (RSAPrivateCrtKey) newKey;
+                try {
+                    nativeKey = (NativeKey) keyFactory.engineGeneratePrivate
+                        (new RSAPrivateCrtKeySpec(privateKey.getModulus(),
+                                                  privateKey.getPublicExponent(),
+                                                  privateKey.getPrivateExponent(),
+                                                  privateKey.getPrimeP(),
+                                                  privateKey.getPrimeQ(),
+                                                  privateKey.getPrimeExponentP(),
+                                                  privateKey.getPrimeExponentQ(),
+                                                  privateKey.getCrtCoefficient()));
+                } catch (InvalidKeySpecException ikse) {
+                    throw new InvalidKeyException(ikse);
+                }
+            }
+
+            // Add nativeKey to keyList cache and associate it with newKey
+            keyList.put(newKey, nativeKey);
+        }
+
+        init(doEncrypt, nativeKey);
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized void engineInit(int opmode, Key key, AlgorithmParameters params,
+            SecureRandom random)
+            throws InvalidKeyException, InvalidAlgorithmParameterException {
+        if (params != null) {
+            throw new InvalidAlgorithmParameterException("No Parameters can be specified");
+        }
+        engineInit(opmode, key, (AlgorithmParameterSpec) null, random);
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized byte[] engineUpdate(byte[] in, int inOfs, int inLen) {
+        if (inLen > 0) {
+            update(in, inOfs, inLen);
+        }
+        return null;
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized int engineUpdate(byte[] in, int inOfs, int inLen, byte[] out,
+            int outOfs) throws ShortBufferException {
+        if (out.length - outOfs < outputSize) {
+            throw new ShortBufferException("Output buffer too small");
+        }
+        if (inLen > 0) {
+            update(in, inOfs, inLen);
+        }
+        return 0;
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized byte[] engineDoFinal(byte[] in, int inOfs, int inLen)
+            throws IllegalBlockSizeException, BadPaddingException {
+        byte[] out = new byte[outputSize];
+        try {
+            // delegate to the other engineDoFinal(...) method
+            int actualLen = engineDoFinal(in, inOfs, inLen, out, 0);
+            if (actualLen != outputSize) {
+                return Arrays.copyOf(out, actualLen);
+            } else {
+                return out;
+            }
+        } catch (ShortBufferException e) {
+            throw new UcryptoException("Internal Error", e);
+        }
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized int engineDoFinal(byte[] in, int inOfs, int inLen, byte[] out,
+                                             int outOfs)
+        throws ShortBufferException, IllegalBlockSizeException,
+               BadPaddingException {
+        if (inLen != 0) {
+            update(in, inOfs, inLen);
+        }
+        return doFinal(out, outOfs, out.length - outOfs);
+    }
+
+
+    // see JCE spec
+    @Override
+    protected synchronized byte[] engineWrap(Key key) throws IllegalBlockSizeException,
+                                                             InvalidKeyException {
+        try {
+            byte[] encodedKey = key.getEncoded();
+            if ((encodedKey == null) || (encodedKey.length == 0)) {
+                throw new InvalidKeyException("Cannot get an encoding of " +
+                                              "the key to be wrapped");
+            }
+            if (encodedKey.length > buffer.length) {
+                throw new InvalidKeyException("Key is too long for wrapping");
+            }
+            return engineDoFinal(encodedKey, 0, encodedKey.length);
+        } catch (BadPaddingException e) {
+            // Should never happen for key wrapping
+            throw new UcryptoException("Internal Error", e);
+        }
+    }
+
+    // see JCE spec
+    @Override
+    protected synchronized Key engineUnwrap(byte[] wrappedKey,
+            String wrappedKeyAlgorithm, int wrappedKeyType)
+            throws InvalidKeyException, NoSuchAlgorithmException {
+
+        if (wrappedKey.length > buffer.length) {
+            throw new InvalidKeyException("Key is too long for unwrapping");
+        }
+
+        boolean isTlsRsaPremasterSecret =
+                wrappedKeyAlgorithm.equals("TlsRsaPremasterSecret");
+        Exception failover = null;
+
+        byte[] encodedKey = null;
+        try {
+            encodedKey = engineDoFinal(wrappedKey, 0, wrappedKey.length);
+        } catch (BadPaddingException bpe) {
+            if (isTlsRsaPremasterSecret) {
+                failover = bpe;
+            } else {
+                throw new InvalidKeyException("Unwrapping failed", bpe);
+            }
+        } catch (Exception e) {
+            throw new InvalidKeyException("Unwrapping failed", e);
+        }
+
+        if (isTlsRsaPremasterSecret) {
+            if (!(spec instanceof TlsRsaPremasterSecretParameterSpec)) {
+                throw new IllegalStateException(
+                        "No TlsRsaPremasterSecretParameterSpec specified");
+            }
+
+            // polish the TLS premaster secret
+            encodedKey = KeyUtil.checkTlsPreMasterSecretKey(
+                ((TlsRsaPremasterSecretParameterSpec)spec).getClientVersion(),
+                ((TlsRsaPremasterSecretParameterSpec)spec).getServerVersion(),
+                random, encodedKey, (failover != null));
+        }
+
+        return NativeCipher.constructKey(wrappedKeyType,
+                encodedKey, wrappedKeyAlgorithm);
+    }
+
+    /**
+     * calls ucrypto_encrypt(...) or ucrypto_decrypt(...)
+     * @returns the length of output or an negative error status code
+     */
+    private native static int nativeAtomic(int mech, boolean encrypt,
+                                           long keyValue, int keyLength,
+                                           byte[] in, int inLen,
+                                           byte[] out, int ouOfs, int outLen);
+
+    // do actual initialization
+    private void init(boolean encrypt, NativeKey key) {
+        this.encrypt = encrypt;
+        this.key = key;
+        try {
+            this.outputSize = engineGetKeySize(key)/8;
+        } catch (InvalidKeyException ike) {
+            throw new UcryptoException("Internal Error", ike);
+        }
+        this.buffer = new byte[outputSize];
+        this.bufOfs = 0;
+    }
+
+    // store the specified input into the internal buffer
+    private void update(byte[] in, int inOfs, int inLen) {
+        if ((inLen <= 0) || (in == null)) {
+            return;
+        }
+        // buffer bytes internally until doFinal is called
+        if ((bufOfs + inLen + (encrypt? padLen:0)) > buffer.length) {
+            // lead to IllegalBlockSizeException when doFinal() is called
+            bufOfs = buffer.length + 1;
+            return;
+        }
+        System.arraycopy(in, inOfs, buffer, bufOfs, inLen);
+        bufOfs += inLen;
+    }
+
+    // return the actual non-negative output length
+    private int doFinal(byte[] out, int outOfs, int outLen)
+            throws ShortBufferException, IllegalBlockSizeException,
+            BadPaddingException {
+        if (bufOfs > buffer.length) {
+            throw new IllegalBlockSizeException(
+                "Data must not be longer than " +
+                (buffer.length - (encrypt ? padLen : 0)) + " bytes");
+        }
+        if (outLen < outputSize) {
+            throw new ShortBufferException();
+        }
+        try {
+            long keyValue = key.value();
+            int k = nativeAtomic(mech.value(), encrypt, keyValue,
+                                 key.length(), buffer, bufOfs,
+                                 out, outOfs, outLen);
+            if (k < 0) {
+                if ( k == -16 || k == -64) {
+                    // -16: CRYPTO_ENCRYPTED_DATA_INVALID
+                    // -64: CKR_ENCRYPTED_DATA_INVALID, see bug 17459266
+                    UcryptoException ue = new UcryptoException(16);
+                    BadPaddingException bpe =
+                        new BadPaddingException("Invalid encryption data");
+                    bpe.initCause(ue);
+                    throw bpe;
+                }
+                throw new UcryptoException(-k);
+            }
+
+            return k;
+        } finally {
+            bufOfs = 0;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSAKeyFactory.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.security.ucrypto;
+
+import java.util.Set;
+import java.util.Arrays;
+import java.util.concurrent.ConcurrentSkipListSet;
+import java.lang.ref.*;
+
+import java.math.BigInteger;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.security.Key;
+import java.security.PublicKey;
+import java.security.PrivateKey;
+import java.security.KeyFactorySpi;
+
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.KeySpec;
+import java.security.spec.RSAPrivateCrtKeySpec;
+import java.security.spec.RSAPublicKeySpec;
+
+/**
+ * Ucrypto-private KeyFactory class for generating native keys
+ * needed for using ucrypto APIs. Given that it's not used
+ * externally, it only needs to support RSAPrivateCrtKeySpec
+ * and RSAPublicKeySpec objects.
+ *
+ * @since 1.9
+ */
+public final class NativeRSAKeyFactory extends KeyFactorySpi {
+
+    @Override
+    protected PrivateKey engineGeneratePrivate(KeySpec keySpec)
+        throws InvalidKeySpecException {
+        return new NativeKey.RSAPrivateCrt(keySpec);
+    }
+
+    @Override
+    protected PublicKey engineGeneratePublic(KeySpec keySpec)
+        throws InvalidKeySpecException {
+        return new NativeKey.RSAPublic(keySpec);
+    }
+
+    @Override
+    protected <T extends KeySpec> T
+        engineGetKeySpec(Key key, Class<T> keySpec)
+            throws InvalidKeySpecException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    protected Key engineTranslateKey(Key key) throws InvalidKeyException {
+        // no need to support this
+        throw new UnsupportedOperationException();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSASignature.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,445 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.security.ucrypto;
+
+import java.util.Set;
+import java.util.Arrays;
+import java.util.concurrent.ConcurrentSkipListSet;
+import java.lang.ref.*;
+import java.math.BigInteger;
+import java.nio.ByteBuffer;
+
+import java.security.SignatureSpi;
+import java.security.NoSuchAlgorithmException;
+import java.security.InvalidParameterException;
+import java.security.InvalidKeyException;
+import java.security.SignatureException;
+import java.security.Key;
+import java.security.PrivateKey;
+import java.security.PublicKey;
+
+import java.security.*;
+import java.security.interfaces.*;
+import java.security.spec.RSAPrivateCrtKeySpec;
+import java.security.spec.RSAPublicKeySpec;
+import java.security.spec.InvalidKeySpecException;
+import sun.nio.ch.DirectBuffer;
+import java.nio.ByteBuffer;
+import sun.security.rsa.RSAPadding;
+
+/**
+ * Signature implementation class. This class currently supports the
+ * following algorithms:
+ *
+ * . RSA:
+ *   . MD5withRSA
+ *   . SHA1withRSA
+ *   . SHA256withRSA
+ *   . SHA384withRSA
+ *   . SHA512withRSA
+ *
+ * @since 1.9
+ */
+class NativeRSASignature extends SignatureSpi {
+
+    private static final int PKCS1PADDING_LEN = 11;
+
+    // fields set in constructor
+    private final UcryptoMech mech;
+    private final int encodedLen;
+
+    // field for ensuring native memory is freed
+    private SignatureContextRef pCtxt = null;
+
+    //
+    // fields (re)set in every init()
+    //
+    private boolean initialized = false;
+    private boolean sign = true;
+    private int sigLength;
+    private NativeKey key;
+    private NativeRSAKeyFactory keyFactory; // may need a more generic type later
+
+    // public implementation classes
+    public static final class MD5 extends NativeRSASignature {
+        public MD5() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_MD5_RSA_PKCS, 34);
+        }
+    }
+
+    public static final class SHA1 extends NativeRSASignature {
+        public SHA1() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_SHA1_RSA_PKCS, 35);
+        }
+    }
+
+    public static final class SHA256 extends NativeRSASignature {
+        public SHA256() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_SHA256_RSA_PKCS, 51);
+        }
+    }
+
+    public static final class SHA384 extends NativeRSASignature {
+        public SHA384() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_SHA384_RSA_PKCS, 67);
+        }
+    }
+
+    public static final class SHA512 extends NativeRSASignature {
+        public SHA512() throws NoSuchAlgorithmException {
+            super(UcryptoMech.CRYPTO_SHA512_RSA_PKCS, 83);
+        }
+    }
+
+    // internal class for native resource cleanup
+    private static class SignatureContextRef extends PhantomReference<NativeRSASignature>
+        implements Comparable<SignatureContextRef> {
+
+        private static ReferenceQueue<NativeRSASignature> refQueue =
+            new ReferenceQueue<NativeRSASignature>();
+
+        // Needed to keep these references from being GC'ed until when their
+        // referents are GC'ed so we can do post-mortem processing
+        private static Set<SignatureContextRef> refList =
+            new ConcurrentSkipListSet<SignatureContextRef>();
+        //           Collections.synchronizedSortedSet(new TreeSet<SignatureContextRef>());
+
+        private final long id;
+        private final boolean sign;
+
+        private static void drainRefQueueBounded() {
+            while (true) {
+                SignatureContextRef next = (SignatureContextRef) refQueue.poll();
+                if (next == null) break;
+                next.dispose(true);
+            }
+        }
+
+        SignatureContextRef(NativeRSASignature ns, long id, boolean sign) {
+            super(ns, refQueue);
+            this.id = id;
+            this.sign = sign;
+            refList.add(this);
+            UcryptoProvider.debug("Resource: track Signature Ctxt " + this.id);
+            drainRefQueueBounded();
+        }
+
+        public int compareTo(SignatureContextRef other) {
+            if (this.id == other.id) {
+                return 0;
+            } else {
+                return (this.id < other.id) ? -1 : 1;
+            }
+        }
+
+        void dispose(boolean doCancel) {
+            refList.remove(this);
+            try {
+                if (doCancel) {
+                    UcryptoProvider.debug("Resource: free Signature Ctxt " + this.id);
+                    NativeRSASignature.nativeFinal(id, sign, null, 0, 0);
+                } else {
+                    UcryptoProvider.debug("Resource: stop tracking Signature Ctxt " + this.id);
+                }
+            } finally {
+                this.clear();
+            }
+        }
+    }
+
+    NativeRSASignature(UcryptoMech mech, int encodedLen)
+        throws NoSuchAlgorithmException {
+        this.mech = mech;
+        this.encodedLen = encodedLen;
+        this.keyFactory = new NativeRSAKeyFactory();
+    }
+
+    // deprecated but abstract
+    @SuppressWarnings("deprecation")
+    protected Object engineGetParameter(String param) throws InvalidParameterException {
+        throw new UnsupportedOperationException("getParameter() not supported");
+    }
+
+    @Override
+    protected synchronized void engineInitSign(PrivateKey privateKey)
+            throws InvalidKeyException {
+        if (privateKey == null) {
+            throw new InvalidKeyException("Key must not be null");
+        }
+        NativeKey newKey = key;
+        int newSigLength = sigLength;
+        // Need to check RSA key length whenever a new private key is set
+        if (privateKey != key) {
+            if (privateKey instanceof RSAPrivateCrtKey) {
+                RSAPrivateCrtKey rsaPrivKey = (RSAPrivateCrtKey) privateKey;
+                BigInteger mod = rsaPrivKey.getModulus();
+                newSigLength = checkRSAKeyLength(mod);
+                try {
+                    newKey = (NativeKey) keyFactory.engineGeneratePrivate
+                        (new RSAPrivateCrtKeySpec(mod,
+                                                  rsaPrivKey.getPublicExponent(),
+                                                  rsaPrivKey.getPrivateExponent(),
+                                                  rsaPrivKey.getPrimeP(),
+                                                  rsaPrivKey.getPrimeQ(),
+                                                  rsaPrivKey.getPrimeExponentP(),
+                                                  rsaPrivKey.getPrimeExponentQ(),
+                                                  rsaPrivKey.getCrtCoefficient()));
+                } catch (InvalidKeySpecException ikse) {
+                    throw new InvalidKeyException(ikse);
+                }
+            } else {
+                throw new InvalidKeyException("RSAPrivateCrtKey required");
+            }
+        }
+        init(true, newKey, newSigLength);
+    }
+
+
+    @Override
+    protected synchronized void engineInitVerify(PublicKey publicKey)
+            throws InvalidKeyException {
+        if (publicKey == null) {
+            throw new InvalidKeyException("Key must not be null");
+        }
+        NativeKey newKey = key;
+        int newSigLength = sigLength;
+        // Need to check RSA key length whenever a new public key is set
+        if (publicKey != key) {
+            if (publicKey instanceof RSAPublicKey) {
+                BigInteger mod = ((RSAPublicKey) publicKey).getModulus();
+                newSigLength = checkRSAKeyLength(mod);
+                try {
+                    newKey = (NativeKey) keyFactory.engineGeneratePublic
+                        (new RSAPublicKeySpec(mod, ((RSAPublicKey) publicKey).getPublicExponent()));
+                } catch (InvalidKeySpecException ikse) {
+                    throw new InvalidKeyException(ikse);
+                }
+            } else {
+                throw new InvalidKeyException("RSAPublicKey required");
+            }
+        }
+        init(false, newKey, newSigLength);
+    }
+
+    // deprecated but abstract
+    @SuppressWarnings("deprecation")
+    protected void engineSetParameter(String param, Object value) throws InvalidParameterException {
+        throw new UnsupportedOperationException("setParameter() not supported");
+    }
+
+    @Override
+    protected synchronized byte[] engineSign() throws SignatureException {
+        byte[] sig = new byte[sigLength];
+        int rv = doFinal(sig, 0, sigLength);
+        if (rv < 0) {
+            throw new SignatureException(new UcryptoException(-rv));
+        }
+        return sig;
+    }
+
+    @Override
+    protected synchronized int engineSign(byte[] outbuf, int offset, int len)
+        throws SignatureException {
+        if (outbuf == null || (offset < 0) || (outbuf.length < (offset + sigLength))
+            || (len < sigLength)) {
+            throw new SignatureException("Invalid output buffer");
+        }
+        int rv = doFinal(outbuf, offset, sigLength);
+        if (rv < 0) {
+            throw new SignatureException(new UcryptoException(-rv));
+        }
+        return sigLength;
+    }
+
+    @Override
+    protected synchronized void engineUpdate(byte b) throws SignatureException {
+        byte[] in = { b };
+        int rv = update(in, 0, 1);
+        if (rv < 0) {
+            throw new SignatureException(new UcryptoException(-rv));
+        }
+    }
+
+    @Override
+    protected synchronized void engineUpdate(byte[] in, int inOfs, int inLen)
+            throws SignatureException {
+        if (in == null || inOfs < 0 || inLen == 0) return;
+
+        int rv = update(in, inOfs, inLen);
+        if (rv < 0) {
+            throw new SignatureException(new UcryptoException(-rv));
+        }
+    }
+
+    @Override
+    protected synchronized void engineUpdate(ByteBuffer in) {
+        if (in == null || in.remaining() == 0) return;
+
+        if (in instanceof DirectBuffer == false) {
+            // cannot do better than default impl
+            super.engineUpdate(in);
+            return;
+        }
+        long inAddr = ((DirectBuffer)in).address();
+        int inOfs = in.position();
+        int inLen = in.remaining();
+
+        int rv = update((inAddr + inOfs), inLen);
+        if (rv < 0) {
+            throw new UcryptoException(-rv);
+        }
+        in.position(inOfs + inLen);
+    }
+
+    @Override
+    protected synchronized boolean engineVerify(byte[] sigBytes) throws SignatureException {
+        return engineVerify(sigBytes, 0, sigBytes.length);
+    }
+
+    @Override
+    protected synchronized boolean engineVerify(byte[] sigBytes, int sigOfs, int sigLen)
+        throws SignatureException {
+        if (sigBytes == null || (sigOfs < 0) || (sigBytes.length < (sigOfs + this.sigLength))
+            || (sigLen < this.sigLength)) {
+            throw new SignatureException("Invalid signature buffer");
+        }
+
+        int rv = doFinal(sigBytes, sigOfs, sigLen);
+        if (rv == 0) {
+            return true;
+        } else {
+            UcryptoProvider.debug("Signature: " + mech + " verification error " +
+                             new UcryptoException(-rv).getMessage());
+            return false;
+        }
+    }
+
+    void reset(boolean doCancel) {
+        initialized = false;
+        if (pCtxt != null) {
+            pCtxt.dispose(doCancel);
+            pCtxt = null;
+        }
+    }
+
+    /**
+     * calls ucrypto_sign_init(...) or ucrypto_verify_init(...)
+     * @return pointer to the context
+     */
+    private native static long nativeInit(int mech, boolean sign,
+                                          long keyValue, int keyLength);
+
+    /**
+     * calls ucrypto_sign_update(...) or ucrypto_verify_update(...)
+     * @returns an error status code (0 means SUCCESS)
+     */
+    private native static int nativeUpdate(long pContext, boolean sign,
+                                           byte[] in, int inOfs, int inLen);
+    /**
+     * calls ucrypto_sign_update(...) or ucrypto_verify_update(...)
+     * @returns an error status code (0 means SUCCESS)
+     */
+    private native static int nativeUpdate(long pContext, boolean sign,
+                                           long pIn, int inLen);
+
+    /**
+     * calls ucrypto_sign_final(...) or ucrypto_verify_final(...)
+     * @returns the length of signature bytes or verification status.
+     * If negative, it indicates an error status code
+     */
+    private native static int nativeFinal(long pContext, boolean sign,
+                                          byte[] sig, int sigOfs, int sigLen);
+
+    // actual init() implementation - caller should clone key if needed
+    private void init(boolean sign, NativeKey key, int sigLength) {
+        reset(true);
+        this.sign = sign;
+        this.sigLength = sigLength;
+        this.key = key;
+        long pCtxtVal = nativeInit(mech.value(), sign, key.value(),
+                                   key.length());
+        initialized = (pCtxtVal != 0L);
+        if (initialized) {
+            pCtxt = new SignatureContextRef(this, pCtxtVal, sign);
+        } else {
+            throw new UcryptoException("Cannot initialize Signature");
+        }
+    }
+
+    private void ensureInitialized() {
+        if (!initialized) {
+            init(sign, key, sigLength);
+            if (!initialized) {
+                throw new UcryptoException("Cannot initialize Signature");
+            }
+        }
+    }
+
+    // returns 0 (success) or negative (ucrypto error occurred)
+    private int update(byte[] in, int inOfs, int inLen) {
+        if (inOfs < 0 || inOfs + inLen > in.length) {
+            throw new ArrayIndexOutOfBoundsException();
+        }
+        ensureInitialized();
+        int k = nativeUpdate(pCtxt.id, sign, in, inOfs, inLen);
+        if (k < 0) {
+            reset(false);
+        }
+        return k;
+    }
+
+    // returns 0 (success) or negative (ucrypto error occurred)
+    private int update(long pIn, int inLen) {
+        ensureInitialized();
+        int k = nativeUpdate(pCtxt.id, sign, pIn, inLen);
+        if (k < 0) {
+            reset(false);
+        }
+        return k;
+    }
+
+    // returns 0 (success) or negative (ucrypto error occurred)
+    private int doFinal(byte[] sigBytes, int sigOfs, int sigLen) {
+        try {
+            ensureInitialized();
+            int k = nativeFinal(pCtxt.id, sign, sigBytes, sigOfs, sigLen);
+            return k;
+        } finally {
+            reset(false);
+        }
+    }
+
+    // check and return RSA key size in number of bytes
+    private int checkRSAKeyLength(BigInteger mod) throws InvalidKeyException {
+        int keySize = (mod.bitLength() + 7) >> 3;
+        int maxDataSize = keySize - PKCS1PADDING_LEN;
+        if (maxDataSize < encodedLen) {
+            throw new InvalidKeyException
+                ("Key is too short for this signature algorithm");
+        }
+        return keySize;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoException.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.security.ucrypto;
+
+import java.util.*;
+import java.security.ProviderException;
+
+/**
+ * The exception class used by SunUcrypto provider. An exception
+ * object of this class indicates that a function call to the underlying
+ * native calls returned a value not equal to CRYPTO_SUCCESS.
+ *
+ * @since 1.9
+ */
+public final class UcryptoException extends ProviderException {
+
+    private static final long serialVersionUID = -933864511110035746L;
+
+    // NOTE: check /usr/include/sys/crypto/common.h for updates
+    private static final String ERROR_MSG[] = {
+        "CRYPTO_SUCCESS",
+        "CRYPTO_CANCEL",
+        "CRYPTO_HOST_MEMORY",
+        "CRYPTO_GENERAL_ERROR",
+        "CRYPTO_FAILED",
+        "CRYPTO_ARGUMENTS_BAD",
+        "CRYPTO_ATTRIBUTE_READ_ONLY",
+        "CRYPTO_ATTRIBUTE_SENSITIVE",
+        "CRYPTO_ATTRIBUTE_TYPE_INVALID",
+        "CRYPTO_ATTRIBUTE_VALUE_INVALID",
+        "CRYPTO_CANCELED",
+        "CRYPTO_DATA_INVALID",
+        "CRYPTO_DATA_LEN_RANGE",
+        "CRYPTO_DEVICE_ERROR",
+        "CRYPTO_DEVICE_MEMORY",
+        "CRYPTO_DEVICE_REMOVED",
+        "CRYPTO_ENCRYPTED_DATA_INVALID",
+        "CRYPTO_ENCRYPTED_DATA_LEN_RANGE",
+        "CRYPTO_KEY_HANDLE_INVALID",
+        "CRYPTO_KEY_SIZE_RANGE",
+        "CRYPTO_KEY_TYPE_INCONSISTENT",
+        "CRYPTO_KEY_NOT_NEEDED",
+        "CRYPTO_KEY_CHANGED",
+        "CRYPTO_KEY_NEEDED",
+        "CRYPTO_KEY_INDIGESTIBLE",
+        "CRYPTO_KEY_FUNCTION_NOT_PERMITTED",
+        "CRYPTO_KEY_NOT_WRAPPABLE",
+        "CRYPTO_KEY_UNEXTRACTABLE",
+        "CRYPTO_MECHANISM_INVALID",
+        "CRYPTO_MECHANISM_PARAM_INVALID",
+        "CRYPTO_OBJECT_HANDLE_INVALID",
+        "CRYPTO_OPERATION_IS_ACTIVE",
+        "CRYPTO_OPERATION_NOT_INITIALIZED",
+        "CRYPTO_PIN_INCORRECT",
+        "CRYPTO_PIN_INVALID",
+        "CRYPTO_PIN_LEN_RANGE",
+        "CRYPTO_PIN_EXPIRED",
+        "CRYPTO_PIN_LOCKED",
+        "CRYPTO_SESSION_CLOSED",
+        "CRYPTO_SESSION_COUNT",
+        "CRYPTO_SESSION_HANDLE_INVALID",
+        "CRYPTO_SESSION_READ_ONLY",
+        "CRYPTO_SESSION_EXISTS",
+        "CRYPTO_SESSION_READ_ONLY_EXISTS",
+        "CRYPTO_SESSION_READ_WRITE_SO_EXISTS",
+        "CRYPTO_SIGNATURE_INVALID",
+        "CRYPTO_SIGNATURE_LEN_RANGE",
+        "CRYPTO_TEMPLATE_INCOMPLETE",
+        "CRYPTO_TEMPLATE_INCONSISTENT",
+        "CRYPTO_UNWRAPPING_KEY_HANDLE_INVALID",
+        "CRYPTO_UNWRAPPING_KEY_SIZE_RANGE",
+        "CRYPTO_UNWRAPPING_KEY_TYPE_INCONSISTENT",
+        "CRYPTO_USER_ALREADY_LOGGED_IN",
+        "CRYPTO_USER_NOT_LOGGED_IN",
+        "CRYPTO_USER_PIN_NOT_INITIALIZED",
+        "CRYPTO_USER_TYPE_INVALID",
+        "CRYPTO_USER_ANOTHER_ALREADY_LOGGED_IN",
+        "CRYPTO_USER_TOO_MANY_TYPES",
+        "CRYPTO_WRAPPED_KEY_INVALID",
+        "CRYPTO_WRAPPED_KEY_LEN_RANGE",
+        "CRYPTO_WRAPPING_KEY_HANDLE_INVALID",
+        "CRYPTO_WRAPPING_KEY_SIZE_RANGE",
+        "CRYPTO_WRAPPING_KEY_TYPE_INCONSISTENT",
+        "CRYPTO_RANDOM_SEED_NOT_SUPPORTED",
+        "CRYPTO_RANDOM_NO_RNG",
+        "CRYPTO_DOMAIN_PARAMS_INVALID",
+        "CRYPTO_BUFFER_TOO_SMALL",
+        "CRYPTO_INFORMATION_SENSITIVE",
+        "CRYPTO_NOT_SUPPORTED",
+        "CRYPTO_QUEUED",
+        "CRYPTO_BUFFER_TOO_BIG",
+        "CRYPTO_INVALID_CONTEXT",
+        "CRYPTO_INVALID_MAC",
+        "CRYPTO_MECH_NOT_SUPPORTED",
+        "CRYPTO_INCONSISTENT_ATTRIBUTE",
+        "CRYPTO_NO_PERMISSION",
+        "CRYPTO_INVALID_PROVIDER_ID",
+        "CRYPTO_VERSION_MISMATCH",
+        "CRYPTO_BUSY",
+        "CRYPTO_UNKNOWN_PROVIDER",
+        "CRYPTO_MODVERIFICATION_FAILED",
+        "CRYPTO_OLD_CTX_TEMPLATE",
+        "CRYPTO_WEAK_KEY",
+        "CRYPTO_FIPS140_ERROR"
+    };
+
+    /**
+     * The error code if this exception is triggered by a Ucrypto error.
+     */
+    private final int errorCode;
+
+    /**
+     * This method gets the corresponding text error message from a
+     * predefined mapping. If mapping is not found, then it returns the error
+     * code as a hex-string.
+     *
+     * @return The message or the error code; e.g. "CRYPTO_DATA_INVALID" or
+     *         "0x88".
+     */
+    static String getErrorMessage(int errorCode) {
+        String message;
+        if (errorCode < ERROR_MSG.length) {
+            message = ERROR_MSG[errorCode];
+        } else {
+            message = "0x" + Integer.toHexString(errorCode);
+        }
+        return message;
+    }
+
+    /**
+     * Constructor taking the error code as defined for the CRYPTO_* constants
+     */
+    public UcryptoException(int rv) {
+        super(getErrorMessage(rv));
+        this.errorCode = rv;
+    }
+
+    public UcryptoException(String message) {
+        super(message);
+        errorCode = -1;
+    }
+
+    public UcryptoException(String message, Throwable cause) {
+        super(message, cause);
+        errorCode = -1;
+    }
+
+    /**
+     * Returns the Ucrypto error code.
+     *
+     * @return The error code.
+     */
+    public int getErrorCode() {
+        return errorCode;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoMech.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.security.ucrypto;
+
+import java.util.HashMap;
+
+/**
+ * Enum for representing the ucrypto mechanisms.
+ *
+ * @since 1.9
+ */
+// Check /usr/include/libsoftcrypto.h for updates
+public enum UcryptoMech {
+    CRYPTO_AES_ECB(1, new String[]
+        { "Cipher.AES/ECB/NoPadding;com.oracle.security.ucrypto.NativeCipher$AesEcbNoPadding",
+          "Cipher.AES/ECB/PKCS5Padding;com.oracle.security.ucrypto.NativeCipherWithJavaPadding$AesEcbPKCS5",
+          "Cipher.AES_128/ECB/NoPadding;com.oracle.security.ucrypto.NativeCipher$Aes128EcbNoPadding",
+          "Alg.Alias.Cipher.2.16.840.1.101.3.4.1.1;AES_128/ECB/NoPadding",
+          "Alg.Alias.Cipher.OID.2.16.840.1.101.3.4.1.1;AES_128/ECB/NoPadding",
+          "Cipher.AES_192/ECB/NoPadding;com.oracle.security.ucrypto.NativeCipher$Aes192EcbNoPadding",
+          "Alg.Alias.Cipher.2.16.840.1.101.3.4.1.21;AES_192/ECB/NoPadding",
+          "Alg.Alias.Cipher.OID.2.16.840.1.101.3.4.1.21;AES_192/ECB/NoPadding",
+          "Cipher.AES_256/ECB/NoPadding;com.oracle.security.ucrypto.NativeCipher$Aes256EcbNoPadding",
+          "Alg.Alias.Cipher.2.16.840.1.101.3.4.1.41;AES_256/ECB/NoPadding",
+          "Alg.Alias.Cipher.OID.2.16.840.1.101.3.4.1.41;AES_256/ECB/NoPadding"
+        }),
+    CRYPTO_AES_CBC(2, new String[]
+        { "Cipher.AES/CBC/NoPadding;com.oracle.security.ucrypto.NativeCipher$AesCbcNoPadding",
+          "Cipher.AES/CBC/PKCS5Padding;com.oracle.security.ucrypto.NativeCipherWithJavaPadding$AesCbcPKCS5",
+          "Cipher.AES_128/CBC/NoPadding;com.oracle.security.ucrypto.NativeCipher$Aes128CbcNoPadding",
+          "Alg.Alias.Cipher.2.16.840.1.101.3.4.1.2;AES_128/CBC/NoPadding",
+          "Alg.Alias.Cipher.OID.2.16.840.1.101.3.4.1.2;AES_128/CBC/NoPadding",
+          "Cipher.AES_192/CBC/NoPadding;com.oracle.security.ucrypto.NativeCipher$Aes192CbcNoPadding",
+          "Alg.Alias.Cipher.2.16.840.1.101.3.4.1.22;AES_192/CBC/NoPadding",
+          "Alg.Alias.Cipher.OID.2.16.840.1.101.3.4.1.22;AES_192/CBC/NoPadding",
+          "Cipher.AES_256/CBC/NoPadding;com.oracle.security.ucrypto.NativeCipher$Aes256CbcNoPadding",
+          "Alg.Alias.Cipher.2.16.840.1.101.3.4.1.42;AES_256/CBC/NoPadding",
+          "Alg.Alias.Cipher.OID.2.16.840.1.101.3.4.1.42;AES_256/CBC/NoPadding"
+        }),
+    CRYPTO_AES_CBC_PAD(3, null), // No support from Solaris yet
+    CRYPTO_AES_CTR(4, new String[]
+        { "Cipher.AES/CTR/NoPadding;com.oracle.security.ucrypto.NativeCipher$AesCtrNoPadding" }),
+    CRYPTO_AES_CCM(5, null), // Cannot support due to lack of Java API which corresponds to CK_AES_CCM_PARAMS
+    CRYPTO_AES_GCM(6, new String[]
+        { "Cipher.AES/GCM/NoPadding;com.oracle.security.ucrypto.NativeGCMCipher$AesGcmNoPadding",
+          "Cipher.AES_128/GCM/NoPadding;com.oracle.security.ucrypto.NativeGCMCipher$Aes128GcmNoPadding",
+          "Alg.Alias.Cipher.2.16.840.1.101.3.4.1.6;AES_128/GCM/NoPadding",
+          "Alg.Alias.Cipher.OID.2.16.840.1.101.3.4.1.6;AES_128/GCM/NoPadding",
+          "Cipher.AES_192/GCM/NoPadding;com.oracle.security.ucrypto.NativeGCMCipher$Aes192GcmNoPadding",
+          "Alg.Alias.Cipher.2.16.840.1.101.3.4.1.26;AES_192/GCM/NoPadding",
+          "Alg.Alias.Cipher.OID.2.16.840.1.101.3.4.1.26;AES_192/GCM/NoPadding",
+          "Cipher.AES_256/GCM/NoPadding;com.oracle.security.ucrypto.NativeGCMCipher$Aes256GcmNoPadding",
+          "Alg.Alias.Cipher.2.16.840.1.101.3.4.1.46;AES_256/GCM/NoPadding",
+          "Alg.Alias.Cipher.OID.2.16.840.1.101.3.4.1.46;AES_256/GCM/NoPadding",
+        }),
+    CRYPTO_AES_GMAC(7, null), // No support from Solaris yet
+    CRYPTO_AES_CFB128(8, new String[]
+        { "Cipher.AES/CFB128/NoPadding;com.oracle.security.ucrypto.NativeCipher$AesCfb128NoPadding",
+          "Cipher.AES/CFB128/PKCS5Padding;com.oracle.security.ucrypto.NativeCipherWithJavaPadding$AesCfb128PKCS5" }),
+    CRYPTO_RSA_PKCS(31, new String[]
+        { "Cipher.RSA/ECB/PKCS1Padding;com.oracle.security.ucrypto.NativeRSACipher$PKCS1Padding" }),
+    CRYPTO_RSA_X_509(32, new String[]
+        { "Cipher.RSA/ECB/NoPadding;com.oracle.security.ucrypto.NativeRSACipher$NoPadding" }),
+    CRYPTO_MD5_RSA_PKCS(33, new String[]
+        { "Signature.MD5withRSA;com.oracle.security.ucrypto.NativeRSASignature$MD5",
+          "Alg.Alias.Signature.1.2.840.113549.1.1.4;MD5withRSA",
+          "Alg.Alias.Signature.OID.1.2.840.113549.1.1.4;MD5withRSA" }),
+    CRYPTO_SHA1_RSA_PKCS(34, new String[]
+        { "Signature.SHA1withRSA;com.oracle.security.ucrypto.NativeRSASignature$SHA1",
+          "Alg.Alias.Signature.1.2.840.113549.1.1.5;SHA1withRSA",
+          "Alg.Alias.Signature.OID.1.2.840.113549.1.1.5;SHA1withRSA",
+          "Alg.Alias.Signature.1.3.14.3.2.29;SHA1withRSA" }),
+    CRYPTO_SHA256_RSA_PKCS(35, new String[]
+        { "Signature.SHA256withRSA;com.oracle.security.ucrypto.NativeRSASignature$SHA256",
+          "Alg.Alias.Signature.1.2.840.113549.1.1.11;SHA256withRSA",
+          "Alg.Alias.Signature.OID.1.2.840.113549.1.1.11;SHA256withRSA" }),
+    CRYPTO_SHA384_RSA_PKCS(36, new String[]
+        { "Signature.SHA384withRSA;com.oracle.security.ucrypto.NativeRSASignature$SHA384",
+          "Alg.Alias.Signature.1.2.840.113549.1.1.12;SHA384withRSA",
+          "Alg.Alias.Signature.OID.1.2.840.113549.1.1.12;SHA384withRSA" }),
+    CRYPTO_SHA512_RSA_PKCS(37, new String[]
+        { "Signature.SHA512withRSA;com.oracle.security.ucrypto.NativeRSASignature$SHA512",
+          "Alg.Alias.Signature.1.2.840.113549.1.1.13;SHA512withRSA",
+          "Alg.Alias.Signature.OID.1.2.840.113549.1.1.13;SHA512withRSA" });
+
+    private int mech;
+    private String[] jceProps;
+
+    UcryptoMech(int mech, String[] jceProps) {
+        this.mech = mech;
+        this.jceProps = jceProps;
+    }
+
+    public int value() { return mech; }
+    public String[] jceProperties() { return jceProps; }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoProvider.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.security.ucrypto;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.StringTokenizer;
+import java.security.*;
+import sun.security.action.PutAllAction;
+import sun.security.action.GetPropertyAction;
+
+/**
+ * OracleUcrypto provider main class.
+ *
+ * @since 1.9
+ */
+public final class UcryptoProvider extends Provider {
+
+    private static final long serialVersionUID = 351251234302833L;
+
+    private static boolean DEBUG;
+    private static HashMap<String, String> provProp;
+
+    static {
+        try {
+            DEBUG = Boolean.parseBoolean(AccessController.doPrivileged
+                (new GetPropertyAction("com.oracle.security.ucrypto.debug")));
+
+            // cannot use LoadLibraryAction because that would make the native
+            // library available to the bootclassloader, but we run in the
+            // extension classloader.
+            provProp = AccessController.doPrivileged
+                (new PrivilegedAction<HashMap<String, String>>() {
+                    public HashMap<String, String> run() {
+                        try {
+                            System.loadLibrary("j2ucrypto");
+                            String osname = System.getProperty("os.name");
+                            if (osname.startsWith("SunOS")) {
+                                return new HashMap<String, String>();
+                            } else return null;
+                        } catch (Error err) {
+                            return null;
+                        } catch (SecurityException se) {
+                            return null;
+                        }
+                    }
+                });
+            if (provProp != null) {
+                boolean[] result = loadLibraries();
+                if (result.length == 2) {
+                    if (result[0]) { // successfully loaded libmd
+                        provProp.put("MessageDigest.MD5",
+                                     "com.oracle.security.ucrypto.NativeDigest$MD5");
+                        provProp.put("MessageDigest.SHA",
+                                     "com.oracle.security.ucrypto.NativeDigest$SHA1");
+                        provProp.put("Alg.Alias.MessageDigest.SHA-1", "SHA");
+                        provProp.put("Alg.Alias.MessageDigest.SHA1", "SHA");
+                        provProp.put("MessageDigest.SHA-256",
+                                     "com.oracle.security.ucrypto.NativeDigest$SHA256");
+                        provProp.put("Alg.Alias.MessageDigest.2.16.840.1.101.3.4.2.1", "SHA-256");
+                        provProp.put("Alg.Alias.MessageDigest.OID.2.16.840.1.101.3.4.2.1", "SHA-256");
+
+                        provProp.put("MessageDigest.SHA-384",
+                                     "com.oracle.security.ucrypto.NativeDigest$SHA384");
+                        provProp.put("Alg.Alias.MessageDigest.2.16.840.1.101.3.4.2.2", "SHA-384");
+                        provProp.put("Alg.Alias.MessageDigest.OID.2.16.840.1.101.3.4.2.2", "SHA-384");
+
+                        provProp.put("MessageDigest.SHA-512",
+                                     "com.oracle.security.ucrypto.NativeDigest$SHA512");
+                        provProp.put("Alg.Alias.MessageDigest.2.16.840.1.101.3.4.2.3", "SHA-512");
+                        provProp.put("Alg.Alias.MessageDigest.OID.2.16.840.1.101.3.4.2.3", "SHA-512");
+
+                    }
+                    if (result[1]) { // successfully loaded libsoftcrypto
+                        String supportedMechs = getMechList();
+                        debug("Prov: supported mechs = " + supportedMechs);
+                        for (UcryptoMech m : UcryptoMech.values()) {
+                            if (supportedMechs.indexOf(m.name() + ",") != -1) {
+                                String[] jceProps = m.jceProperties();
+                                // skip unsupported UcryptoMech
+                                if (jceProps == null) continue;
+                                for (int p = 0; p < jceProps.length; p++) {
+                                    StringTokenizer st =
+                                        new StringTokenizer(jceProps[p], ";");
+                                    if (st.countTokens() != 2) {
+                                        throw new RuntimeException("Wrong format: " + jceProps[p]);
+                                    }
+                                    provProp.put(st.nextToken(), st.nextToken());
+                                }
+                            }
+                        }
+                        // NOTE: GCM support is only available since jdk 7
+                        provProp.put("AlgorithmParameters.GCM",
+                                     "com.oracle.security.ucrypto.GCMParameters");
+                    }
+                } else {
+                    debug("Prov: unexpected ucrypto library loading error, got " + result.length);
+                }
+            }
+        } catch (AccessControlException ace) {
+            // disable Ucrypto provider
+            DEBUG = false;
+            provProp = null;
+        }
+    }
+
+    static Provider provider = null;
+    private static native boolean[] loadLibraries();
+    private static native String getMechList();
+
+    static void debug(String msg) {
+        if (DEBUG) {
+            System.out.println("UCrypto/" + msg);
+        }
+    }
+
+    public UcryptoProvider() {
+        super("OracleUcrypto", 1.9d, "Provider using Oracle Ucrypto API");
+        if (provProp != null) {
+            AccessController.doPrivileged(new PutAllAction(this, provProp));
+        }
+        if (provider == null) provider = this;
+    }
+
+    public UcryptoProvider(String configName) {
+        super("OracleUcrypto", 1.9d, "Provider using Oracle Ucrypto API");
+        try {
+            if (provProp != null) {
+                HashMap<String, String> customProvProp =
+                    new HashMap<String, String>(provProp);
+                Config c = new Config(configName);
+                String[] disabledServices = c.getDisabledServices();
+                for (int i = 0; i < disabledServices.length; i++) {
+                    if (customProvProp.remove(disabledServices[i]) != null) {
+                        debug("Prov: remove config-disabled service " + disabledServices[i]);
+                    } else {
+                        debug("Prov: ignore unsupported config-disabled service " +
+                              disabledServices[i]);
+                    }
+                }
+                AccessController.doPrivileged(new PutAllAction(this, customProvProp));
+            }
+        } catch (IOException ioe) { // thrown by Config
+            throw new UcryptoException("Error parsing Config", ioe);
+        }
+        if (provider == null) provider = this;
+    }
+
+    public boolean equals(Object obj) {
+        return this == obj;
+    }
+
+    public int hashCode() {
+        return System.identityHashCode(this);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/conf/security/ucrypto-solaris.cfg	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,9 @@
+#
+# Configuration file for the OracleUcrypto provider
+#
+disabledServices = {
+  # disabled due to Solaris bug 7121679
+  Cipher.AES/CFB128/PKCS5Padding
+  Cipher.AES/CFB128/NoPadding
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/libsoftcrypto.h	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef _LIBSOFTCRYPTO_H
+#define _LIBSOFTCRYPTO_H
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <strings.h>
+
+typedef enum ucrypto_mech {
+    CRYPTO_AES_ECB = 1,
+    CRYPTO_AES_CBC,
+    CRYPTO_AES_CBC_PAD,
+    CRYPTO_AES_CTR,
+    CRYPTO_AES_CCM,
+    CRYPTO_AES_GCM,
+    CRYPTO_AES_GMAC,
+    CRYPTO_AES_CFB128,
+    CRYPTO_RSA_PKCS = 31,
+    CRYPTO_RSA_X_509,
+    CRYPTO_MD5_RSA_PKCS,
+    CRYPTO_SHA1_RSA_PKCS,
+    CRYPTO_SHA256_RSA_PKCS,
+    CRYPTO_SHA384_RSA_PKCS,
+    CRYPTO_SHA512_RSA_PKCS
+} ucrypto_mech_t;
+
+typedef struct crypto_ctx {
+    void *cc_provider;
+    uint_t    cc_session;
+    void            *cc_provider_private;    /* owned by provider */
+    void            *cc_framework_private;    /* owned by framework */
+    uint32_t        cc_flags;        /* flags */
+    void            *cc_opstate;        /* state */
+} crypto_ctx_t;
+
+extern int ucrypto_encrypt_init(crypto_ctx_t *context,
+    ucrypto_mech_t mech_type, uchar_t *key_str, size_t key_len,
+    void *iv, size_t iv_len);
+
+extern int ucrypto_encrypt_update(crypto_ctx_t *context, uchar_t *in,
+    size_t in_len, uchar_t *out, size_t *out_len);
+
+extern int ucrypto_encrypt_final(crypto_ctx_t *context, uchar_t *out,
+    size_t *out_len);
+
+/* Encrypt atomic */
+extern int ucrypto_encrypt(ucrypto_mech_t mech_type, uchar_t *key_str,
+    size_t key_len, void *iv, size_t iv_len, uchar_t *in,
+    size_t in_len, uchar_t *out, size_t *out_len);
+
+/* Decrypt multi-part */
+extern int ucrypto_decrypt_init(crypto_ctx_t *context,
+    ucrypto_mech_t mech_type, uchar_t *key_str, size_t key_len,
+    void *iv, size_t iv_len);
+
+extern int ucrypto_decrypt_update(crypto_ctx_t *context, uchar_t *in,
+    size_t in_len, uchar_t *out, size_t *out_len);
+
+extern int ucrypto_decrypt_final(crypto_ctx_t *context, uchar_t *out,
+    size_t *out_len);
+
+/* Decrypt atomic */
+extern int ucrypto_decrypt(ucrypto_mech_t mech_type, uchar_t *key_str,
+    size_t key_len, void *iv, size_t iv_len, uchar_t *in,
+    size_t in_len, uchar_t *out, size_t *out_len);
+
+/* Sign multi-part */
+extern int ucrypto_sign_init(crypto_ctx_t *context, ucrypto_mech_t mech_type,
+    uchar_t *key_str, size_t key_len, void *iv, size_t iv_len);
+
+extern int ucrypto_sign_update(crypto_ctx_t *context,
+    uchar_t *data_str, size_t data_len);
+
+extern int ucrypto_sign_final(crypto_ctx_t *context,
+    uchar_t *sig_str, size_t *sig_len);
+
+/* Sign atomic */
+extern int ucrypto_sign(ucrypto_mech_t mech_type,
+    uchar_t *key_str, size_t key_len, void *iv, size_t iv_len,
+    uchar_t *data_str, size_t data_len, uchar_t *sig_str, size_t *sig_len);
+
+/* Verify multi-part */
+extern int ucrypto_verify_init(crypto_ctx_t *context, ucrypto_mech_t mech_type,
+    uchar_t *key_str, size_t key_len, void *iv, size_t iv_len);
+
+extern int ucrypto_verify_update(crypto_ctx_t *context,
+    uchar_t *data_str, size_t data_len);
+
+extern int ucrypto_verify_final(crypto_ctx_t *context,
+    uchar_t *sig_str, size_t *sig_len);
+
+/* Verify atomic */
+extern int ucrypto_verify(ucrypto_mech_t mech_type,
+    uchar_t *key_str, size_t key_len, void *iv, size_t iv_len,
+    uchar_t *data_str, size_t data_len, uchar_t *sig, size_t *sig_len);
+
+extern int ucrypto_get_mechlist(char *str);
+
+extern const char *ucrypto_id2mech(ucrypto_mech_t mech_type);
+
+extern ucrypto_mech_t ucrypto_mech2id(const char *str);
+
+extern int ucrypto_version();
+
+typedef struct CK_AES_CTR_PARAMS {
+    ulong_t    ulCounterBits;
+    uint8_t cb[16];
+} CK_AES_CTR_PARAMS;
+
+typedef struct CK_AES_GCM_PARAMS {
+    uchar_t *pIv;
+    ulong_t ulIvLen;
+    ulong_t ulIvBits;
+    uchar_t *pAAD;
+    ulong_t ulAADLen;
+    ulong_t ulTagBits;
+} CK_AES_GCM_PARAMS;
+
+typedef struct crypto_object_attribute {
+    uint64_t    oa_type;    /* attribute type */
+    caddr_t            oa_value;    /* attribute value */
+    ssize_t            oa_value_len;    /* length of attribute value */
+} crypto_object_attribute_t;
+
+/* Attribute types to use for passing a RSA public key or a private key. */
+#define    SUN_CKA_MODULUS            0x00000120
+#define    SUN_CKA_MODULUS_BITS        0x00000121
+#define    SUN_CKA_PUBLIC_EXPONENT        0x00000122
+#define    SUN_CKA_PRIVATE_EXPONENT    0x00000123
+#define    SUN_CKA_PRIME_1            0x00000124
+#define    SUN_CKA_PRIME_2            0x00000125
+#define    SUN_CKA_EXPONENT_1        0x00000126
+#define    SUN_CKA_EXPONENT_2        0x00000127
+#define    SUN_CKA_COEFFICIENT        0x00000128
+#define    SUN_CKA_PRIME            0x00000130
+#define    SUN_CKA_SUBPRIME        0x00000131
+#define    SUN_CKA_BASE            0x00000132
+
+#define    CKK_EC            0x00000003
+#define    CKK_GENERIC_SECRET    0x00000010
+#define    CKK_RC4            0x00000012
+#define    CKK_AES            0x0000001F
+#define    CKK_DES            0x00000013
+#define    CKK_DES2        0x00000014
+#define    CKK_DES3        0x00000015
+
+#define    CKO_PUBLIC_KEY        0x00000002
+#define    CKO_PRIVATE_KEY        0x00000003
+#define    CKA_CLASS        0x00000000
+#define    CKA_VALUE        0x00000011
+#define    CKA_KEY_TYPE        0x00000100
+#define    CKA_VALUE_LEN        0x00000161
+#define    CKA_EC_PARAMS        0x00000180
+#define    CKA_EC_POINT        0x00000181
+
+#endif /* _LIBSOFTCRYPTO_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCrypto.c	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,1250 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+#include <jni.h>
+#include <libsoftcrypto.h>
+#include "nativeCrypto.h"
+#include "nativeFunc.h"
+
+/*
+ * Dumps out byte array in hex with and name and length info
+ */
+void printBytes(char* header, unsigned char* bytes, int len) {
+  int i;
+
+  printf("%s", header);
+  printf("len=%d {", len);
+  for (i = 0; i < len; i++) {
+    if (i > 0) printf(":");
+    printf("%02X", bytes[i]);
+  }
+  printf("}\n");
+}
+
+/*
+ * Throws java.lang.OutOfMemoryError
+ */
+void throwOutOfMemoryError(JNIEnv *env, const char *msg)
+{
+  jclass jExClass = (*env)->FindClass(env, "java/lang/OutOfMemoryError");
+  if (jExClass != 0) /* Otherwise an exception has already been thrown */ {
+    (*env)->ThrowNew(env, jExClass, msg);
+  }
+  /* free the local ref */
+  (*env)->DeleteLocalRef(env, jExClass);
+}
+
+JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
+    return JNI_VERSION_1_4;
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_UcryptoProvider
+ * Method:    loadLibraries
+ * Signature: ()[Z
+ */
+JNIEXPORT jbooleanArray JNICALL Java_com_oracle_security_ucrypto_UcryptoProvider_loadLibraries
+(JNIEnv *env, jclass jcls) {
+  jbooleanArray jResult;
+  jboolean *result;
+  jResult = (*env)->NewBooleanArray(env, 2);
+
+  if (jResult != NULL) {
+    result = loadNative();
+    (*env)->SetBooleanArrayRegion(env, jResult, 0, 2, result);
+    free(result);
+  }
+  return jResult;
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_UcryptoProvider
+ * Method:    getMechList
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_com_oracle_security_ucrypto_UcryptoProvider_getMechList
+(JNIEnv *env, jclass jcls) {
+  jstring jResult;
+  char* result;
+  int length;
+
+  jResult = NULL;
+  if (ftab->ucryptoVersion != NULL && ftab->ucryptoGetMechList != NULL) {
+      length = (*ftab->ucryptoGetMechList)(NULL);
+      if (DEBUG) printf("mech list length: %d\n", length);
+      result = malloc(length);
+      if (result == NULL) {
+        throwOutOfMemoryError(env, NULL);
+        return NULL;
+      }
+      length = (*ftab->ucryptoGetMechList)(result);
+      if (DEBUG) printf("mech list: %s\n", result);
+      jResult = (*env)->NewStringUTF(env, result);
+      free(result);
+  } else {
+      // version 0 on Solaris 10
+      result = "CRYPTO_AES_ECB,CRYPTO_AES_CBC,CRYPTO_AES_CFB128,";
+      jResult = (*env)->NewStringUTF(env, result);
+  }
+  return jResult;
+}
+
+/*
+ * Utility function for throwing a UcryptoException when rv is not CRYPTO_OK(0)
+ */
+void throwUCExceptionUsingRV(JNIEnv *env, int rv) {
+  jclass jExClass;
+  jmethodID jConstructor;
+  jthrowable jException;
+
+  if ((*env)->ExceptionCheck(env)) return;
+
+  jExClass = (*env)->FindClass(env, "com/oracle/security/ucrypto/UcryptoException");
+  /* if jExClass is NULL, an exception has already been thrown */
+  if (jExClass != NULL) {
+    jConstructor = (*env)->GetMethodID(env, jExClass, "<init>", "(I)V");
+    if (jConstructor != NULL) {
+      jException = (jthrowable) (*env)->NewObject(env, jExClass, jConstructor, rv);
+      if (jException != NULL) {
+        (*env)->Throw(env, jException);
+      }
+    }
+  }
+  /* free the local ref */
+  (*env)->DeleteLocalRef(env, jExClass);
+}
+
+/*
+ * Utility function for duplicating a byte array from jbyteArray
+ * If anything went wrong, no memory will be allocated.
+ * NOTE: caller is responsible for freeing the allocated memory
+ * once this method returned successfully.
+ */
+jbyte* getBytes(JNIEnv *env, jbyteArray bytes, int offset, int len) {
+  jbyte* result = NULL;
+
+  if (!(*env)->ExceptionCheck(env)) {
+    result = (jbyte*) calloc(len, sizeof(char));
+    if (result == NULL) {
+      throwOutOfMemoryError(env, NULL);
+      return NULL;
+    }
+    (*env)->GetByteArrayRegion(env, bytes, offset, len, result);
+    if ((*env)->ExceptionCheck(env)) {
+        // free allocated memory if error occurred
+        free(result);
+        return NULL;
+    }
+  }
+  return result;
+}
+
+
+int
+CipherInit(crypto_ctx_t *context, int encrypt, ucrypto_mech_t mech,
+           unsigned char *jKey, int jKeyLen, unsigned char *jIv, int jIvLen,
+           int tagLen, unsigned char *jAad, int jAadLen)
+
+{
+  int rv = 0;
+  void *iv;
+  size_t ivLen;
+
+  if (DEBUG) printf("CipherInit: mech %i, key %i(%i), iv %i(%i) tagLen %i, aad %i(%i)\n",
+                    mech, jKey, jKeyLen, jIv, jIvLen, tagLen, jAad, jAadLen);
+  if (mech == CRYPTO_AES_CTR) {
+    ivLen = sizeof(CK_AES_CTR_PARAMS);
+    iv = (CK_AES_CTR_PARAMS*) malloc(ivLen);
+    if (iv == NULL) return -1;
+
+    ((CK_AES_CTR_PARAMS*)iv)->ulCounterBits = 32;
+    memcpy(((CK_AES_CTR_PARAMS*)iv)->cb, jIv, 16);
+  } else if (mech == CRYPTO_AES_GCM) {
+    ivLen = sizeof(CK_AES_GCM_PARAMS);
+    iv = (CK_AES_GCM_PARAMS*) malloc(ivLen);
+    if (iv == NULL) return -1;
+
+    ((CK_AES_GCM_PARAMS*)iv)->pIv = (uchar_t *)jIv;
+    ((CK_AES_GCM_PARAMS*)iv)->ulIvLen = (ulong_t)jIvLen;
+    ((CK_AES_GCM_PARAMS*)iv)->ulIvBits = 96;
+    ((CK_AES_GCM_PARAMS*)iv)->pAAD = (uchar_t *)jAad;
+    ((CK_AES_GCM_PARAMS*)iv)->ulAADLen = (ulong_t)jAadLen;
+    ((CK_AES_GCM_PARAMS*)iv)->ulTagBits = (ulong_t)tagLen;
+  } else {
+    // normal bytes
+    iv = jIv;
+    ivLen = jIvLen;
+  }
+  if (encrypt) {
+    rv = (*ftab->ucryptoEncryptInit)(context, mech, jKey, (size_t)jKeyLen, iv, ivLen);
+    if (rv != 0 && DEBUG) printf("ucryptoEncryptInit: ret = 0x%x\n", rv);
+  } else {
+    rv =(*ftab->ucryptoDecryptInit)(context, mech, jKey, (size_t)jKeyLen, iv, ivLen);
+    if (rv != 0 && DEBUG) printf("ucryptoDecryptInit: ret = 0x%x\n", rv);
+  }
+
+  if (iv != jIv) {
+    if (mech == CRYPTO_AES_CTR) {
+      free((CK_AES_CTR_PARAMS*)iv);
+    } else {
+      free((CK_AES_GCM_PARAMS*)iv);
+    }
+  }
+
+  return rv;
+}
+
+int
+CipherUpdate(crypto_ctx_t *context, int encrypt, unsigned char *bufIn, int inOfs,
+             int inLen, unsigned char *bufOut, int outOfs, int *outLen)
+{
+  int rv = 0;
+  size_t outLength;
+
+  outLength = (size_t) *outLen;
+  if (DEBUG) {
+    printf("CipherUpdate: Inofs %i, InLen %i, OutOfs %i, OutLen %i\n", inOfs, inLen, outOfs, *outLen);
+    printBytes("BufIn=", (unsigned char*)(bufIn+inOfs), inLen);
+  }
+  if (encrypt) {
+    rv = (*ftab->ucryptoEncryptUpdate)(context, (unsigned char*)(bufIn+inOfs), (size_t)inLen, (unsigned char*)(bufOut+outOfs), &outLength);
+    if (rv != 0) {
+      if (DEBUG) printf("ucryptoEncryptUpdate: ret = 0x%x\n", rv);
+    } else {
+      *outLen = (int)outLength;
+    }
+  } else {
+    rv = (*ftab->ucryptoDecryptUpdate)(context, (unsigned char*)(bufIn+inOfs), (size_t)inLen, (unsigned char*)(bufOut+outOfs), &outLength);
+    if (rv != 0) {
+      if (DEBUG) printf("ucryptoDecryptUpdate: ret = 0x%x\n", rv);
+    } else {
+      if (DEBUG) printBytes("BufOut=", (unsigned char*)(bufOut+outOfs), outLength);
+      *outLen = (int)outLength;
+    }
+  }
+
+  return rv;
+}
+
+int
+CipherFinal(crypto_ctx_t *context, int encrypt, unsigned char *bufOut, int outOfs, int *outLen)
+{
+  int rv = 0;
+  size_t outLength;
+
+  outLength = (size_t)*outLen;
+
+  if (DEBUG) printf("CipherFinal: OutOfs %i, outLen %i\n", outOfs, *outLen);
+  if (encrypt) {
+    rv = (*ftab->ucryptoEncryptFinal)(context, (unsigned char*)(bufOut+outOfs), &outLength);
+    if (rv != 0) {
+      if (DEBUG) printf("ucryptoDecryptFinal: ret = 0x%x\n", rv);
+    } else {
+      if (DEBUG) printBytes("BufOut=", (unsigned char*)(bufOut+outOfs), outLength);
+      *outLen = (int)outLength;
+    }
+  } else {
+    rv = (*ftab->ucryptoDecryptFinal)(context, (unsigned char*)(bufOut+outOfs), &outLength);
+    if (rv != 0) {
+      if (DEBUG) printf("ucryptoDecryptFinal: ret = 0x%x\n", rv);
+    } else {
+      if (DEBUG) printBytes("BufOut=", (unsigned char*)(bufOut+outOfs), outLength);
+      *outLen = (int)outLength;
+    }
+  }
+  return rv;
+}
+
+////////////////////////////////////////////////////////
+// SPECIAL ENTRIES FOR JVM JNI-BYPASSING OPTIMIZATION
+////////////////////////////////////////////////////////
+jlong JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeInit(jint mech) {
+  void *pContext = NULL;
+
+  switch (mech) {
+  case com_oracle_security_ucrypto_NativeDigest_MECH_SHA1:
+    pContext = (SHA1_CTX *) malloc(sizeof(SHA1_CTX));
+    if (pContext != NULL) {
+      (*ftab->sha1Init)((SHA1_CTX *)pContext);
+    }
+    break;
+  case com_oracle_security_ucrypto_NativeDigest_MECH_MD5:
+    pContext = (MD5_CTX *) malloc(sizeof(MD5_CTX));
+    if (pContext != NULL) {
+      (*ftab->md5Init)((MD5_CTX *)pContext);
+    }
+    break;
+  case com_oracle_security_ucrypto_NativeDigest_MECH_SHA256:
+    pContext = (SHA2_CTX *) malloc(sizeof(SHA2_CTX));
+    if (pContext != NULL) {
+      (*ftab->sha2Init)(SHA256, (SHA2_CTX *)pContext);
+    }
+    break;
+  case com_oracle_security_ucrypto_NativeDigest_MECH_SHA384:
+    pContext = (SHA2_CTX *) malloc(sizeof(SHA2_CTX));
+    if (pContext != NULL) {
+      (*ftab->sha2Init)(SHA384, (SHA2_CTX *)pContext);
+    }
+    break;
+  case com_oracle_security_ucrypto_NativeDigest_MECH_SHA512:
+    pContext = (SHA2_CTX *) malloc(sizeof(SHA2_CTX));
+    if (pContext != NULL) {
+      (*ftab->sha2Init)(SHA512, (SHA2_CTX *)pContext);
+    }
+    break;
+  default:
+    if (DEBUG) printf("ERROR: Unsupported mech %i\n", mech);
+  }
+  return (jlong) pContext;
+}
+
+jint JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeUpdate
+  (jint mech, jlong pContext, int notUsed, unsigned char* in, jint ofs, jint len) {
+  if (mech == com_oracle_security_ucrypto_NativeDigest_MECH_SHA1) {
+    (*ftab->sha1Update)((SHA1_CTX*)pContext, (unsigned char*)(in+ofs), len);
+  } else if (mech == com_oracle_security_ucrypto_NativeDigest_MECH_MD5) {
+    (*ftab->md5Update)((MD5_CTX*)pContext, (unsigned char*)(in+ofs), len);
+  } else { // SHA-2 family
+    (*ftab->sha2Update)((SHA2_CTX*)pContext, (unsigned char*)(in+ofs), len);
+  }
+  return 0;
+}
+
+// Do digest and free the context immediately
+jint JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeDigest
+  (jint mech, jlong pContext, int notUsed, unsigned char* out, jint ofs, jint digestLen) {
+
+  if (mech == com_oracle_security_ucrypto_NativeDigest_MECH_SHA1) {
+    (*ftab->sha1Final)((unsigned char*)(out + ofs), (SHA1_CTX *)pContext);
+    free((SHA1_CTX *)pContext);
+  } else if (mech == com_oracle_security_ucrypto_NativeDigest_MECH_MD5) {
+    (*ftab->md5Final)((unsigned char*)(out + ofs), (MD5_CTX *)pContext);
+    free((MD5_CTX *)pContext);
+  } else { // SHA-2 family
+    (*ftab->sha2Final)((unsigned char*)(out + ofs), (SHA2_CTX *)pContext);
+    free((SHA2_CTX *)pContext);
+  }
+  return 0;
+}
+
+jlong JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeClone
+  (jint mech, jlong pContext) {
+  void *copy = NULL;
+  size_t len = 0;
+
+  if (mech == com_oracle_security_ucrypto_NativeDigest_MECH_SHA1) {
+    len = sizeof(SHA1_CTX);
+  } else if (mech == com_oracle_security_ucrypto_NativeDigest_MECH_MD5) {
+    len = sizeof(MD5_CTX);
+  } else { // SHA-2 family
+    len = sizeof(SHA2_CTX);
+  }
+  copy = (void*) malloc(len);
+  if (copy != NULL) {
+    bcopy((void *)pContext, copy, len);
+  }
+  return (jlong) copy;
+}
+
+void JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeFree
+  (jint mech, jlong pContext) {
+  if (mech == com_oracle_security_ucrypto_NativeDigest_MECH_SHA1) {
+    free((SHA1_CTX*) pContext);
+  } else if (mech == com_oracle_security_ucrypto_NativeDigest_MECH_MD5) {
+    free((MD5_CTX*) pContext);
+  } else { // SHA-2 family
+    free((SHA2_CTX*) pContext);
+  }
+}
+
+// AES
+jlong JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeInit
+  (jint mech, jboolean encrypt, int keyLen, unsigned char* bufKey,
+   int ivLen, unsigned char* bufIv, jint tagLen, int aadLen, unsigned char* bufAad) {
+  crypto_ctx_t *context = NULL;
+  int rv;
+
+  context = malloc(sizeof(crypto_ctx_t));
+  if (context != NULL) {
+    rv = CipherInit(context, encrypt, (ucrypto_mech_t) mech, bufKey, keyLen,
+                    bufIv, ivLen, tagLen, bufAad, aadLen);
+    if (rv) {
+      free(context);
+      return 0L;
+    }
+  }
+  return (jlong)context;
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeCipher
+ * Method:    nativeUpdate
+ * Signature: (JZ[BII[BI)I
+ */
+jint JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeUpdate
+  (jlong pContext, jboolean encrypt, int notUsed, jbyte* bufIn, jint inOfs, jint inLen,
+   int outCapacity, jbyte* bufOut, jint outOfs) {
+  crypto_ctx_t *context;
+  int rv = 0;
+  int outLen = outCapacity - outOfs; // recalculate the real out length
+
+  context = (crypto_ctx_t *) pContext;
+  rv = CipherUpdate(context, encrypt, (unsigned char*)bufIn, inOfs, inLen, (unsigned char*)bufOut, outOfs, &outLen);
+  if (rv) {
+    free(context);
+    context = 0;
+    return -rv; // use negative value to indicate error!
+  }
+
+  return outLen;
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeCipher
+ * Method:    nativeFinal
+ * Signature: (JZ[BI)I
+ */
+jint JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeFinal
+  (jlong pContext, jboolean encrypt, int outLen, jbyte* bufOut, jint outOfs) {
+  crypto_ctx_t *context;
+  int rv = 0;
+
+  context = (crypto_ctx_t *) pContext;
+  rv = CipherFinal(context, encrypt, (unsigned char*)bufOut, outOfs, &outLen);
+  free(context);
+  if (rv) {
+     return -rv; // use negative value to indicate error!
+  }
+
+  return outLen;
+}
+
+
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeDigest
+ * Method:    nativeInit
+ * Signature: (I)J
+ */
+JNIEXPORT jlong JNICALL Java_com_oracle_security_ucrypto_NativeDigest_nativeInit
+  (JNIEnv *env, jclass jcls, jint mech) {
+  jlong result = JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeInit(mech);
+  if (result == NULL) {
+     throwOutOfMemoryError(env, NULL);
+  }
+  return result;
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeDigest
+ * Method:    nativeUpdate
+ * Signature: (IJ[BII)I
+ */
+JNIEXPORT jint JNICALL Java_com_oracle_security_ucrypto_NativeDigest_nativeUpdate
+  (JNIEnv *env, jclass jcls, jint mech, jlong pContext, jbyteArray jIn, jint jOfs, jint jLen) {
+  unsigned char *bufIn;
+
+  bufIn = (unsigned char *) getBytes(env, jIn, jOfs, jLen);
+  if (!(*env)->ExceptionCheck(env)) {
+    JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeUpdate(mech, pContext, jLen, bufIn, 0, jLen);
+    free(bufIn);
+  }
+  return 0;
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeDigest
+ * Method:    nativeDigest
+ * Signature: (IJ[BII)I
+ */
+JNIEXPORT jint JNICALL Java_com_oracle_security_ucrypto_NativeDigest_nativeDigest
+  (JNIEnv *env, jclass jcls, jint mech, jlong pContext, jbyteArray jOut, jint jOutOfs, jint digestLen) {
+  unsigned char *bufOut;
+
+  bufOut = (unsigned char *) malloc(digestLen);
+  if (bufOut == NULL) {
+    throwOutOfMemoryError(env, NULL);
+    return 0;
+  }
+
+  JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeDigest(mech, pContext, digestLen, bufOut, 0, digestLen);
+
+  (*env)->SetByteArrayRegion(env, jOut, jOutOfs, digestLen, (jbyte *) bufOut);
+  free(bufOut);
+  return 0;
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeDigest
+ * Method:    nativeClone
+ * Signature: (IJ)J
+ */
+JNIEXPORT jlong JNICALL Java_com_oracle_security_ucrypto_NativeDigest_nativeClone
+  (JNIEnv *env, jclass jcls, jint mech, jlong pContext) {
+  return JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeClone(mech, pContext);
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeDigest
+ * Method:    nativeFree
+ * Signature: (IJ)V
+ */
+JNIEXPORT void JNICALL Java_com_oracle_security_ucrypto_NativeDigest_nativeFree
+  (JNIEnv *env, jclass jcls, jint mech, jlong pContext) {
+  JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeFree(mech, pContext);
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeCipher
+ * Method:    nativeInit
+ * Signature: (IZ[B[BI[B)J
+ */
+JNIEXPORT jlong JNICALL Java_com_oracle_security_ucrypto_NativeCipher_nativeInit
+(JNIEnv *env, jclass jcls, jint mech, jboolean encrypt, jbyteArray jKey,
+ jbyteArray jIv, jint tagLen, jbyteArray jAad) {
+
+  crypto_ctx_t *context;
+  unsigned char *bufKey;
+  unsigned char *bufIv;
+  unsigned char *bufAad;
+  int keyLen, ivLen, aadLen, rv = 0;
+  jlong result = 0L;
+
+  bufKey = bufIv = bufAad = NULL;
+  keyLen = ivLen = aadLen = 0;
+  context = malloc(sizeof(crypto_ctx_t));
+  if (context == NULL) {
+    throwOutOfMemoryError(env, NULL);
+    return 0L;
+  }
+
+  // jKey MUST NOT BE NULL;
+  keyLen = (*env)->GetArrayLength(env, jKey);
+  bufKey = (unsigned char *) (*env)->GetByteArrayElements(env, jKey, NULL);
+  if (bufKey == NULL) {
+    goto cleanup;
+  }
+
+  if (jIv != NULL) {
+    ivLen = (*env)->GetArrayLength(env, jIv);
+    bufIv = (unsigned char *) (*env)->GetByteArrayElements(env, jIv, NULL);
+    if (bufIv == NULL) {
+      goto cleanup;
+    }
+  }
+
+  if (jAad != NULL) {
+    aadLen = (*env)->GetArrayLength(env, jAad);
+    bufAad = (unsigned char *) (*env)->GetByteArrayElements(env, jAad, NULL);
+    if (bufAad == NULL) {
+      goto cleanup;
+    }
+  }
+
+  rv = CipherInit(context, encrypt, mech, bufKey, keyLen, bufIv, ivLen, tagLen, bufAad, aadLen);
+  if (rv != 0) {
+    throwUCExceptionUsingRV(env, rv);
+  } else {
+     result = (jlong) context;
+  }
+
+cleanup:
+  if ((result == 0L) && (context != NULL)) {
+    free(context);
+  }
+  if (bufKey != NULL) {
+    (*env)->ReleaseByteArrayElements(env, jKey, (jbyte *)bufKey, 0);
+  }
+  if (bufIv != NULL) {
+    (*env)->ReleaseByteArrayElements(env, jIv, (jbyte *)bufIv, 0);
+  }
+  if (bufAad != NULL) {
+    (*env)->ReleaseByteArrayElements(env, jAad, (jbyte *)bufAad, 0);
+  }
+
+  return result;
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeCipher
+ * Method:    nativeUpdate
+ * Signature: (JZ[BII[BI)I
+ */
+JNIEXPORT jint JNICALL Java_com_oracle_security_ucrypto_NativeCipher_nativeUpdate
+  (JNIEnv *env, jclass jcls, jlong contextID, jboolean encrypt,
+    jbyteArray jIn, jint inOfs, jint inLen, jbyteArray jOut, jint outOfs) {
+  crypto_ctx_t *context;
+  unsigned char *bufIn;
+  unsigned char *bufOut;
+  int outLen, rv = 0;
+
+  context = (crypto_ctx_t *) contextID;
+  bufIn = (unsigned char *) getBytes(env, jIn, inOfs, inLen);
+  if ((*env)->ExceptionCheck(env)) {
+    return 0;
+  }
+
+  outLen = (*env)->GetArrayLength(env, jOut) - outOfs;
+  bufOut = calloc(outLen, sizeof(char));
+  if (bufOut == NULL) {
+    free(bufIn);
+    throwOutOfMemoryError(env, NULL);
+    return 0;
+  }
+
+  rv = CipherUpdate(context, encrypt, bufIn, 0, inLen, bufOut, 0, &outLen);
+  if (rv) {
+    free(context);
+    free(bufIn);
+    free(bufOut);
+    return -rv;
+  } else {
+    (*env)->SetByteArrayRegion(env, jOut, outOfs, outLen, (jbyte *)bufOut);
+    free(bufIn);
+    free(bufOut);
+    return outLen;
+  }
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeCipher
+ * Method:    nativeFinal
+ * Signature: (JZ[BI)I
+ */
+JNIEXPORT jint JNICALL Java_com_oracle_security_ucrypto_NativeCipher_nativeFinal
+  (JNIEnv *env, jclass jCls, jlong contextID, jboolean encrypt,
+   jbyteArray out, jint outOfs) {
+  crypto_ctx_t *context;
+  unsigned char *bufIn;
+  unsigned char *bufOut;
+  int outLen, rv = 0;
+
+  context = (crypto_ctx_t *) contextID;
+
+  // out is null when nativeFinal() is called solely for resource clean up
+  if (out == NULL) {
+    bufOut = NULL;
+    outLen = 0;
+  } else {
+    outLen = (*env)->GetArrayLength(env, out) - outOfs;
+    bufOut = calloc(outLen, sizeof(char));
+    if (bufOut == NULL) {
+      throwOutOfMemoryError(env, NULL);
+      return 0;
+    }
+  }
+  rv = CipherFinal(context, encrypt, bufOut, 0, &outLen);
+  if (rv) {
+    free(context);
+    free(bufOut);
+    return -rv;
+  } else {
+    if (bufOut != NULL) {
+      (*env)->SetByteArrayRegion(env, out, outOfs, outLen, (jbyte *)bufOut);
+      free(bufOut);
+    }
+    free(context);
+    return outLen;
+  }
+}
+
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeKey
+ * Method:    nativeFree
+ * Signature: (JI)V
+ */
+void JavaCritical_com_oracle_security_ucrypto_NativeKey_nativeFree
+  (jlong id, jint numOfComponents) {
+  crypto_object_attribute_t* pKey;
+  int i;
+
+  pKey = (crypto_object_attribute_t*) id;
+  for (i = 0; i < numOfComponents; i++) {
+    free(pKey[i].oa_value);
+  }
+  free(pKey);
+}
+
+JNIEXPORT void JNICALL Java_com_oracle_security_ucrypto_NativeKey_nativeFree
+  (JNIEnv *env, jclass jCls, jlong id, jint numOfComponents) {
+  JavaCritical_com_oracle_security_ucrypto_NativeKey_nativeFree(id, numOfComponents);
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeKey_RSAPrivateCrt
+ * Method:    nativeInit
+ * Signature: ([B[B[B[B[B[B[B[B)J
+ */
+jlong JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPrivateCrt_nativeInit
+(int modLen, jbyte* jMod, int pubLen, jbyte* jPub, int privLen, jbyte* jPriv,
+ int pLen, jbyte* jP, int qLen, jbyte* jQ, int expPLen, jbyte* jExpP,
+ int expQLen, jbyte* jExpQ, int crtCoeffLen, jbyte* jCrtCoeff) {
+
+  unsigned char *mod, *pub, *priv, *p, *q, *expP, *expQ, *crtCoeff;
+  crypto_object_attribute_t* pKey = NULL;
+
+  pKey = calloc(8, sizeof(crypto_object_attribute_t));
+  if (pKey == NULL) {
+    return 0L;
+  }
+  mod = pub = priv = p = q = expP = expQ = crtCoeff = NULL;
+  mod = malloc(modLen);
+  pub = malloc(pubLen);
+  priv = malloc(privLen);
+  p = malloc(pLen);
+  q = malloc(qLen);
+  expP = malloc(expPLen);
+  expQ = malloc(expQLen);
+  crtCoeff = malloc(crtCoeffLen);
+  if (mod == NULL || pub == NULL || priv == NULL || p == NULL ||
+      q == NULL || expP == NULL || expQ == NULL || crtCoeff == NULL) {
+    free(pKey);
+    free(mod);
+    free(pub);
+    free(priv);
+    free(p);
+    free(q);
+    free(expP);
+    free(expQ);
+    free(crtCoeff);
+    return 0L;
+  } else {
+    memcpy(mod, jMod, modLen);
+    memcpy(pub, jPub, pubLen);
+    memcpy(priv, jPriv, privLen);
+    memcpy(p, jP, pLen);
+    memcpy(q, jQ, qLen);
+    memcpy(expP, jExpP, expPLen);
+    memcpy(expQ, jExpQ, expQLen);
+    memcpy(crtCoeff, jCrtCoeff, crtCoeffLen);
+  }
+
+  // NOTE: numOfComponents should be 8
+  pKey[0].oa_type = SUN_CKA_MODULUS;
+  pKey[0].oa_value = (char*) mod;
+  pKey[0].oa_value_len = (size_t) modLen;
+  pKey[1].oa_type = SUN_CKA_PUBLIC_EXPONENT;
+  pKey[1].oa_value = (char*) pub;
+  pKey[1].oa_value_len = (size_t) pubLen;
+  pKey[2].oa_type = SUN_CKA_PRIVATE_EXPONENT;
+  pKey[2].oa_value = (char*) priv;
+  pKey[2].oa_value_len = (size_t) privLen;
+  pKey[3].oa_type = SUN_CKA_PRIME_1;
+  pKey[3].oa_value = (char*) p;
+  pKey[3].oa_value_len = (size_t) pLen;
+  pKey[4].oa_type = SUN_CKA_PRIME_2;
+  pKey[4].oa_value = (char*) q;
+  pKey[4].oa_value_len = (size_t) qLen;
+  pKey[5].oa_type = SUN_CKA_EXPONENT_1;
+  pKey[5].oa_value = (char*) expP;
+  pKey[5].oa_value_len = (size_t) expPLen;
+  pKey[6].oa_type = SUN_CKA_EXPONENT_2;
+  pKey[6].oa_value = (char*) expQ;
+  pKey[6].oa_value_len = (size_t) expQLen;
+  pKey[7].oa_type = SUN_CKA_COEFFICIENT;
+  pKey[7].oa_value = (char*) crtCoeff;
+  pKey[7].oa_value_len = (size_t) crtCoeffLen;
+
+  return (jlong) pKey;
+}
+
+
+JNIEXPORT jlong JNICALL
+Java_com_oracle_security_ucrypto_NativeKey_00024RSAPrivateCrt_nativeInit
+  (JNIEnv *env, jclass jCls, jbyteArray jMod, jbyteArray jPub, jbyteArray jPriv,
+   jbyteArray jP, jbyteArray jQ, jbyteArray jExpP, jbyteArray jExpQ,
+   jbyteArray jCrtCoeff) {
+
+  int modLen, pubLen, privLen, pLen, qLen, expPLen, expQLen, crtCoeffLen;
+  jbyte *bufMod, *bufPub, *bufPriv, *bufP, *bufQ, *bufExpP, *bufExpQ, *bufCrtCoeff;
+  crypto_object_attribute_t* pKey = NULL;
+
+  bufMod = bufPub = bufPriv = bufP = bufQ = bufExpP = bufExpQ = bufCrtCoeff = NULL;
+
+  modLen = (*env)->GetArrayLength(env, jMod);
+  bufMod = getBytes(env, jMod, 0, modLen);
+  if ((*env)->ExceptionCheck(env)) goto cleanup;
+
+  pubLen = (*env)->GetArrayLength(env, jPub);
+  bufPub = getBytes(env, jPub, 0, pubLen);
+  if ((*env)->ExceptionCheck(env)) goto cleanup;
+
+  privLen = (*env)->GetArrayLength(env, jPriv);
+  bufPriv = getBytes(env, jPriv, 0, privLen);
+  if ((*env)->ExceptionCheck(env)) goto cleanup;
+
+  pLen = (*env)->GetArrayLength(env, jP);
+  bufP = getBytes(env, jP, 0, pLen);
+  if ((*env)->ExceptionCheck(env)) goto cleanup;
+
+  qLen = (*env)->GetArrayLength(env, jQ);
+  bufQ = getBytes(env, jQ, 0, qLen);
+  if ((*env)->ExceptionCheck(env)) goto cleanup;
+
+  expPLen = (*env)->GetArrayLength(env, jExpP);
+  bufExpP = getBytes(env, jExpP, 0, expPLen);
+  if ((*env)->ExceptionCheck(env)) goto cleanup;
+
+  expQLen = (*env)->GetArrayLength(env, jExpQ);
+  bufExpQ = getBytes(env, jExpQ, 0, expQLen);
+  if ((*env)->ExceptionCheck(env)) goto cleanup;
+
+  crtCoeffLen = (*env)->GetArrayLength(env, jCrtCoeff);
+  bufCrtCoeff = getBytes(env, jCrtCoeff, 0, crtCoeffLen);
+  if ((*env)->ExceptionCheck(env)) goto cleanup;
+
+  // proceed if no error; otherwise free allocated memory
+  pKey = calloc(8, sizeof(crypto_object_attribute_t));
+  if (pKey == NULL) {
+    throwOutOfMemoryError(env, NULL);
+    goto cleanup;
+  }
+
+  // NOTE: numOfComponents should be 8
+  pKey[0].oa_type = SUN_CKA_MODULUS;
+  pKey[0].oa_value = (char*) bufMod;
+  pKey[0].oa_value_len = (size_t) modLen;
+  pKey[1].oa_type = SUN_CKA_PUBLIC_EXPONENT;
+  pKey[1].oa_value = (char*) bufPub;
+  pKey[1].oa_value_len = (size_t) pubLen;
+  pKey[2].oa_type = SUN_CKA_PRIVATE_EXPONENT;
+  pKey[2].oa_value = (char*) bufPriv;
+  pKey[2].oa_value_len = (size_t) privLen;
+  pKey[3].oa_type = SUN_CKA_PRIME_1;
+  pKey[3].oa_value = (char*) bufP;
+  pKey[3].oa_value_len = (size_t) pLen;
+  pKey[4].oa_type = SUN_CKA_PRIME_2;
+  pKey[4].oa_value = (char*) bufQ;
+  pKey[4].oa_value_len = (size_t) qLen;
+  pKey[5].oa_type = SUN_CKA_EXPONENT_1;
+  pKey[5].oa_value = (char*) bufExpP;
+  pKey[5].oa_value_len = (size_t) expPLen;
+  pKey[6].oa_type = SUN_CKA_EXPONENT_2;
+  pKey[6].oa_value = (char*) bufExpQ;
+  pKey[6].oa_value_len = (size_t) expQLen;
+  pKey[7].oa_type = SUN_CKA_COEFFICIENT;
+  pKey[7].oa_value = (char*) bufCrtCoeff;
+  pKey[7].oa_value_len = (size_t) crtCoeffLen;
+  return (jlong) pKey;
+
+cleanup:
+  free(bufMod);
+  free(bufPub);
+  free(bufPriv);
+  free(bufP);
+  free(bufQ);
+  free(bufExpP);
+  free(bufExpQ);
+  free(bufCrtCoeff);
+
+  return 0L;
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeKey_RSAPublic
+ * Method:    nativeInit
+ * Signature: ([B[B)J
+ */
+
+jlong JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPublic_nativeInit
+(int modLen, jbyte* jMod, int pubLen, jbyte* jPub) {
+  unsigned char *mod, *pub;
+  crypto_object_attribute_t* pKey = NULL;
+
+  pKey = calloc(2, sizeof(crypto_object_attribute_t));
+  if (pKey == NULL) {
+    return 0L;
+  }
+  mod = pub = NULL;
+  mod = malloc(modLen);
+  pub = malloc(pubLen);
+  if (mod == NULL || pub == NULL) {
+    free(pKey);
+    free(mod);
+    free(pub);
+    return 0L;
+  } else {
+    memcpy(mod, jMod, modLen);
+    memcpy(pub, jPub, pubLen);
+  }
+
+  if (DEBUG) {
+    printf("RSAPublicKey Init: keyValue=%ld, keyLen=2\n", pKey);
+    printBytes("RSA PublicKey mod: ", (unsigned char*) mod, modLen);
+    printBytes("RSA PublicKey pubExp: ", (unsigned char*) pub, pubLen);
+  }
+
+  pKey[0].oa_type = SUN_CKA_MODULUS;
+  pKey[0].oa_value = (char*) mod;
+  pKey[0].oa_value_len = (size_t) modLen;
+  pKey[1].oa_type = SUN_CKA_PUBLIC_EXPONENT;
+  pKey[1].oa_value = (char*) pub;
+  pKey[1].oa_value_len = (size_t) pubLen;
+
+  return (jlong) pKey;
+}
+
+JNIEXPORT jlong JNICALL
+Java_com_oracle_security_ucrypto_NativeKey_00024RSAPublic_nativeInit
+(JNIEnv *env, jclass jCls, jbyteArray jMod, jbyteArray jPub) {
+  int modLen, pubLen;
+  jbyte *bufMod, *bufPub;
+  crypto_object_attribute_t* pKey = NULL;
+
+  bufMod = bufPub = NULL;
+
+  modLen = (*env)->GetArrayLength(env, jMod);
+  bufMod = getBytes(env, jMod, 0, modLen);
+  if ((*env)->ExceptionCheck(env)) {
+    return 0L;
+  }
+
+  pubLen = (*env)->GetArrayLength(env, jPub);
+  bufPub = getBytes(env, jPub, 0, pubLen);
+  if ((*env)->ExceptionCheck(env)) {
+    free(bufMod);
+    return 0L;
+  }
+
+  // proceed if no error; otherwise free allocated memory
+  pKey = calloc(2, sizeof(crypto_object_attribute_t));
+  if (pKey != NULL) {
+    // NOTE: numOfComponents should be 2
+    pKey[0].oa_type = SUN_CKA_MODULUS;
+    pKey[0].oa_value = (char*) bufMod;
+    pKey[0].oa_value_len = (size_t) modLen;
+    pKey[1].oa_type = SUN_CKA_PUBLIC_EXPONENT;
+    pKey[1].oa_value = (char*) bufPub;
+    pKey[1].oa_value_len = (size_t) pubLen;
+    return (jlong) pKey;
+  } else {
+    free(bufMod);
+    free(bufPub);
+    throwOutOfMemoryError(env, NULL);
+    return 0L;
+  }
+}
+
+////////////////////////
+// NativeRSASignature
+////////////////////////
+
+int
+SignatureInit(crypto_ctx_t *context, jint mechVal, jboolean sign,
+              uchar_t *pKey, size_t keyLength) {
+  ucrypto_mech_t mech;
+  int rv = 0;
+
+  mech = (ucrypto_mech_t) mechVal;
+
+  if (sign) {
+    rv = (*ftab->ucryptoSignInit)(context, mech, pKey, keyLength,
+                                  NULL, 0);
+  } else {
+    rv = (*ftab->ucryptoVerifyInit)(context, mech, pKey, keyLength,
+                                    NULL, 0);
+  }
+  if (DEBUG) {
+    printf("SignatureInit: context=%ld, mech=%d, sign=%d, keyValue=%ld, keyLength=%d\n",
+           context, mech, sign, pKey, keyLength);
+    printf("SignatureInit, ret =>  0x%x\n", rv);
+  }
+  return rv;
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeRSASignature
+ * Method:    nativeInit
+ * Signature: (IZJI[B)J
+ */
+jlong JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeInit
+(jint mech, jboolean sign, jlong jKey, jint keyLength) {
+  crypto_ctx_t *context;
+  int rv;
+  uchar_t *pKey;
+
+  context = malloc(sizeof(crypto_ctx_t));
+  if (context != NULL) {
+    pKey = (uchar_t *) jKey;
+    rv = SignatureInit(context, mech, sign, pKey, (size_t)keyLength);
+    if (rv) {
+      free(context);
+      return 0L;
+    }
+  }
+  return (jlong)context;
+}
+
+JNIEXPORT jlong JNICALL Java_com_oracle_security_ucrypto_NativeRSASignature_nativeInit
+(JNIEnv *env, jclass jCls, jint mech, jboolean sign, jlong jKey, jint keyLength) {
+  crypto_ctx_t *context;
+  int rv = 0;
+  uchar_t *pKey;
+
+  context = malloc(sizeof(crypto_ctx_t));
+  if (context == NULL) {
+    throwOutOfMemoryError(env, NULL);
+    return 0L;
+  }
+
+  pKey = (uchar_t *) jKey;
+  rv = SignatureInit(context, mech, sign, pKey, (size_t)keyLength);
+  if (rv) {
+    free(context);
+    throwUCExceptionUsingRV(env, rv);
+    return 0L;
+  }
+
+  return (jlong)context;
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeRSASignature
+ * Method:    nativeUpdate
+ * Signature: (JZ[BII)I
+ */
+jint JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII
+(jlong pCtxt, jboolean sign, int notUsed, jbyte* jIn, jint jInOfs, jint jInLen) {
+  crypto_ctx_t *context;
+  int rv = 0;
+
+  context = (crypto_ctx_t *) pCtxt;
+  if (DEBUG) {
+    printf("Signature update: context=%ld, sign=%d, jIn=%ld, jInOfs=%d, jInLen=%d\n",
+           context, sign, jIn, jInOfs, jInLen);
+  }
+  if (sign) {
+    rv = (*ftab->ucryptoSignUpdate)(context, (uchar_t *) (jIn + jInOfs), (size_t) jInLen);
+  } else {
+    rv = (*ftab->ucryptoVerifyUpdate)(context, (uchar_t *) (jIn + jInOfs), (size_t) jInLen);
+  }
+  if (DEBUG) printf("Signature update, ret =>  0x%x\n", rv);
+  if (rv) {
+    free(context);
+    return -rv; // use negative value to indicate error!
+  }
+
+  return 0;
+}
+
+JNIEXPORT jint JNICALL Java_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII
+(JNIEnv *env, jclass jCls, jlong pCtxt, jboolean sign, jbyteArray jIn, jint inOfs, jint inLen) {
+  int rv = 0;
+  jbyte* bufIn;
+
+  bufIn = getBytes(env, jIn, inOfs, inLen);
+  if ((*env)->ExceptionCheck(env)) {
+    return -1; // use negative value to indicate error!
+  }
+
+  if (DEBUG) printBytes("Update w/ data: ", (unsigned char*)bufIn, (size_t) inLen);
+
+  rv = JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII
+    (pCtxt, sign, inLen, bufIn, 0, inLen);
+
+  free(bufIn);
+  return rv;
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeRSASignature
+ * Method:    nativeUpdate
+ * Signature: (JZJI)I
+ */
+jint JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZJI
+(jlong pCtxt, jboolean sign, jlong inAddr, jint inLen) {
+
+  return JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII
+    (pCtxt, sign, inLen, (jbyte*)inAddr, 0, inLen);
+}
+
+JNIEXPORT jint JNICALL Java_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZJI
+(JNIEnv *env, jclass jCls, jlong pCtxt, jboolean sign, jlong inAddr, jint inLen) {
+
+  return JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII
+    (pCtxt, sign, inLen, (jbyte*)inAddr, 0, inLen);
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeRSASignature
+ * Method:    nativeFinal
+ * Signature: (JZ[BII)I
+ */
+jint JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeFinal
+(jlong pCtxt, jboolean sign, int notUsed, jbyte* bufSig, jint sigOfs, jint jSigLen) {
+
+  crypto_ctx_t *context;
+  int rv = 0;
+  size_t sigLength = (size_t) jSigLen;
+
+  context = (crypto_ctx_t *) pCtxt;
+  if (DEBUG) {
+      printf("Signature final: context=%ld, sign=%d, bufSig=%ld, sigOfs=%d, sigLen=%d\n",
+             context, sign, bufSig, sigOfs, jSigLen);
+      printBytes("Before Final: SigBytes ", (unsigned char*) (bufSig + sigOfs), jSigLen);
+  }
+  if (sign) {
+    rv = (*ftab->ucryptoSignFinal)(context, (uchar_t *) (bufSig + sigOfs), &sigLength);
+  } else {
+    rv = (*ftab->ucryptoVerifyFinal)(context, (uchar_t *) (bufSig + sigOfs), &sigLength);
+  }
+
+  if (DEBUG) {
+    printf("Signature nativeFinal, ret =>  0x%x\n", rv);
+    if (sigLength != jSigLen) {
+      printf("SIG actual output len=%d\n", sigLength);
+    }
+    if (sign) {
+      printBytes("After nativeFinal: ", (unsigned char*) (bufSig + sigOfs), jSigLen);
+    }
+  }
+
+  free(context);
+  if (rv) {
+    return -rv;
+  } else return 0;
+}
+
+JNIEXPORT jint JNICALL Java_com_oracle_security_ucrypto_NativeRSASignature_nativeFinal
+(JNIEnv *env, jclass jCls, jlong pCtxt, jboolean sign, jbyteArray jSig, jint jSigOfs, jint jSigLen) {
+  int rv = 0;
+  jbyte* bufSig = NULL;
+
+  if (jSigLen != 0) {
+    bufSig = calloc(jSigLen, sizeof(char));
+    if (bufSig == NULL) {
+      throwOutOfMemoryError(env, NULL);
+      return 0;
+    }
+    if (!sign) {
+      // need to copy over the to-be-verified signature bytes
+      (*env)->GetByteArrayRegion(env, jSig, jSigOfs, jSigLen, (jbyte *)bufSig);
+    }
+  }
+
+  if (!(*env)->ExceptionCheck(env)) {
+    // Frees context + converts rv to negative if error occurred
+    rv = JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeFinal
+      (pCtxt, sign, jSigLen, bufSig, 0, jSigLen);
+
+    if (rv == 0 && sign) {
+      // need to copy the generated signature bytes to the java bytearray
+      (*env)->SetByteArrayRegion(env, jSig, jSigOfs, jSigLen, (jbyte *)bufSig);
+    }
+  } else {
+    // set rv to negative to indicate error
+    rv = -1;
+  }
+
+  free(bufSig);
+
+  return rv;
+}
+
+/*
+ * Class:     com_oracle_security_ucrypto_NativeRSACipher
+ * Method:    nativeAtomic
+ * Signature: (IZJI[BI[BII)I
+ */
+jint JavaCritical_com_oracle_security_ucrypto_NativeRSACipher_nativeAtomic
+  (jint mech, jboolean encrypt, jlong keyValue, jint keyLength,
+   int notUsed1, jbyte* bufIn, jint jInLen,
+   int notUsed2, jbyte* bufOut, jint jOutOfs, jint jOutLen) {
+
+  uchar_t *pKey;
+  crypto_object_attribute_t* pKey2;
+  int rv = 0;
+  size_t outLength = (size_t) jOutLen;
+
+  pKey = (uchar_t *) keyValue;
+  if (DEBUG) {
+    printf("Cipher nativeAtomic: mech=%d, encrypt=%d, pKey=%ld, keyLength=%d\n",
+           mech, encrypt, pKey, keyLength);
+    printBytes("Before nativeAtomic: in: ", (unsigned char*) bufIn, jInLen);
+    printBytes("Before nativeAtomic: out: ", (unsigned char*) (bufOut + jOutOfs), jOutLen);
+  }
+
+  if (encrypt) {
+    rv = (*ftab->ucryptoEncrypt)((ucrypto_mech_t)mech, pKey, (size_t)keyLength,
+      NULL, 0, (uchar_t *)bufIn, (size_t)jInLen,
+      (uchar_t *)(bufOut + jOutOfs), &outLength);
+  } else {
+    rv = (*ftab->ucryptoDecrypt)((ucrypto_mech_t)mech, pKey, (size_t)keyLength,
+      NULL, 0, (uchar_t *)bufIn, (size_t)jInLen,
+      (uchar_t *)(bufOut + jOutOfs), &outLength);
+  }
+  if (DEBUG) {
+    printf("Cipher nativeAtomic, ret =>  0x%x\n", rv);
+    if (outLength != jOutLen) {
+      printf("CIP actual output len=%d\n", outLength);
+    }
+    printBytes("After nativeAtomic: ", (unsigned char*) (bufOut + jOutOfs), outLength);
+  }
+
+  if (rv) {
+    return -rv;
+  } else return outLength;
+}
+
+JNIEXPORT jint JNICALL Java_com_oracle_security_ucrypto_NativeRSACipher_nativeAtomic
+  (JNIEnv *env, jclass jCls, jint mech, jboolean encrypt,
+   jlong keyValue, jint keyLength, jbyteArray jIn, jint jInLen,
+   jbyteArray jOut, jint jOutOfs, jint jOutLen) {
+  int rv = 0;
+  jbyte *bufIn = NULL;
+  jbyte *bufOut = NULL;
+
+  if (jInLen != 0) {
+    bufIn = (*env)->GetByteArrayElements(env, jIn, NULL);
+    if (bufIn == NULL) {
+      return 0;
+    }
+  }
+  bufOut = calloc(jOutLen, sizeof(jbyte));
+  if (bufOut == NULL) {
+    (*env)->ReleaseByteArrayElements(env, jIn, bufIn, 0);
+    throwOutOfMemoryError(env, NULL);
+    return 0;
+  }
+
+  // rv: output length or error code (if negative)
+  rv = JavaCritical_com_oracle_security_ucrypto_NativeRSACipher_nativeAtomic
+    (mech, encrypt, keyValue, keyLength, jInLen, bufIn, jInLen,
+     jOutLen, bufOut, 0, jOutLen);
+
+  if (rv > 0) {
+    (*env)->SetByteArrayRegion(env, jOut, jOutOfs, rv, (jbyte *)bufOut);
+  }
+
+  if (bufIn != NULL) {
+    (*env)->ReleaseByteArrayElements(env, jIn, bufIn, 0);
+  }
+  free(bufOut);
+  return rv;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCrypto.h	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef _Included_com_oracle_security_ucrypto_NativeCrypto
+#define _Included_com_oracle_security_ucrypto_NativeCrypto
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#undef com_oracle_security_ucrypto_NativeDigest_MECH_MD5
+#define com_oracle_security_ucrypto_NativeDigest_MECH_MD5 1L
+#undef com_oracle_security_ucrypto_NativeDigest_MECH_SHA1
+#define com_oracle_security_ucrypto_NativeDigest_MECH_SHA1 2L
+#undef com_oracle_security_ucrypto_NativeDigest_MECH_SHA256
+#define com_oracle_security_ucrypto_NativeDigest_MECH_SHA256 3L
+#undef com_oracle_security_ucrypto_NativeDigest_MECH_SHA224
+#define com_oracle_security_ucrypto_NativeDigest_MECH_SHA224 4L
+#undef com_oracle_security_ucrypto_NativeDigest_MECH_SHA384
+#define com_oracle_security_ucrypto_NativeDigest_MECH_SHA384 5L
+#undef com_oracle_security_ucrypto_NativeDigest_MECH_SHA512
+#define com_oracle_security_ucrypto_NativeDigest_MECH_SHA512 6L
+
+#define DEBUG 0
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeFunc.c	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include <jni.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+#include <link.h>
+#include "nativeFunc.h"
+
+/* standard md5/md/softcrypto method names (ordering is from mapfile) */
+static const char MD5_INIT[]                     = "MD5Init";
+static const char MD5_UPDATE[]                   = "MD5Update";
+static const char MD5_FINAL[]                    = "MD5Final";
+static const char SHA1_INIT[]                    = "SHA1Init";
+static const char SHA1_UPDATE[]                  = "SHA1Update";
+static const char SHA1_FINAL[]                   = "SHA1Final";
+static const char SHA2_INIT[]                    = "SHA2Init";
+static const char SHA2_UPDATE[]                  = "SHA2Update";
+static const char SHA2_FINAL[]                   = "SHA2Final";
+static const char UCRYPTO_VERSION[]              = "ucrypto_version";
+static const char UCRYPTO_GET_MECHLIST[]         = "ucrypto_get_mechlist";
+static const char UCRYPTO_ENCRYPT_INIT[]         = "ucrypto_encrypt_init";
+static const char UCRYPTO_ENCRYPT_UPDATE[]       = "ucrypto_encrypt_update";
+static const char UCRYPTO_ENCRYPT_FINAL[]        = "ucrypto_encrypt_final";
+static const char UCRYPTO_ENCRYPT[]              = "ucrypto_encrypt";
+static const char UCRYPTO_DECRYPT_INIT[]         = "ucrypto_decrypt_init";
+static const char UCRYPTO_DECRYPT_UPDATE[]       = "ucrypto_decrypt_update";
+static const char UCRYPTO_DECRYPT_FINAL[]        = "ucrypto_decrypt_final";
+static const char UCRYPTO_DECRYPT[]              = "ucrypto_decrypt";
+static const char UCRYPTO_SIGN_INIT[]            = "ucrypto_sign_init";
+static const char UCRYPTO_SIGN_UPDATE[]          = "ucrypto_sign_update";
+static const char UCRYPTO_SIGN_FINAL[]           = "ucrypto_sign_final";
+static const char UCRYPTO_VERIFY_INIT[]          = "ucrypto_verify_init";
+static const char UCRYPTO_VERIFY_UPDATE[]        = "ucrypto_verify_update";
+static const char UCRYPTO_VERIFY_FINAL[]         = "ucrypto_verify_final";
+
+/**
+ * Initialize native T4 crypto function pointers
+ */
+jboolean* loadNative() {
+
+  jboolean* buf;
+  void *lib;
+
+  buf = malloc(2 * sizeof(jboolean));
+  buf[0] = buf[1] = JNI_FALSE;
+  ftab = (T4CRYPTO_FUNCTION_TABLE_PTR) calloc(1, sizeof(T4CRYPTO_FUNCTION_TABLE));
+  if (ftab == NULL) {
+    free(buf);
+    return NULL;
+  }
+
+  lib = dlopen("libmd.so", RTLD_NOW);
+  if (lib != NULL) {
+    ftab->md5Init = (MD5INIT_FN_PTR) dlsym(lib, MD5_INIT);
+    ftab->md5Update = (MD5UPDATE_FN_PTR) dlsym(lib, MD5_UPDATE);
+    ftab->md5Final = (MD5FINAL_FN_PTR) dlsym(lib, MD5_FINAL);
+    ftab->sha1Init = (SHA1INIT_FN_PTR) dlsym(lib, SHA1_INIT);
+    ftab->sha1Update = (SHA1UPDATE_FN_PTR) dlsym(lib, SHA1_UPDATE);
+    ftab->sha1Final = (SHA1FINAL_FN_PTR) dlsym(lib, SHA1_FINAL);
+    ftab->sha2Init = (SHA2INIT_FN_PTR) dlsym(lib, SHA2_INIT);
+    ftab->sha2Update = (SHA2UPDATE_FN_PTR) dlsym(lib, SHA2_UPDATE);
+    ftab->sha2Final = (SHA2FINAL_FN_PTR) dlsym(lib, SHA2_FINAL);
+    if (ftab->md5Init != NULL && ftab->md5Update != NULL &&
+        ftab->md5Final != NULL && ftab->sha1Init != NULL &&
+        ftab->sha1Update != NULL && ftab->sha1Final != NULL &&
+        ftab->sha2Init != NULL && ftab->sha2Update != NULL &&
+        ftab->sha2Final != NULL) {
+      buf[0] = JNI_TRUE;
+    } else {
+      dlclose(lib);
+    }
+  }
+
+  lib = dlopen("libsoftcrypto.so", RTLD_NOW);
+  if (lib != NULL) {
+    // These APIs aren't available for v0 lib on Solaris 10
+    ftab->ucryptoVersion = (UCRYPTO_VERSION_FN_PTR)
+      dlsym(lib, UCRYPTO_VERSION);
+    ftab->ucryptoGetMechList = (UCRYPTO_GET_MECHLIST_FN_PTR)
+      dlsym(lib, UCRYPTO_GET_MECHLIST);
+    //??
+    ftab->ucryptoSignInit = (UCRYPTO_SIGN_INIT_FN_PTR)
+      dlsym(lib, UCRYPTO_SIGN_INIT);
+    ftab->ucryptoSignUpdate = (UCRYPTO_SIGN_UPDATE_FN_PTR)
+      dlsym(lib, UCRYPTO_SIGN_UPDATE);
+    ftab->ucryptoSignFinal = (UCRYPTO_SIGN_FINAL_FN_PTR)
+      dlsym(lib, UCRYPTO_SIGN_FINAL);
+    ftab->ucryptoVerifyInit = (UCRYPTO_VERIFY_INIT_FN_PTR)
+      dlsym(lib, UCRYPTO_VERIFY_INIT);
+    ftab->ucryptoVerifyUpdate = (UCRYPTO_VERIFY_UPDATE_FN_PTR)
+      dlsym(lib, UCRYPTO_VERIFY_UPDATE);
+    ftab->ucryptoVerifyFinal = (UCRYPTO_VERIFY_FINAL_FN_PTR)
+      dlsym(lib, UCRYPTO_VERIFY_FINAL);
+
+    // These should be avilable for all libsoftcrypto libs
+    ftab->ucryptoEncryptInit = (UCRYPTO_ENCRYPT_INIT_FN_PTR)
+      dlsym(lib, UCRYPTO_ENCRYPT_INIT);
+    ftab->ucryptoEncryptUpdate = (UCRYPTO_ENCRYPT_UPDATE_FN_PTR)
+      dlsym(lib, UCRYPTO_ENCRYPT_UPDATE);
+    ftab->ucryptoEncryptFinal = (UCRYPTO_ENCRYPT_FINAL_FN_PTR)
+      dlsym(lib, UCRYPTO_ENCRYPT_FINAL);
+    ftab->ucryptoEncrypt = (UCRYPTO_ENCRYPT_FN_PTR)
+      dlsym(lib, UCRYPTO_ENCRYPT);
+
+    ftab->ucryptoDecryptInit = (UCRYPTO_DECRYPT_INIT_FN_PTR)
+      dlsym(lib, UCRYPTO_DECRYPT_INIT);
+    ftab->ucryptoDecryptUpdate = (UCRYPTO_DECRYPT_UPDATE_FN_PTR)
+      dlsym(lib, UCRYPTO_DECRYPT_UPDATE);
+    ftab->ucryptoDecryptFinal = (UCRYPTO_DECRYPT_FINAL_FN_PTR)
+      dlsym(lib, UCRYPTO_DECRYPT_FINAL);
+    ftab->ucryptoDecrypt = (UCRYPTO_DECRYPT_FN_PTR)
+      dlsym(lib, UCRYPTO_DECRYPT);
+
+    if (ftab->ucryptoEncryptInit != NULL &&
+        ftab->ucryptoEncryptUpdate != NULL &&
+        ftab->ucryptoEncryptFinal != NULL &&
+        ftab->ucryptoEncrypt != NULL &&
+        ftab->ucryptoDecryptInit != NULL &&
+        ftab->ucryptoDecryptUpdate != NULL &&
+        ftab->ucryptoDecryptFinal != NULL &&
+        ftab->ucryptoDecrypt != NULL) {
+      buf[1] = JNI_TRUE;
+    } else {
+      dlclose(lib);
+    }
+  }
+
+  return buf;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeFunc.h	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef SPARCT4_NATIVE_FUNC_H
+#define SPARCT4_NATIVE_FUNC_H
+#include <md5.h>
+#include <sha1.h>
+#include <sha2.h>
+#include <libsoftcrypto.h>
+
+jboolean* loadNative();
+
+/* function pointer definitions */
+
+typedef void (*MD5INIT_FN_PTR)(MD5_CTX *context);
+
+typedef void (*MD5UPDATE_FN_PTR)
+     (MD5_CTX *context, unsigned char *input,
+      unsigned int inlen);
+
+typedef void (*MD5FINAL_FN_PTR)
+     (unsigned char *output, MD5_CTX *context);
+
+typedef void (*SHA1INIT_FN_PTR)(SHA1_CTX *context);
+
+typedef void (*SHA1UPDATE_FN_PTR)
+     (SHA1_CTX *context, unsigned char *input,
+      unsigned int inlen);
+
+typedef void (*SHA1FINAL_FN_PTR)
+     (unsigned char *output, SHA1_CTX *context);
+
+typedef void (*SHA2INIT_FN_PTR)(uint64_t mech, SHA2_CTX *context);
+
+typedef void (*SHA2UPDATE_FN_PTR)
+     (SHA2_CTX *context, unsigned char *input,
+      unsigned int inlen);
+
+typedef void (*SHA2FINAL_FN_PTR)
+     (unsigned char *output, SHA2_CTX *context);
+
+typedef int (*UCRYPTO_VERSION_FN_PTR)();
+
+typedef int (*UCRYPTO_GET_MECHLIST_FN_PTR)(char *str);
+
+typedef int (*UCRYPTO_ENCRYPT_INIT_FN_PTR)
+     (crypto_ctx_t *context, ucrypto_mech_t mech_type,
+      uchar_t *key_str, size_t key_len,
+      void *iv, size_t iv_len);
+
+typedef int (*UCRYPTO_ENCRYPT_UPDATE_FN_PTR)
+     (crypto_ctx_t *context, uchar_t *in,
+      size_t in_len, uchar_t *out, size_t *out_len);
+
+typedef int (*UCRYPTO_ENCRYPT_FINAL_FN_PTR)
+     (crypto_ctx_t *context, uchar_t *out,
+      size_t *out_len);
+
+typedef int (*UCRYPTO_ENCRYPT_FN_PTR)
+     (ucrypto_mech_t mech_type, uchar_t *key_str,
+      size_t key_len, void *iv, size_t iv_len, uchar_t *in,
+      size_t in_len, uchar_t *out, size_t *out_len);
+
+typedef int (*UCRYPTO_DECRYPT_INIT_FN_PTR)
+     (crypto_ctx_t *context,
+      ucrypto_mech_t mech_type, uchar_t *key_str, size_t key_len,
+      void *iv, size_t iv_len);
+
+typedef int (*UCRYPTO_DECRYPT_UPDATE_FN_PTR)
+     (crypto_ctx_t *context, uchar_t *in,
+      size_t in_len, uchar_t *out, size_t *out_len);
+
+typedef int (*UCRYPTO_DECRYPT_FINAL_FN_PTR)
+     (crypto_ctx_t *context, uchar_t *out,
+      size_t *out_len);
+
+typedef int (*UCRYPTO_DECRYPT_FN_PTR)
+     (ucrypto_mech_t mech_type, uchar_t *key_str,
+      size_t key_len, void *iv, size_t iv_len, uchar_t *in,
+      size_t in_len, uchar_t *out, size_t *out_len);
+
+typedef int (*UCRYPTO_SIGN_INIT_FN_PTR)
+     (crypto_ctx_t *context, ucrypto_mech_t mech_type,
+      uchar_t *key_str, size_t key_len,
+      void *iv, size_t iv_len);
+
+typedef int (*UCRYPTO_SIGN_UPDATE_FN_PTR)
+     (crypto_ctx_t *context, uchar_t *data_str, size_t data_len);
+
+typedef int (*UCRYPTO_SIGN_FINAL_FN_PTR)
+     (crypto_ctx_t *context, uchar_t *sig_str, size_t *sig_len);
+
+typedef int (*UCRYPTO_VERIFY_INIT_FN_PTR)
+     (crypto_ctx_t *context, ucrypto_mech_t mech_type,
+      uchar_t *key_str, size_t key_len,
+      void *iv, size_t iv_len);
+
+typedef int (*UCRYPTO_VERIFY_UPDATE_FN_PTR)
+     (crypto_ctx_t *context, uchar_t *data_str, size_t data_len);
+
+typedef int (*UCRYPTO_VERIFY_FINAL_FN_PTR)
+     (crypto_ctx_t *context, uchar_t *sig_str, size_t *sig_len);
+
+
+
+/* dynamically resolved functions from libmd, and libsoftcrypto
+   libraries */
+typedef struct T4CRYPTO_FUNCTION_TABLE {
+  MD5INIT_FN_PTR                 md5Init;
+  MD5UPDATE_FN_PTR               md5Update;
+  MD5FINAL_FN_PTR                md5Final;
+  SHA1INIT_FN_PTR                sha1Init;
+  SHA1UPDATE_FN_PTR              sha1Update;
+  SHA1FINAL_FN_PTR               sha1Final;
+  SHA2INIT_FN_PTR                sha2Init;
+  SHA2UPDATE_FN_PTR              sha2Update;
+  SHA2FINAL_FN_PTR               sha2Final;
+  UCRYPTO_VERSION_FN_PTR         ucryptoVersion;
+  UCRYPTO_GET_MECHLIST_FN_PTR    ucryptoGetMechList;
+  UCRYPTO_ENCRYPT_INIT_FN_PTR    ucryptoEncryptInit;
+  UCRYPTO_ENCRYPT_UPDATE_FN_PTR  ucryptoEncryptUpdate;
+  UCRYPTO_ENCRYPT_FINAL_FN_PTR   ucryptoEncryptFinal;
+  UCRYPTO_ENCRYPT_FN_PTR         ucryptoEncrypt;
+  UCRYPTO_DECRYPT_INIT_FN_PTR    ucryptoDecryptInit;
+  UCRYPTO_DECRYPT_UPDATE_FN_PTR  ucryptoDecryptUpdate;
+  UCRYPTO_DECRYPT_FINAL_FN_PTR   ucryptoDecryptFinal;
+  UCRYPTO_DECRYPT_FN_PTR         ucryptoDecrypt;
+  UCRYPTO_SIGN_INIT_FN_PTR       ucryptoSignInit;
+  UCRYPTO_SIGN_UPDATE_FN_PTR     ucryptoSignUpdate;
+  UCRYPTO_SIGN_FINAL_FN_PTR      ucryptoSignFinal;
+  UCRYPTO_VERIFY_INIT_FN_PTR     ucryptoVerifyInit;
+  UCRYPTO_VERIFY_UPDATE_FN_PTR   ucryptoVerifyUpdate;
+  UCRYPTO_VERIFY_FINAL_FN_PTR    ucryptoVerifyFinal;
+} T4CRYPTO_FUNCTION_TABLE;
+
+typedef T4CRYPTO_FUNCTION_TABLE *T4CRYPTO_FUNCTION_TABLE_PTR;
+
+/* global function table */
+T4CRYPTO_FUNCTION_TABLE_PTR ftab;
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/sys_old/crypto/common.h	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,637 @@
+/*
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef _SYS_CRYPTO_COMMON_H
+#define _SYS_CRYPTO_COMMON_H
+
+/*
+ * Header file for the common data structures of the cryptographic framework
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <sys/stream.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+
+/* Convenience defines/macros */
+
+#define CRYPTO_ARG_INPLACE(input, output)    \
+    if ((output) == NULL)        \
+        (output) = (input);
+
+#ifdef _KERNEL
+
+#include <sys/kmem.h>
+#define CRYPTO_KMFLAG(x)        crypto_kmflag((x))
+#define CRYPTO_ALLOC(sz, kmflag)        kmem_alloc((sz), (kmflag))
+#define CRYPTO_ZALLOC(sz, kmflag)        kmem_zalloc((sz), (kmflag))
+#define CRYPTO_FREE(ptr, sz)        kmem_free((ptr), (sz))
+#define CRYPTO_ZFREE(ptr, sz)        if (ptr != NULL) { \
+                                         bzero((ptr), (sz)), \
+                                         kmem_free((ptr), (sz)); \
+                                     }
+
+#else /* _KERNEL */
+
+#include <malloc.h>
+#define    CRYPTO_KMFLAG(x)        (0)
+#define    CRYPTO_ALLOC(sz, kmflag)        malloc((sz))
+#define    CRYPTO_ZALLOC(sz, kmflag)        calloc(1, (sz))
+#define    CRYPTO_FREE(ptr, sz)        free((ptr))
+#define    CRYPTO_ZFREE(ptr, sz)        if (ptr != NULL) { \
+                                         bzero((ptr), (sz)), \
+                                         free((ptr)); \
+                                     }
+
+#endif /* _KERNEL */
+
+/* Cryptographic Mechanisms */
+
+#define    CRYPTO_MAX_MECH_NAME 32
+typedef char crypto_mech_name_t[CRYPTO_MAX_MECH_NAME];
+
+typedef uint64_t crypto_mech_type_t;
+
+typedef struct crypto_mechanism {
+    crypto_mech_type_t    cm_type;    /* mechanism type */
+    caddr_t            cm_param;    /* mech. parameter */
+    size_t            cm_param_len;    /* mech. parameter len */
+} crypto_mechanism_t;
+
+#ifdef  _SYSCALL32
+
+typedef struct crypto_mechanism32 {
+    crypto_mech_type_t    cm_type;    /* mechanism type */
+    caddr32_t        cm_param;    /* mech. parameter */
+    size32_t        cm_param_len;   /* mech. parameter len */
+} crypto_mechanism32_t;
+
+#endif  /* _SYSCALL32 */
+
+#ifdef _KERNEL
+/* CK_AES_CTR_PARAMS provides parameters to the CKM_AES_CTR mechanism */
+typedef struct CK_AES_CTR_PARAMS {
+    ulong_t    ulCounterBits;
+    uint8_t cb[16];
+} CK_AES_CTR_PARAMS;
+#endif
+
+/* CK_AES_CCM_PARAMS provides parameters to the CKM_AES_CCM mechanism */
+typedef struct CK_AES_CCM_PARAMS {
+    ulong_t ulMACSize;
+    ulong_t ulNonceSize;
+    ulong_t ulAuthDataSize;
+    ulong_t ulDataSize; /* used for plaintext or ciphertext */
+    uchar_t *nonce;
+    uchar_t *authData;
+} CK_AES_CCM_PARAMS;
+
+/* CK_AES_GCM_PARAMS provides parameters to the CKM_AES_GCM mechanism */
+typedef struct CK_AES_GCM_PARAMS {
+    uchar_t *pIv;
+    ulong_t ulIvLen;
+    ulong_t ulIvBits;
+    uchar_t *pAAD;
+    ulong_t ulAADLen;
+    ulong_t ulTagBits;
+} CK_AES_GCM_PARAMS;
+
+/* CK_AES_GMAC_PARAMS provides parameters to the CKM_AES_GMAC mechanism */
+typedef struct CK_AES_GMAC_PARAMS {
+    uchar_t *pIv;
+    uchar_t *pAAD;
+    ulong_t ulAADLen;
+} CK_AES_GMAC_PARAMS;
+
+#ifdef _KERNEL
+/*
+ * CK_ECDH1_DERIVE_PARAMS provides the parameters to the
+ * CKM_ECDH1_KEY_DERIVE mechanism
+ */
+typedef struct CK_ECDH1_DERIVE_PARAMS {
+    ulong_t        kdf;
+    ulong_t        ulSharedDataLen;
+    uchar_t        *pSharedData;
+    ulong_t        ulPublicDataLen;
+    uchar_t        *pPublicData;
+} CK_ECDH1_DERIVE_PARAMS;
+#endif
+
+#ifdef _KERNEL
+#ifdef  _SYSCALL32
+
+/* needed for 32-bit applications running on 64-bit kernels */
+typedef struct CK_AES_CTR_PARAMS32 {
+    uint32_t ulCounterBits;
+    uint8_t cb[16];
+} CK_AES_CTR_PARAMS32;
+
+/* needed for 32-bit applications running on 64-bit kernels */
+typedef struct CK_AES_CCM_PARAMS32 {
+    uint32_t ulMACSize;
+    uint32_t ulNonceSize;
+    uint32_t ulAuthDataSize;
+    uint32_t ulDataSize;
+    caddr32_t nonce;
+    caddr32_t authData;
+} CK_AES_CCM_PARAMS32;
+
+/* needed for 32-bit applications running on 64-bit kernels */
+typedef struct CK_AES_GCM_PARAMS32 {
+    caddr32_t pIv;
+    uint32_t ulIvLen;
+    uint32_t ulIvBits;
+    caddr32_t pAAD;
+    uint32_t ulAADLen;
+    uint32_t ulTagBits;
+} CK_AES_GCM_PARAMS32;
+
+/* needed for 32-bit applications running on 64-bit kernels */
+typedef struct CK_AES_GMAC_PARAMS32 {
+    caddr32_t pIv;
+    caddr32_t pAAD;
+    uint32_t ulAADLen;
+} CK_AES_GMAC_PARAMS32;
+
+typedef struct CK_ECDH1_DERIVE_PARAMS32 {
+    uint32_t    kdf;
+    uint32_t    ulSharedDataLen;
+    caddr32_t    pSharedData;
+    uint32_t    ulPublicDataLen;
+    caddr32_t    pPublicData;
+} CK_ECDH1_DERIVE_PARAMS32;
+
+#endif  /* _SYSCALL32 */
+#endif /* _KERNEL */
+
+/*
+ * The measurement unit bit flag for a mechanism's minimum or maximum key size.
+ * The unit are mechanism dependent.  It can be in bits or in bytes.
+ */
+typedef uint32_t crypto_keysize_unit_t;
+
+/*
+ * The following bit flags are valid in cm_mech_flags field in
+ * the crypto_mech_info_t structure of the SPI.
+ *
+ * Only the first two bit flags are valid in mi_keysize_unit
+ * field in the crypto_mechanism_info_t structure of the API.
+ */
+#define    CRYPTO_KEYSIZE_UNIT_IN_BITS    0x00000001
+#define    CRYPTO_KEYSIZE_UNIT_IN_BYTES    0x00000002
+#define    CRYPTO_CAN_SHARE_OPSTATE    0x00000004 /* supports sharing */
+
+
+/* Mechanisms supported out-of-the-box */
+#define    SUN_CKM_MD4            "CKM_MD4"
+#define    SUN_CKM_MD5            "CKM_MD5"
+#define    SUN_CKM_MD5_HMAC        "CKM_MD5_HMAC"
+#define    SUN_CKM_MD5_HMAC_GENERAL    "CKM_MD5_HMAC_GENERAL"
+#define    SUN_CKM_SHA1            "CKM_SHA_1"
+#define    SUN_CKM_SHA1_HMAC        "CKM_SHA_1_HMAC"
+#define    SUN_CKM_SHA1_HMAC_GENERAL    "CKM_SHA_1_HMAC_GENERAL"
+#define    SUN_CKM_SHA256            "CKM_SHA256"
+#define    SUN_CKM_SHA256_HMAC        "CKM_SHA256_HMAC"
+#define    SUN_CKM_SHA256_HMAC_GENERAL    "CKM_SHA256_HMAC_GENERAL"
+#define    SUN_CKM_SHA384            "CKM_SHA384"
+#define    SUN_CKM_SHA384_HMAC        "CKM_SHA384_HMAC"
+#define    SUN_CKM_SHA384_HMAC_GENERAL    "CKM_SHA384_HMAC_GENERAL"
+#define    SUN_CKM_SHA512            "CKM_SHA512"
+#define    SUN_CKM_SHA512_HMAC        "CKM_SHA512_HMAC"
+#define    SUN_CKM_SHA512_HMAC_GENERAL    "CKM_SHA512_HMAC_GENERAL"
+#define    SUN_CKM_DES_CBC            "CKM_DES_CBC"
+#define    SUN_CKM_DES3_CBC        "CKM_DES3_CBC"
+#define    SUN_CKM_DES_ECB            "CKM_DES_ECB"
+#define    SUN_CKM_DES3_ECB        "CKM_DES3_ECB"
+#define    SUN_CKM_BLOWFISH_CBC        "CKM_BLOWFISH_CBC"
+#define    SUN_CKM_BLOWFISH_ECB        "CKM_BLOWFISH_ECB"
+#define    SUN_CKM_AES_CBC            "CKM_AES_CBC"
+#define    SUN_CKM_AES_ECB            "CKM_AES_ECB"
+#define    SUN_CKM_AES_CTR            "CKM_AES_CTR"
+#define    SUN_CKM_AES_CCM            "CKM_AES_CCM"
+#define    SUN_CKM_AES_GCM            "CKM_AES_GCM"
+#define    SUN_CKM_AES_GMAC        "CKM_AES_GMAC"
+#define    SUN_CKM_AES_CFB128        "CKM_AES_CFB128"
+#define    SUN_CKM_RC4            "CKM_RC4"
+#define    SUN_CKM_RSA_PKCS        "CKM_RSA_PKCS"
+#define    SUN_CKM_RSA_X_509        "CKM_RSA_X_509"
+#define    SUN_CKM_MD5_RSA_PKCS        "CKM_MD5_RSA_PKCS"
+#define    SUN_CKM_SHA1_RSA_PKCS        "CKM_SHA1_RSA_PKCS"
+#define    SUN_CKM_SHA256_RSA_PKCS        "CKM_SHA256_RSA_PKCS"
+#define    SUN_CKM_SHA384_RSA_PKCS        "CKM_SHA384_RSA_PKCS"
+#define    SUN_CKM_SHA512_RSA_PKCS        "CKM_SHA512_RSA_PKCS"
+#define    SUN_CKM_EC_KEY_PAIR_GEN        "CKM_EC_KEY_PAIR_GEN"
+#define    SUN_CKM_ECDH1_DERIVE        "CKM_ECDH1_DERIVE"
+#define    SUN_CKM_ECDSA_SHA1        "CKM_ECDSA_SHA1"
+#define    SUN_CKM_ECDSA            "CKM_ECDSA"
+
+/* Shared operation context format for CKM_RC4 */
+typedef struct {
+#if defined(__amd64)
+    uint32_t    i, j;
+    uint32_t    arr[256];
+    uint32_t    flag;
+#else
+    uchar_t        arr[256];
+    uchar_t        i, j;
+#endif /* __amd64 */
+    uint64_t    pad;        /* For 64-bit alignment */
+} arcfour_state_t;
+
+/* Data arguments of cryptographic operations */
+
+typedef enum crypto_data_format {
+    CRYPTO_DATA_RAW = 1,
+    CRYPTO_DATA_UIO,
+    CRYPTO_DATA_MBLK
+} crypto_data_format_t;
+
+typedef struct crypto_data {
+    crypto_data_format_t    cd_format;    /* Format identifier    */
+    off_t            cd_offset;    /* Offset from the beginning */
+    size_t            cd_length;    /* # of bytes in use */
+    caddr_t            cd_miscdata;    /* ancillary data */
+    union {
+        /* Raw format */
+        iovec_t cdu_raw;        /* Pointer and length        */
+
+        /* uio scatter-gather format */
+        uio_t    *cdu_uio;
+
+        /* mblk scatter-gather format */
+        mblk_t    *cdu_mp;        /* The mblk chain */
+
+    } cdu;    /* Crypto Data Union */
+} crypto_data_t;
+
+#define    cd_raw        cdu.cdu_raw
+#define    cd_uio        cdu.cdu_uio
+#define    cd_mp        cdu.cdu_mp
+
+#define    CRYPTO_SET_RAW_DATA(var, str, len)    \
+    (var).cd_format = CRYPTO_DATA_RAW;    \
+    (var).cd_offset = 0;            \
+    (var).cd_length = (len);        \
+    (var).cd_miscdata = NULL;        \
+    (var).cd_raw.iov_base = (caddr_t)(str);    \
+    (var).cd_raw.iov_len = (len);
+
+#define    CRYPTO_DATA_IS_USERSPACE(buf) \
+    ((buf->cd_format == CRYPTO_DATA_UIO && \
+    buf->cd_uio->uio_segflg == UIO_USERSPACE))
+
+typedef struct crypto_dual_data {
+    crypto_data_t        dd_data;    /* The data */
+    off_t            dd_offset2;    /* Used by dual operation */
+    size_t            dd_len2;    /* # of bytes to take    */
+} crypto_dual_data_t;
+
+#define    dd_format    dd_data.cd_format
+#define    dd_offset1    dd_data.cd_offset
+#define    dd_len1        dd_data.cd_length
+#define    dd_miscdata    dd_data.cd_miscdata
+#define    dd_raw        dd_data.cd_raw
+#define    dd_uio        dd_data.cd_uio
+#define    dd_mp        dd_data.cd_mp
+
+/* The keys, and their contents */
+
+typedef enum {
+    CRYPTO_KEY_RAW = 1,    /* ck_data is a cleartext key */
+    CRYPTO_KEY_REFERENCE,    /* ck_obj_id is an opaque reference */
+    CRYPTO_KEY_ATTR_LIST    /* ck_attrs is a list of object attributes */
+} crypto_key_format_t;
+
+typedef uint64_t crypto_attr_type_t;
+
+/* Attribute types to use for passing a RSA public key or a private key. */
+#define    SUN_CKA_MODULUS            0x00000120
+#define    SUN_CKA_MODULUS_BITS        0x00000121
+#define    SUN_CKA_PUBLIC_EXPONENT        0x00000122
+#define    SUN_CKA_PRIVATE_EXPONENT    0x00000123
+#define    SUN_CKA_PRIME_1            0x00000124
+#define    SUN_CKA_PRIME_2            0x00000125
+#define    SUN_CKA_EXPONENT_1        0x00000126
+#define    SUN_CKA_EXPONENT_2        0x00000127
+#define    SUN_CKA_COEFFICIENT        0x00000128
+#define    SUN_CKA_PRIME            0x00000130
+#define    SUN_CKA_SUBPRIME        0x00000131
+#define    SUN_CKA_BASE            0x00000132
+
+#define    CKK_EC            0x00000003
+#define    CKK_GENERIC_SECRET    0x00000010
+#define    CKK_RC4            0x00000012
+#define    CKK_AES            0x0000001F
+#define    CKK_DES            0x00000013
+#define    CKK_DES2        0x00000014
+#define    CKK_DES3        0x00000015
+
+#define    CKO_PUBLIC_KEY        0x00000002
+#define    CKO_PRIVATE_KEY        0x00000003
+#define    CKA_CLASS        0x00000000
+#define    CKA_VALUE        0x00000011
+#define    CKA_KEY_TYPE        0x00000100
+#define    CKA_VALUE_LEN        0x00000161
+#define    CKA_EC_PARAMS        0x00000180
+#define    CKA_EC_POINT        0x00000181
+
+typedef uint32_t    crypto_object_id_t;
+
+typedef struct crypto_object_attribute {
+    crypto_attr_type_t    oa_type;    /* attribute type */
+    caddr_t            oa_value;    /* attribute value */
+    ssize_t            oa_value_len;    /* length of attribute value */
+} crypto_object_attribute_t;
+
+typedef struct crypto_key {
+    crypto_key_format_t    ck_format;    /* format identifier */
+    union {
+        /* for CRYPTO_KEY_RAW ck_format */
+        struct {
+            uint_t    cku_v_length;    /* # of bits in ck_data   */
+            void    *cku_v_data;    /* ptr to key value */
+        } cku_key_value;
+
+        /* for CRYPTO_KEY_REFERENCE ck_format */
+        crypto_object_id_t cku_key_id;    /* reference to object key */
+
+        /* for CRYPTO_KEY_ATTR_LIST ck_format */
+        struct {
+            uint_t cku_a_count;    /* number of attributes */
+            crypto_object_attribute_t *cku_a_oattr;
+        } cku_key_attrs;
+    } cku_data;                /* Crypto Key union */
+} crypto_key_t;
+
+#ifdef  _SYSCALL32
+
+typedef struct crypto_object_attribute32 {
+    uint64_t    oa_type;    /* attribute type */
+    caddr32_t    oa_value;    /* attribute value */
+    ssize32_t    oa_value_len;    /* length of attribute value */
+} crypto_object_attribute32_t;
+
+typedef struct crypto_key32 {
+    crypto_key_format_t    ck_format;    /* format identifier */
+    union {
+        /* for CRYPTO_KEY_RAW ck_format */
+        struct {
+            uint32_t cku_v_length;    /* # of bytes in ck_data */
+            caddr32_t cku_v_data;    /* ptr to key value */
+        } cku_key_value;
+
+        /* for CRYPTO_KEY_REFERENCE ck_format */
+        crypto_object_id_t cku_key_id; /* reference to object key */
+
+        /* for CRYPTO_KEY_ATTR_LIST ck_format */
+        struct {
+            uint32_t cku_a_count;    /* number of attributes */
+            caddr32_t cku_a_oattr;
+        } cku_key_attrs;
+    } cku_data;                /* Crypto Key union */
+} crypto_key32_t;
+
+#endif  /* _SYSCALL32 */
+
+#define    ck_data        cku_data.cku_key_value.cku_v_data
+#define    ck_length    cku_data.cku_key_value.cku_v_length
+#define    ck_obj_id    cku_data.cku_key_id
+#define    ck_count    cku_data.cku_key_attrs.cku_a_count
+#define    ck_attrs    cku_data.cku_key_attrs.cku_a_oattr
+
+/*
+ * Raw key lengths are expressed in number of bits.
+ * The following macro returns the minimum number of
+ * bytes that can contain the specified number of bits.
+ * Round up without overflowing the integer type.
+ */
+#define    CRYPTO_BITS2BYTES(n) ((n) == 0 ? 0 : (((n) - 1) >> 3) + 1)
+#define    CRYPTO_BYTES2BITS(n) ((n) << 3)
+
+/* Providers */
+
+typedef enum {
+    CRYPTO_HW_PROVIDER = 0,
+    CRYPTO_SW_PROVIDER,
+    CRYPTO_LOGICAL_PROVIDER
+} crypto_provider_type_t;
+
+typedef uint32_t     crypto_provider_id_t;
+#define    KCF_PROVID_INVALID    ((uint32_t)-1)
+
+typedef struct crypto_provider_entry {
+    crypto_provider_id_t    pe_provider_id;
+    uint_t            pe_mechanism_count;
+} crypto_provider_entry_t;
+
+typedef struct crypto_dev_list_entry {
+    char            le_dev_name[MAXNAMELEN];
+    uint_t            le_dev_instance;
+    uint_t            le_mechanism_count;
+} crypto_dev_list_entry_t;
+
+/* User type for authentication ioctls and SPI entry points */
+
+typedef enum crypto_user_type {
+    CRYPTO_SO = 0,
+    CRYPTO_USER
+} crypto_user_type_t;
+
+/* Version for provider management ioctls and SPI entry points */
+
+typedef struct crypto_version {
+    uchar_t    cv_major;
+    uchar_t    cv_minor;
+} crypto_version_t;
+
+/* session data structure opaque to the consumer */
+typedef void *crypto_session_t;
+
+/* provider data structure opaque to the consumer */
+typedef void *crypto_provider_t;
+
+/* Limits used by both consumers and providers */
+#define    CRYPTO_EXT_SIZE_LABEL        32
+#define    CRYPTO_EXT_SIZE_MANUF        32
+#define    CRYPTO_EXT_SIZE_MODEL        16
+#define    CRYPTO_EXT_SIZE_SERIAL        16
+#define    CRYPTO_EXT_SIZE_TIME        16
+
+typedef struct crypto_provider_ext_info {
+    uchar_t            ei_label[CRYPTO_EXT_SIZE_LABEL];
+    uchar_t            ei_manufacturerID[CRYPTO_EXT_SIZE_MANUF];
+    uchar_t            ei_model[CRYPTO_EXT_SIZE_MODEL];
+    uchar_t            ei_serial_number[CRYPTO_EXT_SIZE_SERIAL];
+    ulong_t            ei_flags;
+    ulong_t            ei_max_session_count;
+    ulong_t            ei_max_pin_len;
+    ulong_t            ei_min_pin_len;
+    ulong_t            ei_total_public_memory;
+    ulong_t            ei_free_public_memory;
+    ulong_t            ei_total_private_memory;
+    ulong_t            ei_free_private_memory;
+    crypto_version_t    ei_hardware_version;
+    crypto_version_t    ei_firmware_version;
+    uchar_t            ei_time[CRYPTO_EXT_SIZE_TIME];
+    int            ei_hash_max_input_len;
+    int            ei_hmac_max_input_len;
+} crypto_provider_ext_info_t;
+
+typedef uint_t        crypto_session_id_t;
+
+typedef enum cmd_type {
+    COPY_FROM_DATA,
+    COPY_TO_DATA,
+    COMPARE_TO_DATA,
+    MD5_DIGEST_DATA,
+    SHA1_DIGEST_DATA,
+    SHA2_DIGEST_DATA,
+    GHASH_DATA
+} cmd_type_t;
+
+#define    CRYPTO_DO_UPDATE    0x01
+#define    CRYPTO_DO_FINAL        0x02
+#define    CRYPTO_DO_MD5        0x04
+#define    CRYPTO_DO_SHA1        0x08
+#define    CRYPTO_DO_SIGN        0x10
+#define    CRYPTO_DO_VERIFY    0x20
+#define    CRYPTO_DO_SHA2        0x40
+
+#define    PROVIDER_OWNS_KEY_SCHEDULE    0x00000001
+
+/*
+ * Common cryptographic status and error codes.
+ */
+#define    CRYPTO_SUCCESS                0x00000000
+#define    CRYPTO_CANCEL                0x00000001
+#define    CRYPTO_HOST_MEMORY            0x00000002
+#define    CRYPTO_GENERAL_ERROR            0x00000003
+#define    CRYPTO_FAILED                0x00000004
+#define    CRYPTO_ARGUMENTS_BAD            0x00000005
+#define    CRYPTO_ATTRIBUTE_READ_ONLY        0x00000006
+#define    CRYPTO_ATTRIBUTE_SENSITIVE        0x00000007
+#define    CRYPTO_ATTRIBUTE_TYPE_INVALID        0x00000008
+#define    CRYPTO_ATTRIBUTE_VALUE_INVALID        0x00000009
+#define    CRYPTO_CANCELED                0x0000000A
+#define    CRYPTO_DATA_INVALID            0x0000000B
+#define    CRYPTO_DATA_LEN_RANGE            0x0000000C
+#define    CRYPTO_DEVICE_ERROR            0x0000000D
+#define    CRYPTO_DEVICE_MEMORY            0x0000000E
+#define    CRYPTO_DEVICE_REMOVED            0x0000000F
+#define    CRYPTO_ENCRYPTED_DATA_INVALID        0x00000010
+#define    CRYPTO_ENCRYPTED_DATA_LEN_RANGE        0x00000011
+#define    CRYPTO_KEY_HANDLE_INVALID        0x00000012
+#define    CRYPTO_KEY_SIZE_RANGE            0x00000013
+#define    CRYPTO_KEY_TYPE_INCONSISTENT        0x00000014
+#define    CRYPTO_KEY_NOT_NEEDED            0x00000015
+#define    CRYPTO_KEY_CHANGED            0x00000016
+#define    CRYPTO_KEY_NEEDED            0x00000017
+#define    CRYPTO_KEY_INDIGESTIBLE            0x00000018
+#define    CRYPTO_KEY_FUNCTION_NOT_PERMITTED    0x00000019
+#define    CRYPTO_KEY_NOT_WRAPPABLE        0x0000001A
+#define    CRYPTO_KEY_UNEXTRACTABLE        0x0000001B
+#define    CRYPTO_MECHANISM_INVALID        0x0000001C
+#define    CRYPTO_MECHANISM_PARAM_INVALID        0x0000001D
+#define    CRYPTO_OBJECT_HANDLE_INVALID        0x0000001E
+#define    CRYPTO_OPERATION_IS_ACTIVE        0x0000001F
+#define    CRYPTO_OPERATION_NOT_INITIALIZED    0x00000020
+#define    CRYPTO_PIN_INCORRECT            0x00000021
+#define    CRYPTO_PIN_INVALID            0x00000022
+#define    CRYPTO_PIN_LEN_RANGE            0x00000023
+#define    CRYPTO_PIN_EXPIRED            0x00000024
+#define    CRYPTO_PIN_LOCKED            0x00000025
+#define    CRYPTO_SESSION_CLOSED            0x00000026
+#define    CRYPTO_SESSION_COUNT            0x00000027
+#define    CRYPTO_SESSION_HANDLE_INVALID        0x00000028
+#define    CRYPTO_SESSION_READ_ONLY        0x00000029
+#define    CRYPTO_SESSION_EXISTS            0x0000002A
+#define    CRYPTO_SESSION_READ_ONLY_EXISTS        0x0000002B
+#define    CRYPTO_SESSION_READ_WRITE_SO_EXISTS    0x0000002C
+#define    CRYPTO_SIGNATURE_INVALID        0x0000002D
+#define    CRYPTO_SIGNATURE_LEN_RANGE        0x0000002E
+#define    CRYPTO_TEMPLATE_INCOMPLETE        0x0000002F
+#define    CRYPTO_TEMPLATE_INCONSISTENT        0x00000030
+#define    CRYPTO_UNWRAPPING_KEY_HANDLE_INVALID    0x00000031
+#define    CRYPTO_UNWRAPPING_KEY_SIZE_RANGE    0x00000032
+#define    CRYPTO_UNWRAPPING_KEY_TYPE_INCONSISTENT    0x00000033
+#define    CRYPTO_USER_ALREADY_LOGGED_IN        0x00000034
+#define    CRYPTO_USER_NOT_LOGGED_IN        0x00000035
+#define    CRYPTO_USER_PIN_NOT_INITIALIZED        0x00000036
+#define    CRYPTO_USER_TYPE_INVALID        0x00000037
+#define    CRYPTO_USER_ANOTHER_ALREADY_LOGGED_IN    0x00000038
+#define    CRYPTO_USER_TOO_MANY_TYPES        0x00000039
+#define    CRYPTO_WRAPPED_KEY_INVALID        0x0000003A
+#define    CRYPTO_WRAPPED_KEY_LEN_RANGE        0x0000003B
+#define    CRYPTO_WRAPPING_KEY_HANDLE_INVALID    0x0000003C
+#define    CRYPTO_WRAPPING_KEY_SIZE_RANGE        0x0000003D
+#define    CRYPTO_WRAPPING_KEY_TYPE_INCONSISTENT    0x0000003E
+#define    CRYPTO_RANDOM_SEED_NOT_SUPPORTED    0x0000003F
+#define    CRYPTO_RANDOM_NO_RNG            0x00000040
+#define    CRYPTO_DOMAIN_PARAMS_INVALID        0x00000041
+#define    CRYPTO_BUFFER_TOO_SMALL            0x00000042
+#define    CRYPTO_INFORMATION_SENSITIVE        0x00000043
+#define    CRYPTO_NOT_SUPPORTED            0x00000044
+
+#define    CRYPTO_QUEUED                0x00000045
+#define    CRYPTO_BUFFER_TOO_BIG            0x00000046
+#define    CRYPTO_INVALID_CONTEXT            0x00000047
+#define    CRYPTO_INVALID_MAC            0x00000048
+#define    CRYPTO_MECH_NOT_SUPPORTED        0x00000049
+#define    CRYPTO_INCONSISTENT_ATTRIBUTE        0x0000004A
+#define    CRYPTO_NO_PERMISSION            0x0000004B
+#define    CRYPTO_INVALID_PROVIDER_ID        0x0000004C
+#define    CRYPTO_VERSION_MISMATCH            0x0000004D
+#define    CRYPTO_BUSY                0x0000004E
+#define    CRYPTO_UNKNOWN_PROVIDER            0x0000004F
+#define    CRYPTO_MODVERIFICATION_FAILED        0x00000050
+#define    CRYPTO_OLD_CTX_TEMPLATE            0x00000051
+#define    CRYPTO_WEAK_KEY                0x00000052
+#define    CRYPTO_FIPS140_ERROR            0x00000053
+/*
+ * Don't forget to update CRYPTO_LAST_ERROR and the error_number_table[]
+ * in kernelUtil.c when new error code is added.
+ */
+#define    CRYPTO_LAST_ERROR            0x00000053
+
+/*
+ * Special values that can be used to indicate that information is unavailable
+ * or that there is not practical limit. These values can be used
+ * by fields of the SPI crypto_provider_ext_info(9S) structure.
+ * The value of CRYPTO_UNAVAILABLE_INFO should be the same as
+ * CK_UNAVAILABLE_INFO in the PKCS#11 spec.
+ */
+#define    CRYPTO_UNAVAILABLE_INFO        ((ulong_t)(-1))
+#define    CRYPTO_EFFECTIVELY_INFINITE    0x0
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_CRYPTO_COMMON_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/sys_old/crypto/spi.h	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,791 @@
+/*
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef _SYS_CRYPTO_SPI_H
+#define    _SYS_CRYPTO_SPI_H
+
+/*
+ * CSPI: Cryptographic Service Provider Interface.
+ */
+
+#include <sys/types.h>
+#include <sys/crypto/common.h>
+
+#ifdef    __cplusplus
+extern "C" {
+#endif
+
+#ifdef    _KERNEL
+#include <sys/dditypes.h>
+#include <sys/ddi.h>
+#include <sys/kmem.h>
+
+#define    CRYPTO_SPI_VERSION_1    1
+#define    CRYPTO_SPI_VERSION_2    2
+#define    CRYPTO_SPI_VERSION_3    3
+#define    CRYPTO_SPI_VERSION_4    4
+#define    CRYPTO_SPI_VERSION_5    5
+
+#define    CRYPTO_OPS_OFFSET(f)        offsetof(crypto_ops_t, co_##f)
+#define    CRYPTO_PROVIDER_OFFSET(f)    \
+    offsetof(crypto_provider_management_ops_t, f)
+#define    CRYPTO_OBJECT_OFFSET(f)        offsetof(crypto_object_ops_t, f)
+#define    CRYPTO_SESSION_OFFSET(f)    offsetof(crypto_session_ops_t, f)
+
+#endif
+
+/*
+ * Provider-private handle. This handle is specified by a provider
+ * when it registers by means of the pi_provider_handle field of
+ * the crypto_provider_info structure, and passed to the provider
+ * when its entry points are invoked.
+ */
+typedef void *crypto_provider_handle_t;
+
+/*
+ * Context templates can be used to by software providers to pre-process
+ * keying material, such as key schedules. They are allocated by
+ * a software provider create_ctx_template(9E) entry point, and passed
+ * as argument to initialization and atomic provider entry points.
+ */
+typedef void *crypto_spi_ctx_template_t;
+
+/*
+ * Request handles are used by the kernel to identify an asynchronous
+ * request being processed by a provider. It is passed by the kernel
+ * to a hardware provider when submitting a request, and must be
+ * specified by a provider when calling crypto_op_notification(9F)
+ */
+typedef void *crypto_req_handle_t;
+
+/*
+ * The context structure is passed from kcf to a provider in kernel and
+ * internally in libsoftcrypto between ucrypto and the algorithm.
+ * It contains the information needed to process a multi-part or
+ * single part operation. The context structure is not used
+ * by atomic operations.
+ *
+ * Parameters needed to perform a cryptographic operation, such
+ * as keys, mechanisms, input and output buffers, are passed
+ * as separate arguments to Provider routines.
+ */
+typedef struct crypto_ctx {
+    crypto_provider_handle_t cc_provider;
+    crypto_session_id_t    cc_session;
+    void            *cc_provider_private;    /* owned by provider */
+    void            *cc_framework_private;    /* owned by framework */
+    uint32_t        cc_flags;        /* flags */
+    void            *cc_opstate;        /* state */
+} crypto_ctx_t;
+
+#ifdef    _KERNEL
+
+/* Values for cc_flags field */
+#define    CRYPTO_INIT_OPSTATE    0x00000001 /* allocate and init cc_opstate */
+#define    CRYPTO_USE_OPSTATE    0x00000002 /* .. start using it as context */
+
+/*
+ * Extended provider information.
+ */
+
+/*
+ * valid values for ei_flags field of extended info structure
+ * They match the RSA Security, Inc PKCS#11 tokenInfo flags.
+ */
+#define    CRYPTO_EXTF_RNG                    0x00000001
+#define    CRYPTO_EXTF_WRITE_PROTECTED            0x00000002
+#define    CRYPTO_EXTF_LOGIN_REQUIRED            0x00000004
+#define    CRYPTO_EXTF_USER_PIN_INITIALIZED        0x00000008
+#define    CRYPTO_EXTF_CLOCK_ON_TOKEN            0x00000040
+#define    CRYPTO_EXTF_PROTECTED_AUTHENTICATION_PATH    0x00000100
+#define    CRYPTO_EXTF_DUAL_CRYPTO_OPERATIONS        0x00000200
+#define    CRYPTO_EXTF_TOKEN_INITIALIZED            0x00000400
+#define    CRYPTO_EXTF_USER_PIN_COUNT_LOW            0x00010000
+#define    CRYPTO_EXTF_USER_PIN_FINAL_TRY            0x00020000
+#define    CRYPTO_EXTF_USER_PIN_LOCKED            0x00040000
+#define    CRYPTO_EXTF_USER_PIN_TO_BE_CHANGED        0x00080000
+#define    CRYPTO_EXTF_SO_PIN_COUNT_LOW            0x00100000
+#define    CRYPTO_EXTF_SO_PIN_FINAL_TRY            0x00200000
+#define    CRYPTO_EXTF_SO_PIN_LOCKED            0x00400000
+#define    CRYPTO_EXTF_SO_PIN_TO_BE_CHANGED        0x00800000
+
+/*
+ * The crypto_control_ops structure contains pointers to control
+ * operations for cryptographic providers.  It is passed through
+ * the crypto_ops(9S) structure when providers register with the
+ * kernel using crypto_register_provider(9F).
+ */
+typedef struct crypto_control_ops {
+    void (*provider_status)(crypto_provider_handle_t, uint_t *);
+} crypto_control_ops_t;
+
+/*
+ * The crypto_ctx_ops structure contains points to context and context
+ * templates management operations for cryptographic providers. It is
+ * passed through the crypto_ops(9S) structure when providers register
+ * with the kernel using crypto_register_provider(9F).
+ */
+typedef struct crypto_ctx_ops {
+    int (*create_ctx_template)(crypto_provider_handle_t,
+        crypto_mechanism_t *, crypto_key_t *,
+        crypto_spi_ctx_template_t *, size_t *, crypto_req_handle_t);
+    int (*free_context)(crypto_ctx_t *);
+} crypto_ctx_ops_t;
+
+/*
+ * The crypto_digest_ops structure contains pointers to digest
+ * operations for cryptographic providers.  It is passed through
+ * the crypto_ops(9S) structure when providers register with the
+ * kernel using crypto_register_provider(9F).
+ */
+typedef struct crypto_digest_ops {
+    int (*digest_init)(crypto_ctx_t *, crypto_mechanism_t *,
+        crypto_req_handle_t);
+    int (*digest)(crypto_ctx_t *, crypto_data_t *, crypto_data_t *,
+        crypto_req_handle_t);
+    int (*digest_update)(crypto_ctx_t *, crypto_data_t *,
+        crypto_req_handle_t);
+    int (*digest_key)(crypto_ctx_t *, crypto_key_t *, crypto_req_handle_t);
+    int (*digest_final)(crypto_ctx_t *, crypto_data_t *,
+        crypto_req_handle_t);
+    int (*digest_atomic)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_mechanism_t *, crypto_data_t *,
+        crypto_data_t *, crypto_req_handle_t);
+} crypto_digest_ops_t;
+
+/*
+ * The crypto_cipher_ops structure contains pointers to encryption
+ * and decryption operations for cryptographic providers.  It is
+ * passed through the crypto_ops(9S) structure when providers register
+ * with the kernel using crypto_register_provider(9F).
+ */
+typedef struct crypto_cipher_ops {
+    int (*encrypt_init)(crypto_ctx_t *,
+        crypto_mechanism_t *, crypto_key_t *,
+        crypto_spi_ctx_template_t, crypto_req_handle_t);
+    int (*encrypt)(crypto_ctx_t *,
+        crypto_data_t *, crypto_data_t *, crypto_req_handle_t);
+    int (*encrypt_update)(crypto_ctx_t *,
+        crypto_data_t *, crypto_data_t *, crypto_req_handle_t);
+    int (*encrypt_final)(crypto_ctx_t *,
+        crypto_data_t *, crypto_req_handle_t);
+    int (*encrypt_atomic)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_mechanism_t *, crypto_key_t *, crypto_data_t *,
+        crypto_data_t *, crypto_spi_ctx_template_t, crypto_req_handle_t);
+
+    int (*decrypt_init)(crypto_ctx_t *,
+        crypto_mechanism_t *, crypto_key_t *,
+        crypto_spi_ctx_template_t, crypto_req_handle_t);
+    int (*decrypt)(crypto_ctx_t *,
+        crypto_data_t *, crypto_data_t *, crypto_req_handle_t);
+    int (*decrypt_update)(crypto_ctx_t *,
+        crypto_data_t *, crypto_data_t *, crypto_req_handle_t);
+    int (*decrypt_final)(crypto_ctx_t *,
+        crypto_data_t *, crypto_req_handle_t);
+    int (*decrypt_atomic)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_mechanism_t *, crypto_key_t *, crypto_data_t *,
+        crypto_data_t *, crypto_spi_ctx_template_t, crypto_req_handle_t);
+} crypto_cipher_ops_t;
+
+/*
+ * The crypto_mac_ops structure contains pointers to MAC
+ * operations for cryptographic providers.  It is passed through
+ * the crypto_ops(9S) structure when providers register with the
+ * kernel using crypto_register_provider(9F).
+ */
+typedef struct crypto_mac_ops {
+    int (*mac_init)(crypto_ctx_t *,
+        crypto_mechanism_t *, crypto_key_t *,
+        crypto_spi_ctx_template_t, crypto_req_handle_t);
+    int (*mac)(crypto_ctx_t *,
+        crypto_data_t *, crypto_data_t *, crypto_req_handle_t);
+    int (*mac_update)(crypto_ctx_t *,
+        crypto_data_t *, crypto_req_handle_t);
+    int (*mac_final)(crypto_ctx_t *,
+        crypto_data_t *, crypto_req_handle_t);
+    int (*mac_atomic)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_mechanism_t *, crypto_key_t *, crypto_data_t *,
+        crypto_data_t *, crypto_spi_ctx_template_t,
+        crypto_req_handle_t);
+    int (*mac_verify_atomic)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_mechanism_t *, crypto_key_t *, crypto_data_t *,
+        crypto_data_t *, crypto_spi_ctx_template_t,
+        crypto_req_handle_t);
+} crypto_mac_ops_t;
+
+/*
+ * The crypto_sign_ops structure contains pointers to signing
+ * operations for cryptographic providers.  It is passed through
+ * the crypto_ops(9S) structure when providers register with the
+ * kernel using crypto_register_provider(9F).
+ */
+typedef struct crypto_sign_ops {
+    int (*sign_init)(crypto_ctx_t *,
+        crypto_mechanism_t *, crypto_key_t *, crypto_spi_ctx_template_t,
+        crypto_req_handle_t);
+    int (*sign)(crypto_ctx_t *,
+        crypto_data_t *, crypto_data_t *, crypto_req_handle_t);
+    int (*sign_update)(crypto_ctx_t *,
+        crypto_data_t *, crypto_req_handle_t);
+    int (*sign_final)(crypto_ctx_t *,
+        crypto_data_t *, crypto_req_handle_t);
+    int (*sign_atomic)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_mechanism_t *, crypto_key_t *, crypto_data_t *,
+        crypto_data_t *, crypto_spi_ctx_template_t,
+        crypto_req_handle_t);
+    int (*sign_recover_init)(crypto_ctx_t *, crypto_mechanism_t *,
+        crypto_key_t *, crypto_spi_ctx_template_t,
+        crypto_req_handle_t);
+    int (*sign_recover)(crypto_ctx_t *,
+        crypto_data_t *, crypto_data_t *, crypto_req_handle_t);
+    int (*sign_recover_atomic)(crypto_provider_handle_t,
+        crypto_session_id_t, crypto_mechanism_t *, crypto_key_t *,
+        crypto_data_t *, crypto_data_t *, crypto_spi_ctx_template_t,
+        crypto_req_handle_t);
+} crypto_sign_ops_t;
+
+/*
+ * The crypto_verify_ops structure contains pointers to verify
+ * operations for cryptographic providers.  It is passed through
+ * the crypto_ops(9S) structure when providers register with the
+ * kernel using crypto_register_provider(9F).
+ */
+typedef struct crypto_verify_ops {
+    int (*verify_init)(crypto_ctx_t *,
+        crypto_mechanism_t *, crypto_key_t *, crypto_spi_ctx_template_t,
+        crypto_req_handle_t);
+    int (*verify)(crypto_ctx_t *,
+        crypto_data_t *, crypto_data_t *, crypto_req_handle_t);
+    int (*verify_update)(crypto_ctx_t *,
+        crypto_data_t *, crypto_req_handle_t);
+    int (*verify_final)(crypto_ctx_t *,
+        crypto_data_t *, crypto_req_handle_t);
+    int (*verify_atomic)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_mechanism_t *, crypto_key_t *, crypto_data_t *,
+        crypto_data_t *, crypto_spi_ctx_template_t,
+        crypto_req_handle_t);
+    int (*verify_recover_init)(crypto_ctx_t *, crypto_mechanism_t *,
+        crypto_key_t *, crypto_spi_ctx_template_t,
+        crypto_req_handle_t);
+    int (*verify_recover)(crypto_ctx_t *,
+        crypto_data_t *, crypto_data_t *, crypto_req_handle_t);
+    int (*verify_recover_atomic)(crypto_provider_handle_t,
+        crypto_session_id_t, crypto_mechanism_t *, crypto_key_t *,
+        crypto_data_t *, crypto_data_t *, crypto_spi_ctx_template_t,
+        crypto_req_handle_t);
+} crypto_verify_ops_t;
+
+/*
+ * The crypto_dual_ops structure contains pointers to dual
+ * cipher and sign/verify operations for cryptographic providers.
+ * It is passed through the crypto_ops(9S) structure when
+ * providers register with the kernel using
+ * crypto_register_provider(9F).
+ */
+typedef struct crypto_dual_ops {
+    int (*digest_encrypt_update)(
+        crypto_ctx_t *, crypto_ctx_t *, crypto_data_t *,
+        crypto_data_t *, crypto_req_handle_t);
+    int (*decrypt_digest_update)(
+        crypto_ctx_t *, crypto_ctx_t *, crypto_data_t *,
+        crypto_data_t *, crypto_req_handle_t);
+    int (*sign_encrypt_update)(
+        crypto_ctx_t *, crypto_ctx_t *, crypto_data_t *,
+        crypto_data_t *, crypto_req_handle_t);
+    int (*decrypt_verify_update)(
+        crypto_ctx_t *, crypto_ctx_t *, crypto_data_t *,
+        crypto_data_t *, crypto_req_handle_t);
+} crypto_dual_ops_t;
+
+/*
+ * The crypto_dual_cipher_mac_ops structure contains pointers to dual
+ * cipher and MAC operations for cryptographic providers.
+ * It is passed through the crypto_ops(9S) structure when
+ * providers register with the kernel using
+ * crypto_register_provider(9F).
+ */
+typedef struct crypto_dual_cipher_mac_ops {
+    int (*encrypt_mac_init)(crypto_ctx_t *,
+        crypto_mechanism_t *, crypto_key_t *, crypto_mechanism_t *,
+        crypto_key_t *, crypto_spi_ctx_template_t,
+        crypto_spi_ctx_template_t, crypto_req_handle_t);
+    int (*encrypt_mac)(crypto_ctx_t *,
+        crypto_data_t *, crypto_dual_data_t *, crypto_data_t *,
+        crypto_req_handle_t);
+    int (*encrypt_mac_update)(crypto_ctx_t *,
+        crypto_data_t *, crypto_dual_data_t *, crypto_req_handle_t);
+    int (*encrypt_mac_final)(crypto_ctx_t *,
+        crypto_dual_data_t *, crypto_data_t *, crypto_req_handle_t);
+    int (*encrypt_mac_atomic)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_mechanism_t *, crypto_key_t *, crypto_mechanism_t *,
+        crypto_key_t *, crypto_data_t *, crypto_dual_data_t *,
+        crypto_data_t *, crypto_spi_ctx_template_t,
+        crypto_spi_ctx_template_t, crypto_req_handle_t);
+
+    int (*mac_decrypt_init)(crypto_ctx_t *,
+        crypto_mechanism_t *, crypto_key_t *, crypto_mechanism_t *,
+        crypto_key_t *, crypto_spi_ctx_template_t,
+        crypto_spi_ctx_template_t, crypto_req_handle_t);
+    int (*mac_decrypt)(crypto_ctx_t *,
+        crypto_dual_data_t *, crypto_data_t *, crypto_data_t *,
+        crypto_req_handle_t);
+    int (*mac_decrypt_update)(crypto_ctx_t *,
+        crypto_dual_data_t *, crypto_data_t *, crypto_req_handle_t);
+    int (*mac_decrypt_final)(crypto_ctx_t *,
+        crypto_data_t *, crypto_data_t *, crypto_req_handle_t);
+    int (*mac_decrypt_atomic)(crypto_provider_handle_t,
+        crypto_session_id_t, crypto_mechanism_t *, crypto_key_t *,
+        crypto_mechanism_t *, crypto_key_t *, crypto_dual_data_t *,
+        crypto_data_t *, crypto_data_t *, crypto_spi_ctx_template_t,
+        crypto_spi_ctx_template_t, crypto_req_handle_t);
+    int (*mac_verify_decrypt_atomic)(crypto_provider_handle_t,
+        crypto_session_id_t, crypto_mechanism_t *, crypto_key_t *,
+        crypto_mechanism_t *, crypto_key_t *, crypto_dual_data_t *,
+        crypto_data_t *, crypto_data_t *, crypto_spi_ctx_template_t,
+        crypto_spi_ctx_template_t, crypto_req_handle_t);
+} crypto_dual_cipher_mac_ops_t;
+
+/*
+ * The crypto_random_number_ops structure contains pointers to random
+ * number operations for cryptographic providers.  It is passed through
+ * the crypto_ops(9S) structure when providers register with the
+ * kernel using crypto_register_provider(9F).
+ */
+typedef struct crypto_random_number_ops {
+    int (*seed_random)(crypto_provider_handle_t, crypto_session_id_t,
+        uchar_t *, size_t, uint_t, uint32_t, crypto_req_handle_t);
+    int (*generate_random)(crypto_provider_handle_t, crypto_session_id_t,
+        uchar_t *, size_t, crypto_req_handle_t);
+} crypto_random_number_ops_t;
+
+/*
+ * Flag values for seed_random.
+ */
+#define    CRYPTO_SEED_NOW        0x00000001
+
+/*
+ * The crypto_session_ops structure contains pointers to session
+ * operations for cryptographic providers.  It is passed through
+ * the crypto_ops(9S) structure when providers register with the
+ * kernel using crypto_register_provider(9F).
+ */
+typedef struct crypto_session_ops {
+    int (*session_open)(crypto_provider_handle_t, crypto_session_id_t *,
+        crypto_req_handle_t);
+    int (*session_close)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_req_handle_t);
+    int (*session_login)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_user_type_t, char *, size_t, crypto_req_handle_t);
+    int (*session_logout)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_req_handle_t);
+} crypto_session_ops_t;
+
+/*
+ * The crypto_object_ops structure contains pointers to object
+ * operations for cryptographic providers.  It is passed through
+ * the crypto_ops(9S) structure when providers register with the
+ * kernel using crypto_register_provider(9F).
+ */
+typedef struct crypto_object_ops {
+    int (*object_create)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_object_attribute_t *, uint_t, crypto_object_id_t *,
+        crypto_req_handle_t);
+    int (*object_copy)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_object_id_t, crypto_object_attribute_t *, uint_t,
+        crypto_object_id_t *, crypto_req_handle_t);
+    int (*object_destroy)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_object_id_t, crypto_req_handle_t);
+    int (*object_get_size)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_object_id_t, size_t *, crypto_req_handle_t);
+    int (*object_get_attribute_value)(crypto_provider_handle_t,
+        crypto_session_id_t, crypto_object_id_t,
+        crypto_object_attribute_t *, uint_t, crypto_req_handle_t);
+    int (*object_set_attribute_value)(crypto_provider_handle_t,
+        crypto_session_id_t, crypto_object_id_t,
+        crypto_object_attribute_t *,  uint_t, crypto_req_handle_t);
+    int (*object_find_init)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_object_attribute_t *, uint_t, void **,
+        crypto_req_handle_t);
+    int (*object_find)(crypto_provider_handle_t, void *,
+        crypto_object_id_t *, uint_t, uint_t *, crypto_req_handle_t);
+    int (*object_find_final)(crypto_provider_handle_t, void *,
+        crypto_req_handle_t);
+} crypto_object_ops_t;
+
+/*
+ * The crypto_key_ops structure contains pointers to key
+ * operations for cryptographic providers.  It is passed through
+ * the crypto_ops(9S) structure when providers register with the
+ * kernel using crypto_register_provider(9F).
+ */
+typedef struct crypto_key_ops {
+    int (*key_generate)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_mechanism_t *, crypto_object_attribute_t *, uint_t,
+        crypto_object_id_t *, crypto_req_handle_t);
+    int (*key_generate_pair)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_mechanism_t *, crypto_object_attribute_t *, uint_t,
+        crypto_object_attribute_t *, uint_t, crypto_object_id_t *,
+        crypto_object_id_t *, crypto_req_handle_t);
+    int (*key_wrap)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_mechanism_t *, crypto_key_t *, crypto_object_id_t *,
+        uchar_t *, size_t *, crypto_req_handle_t);
+    int (*key_unwrap)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_mechanism_t *, crypto_key_t *, uchar_t *, size_t *,
+        crypto_object_attribute_t *, uint_t,
+        crypto_object_id_t *, crypto_req_handle_t);
+    int (*key_derive)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_mechanism_t *, crypto_key_t *, crypto_object_attribute_t *,
+        uint_t, crypto_object_id_t *, crypto_req_handle_t);
+    int (*key_check)(crypto_provider_handle_t, crypto_mechanism_t *,
+        crypto_key_t *);
+} crypto_key_ops_t;
+
+/*
+ * The crypto_provider_management_ops structure contains pointers
+ * to management operations for cryptographic providers.  It is passed
+ * through the crypto_ops(9S) structure when providers register with the
+ * kernel using crypto_register_provider(9F).
+ */
+typedef struct crypto_provider_management_ops {
+    int (*ext_info)(crypto_provider_handle_t,
+        crypto_provider_ext_info_t *, crypto_req_handle_t);
+    int (*init_token)(crypto_provider_handle_t, char *, size_t,
+        char *, crypto_req_handle_t);
+    int (*init_pin)(crypto_provider_handle_t, crypto_session_id_t,
+        char *, size_t, crypto_req_handle_t);
+    int (*set_pin)(crypto_provider_handle_t, crypto_session_id_t,
+        char *, size_t, char *, size_t, crypto_req_handle_t);
+} crypto_provider_management_ops_t;
+
+typedef struct crypto_mech_ops {
+    int (*copyin_mechanism)(crypto_provider_handle_t,
+        crypto_mechanism_t *, crypto_mechanism_t *, int *, int);
+    int (*copyout_mechanism)(crypto_provider_handle_t,
+        crypto_mechanism_t *, crypto_mechanism_t *, int *, int);
+    int (*free_mechanism)(crypto_provider_handle_t, crypto_mechanism_t *);
+} crypto_mech_ops_t;
+
+typedef struct crypto_nostore_key_ops {
+    int (*nostore_key_generate)(crypto_provider_handle_t,
+        crypto_session_id_t, crypto_mechanism_t *,
+        crypto_object_attribute_t *, uint_t, crypto_object_attribute_t *,
+        uint_t, crypto_req_handle_t);
+    int (*nostore_key_generate_pair)(crypto_provider_handle_t,
+        crypto_session_id_t, crypto_mechanism_t *,
+        crypto_object_attribute_t *, uint_t, crypto_object_attribute_t *,
+        uint_t, crypto_object_attribute_t *, uint_t,
+        crypto_object_attribute_t *, uint_t, crypto_req_handle_t);
+    int (*nostore_key_derive)(crypto_provider_handle_t, crypto_session_id_t,
+        crypto_mechanism_t *, crypto_key_t *, crypto_object_attribute_t *,
+        uint_t, crypto_object_attribute_t *, uint_t, crypto_req_handle_t);
+} crypto_nostore_key_ops_t;
+
+/*
+ * crypto_fips140_ops provides a function for FIPS 140 Power-On Self Test for
+ * those providers that are part of the Cryptographic Framework bounday.  See
+ * crypto_fips140_ops(9s) for details.
+ */
+typedef struct crypto_fips140_ops {
+    void (*fips140_post)(int *);
+} crypto_fips140_ops_t;
+
+/*
+ * The crypto_ops(9S) structure contains the structures containing
+ * the pointers to functions implemented by cryptographic providers.
+ * It is specified as part of the crypto_provider_info(9S)
+ * supplied by a provider when it registers with the kernel
+ * by calling crypto_register_provider(9F).
+ */
+typedef struct crypto_ops_v1 {
+    crypto_control_ops_t            *co_control_ops;
+    crypto_digest_ops_t            *co_digest_ops;
+    crypto_cipher_ops_t            *co_cipher_ops;
+    crypto_mac_ops_t            *co_mac_ops;
+    crypto_sign_ops_t            *co_sign_ops;
+    crypto_verify_ops_t            *co_verify_ops;
+    crypto_dual_ops_t            *co_dual_ops;
+    crypto_dual_cipher_mac_ops_t        *co_dual_cipher_mac_ops;
+    crypto_random_number_ops_t        *co_random_ops;
+    crypto_session_ops_t            *co_session_ops;
+    crypto_object_ops_t            *co_object_ops;
+    crypto_key_ops_t            *co_key_ops;
+    crypto_provider_management_ops_t    *co_provider_ops;
+    crypto_ctx_ops_t            *co_ctx_ops;
+} crypto_ops_v1_t;
+
+typedef struct crypto_ops_v2 {
+    crypto_ops_v1_t                v1_ops;
+    crypto_mech_ops_t            *co_mech_ops;
+} crypto_ops_v2_t;
+
+typedef struct crypto_ops_v3 {
+    crypto_ops_v2_t                v2_ops;
+    crypto_nostore_key_ops_t        *co_nostore_key_ops;
+} crypto_ops_v3_t;
+
+typedef struct crypto_ops_v4 {
+    crypto_ops_v3_t                v3_ops;
+    crypto_fips140_ops_t            *co_fips140_ops;
+} crypto_ops_v4_t;
+
+typedef struct crypto_ops_v5 {
+    crypto_ops_v4_t                v4_ops;
+    boolean_t                co_uio_userspace_ok;
+} crypto_ops_v5_t;
+
+typedef struct crypto_ops {
+    union {
+        crypto_ops_v5_t    cou_v5;
+        crypto_ops_v4_t    cou_v4;
+        crypto_ops_v3_t    cou_v3;
+        crypto_ops_v2_t    cou_v2;
+        crypto_ops_v1_t    cou_v1;
+    } cou;
+} crypto_ops_t;
+
+#define    co_control_ops            cou.cou_v1.co_control_ops
+#define    co_digest_ops            cou.cou_v1.co_digest_ops
+#define    co_cipher_ops            cou.cou_v1.co_cipher_ops
+#define    co_mac_ops            cou.cou_v1.co_mac_ops
+#define    co_sign_ops            cou.cou_v1.co_sign_ops
+#define    co_verify_ops            cou.cou_v1.co_verify_ops
+#define    co_dual_ops            cou.cou_v1.co_dual_ops
+#define    co_dual_cipher_mac_ops        cou.cou_v1.co_dual_cipher_mac_ops
+#define    co_random_ops            cou.cou_v1.co_random_ops
+#define    co_session_ops            cou.cou_v1.co_session_ops
+#define    co_object_ops            cou.cou_v1.co_object_ops
+#define    co_key_ops            cou.cou_v1.co_key_ops
+#define    co_provider_ops            cou.cou_v1.co_provider_ops
+#define    co_ctx_ops            cou.cou_v1.co_ctx_ops
+#define    co_mech_ops            cou.cou_v2.co_mech_ops
+#define    co_nostore_key_ops        cou.cou_v3.co_nostore_key_ops
+#define    co_fips140_ops            cou.cou_v4.co_fips140_ops
+#define    co_uio_userspace_ok        cou.cou_v5.co_uio_userspace_ok
+
+/*
+ * Provider device specification passed during registration.
+ *
+ * Software providers set the pi_provider_type field of provider_info_t
+ * to CRYPTO_SW_PROVIDER, and set the pd_sw field of
+ * crypto_provider_dev_t to the address of their modlinkage.
+ *
+ * Hardware providers set the pi_provider_type field of provider_info_t
+ * to CRYPTO_HW_PROVIDER, and set the pd_hw field of
+ * crypto_provider_dev_t to the dev_info structure corresponding
+ * to the device instance being registered.
+ *
+ * Logical providers set the pi_provider_type field of provider_info_t
+ * to CRYPTO_LOGICAL_PROVIDER, and set the pd_hw field of
+ * crypto_provider_dev_t to the dev_info structure corresponding
+ * to the device instance being registered.
+ */
+
+typedef union crypto_provider_dev {
+    struct modlinkage    *pd_sw; /* for CRYPTO_SW_PROVIDER */
+    dev_info_t        *pd_hw; /* for CRYPTO_HW_PROVIDER */
+} crypto_provider_dev_t;
+
+/*
+ * The mechanism info structure crypto_mech_info_t contains a function group
+ * bit mask cm_func_group_mask. This field, of type crypto_func_group_t,
+ * specifies the provider entry point that can be used a particular
+ * mechanism. The function group mask is a combination of the following values.
+ */
+
+typedef uint32_t crypto_func_group_t;
+
+#endif /* _KERNEL */
+
+#define    CRYPTO_FG_ENCRYPT        0x00000001 /* encrypt_init() */
+#define    CRYPTO_FG_DECRYPT        0x00000002 /* decrypt_init() */
+#define    CRYPTO_FG_DIGEST        0x00000004 /* digest_init() */
+#define    CRYPTO_FG_SIGN            0x00000008 /* sign_init() */
+#define    CRYPTO_FG_SIGN_RECOVER        0x00000010 /* sign_recover_init() */
+#define    CRYPTO_FG_VERIFY        0x00000020 /* verify_init() */
+#define    CRYPTO_FG_VERIFY_RECOVER    0x00000040 /* verify_recover_init() */
+#define    CRYPTO_FG_GENERATE        0x00000080 /* key_generate() */
+#define    CRYPTO_FG_GENERATE_KEY_PAIR    0x00000100 /* key_generate_pair() */
+#define    CRYPTO_FG_WRAP            0x00000200 /* key_wrap() */
+#define    CRYPTO_FG_UNWRAP        0x00000400 /* key_unwrap() */
+#define    CRYPTO_FG_DERIVE        0x00000800 /* key_derive() */
+#define    CRYPTO_FG_MAC            0x00001000 /* mac_init() */
+#define    CRYPTO_FG_ENCRYPT_MAC        0x00002000 /* encrypt_mac_init() */
+#define    CRYPTO_FG_MAC_DECRYPT        0x00004000 /* decrypt_mac_init() */
+#define    CRYPTO_FG_ENCRYPT_ATOMIC    0x00008000 /* encrypt_atomic() */
+#define    CRYPTO_FG_DECRYPT_ATOMIC    0x00010000 /* decrypt_atomic() */
+#define    CRYPTO_FG_MAC_ATOMIC        0x00020000 /* mac_atomic() */
+#define    CRYPTO_FG_DIGEST_ATOMIC        0x00040000 /* digest_atomic() */
+#define    CRYPTO_FG_SIGN_ATOMIC        0x00080000 /* sign_atomic() */
+#define    CRYPTO_FG_SIGN_RECOVER_ATOMIC   0x00100000 /* sign_recover_atomic() */
+#define    CRYPTO_FG_VERIFY_ATOMIC        0x00200000 /* verify_atomic() */
+#define    CRYPTO_FG_VERIFY_RECOVER_ATOMIC    0x00400000 /* verify_recover_atomic() */
+#define    CRYPTO_FG_ENCRYPT_MAC_ATOMIC    0x00800000 /* encrypt_mac_atomic() */
+#define    CRYPTO_FG_MAC_DECRYPT_ATOMIC    0x01000000 /* mac_decrypt_atomic() */
+#define    CRYPTO_FG_RESERVED        0x80000000
+
+/*
+ * Maximum length of the pi_provider_description field of the
+ * crypto_provider_info structure.
+ */
+#define    CRYPTO_PROVIDER_DESCR_MAX_LEN    64
+
+#ifdef _KERNEL
+
+/* Bit mask for all the simple operations */
+#define    CRYPTO_FG_SIMPLEOP_MASK    (CRYPTO_FG_ENCRYPT | CRYPTO_FG_DECRYPT | \
+    CRYPTO_FG_DIGEST | CRYPTO_FG_SIGN | CRYPTO_FG_VERIFY | CRYPTO_FG_MAC | \
+    CRYPTO_FG_ENCRYPT_ATOMIC | CRYPTO_FG_DECRYPT_ATOMIC |        \
+    CRYPTO_FG_MAC_ATOMIC | CRYPTO_FG_DIGEST_ATOMIC | CRYPTO_FG_SIGN_ATOMIC | \
+    CRYPTO_FG_VERIFY_ATOMIC)
+
+/* Bit mask for all the dual operations */
+#define    CRYPTO_FG_MAC_CIPHER_MASK    (CRYPTO_FG_ENCRYPT_MAC |    \
+    CRYPTO_FG_MAC_DECRYPT | CRYPTO_FG_ENCRYPT_MAC_ATOMIC |         \
+    CRYPTO_FG_MAC_DECRYPT_ATOMIC)
+
+/* Add other combos to CRYPTO_FG_DUAL_MASK */
+#define    CRYPTO_FG_DUAL_MASK    CRYPTO_FG_MAC_CIPHER_MASK
+
+/*
+ * The crypto_mech_info structure specifies one of the mechanisms
+ * supported by a cryptographic provider. The pi_mechanisms field of
+ * the crypto_provider_info structure contains a pointer to an array
+ * of crypto_mech_info's.
+ */
+typedef struct crypto_mech_info {
+    crypto_mech_name_t    cm_mech_name;
+    crypto_mech_type_t    cm_mech_number;
+    crypto_func_group_t    cm_func_group_mask;
+    ssize_t            cm_min_key_length;
+    ssize_t            cm_max_key_length;
+    uint32_t        cm_mech_flags;
+} crypto_mech_info_t;
+
+/* Alias the old name to the new name for compatibility. */
+#define    cm_keysize_unit    cm_mech_flags
+
+/*
+ * crypto_kcf_provider_handle_t is a handle allocated by the kernel.
+ * It is returned after the provider registers with
+ * crypto_register_provider(), and must be specified by the provider
+ * when calling crypto_unregister_provider(), and
+ * crypto_provider_notification().
+ */
+typedef uint_t crypto_kcf_provider_handle_t;
+
+/*
+ * Provider information. Passed as argument to crypto_register_provider(9F).
+ * Describes the provider and its capabilities. Multiple providers can
+ * register for the same device instance. In this case, the same
+ * pi_provider_dev must be specified with a different pi_provider_handle.
+ */
+typedef struct crypto_provider_info_v1 {
+    uint_t                pi_interface_version;
+    char                *pi_provider_description;
+    crypto_provider_type_t        pi_provider_type;
+    crypto_provider_dev_t        pi_provider_dev;
+    crypto_provider_handle_t    pi_provider_handle;
+    crypto_ops_t            *pi_ops_vector;
+    uint_t                pi_mech_list_count;
+    crypto_mech_info_t        *pi_mechanisms;
+    uint_t                pi_logical_provider_count;
+    crypto_kcf_provider_handle_t    *pi_logical_providers;
+} crypto_provider_info_v1_t;
+
+typedef struct crypto_provider_info_v2 {
+    crypto_provider_info_v1_t    v1_info;
+    uint_t                pi_flags;
+} crypto_provider_info_v2_t;
+
+typedef struct crypto_provider_info {
+    union {
+        crypto_provider_info_v2_t piu_v2;
+        crypto_provider_info_v1_t piu_v1;
+    } piu;
+} crypto_provider_info_t;
+
+#define    pi_interface_version        piu.piu_v1.pi_interface_version
+#define    pi_provider_description        piu.piu_v1.pi_provider_description
+#define    pi_provider_type        piu.piu_v1.pi_provider_type
+#define    pi_provider_dev            piu.piu_v1.pi_provider_dev
+#define    pi_provider_handle        piu.piu_v1.pi_provider_handle
+#define    pi_ops_vector            piu.piu_v1.pi_ops_vector
+#define    pi_mech_list_count        piu.piu_v1.pi_mech_list_count
+#define    pi_mechanisms            piu.piu_v1.pi_mechanisms
+#define    pi_logical_provider_count    piu.piu_v1.pi_logical_provider_count
+#define    pi_logical_providers        piu.piu_v1.pi_logical_providers
+#define    pi_flags            piu.piu_v2.pi_flags
+
+/* hidden providers can only be accessed via a logical provider */
+#define    CRYPTO_HIDE_PROVIDER        0x00000001
+/*
+ * provider can not do multi-part digest (updates) and has a limit
+ * on maximum input data that it can digest. The provider sets
+ * this value in crypto_provider_ext_info_t by implementing
+ * the ext_info entry point in the co_provider_ops vector.
+ */
+#define    CRYPTO_HASH_NO_UPDATE        0x00000002
+/*
+ * provider can not do multi-part HMAC (updates) and has a limit
+ * on maximum input data that it can hmac. The provider sets
+ * this value in crypto_provider_ext_info_t by implementing
+ * the ext_info entry point in the co_provider_ops vector.
+ */
+#define    CRYPTO_HMAC_NO_UPDATE        0x00000008
+
+/* provider can handle the request without returning a CRYPTO_QUEUED */
+#define    CRYPTO_SYNCHRONOUS        0x00000004
+
+#define    CRYPTO_PIFLAGS_RESERVED2    0x40000000
+#define    CRYPTO_PIFLAGS_RESERVED1    0x80000000
+
+/*
+ * Provider status passed by a provider to crypto_provider_notification(9F)
+ * and returned by the provider_stauts(9E) entry point.
+ */
+#define    CRYPTO_PROVIDER_READY        0
+#define    CRYPTO_PROVIDER_BUSY        1
+#define    CRYPTO_PROVIDER_FAILED        2
+
+/*
+ * Functions exported by Solaris to cryptographic providers. Providers
+ * call these functions to register and unregister, notify the kernel
+ * of state changes, and notify the kernel when a asynchronous request
+ * completed.
+ */
+extern int crypto_register_provider(crypto_provider_info_t *,
+        crypto_kcf_provider_handle_t *);
+extern int crypto_unregister_provider(crypto_kcf_provider_handle_t);
+extern void crypto_provider_notification(crypto_kcf_provider_handle_t, uint_t);
+extern void crypto_op_notification(crypto_req_handle_t, int);
+extern int crypto_kmflag(crypto_req_handle_t);
+
+#endif    /* _KERNEL */
+
+#ifdef    __cplusplus
+}
+#endif
+
+#endif    /* _SYS_CRYPTO_SPI_H */
--- a/jdk/src/jdk.dev/share/classes/com/sun/tools/extcheck/ExtCheck.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,410 +0,0 @@
-/*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.tools.extcheck;
-
-import java.util.*;
-import java.net.MalformedURLException;
-import java.util.Vector;
-import java.io.*;
-import java.util.StringTokenizer;
-import java.net.URL;
-import java.util.jar.JarFile;
-import java.util.jar.JarEntry;
-import java.util.jar.Manifest;
-import java.util.jar.Attributes;
-import java.util.jar.Attributes.Name;
-import java.net.URLConnection;
-import java.security.Permission;
-import java.util.jar.*;
-import java.net.JarURLConnection;
-import sun.net.www.ParseUtil;
-
-/**
- * ExtCheck reports on clashes between a specified (target)
- * jar file and jar files already installed in the extensions
- * directory.
- *
- * @author Benedict Gomes
- * @since 1.2
- */
-
-public class ExtCheck {
-
-    private static final boolean DEBUG = false;
-
-    // The following strings hold the values of the version variables
-    // for the target jar file
-    private String targetSpecTitle;
-    private String targetSpecVersion;
-    private String targetSpecVendor;
-    private String targetImplTitle;
-    private String targetImplVersion;
-    private String targetImplVendor;
-    private String targetsealed;
-
-    /* Flag to indicate whether extra information should be dumped to stdout */
-    private boolean verboseFlag;
-
-    /*
-     * Create a new instance of the jar reporting tool for a particular
-     * targetFile.
-     * @param targetFile is the file to compare against.
-     * @param verbose indicates whether to dump filenames and manifest
-     *                information (on conflict) to the standard output.
-     */
-    static ExtCheck create(File targetFile, boolean verbose) {
-        return new ExtCheck(targetFile, verbose);
-    }
-
-    private ExtCheck(File targetFile, boolean verbose) {
-        verboseFlag = verbose;
-        investigateTarget(targetFile);
-    }
-
-
-    private void investigateTarget(File targetFile) {
-        verboseMessage("Target file:" + targetFile);
-        Manifest targetManifest = null;
-        try {
-            File canon = new File(targetFile.getCanonicalPath());
-            URL url = ParseUtil.fileToEncodedURL(canon);
-            if (url != null){
-                JarLoader loader = new JarLoader(url);
-                JarFile jarFile = loader.getJarFile();
-                targetManifest = jarFile.getManifest();
-            }
-        } catch (MalformedURLException e){
-            error("Malformed URL ");
-        } catch (IOException e) {
-            error("IO Exception ");
-        }
-        if (targetManifest == null)
-            error("No manifest available in "+targetFile);
-        Attributes attr = targetManifest.getMainAttributes();
-        if (attr != null) {
-            targetSpecTitle   = attr.getValue(Name.SPECIFICATION_TITLE);
-            targetSpecVersion = attr.getValue(Name.SPECIFICATION_VERSION);
-            targetSpecVendor  = attr.getValue(Name.SPECIFICATION_VENDOR);
-            targetImplTitle   = attr.getValue(Name.IMPLEMENTATION_TITLE);
-            targetImplVersion = attr.getValue(Name.IMPLEMENTATION_VERSION);
-            targetImplVendor  = attr.getValue(Name.IMPLEMENTATION_VENDOR);
-            targetsealed      = attr.getValue(Name.SEALED);
-        } else {
-            error("No attributes available in the manifest");
-        }
-        if (targetSpecTitle == null)
-            error("The target file does not have a specification title");
-        if (targetSpecVersion == null)
-            error("The target file does not have a specification version");
-        verboseMessage("Specification title:" + targetSpecTitle);
-        verboseMessage("Specification version:" + targetSpecVersion);
-        if (targetSpecVendor != null)
-            verboseMessage("Specification vendor:" + targetSpecVendor);
-        if (targetImplVersion != null)
-            verboseMessage("Implementation version:" + targetImplVersion);
-        if (targetImplVendor != null)
-            verboseMessage("Implementation vendor:" + targetImplVendor);
-        verboseMessage("");
-    }
-
-    /**
-     * Verify that none of the jar files in the install directory
-     * has the same specification-title and the same or a newer
-     * specification-version.
-     *
-     * @return Return true if the target jar file is newer
-     *        than any installed jar file with the same specification-title,
-     *        otherwise return false
-     */
-    boolean checkInstalledAgainstTarget(){
-        String s = System.getProperty("java.ext.dirs");
-        File [] dirs;
-        if (s != null) {
-            StringTokenizer st =
-                new StringTokenizer(s, File.pathSeparator);
-            int count = st.countTokens();
-            dirs = new File[count];
-            for (int i = 0; i < count; i++) {
-                dirs[i] = new File(st.nextToken());
-            }
-        } else {
-            dirs = new File[0];
-        }
-
-        boolean result = true;
-        for (int i = 0; i < dirs.length; i++) {
-            String[] files = dirs[i].list();
-            if (files != null) {
-                for (int j = 0; j < files.length; j++) {
-                    try {
-                        File f = new File(dirs[i],files[j]);
-                        File canon = new File(f.getCanonicalPath());
-                        URL url = ParseUtil.fileToEncodedURL(canon);
-                        if (url != null){
-                            result = result && checkURLRecursively(1,url);
-                        }
-                    } catch (MalformedURLException e){
-                        error("Malformed URL");
-                    } catch (IOException e) {
-                        error("IO Exception");
-                    }
-                }
-            }
-        }
-        if (result) {
-            generalMessage("No conflicting installed jar found.");
-        } else {
-            generalMessage("Conflicting installed jar found. "
-                           + " Use -verbose for more information.");
-        }
-        return result;
-    }
-
-    /**
-     * Recursively verify that a jar file, and any urls mentioned
-     * in its class path, do not conflict with the target jar file.
-     *
-     * @param indent is the current nesting level
-     * @param url is the path to the jar file being checked.
-     * @return true if there is no newer URL, otherwise false
-     */
-    private boolean checkURLRecursively(int indent, URL url)
-        throws IOException
-    {
-        verboseMessage("Comparing with " + url);
-        JarLoader jarloader = new JarLoader(url);
-        JarFile j = jarloader.getJarFile();
-        Manifest man = j.getManifest();
-        if (man != null) {
-            Attributes attr = man.getMainAttributes();
-            if (attr != null){
-                String title   = attr.getValue(Name.SPECIFICATION_TITLE);
-                String version = attr.getValue(Name.SPECIFICATION_VERSION);
-                String vendor  = attr.getValue(Name.SPECIFICATION_VENDOR);
-                String implTitle   = attr.getValue(Name.IMPLEMENTATION_TITLE);
-                String implVersion
-                    = attr.getValue(Name.IMPLEMENTATION_VERSION);
-                String implVendor  = attr.getValue(Name.IMPLEMENTATION_VENDOR);
-                String sealed      = attr.getValue(Name.SEALED);
-                if (title != null){
-                    if (title.equals(targetSpecTitle)){
-                        if (version != null){
-                            if (version.equals(targetSpecVersion) ||
-                                isNotOlderThan(version,targetSpecVersion)){
-                                verboseMessage("");
-                                verboseMessage("CONFLICT DETECTED ");
-                                verboseMessage("Conflicting file:"+ url);
-                                verboseMessage("Installed Version:" +
-                                               version);
-                                if (implTitle != null)
-                                    verboseMessage("Implementation Title:"+
-                                                   implTitle);
-                                if (implVersion != null)
-                                    verboseMessage("Implementation Version:"+
-                                                   implVersion);
-                                if (implVendor != null)
-                                    verboseMessage("Implementation Vendor:"+
-                                                   implVendor);
-                                return false;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        boolean result = true;
-        URL[] loaderList = jarloader.getClassPath();
-        if (loaderList != null) {
-            for(int i=0; i < loaderList.length; i++){
-                if (url != null){
-                    boolean res =  checkURLRecursively(indent+1,loaderList[i]);
-                    result = res && result;
-                }
-            }
-        }
-        return result;
-    }
-
-    /**
-     *  See comment in method java.lang.Package.isCompatibleWith.
-     *  Return true if already is not older than target. i.e. the
-     *  target file may be superseded by a file already installed
-     */
-    private boolean isNotOlderThan(String already,String target)
-        throws NumberFormatException
-    {
-            if (already == null || already.length() < 1) {
-            throw new NumberFormatException("Empty version string");
-        }
-
-            // Until it matches scan and compare numbers
-            StringTokenizer dtok = new StringTokenizer(target, ".", true);
-            StringTokenizer stok = new StringTokenizer(already, ".", true);
-        while (dtok.hasMoreTokens() || stok.hasMoreTokens()) {
-            int dver;
-            int sver;
-            if (dtok.hasMoreTokens()) {
-                dver = Integer.parseInt(dtok.nextToken());
-            } else
-                dver = 0;
-
-            if (stok.hasMoreTokens()) {
-                sver = Integer.parseInt(stok.nextToken());
-            } else
-                sver = 0;
-
-                if (sver < dver)
-                        return false;                // Known to be incompatible
-                if (sver > dver)
-                        return true;                // Known to be compatible
-
-                // Check for and absorb separators
-                if (dtok.hasMoreTokens())
-                        dtok.nextToken();
-                if (stok.hasMoreTokens())
-                        stok.nextToken();
-                // Compare next component
-            }
-            // All components numerically equal
-        return true;
-    }
-
-
-    /**
-     * Prints out message if the verboseFlag is set
-     */
-    void verboseMessage(String message){
-        if (verboseFlag) {
-            System.err.println(message);
-        }
-    }
-
-    void generalMessage(String message){
-        System.err.println(message);
-    }
-
-    /**
-     * Throws a RuntimeException with a message describing the error.
-     */
-    static void error(String message) throws RuntimeException {
-        throw new RuntimeException(message);
-    }
-
-
-    /**
-     * Inner class used to represent a loader of resources and classes
-     * from a base URL. Somewhat modified version of code in
-     * sun.misc.URLClassPath.JarLoader
-     */
-    private static class JarLoader {
-        private final URL base;
-        private JarFile jar;
-        private URL csu;
-
-        /*
-         * Creates a new Loader for the specified URL.
-         */
-        JarLoader(URL url) {
-            String urlName = url + "!/";
-            URL tmpBaseURL = null;
-            try {
-                tmpBaseURL = new URL("jar","",urlName);
-                jar = findJarFile(url);
-                csu = url;
-            } catch (MalformedURLException e) {
-                ExtCheck.error("Malformed url "+urlName);
-            } catch (IOException e) {
-                ExtCheck.error("IO Exception occurred");
-            }
-            base = tmpBaseURL;
-
-        }
-
-        /*
-         * Returns the base URL for this Loader.
-         */
-        URL getBaseURL() {
-            return base;
-        }
-
-        JarFile getJarFile() {
-            return jar;
-        }
-
-        private JarFile findJarFile(URL url) throws IOException {
-             // Optimize case where url refers to a local jar file
-             if ("file".equals(url.getProtocol())) {
-                 String path = url.getFile().replace('/', File.separatorChar);
-                 File file = new File(path);
-                 if (!file.exists()) {
-                     throw new FileNotFoundException(path);
-                 }
-                 return new JarFile(path);
-             }
-             URLConnection uc = getBaseURL().openConnection();
-             //uc.setRequestProperty(USER_AGENT_JAVA_VERSION, JAVA_VERSION);
-             return ((JarURLConnection)uc).getJarFile();
-         }
-
-
-        /*
-         * Returns the JAR file local class path, or null if none.
-         */
-        URL[] getClassPath() throws IOException {
-            Manifest man = jar.getManifest();
-            if (man != null) {
-                Attributes attr = man.getMainAttributes();
-                if (attr != null) {
-                    String value = attr.getValue(Name.CLASS_PATH);
-                    if (value != null) {
-                        return parseClassPath(csu, value);
-                    }
-                }
-            }
-            return null;
-        }
-
-        /*
-         * Parses value of the Class-Path manifest attribute and returns
-         * an array of URLs relative to the specified base URL.
-         */
-        private URL[] parseClassPath(URL base, String value)
-            throws MalformedURLException
-        {
-            StringTokenizer st = new StringTokenizer(value);
-            URL[] urls = new URL[st.countTokens()];
-            int i = 0;
-            while (st.hasMoreTokens()) {
-                String path = st.nextToken();
-                urls[i] = new URL(base, path);
-                i++;
-            }
-            return urls;
-        }
-    }
-
-
-}
--- a/jdk/src/jdk.dev/share/classes/com/sun/tools/extcheck/Main.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.tools.extcheck;
-
-import java.io.*;
-
-/**
- * Main program of extcheck
- */
-
-public final class Main {
-    public static final String INSUFFICIENT = "Insufficient number of arguments";
-    public static final String MISSING = "Missing <jar file> argument";
-    public static final String DOES_NOT_EXIST = "Jarfile does not exist: ";
-    public static final String EXTRA = "Extra command line argument: ";
-
-    /**
-     * Terminates with one of the following codes
-     *  1 A newer (or same version) jar file is already installed
-     *  0 No newer jar file was found
-     *  -1 An internal error occurred
-     */
-    public static void main(String args[]) {
-        try {
-            realMain(args);
-        } catch (Exception ex) {
-            System.err.println(ex.getMessage());
-            System.exit(-1);
-        }
-    }
-
-    public static void realMain(String[] args) throws Exception {
-        if (args.length < 1) {
-            usage(INSUFFICIENT);
-        }
-        int argIndex = 0;
-        boolean verboseFlag = false;
-        if (args[argIndex].equals("-verbose")) {
-            verboseFlag = true;
-            argIndex++;
-            if (argIndex >= args.length) {
-                usage(MISSING);
-            }
-        }
-        String jarName = args[argIndex];
-        argIndex++;
-        File jarFile = new File(jarName);
-        if (!jarFile.exists()){
-            usage(DOES_NOT_EXIST + jarName);
-        }
-        if (argIndex < args.length) {
-            usage(EXTRA + args[argIndex]);
-        }
-        ExtCheck jt = ExtCheck.create(jarFile,verboseFlag);
-        boolean result = jt.checkInstalledAgainstTarget();
-        if (result) {
-            System.exit(0);
-        } else {
-            System.exit(1);
-        }
-    }
-
-    private static void usage(String msg) throws Exception {
-        throw new Exception(msg + "\nUsage: extcheck [-verbose] <jar file>");
-    }
-}
-
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/BerDecoder.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,757 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-
-/**
- * The <CODE>BerDecoder</CODE> class is used for decoding
- * BER-encoded data.
- *
- * A <CODE>BerDecoder</CODE> needs to be set up with the byte string containing
- * the encoding. It maintains a current position in the byte string.
- *
- * Methods allows to fetch integer, string, OID, etc., from the current
- * position. After a fetch the current position is moved forward.
- *
- * A fetch throws a <CODE>BerException</CODE> if the encoding is not of the
- * expected type.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- *
- * @since 1.5
- */
-
-public class BerDecoder {
-
-  /**
-  * Constructs a new decoder and attaches it to the specified byte string.
-  *
-  * @param b The byte string containing the encoded data.
-  */
-
-  public BerDecoder(byte b[]) {
-    bytes = b ;
-    reset() ;
-  }
-
-  public void reset() {
-    next = 0 ;
-    stackTop = 0 ;
-  }
-
-  /**
-  * Fetch an integer.
-  *
-  * @return The decoded integer.
-  *
-  * @exception BerException Current position does not point to an integer.
-  */
-
-  public int fetchInteger() throws BerException {
-    return fetchInteger(IntegerTag) ;
-  }
-
-
-  /**
-  * Fetch an integer with the specified tag.
-  *
-  * @param tag The expected tag.
-  *
-  * @return The decoded integer.
-  *
-  * @exception BerException Current position does not point to an integer
-  *                         or the tag is not the expected one.
-  */
-
-  public int fetchInteger(int tag) throws BerException {
-    int result = 0 ;
-    final int backup = next ;
-    try {
-      if (fetchTag() != tag) {
-        throw new BerException() ;
-      }
-      result = fetchIntegerValue() ;
-    }
-    catch(BerException e) {
-      next = backup ;
-      throw e ;
-    }
-
-    return result ;
-  }
-
-
-
-  /**
-  * Fetch an integer and return a long value.
-  *
-  * @return The decoded integer.
-  *
-  * @exception BerException Current position does not point to an integer.
-  */
-
-  public long fetchIntegerAsLong() throws BerException {
-    return fetchIntegerAsLong(IntegerTag) ;
-  }
-
-
-  /**
-  * Fetch an integer with the specified tag and return a long value.
-  *
-  * @param tag The expected tag.
-  *
-  * @return The decoded integer.
-  *
-  * @exception BerException Current position does not point to an integer
-  *                         or the tag is not the expected one.
-  */
-
-  public long fetchIntegerAsLong(int tag) throws BerException {
-    long result = 0 ;
-    final int backup = next ;
-    try {
-      if (fetchTag() != tag) {
-        throw new BerException() ;
-      }
-      result = fetchIntegerValueAsLong() ;
-    }
-    catch(BerException e) {
-      next = backup ;
-      throw e ;
-    }
-
-    return result ;
-  }
-
-
-
-  /**
-  * Fetch an octet string.
-  *
-  * @return The decoded string.
-  *
-  * @exception BerException Current position does not point to an octet string.
-  */
-
-  public byte[] fetchOctetString() throws BerException {
-    return fetchOctetString(OctetStringTag) ;
-  }
-
-
-  /**
-  * Fetch an octet string with a specified tag.
-  *
-  * @param tag The expected tag.
-  *
-  * @return The decoded string.
-  *
-  * @exception BerException Current position does not point to an octet string
-  *                         or the tag is not the expected one.
-  */
-
-  public byte[] fetchOctetString(int tag) throws BerException {
-    byte[] result = null ;
-    final int backup = next ;
-    try {
-      if (fetchTag() != tag) {
-        throw new BerException() ;
-      }
-      result = fetchStringValue() ;
-    }
-    catch(BerException e) {
-      next = backup ;
-      throw e ;
-    }
-
-    return result ;
-  }
-
-
-  /**
-  * Fetch an object identifier.
-  *
-  * @return The decoded object identifier as an array of long.
-  */
-
-  public long[] fetchOid() throws BerException {
-    return fetchOid(OidTag) ;
-  }
-
-
-  /**
-  * Fetch an object identifier with a specified tag.
-  *
-  * @param tag The expected tag.
-  *
-  * @return The decoded object identifier as an array of long.
-  *
-  * @exception BerException Current position does not point to an oid
-  *                         or the tag is not the expected one.
-  */
-
-  public long[] fetchOid(int tag) throws BerException {
-    long[] result = null ;
-    final int backup = next ;
-    try {
-      if (fetchTag() != tag) {
-        throw new BerException() ;
-      }
-      result = fetchOidValue() ;
-    }
-    catch(BerException e) {
-      next = backup ;
-      throw e ;
-    }
-
-    return result ;
-  }
-
-
-  /**
-  * Fetch a <CODE>NULL</CODE> value.
-  *
-  * @exception BerException Current position does not point to <CODE>NULL</CODE> value.
-  */
-
-  public void fetchNull() throws BerException {
-    fetchNull(NullTag) ;
-  }
-
-
-  /**
-  * Fetch a <CODE>NULL</CODE> value with a specified tag.
-  *
-  * @param tag The expected tag.
-  *
-  * @exception BerException Current position does not point to
-  *            <CODE>NULL</CODE> value or the tag is not the expected one.
-  */
-
-  public void fetchNull(int tag) throws BerException {
-    final int backup = next ;
-    try {
-      if (fetchTag() != tag) {
-        throw new BerException() ;
-      }
-      final int length = fetchLength();
-      if (length != 0) throw new BerException();
-    }
-    catch(BerException e) {
-      next = backup ;
-      throw e ;
-    }
-  }
-
-
-
-  /**
-  * Fetch an <CODE>ANY</CODE> value. In fact, this method does not decode anything
-  * it simply returns the next TLV as an array of bytes.
-  *
-  * @return The TLV as a byte array.
-  *
-  * @exception BerException The next TLV is really badly encoded...
-  */
-
-  public byte[] fetchAny() throws BerException {
-    byte[] result = null ;
-    final int backup = next ;
-    try {
-      final int tag = fetchTag() ;
-      final int contentLength = fetchLength() ;
-      if (contentLength < 0) throw new BerException() ;
-      final int tlvLength = next + contentLength - backup ;
-      if (contentLength > (bytes.length - next))
-          throw new IndexOutOfBoundsException("Decoded length exceeds buffer");
-      final byte[] data = new byte[tlvLength] ;
-      java.lang.System.arraycopy(bytes,backup,data,0,tlvLength);
-      // for (int i = 0 ; i < tlvLength ; i++) {
-      //  data[i] = bytes[backup + i] ;
-      // }
-      next = next + contentLength ;
-      result = data;
-    }
-    catch(IndexOutOfBoundsException e) {
-      next = backup ;
-      throw new BerException() ;
-    }
-    // catch(Error e) {
-    //    debug("fetchAny: Error decoding BER: " + e);
-    //    throw e;
-    // }
-
-    return result ;
-  }
-
-
-  /**
-  * Fetch an <CODE>ANY</CODE> value with a specific tag.
-  *
-  * @param tag The expected tag.
-  *
-  * @return The TLV as a byte array.
-  *
-  * @exception BerException The next TLV is really badly encoded...
-  */
-
-  public byte[] fetchAny(int tag) throws BerException {
-    if (getTag() != tag) {
-      throw new BerException() ;
-    }
-    return fetchAny() ;
-  }
-
-
-
-  /**
-  * Fetch a sequence header.
-  * The decoder computes the end position of the sequence and push it
-  * on its stack.
-  *
-  * @exception BerException Current position does not point to a sequence header.
-  */
-
-  public void openSequence() throws BerException {
-    openSequence(SequenceTag) ;
-  }
-
-
-  /**
-  * Fetch a sequence header with a specific tag.
-  *
-  * @param tag The expected tag.
-  *
-  * @exception BerException Current position does not point to a sequence header
-  *                         or the tag is not the expected one.
-  */
-
-  public void openSequence(int tag) throws BerException {
-    final int backup = next ;
-    try {
-      if (fetchTag() != tag) {
-        throw new BerException() ;
-      }
-      final int l = fetchLength() ;
-      if (l < 0) throw new BerException();
-      if (l > (bytes.length - next)) throw new BerException();
-      stackBuf[stackTop++] = next + l ;
-    }
-    catch(BerException e) {
-      next = backup ;
-      throw e ;
-    }
-  }
-
-
-  /**
-  * Close a sequence.
-  * The decode pull the stack and verifies that the current position
-  * matches with the calculated end of the sequence. If not it throws
-  * an exception.
-  *
-  * @exception BerException The sequence is not expected to finish here.
-  */
-
-  public void closeSequence() throws BerException {
-    if (stackBuf[stackTop - 1] == next) {
-      stackTop-- ;
-    }
-    else {
-      throw new BerException() ;
-    }
-  }
-
-
-  /**
-  * Return <CODE>true</CODE> if the end of the current sequence is not reached.
-  * When this method returns <CODE>false</CODE>, <CODE>closeSequence</CODE> can (and must) be
-  * invoked.
-  *
-  * @return <CODE>true</CODE> if there is still some data in the sequence.
-  */
-
-  public boolean cannotCloseSequence() {
-    return (next < stackBuf[stackTop - 1]) ;
-  }
-
-
-  /**
-  * Get the tag of the data at the current position.
-  * Current position is unchanged.
-  *
-  * @return The next tag.
-  */
-
-  public int getTag() throws BerException {
-    int result = 0 ;
-    final int backup = next ;
-    try {
-      result = fetchTag() ;
-    }
-    finally {
-      next = backup ;
-    }
-
-    return result ;
-  }
-
-
-
-  public String toString() {
-    final StringBuffer result = new StringBuffer(bytes.length * 2) ;
-    for (int i = 0 ; i < bytes.length ; i++) {
-      final int b = (bytes[i] > 0) ? bytes[i] : bytes[i] + 256 ;
-      if (i == next) {
-        result.append("(") ;
-      }
-      result.append(Character.forDigit(b / 16, 16)) ;
-      result.append(Character.forDigit(b % 16, 16)) ;
-      if (i == next) {
-        result.append(")") ;
-      }
-    }
-    if (bytes.length == next) {
-      result.append("()") ;
-    }
-
-    return new String(result) ;
-  }
-
-
-  //
-  // Some standard tags
-  //
-  public final static int BooleanTag      = 1 ;
-  public final static int IntegerTag      = 2 ;
-  public final static int OctetStringTag  = 4 ;
-  public final static int NullTag          = 5 ;
-  public final static int OidTag          = 6 ;
-  public final static int SequenceTag      = 0x30 ;
-
-
-
-
-  ////////////////////////// PRIVATE ///////////////////////////////
-
-
-
-  /**
-  * Fetch a tag and move the current position forward.
-  *
-  * @return The tag
-  */
-
-  private final int fetchTag() throws BerException {
-    int result = 0 ;
-    final int backup = next ;
-
-    try {
-      final byte b0 = bytes[next++] ;
-      result = (b0 >= 0) ? b0 : b0 + 256 ;
-      if ((result & 31) == 31) {
-        while ((bytes[next] & 128) != 0) {
-          result = result << 7 ;
-          result = result | (bytes[next++] & 127);
-        }
-      }
-    }
-    catch(IndexOutOfBoundsException e) {
-      next = backup ;
-      throw new BerException() ;
-    }
-
-    return result ;
-  }
-
-
-  /**
-  * Fetch a length and move the current position forward.
-  *
-  * @return The length
-  */
-
-  private final int fetchLength() throws BerException {
-    int result = 0 ;
-    final int backup = next ;
-
-    try {
-      final byte b0 = bytes[next++] ;
-      if (b0 >= 0) {
-        result = b0 ;
-      }
-      else {
-        for (int c = 128 + b0 ; c > 0 ; c--) {
-          final byte bX = bytes[next++] ;
-          result = result << 8 ;
-          result = result | ((bX >= 0) ? bX : bX+256) ;
-        }
-      }
-    }
-    catch(IndexOutOfBoundsException e) {
-      next = backup ;
-      throw new BerException() ;
-    }
-
-    return result ;
-  }
-
-
-  /**
-  * Fetch an integer value and move the current position forward.
-  *
-  * @return The integer
-  */
-
-  private int fetchIntegerValue() throws BerException {
-    int result = 0 ;
-    final int backup = next ;
-
-    try {
-      final int length = fetchLength() ;
-      if (length <= 0) throw new BerException() ;
-      if (length > (bytes.length - next)) throw
-          new IndexOutOfBoundsException("Decoded length exceeds buffer");
-      final int end = next + length ;
-      result = bytes[next++] ;
-      while (next < end) {
-        final byte b = bytes[next++] ;
-        if (b < 0) {
-          result = (result << 8) | (256 + b) ;
-        }
-        else {
-          result = (result << 8) | b ;
-        }
-      }
-    }
-    catch(BerException e) {
-      next = backup ;
-      throw e ;
-    }
-    catch(IndexOutOfBoundsException e) {
-      next = backup ;
-      throw new BerException() ;
-    }
-    catch(ArithmeticException e) {
-      next = backup ;
-      throw new BerException() ;
-    }
-    return result ;
-  }
-
-
-  /**
-  * Fetch an integer value and return a long value.
-  * FIX ME: someday we could have only on fetchIntegerValue() which always
-  * returns a long value.
-  *
-  * @return The integer
-  */
-
-  private final long fetchIntegerValueAsLong() throws BerException {
-    long result = 0 ;
-    final int backup = next ;
-
-    try {
-      final int length = fetchLength() ;
-      if (length <= 0) throw new BerException() ;
-      if (length > (bytes.length - next)) throw
-          new IndexOutOfBoundsException("Decoded length exceeds buffer");
-
-      final int end = next + length ;
-      result = bytes[next++] ;
-      while (next < end) {
-        final byte b = bytes[next++] ;
-        if (b < 0) {
-          result = (result << 8) | (256 + b) ;
-        }
-        else {
-          result = (result << 8) | b ;
-        }
-      }
-    }
-    catch(BerException e) {
-      next = backup ;
-      throw e ;
-    }
-    catch(IndexOutOfBoundsException e) {
-      next = backup ;
-      throw new BerException() ;
-    }
-    catch(ArithmeticException e) {
-      next = backup ;
-      throw new BerException() ;
-    }
-    return result ;
-  }
-
-
-  /**
-  * Fetch a byte string and move the current position forward.
-  *
-  * @return The byte string
-  */
-
-  private byte[] fetchStringValue() throws BerException {
-    byte[] result = null ;
-    final int backup = next ;
-
-    try {
-      final int length = fetchLength() ;
-      if (length < 0) throw new BerException() ;
-      if (length > (bytes.length - next))
-          throw new IndexOutOfBoundsException("Decoded length exceeds buffer");
-      final byte data[] = new byte[length] ;
-      java.lang.System.arraycopy(bytes,next,data,0,length);
-      next += length;
-      //      int i = 0 ;
-      //      while (i < length) {
-      //          result[i++] = bytes[next++] ;
-      //      }
-      result = data;
-    }
-    catch(BerException e) {
-        next = backup ;
-      throw e ;
-    }
-    catch(IndexOutOfBoundsException e) {
-      next = backup ;
-      throw new BerException() ;
-    }
-    catch(ArithmeticException e) {
-      next = backup ;
-      throw new BerException() ;
-    }
-    // catch(Error e) {
-    //  debug("fetchStringValue: Error decoding BER: " + e);
-    //  throw e;
-    // }
-
-    return result ;
-  }
-
-
-
-  /**
-  * Fetch an oid and move the current position forward.
-  *
-  * @return The oid
-  */
-
-  private final long[] fetchOidValue() throws BerException {
-    long[] result = null ;
-    final int backup = next ;
-
-    try {
-      final int length = fetchLength() ;
-      if (length <= 0) throw new BerException() ;
-      if (length > (bytes.length - next))
-          throw new IndexOutOfBoundsException("Decoded length exceeds buffer");
-      // Count how many bytes have their 8th bit to 0
-      // -> this gives the number of components in the oid
-      int subidCount = 2 ;
-      for (int i = 1 ; i < length ; i++) {
-        if ((bytes[next + i] & 0x80) == 0) {
-          subidCount++ ;
-        }
-      }
-      final int datalen = subidCount;
-      final long[] data = new long[datalen];
-      final byte b0 = bytes[next++] ;
-
-      // bugId 4641746
-      // The 8th bit of the first byte should always be set to 0
-      if (b0 < 0) throw new BerException();
-
-      // bugId 4641746
-      // The first sub Id cannot be greater than 2
-      final long lb0 =  b0 / 40 ;
-      if (lb0 > 2) throw new BerException();
-
-      final long lb1 = b0 % 40;
-      data[0] = lb0 ;
-      data[1] = lb1 ;
-      int i = 2 ;
-      while (i < datalen) {
-        long subid = 0 ;
-        byte b = bytes[next++] ;
-        while ((b & 0x80) != 0) {
-          subid = (subid << 7) | (b & 0x7f) ;
-          // bugId 4654674
-          if (subid < 0) throw new BerException();
-          b = bytes[next++] ;
-        }
-        subid = (subid << 7) | b ;
-        // bugId 4654674
-        if (subid < 0) throw new BerException();
-        data[i++] = subid ;
-      }
-      result = data;
-    }
-    catch(BerException e) {
-      next = backup ;
-      throw e ;
-    }
-    catch(IndexOutOfBoundsException e) {
-      next = backup ;
-      throw new BerException() ;
-    }
-    // catch(Error e) {
-    //  debug("fetchOidValue: Error decoding BER: " + e);
-    //  throw e;
-    // }
-
-    return result ;
-  }
-
-    // private static final void debug(String str) {
-    //   System.out.println(str);
-    // }
-
-  //
-  // This is the byte array containing the encoding.
-  //
-  private final byte bytes[];
-
-  //
-  // This is the current location. It is the next byte
-  // to be decoded. It's an index in bytes[].
-  //
-  private int next = 0 ;
-
-  //
-  // This is the stack where end of sequences are kept.
-  // A value is computed and pushed in it each time openSequence()
-  // is invoked.
-  // A value is pulled and checked each time closeSequence() is called.
-  //
-  private final int stackBuf[] = new int[200] ;
-  private int stackTop = 0 ;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/BerEncoder.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,477 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-/**
- * The <CODE>BerEncoder</CODE> class is used for encoding data using BER.
- *
- * A <CODE>BerEncoder</CODE> needs to be set up with a byte buffer. The encoded
- * data are stored in this byte buffer.
- * <P>
- * NOTE : the buffer is filled from end to start. This means the caller
- * needs to encode its data in the reverse order.
- *
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- *
- * @since 1.5
- */
-
-public class BerEncoder {
-
-  /**
-  * Constructs a new encoder and attaches it to the specified byte string.
-  *
-  * @param b The byte string containing the encoded data.
-  */
-
-  public BerEncoder(byte b[]) {
-    bytes = b ;
-    start = b.length ;
-    stackTop = 0 ;
-  }
-
-
-  /**
-  * Trim the encoding data and returns the length of the encoding.
-  *
-  * The encoder does backward encoding : so the bytes buffer is
-  * filled from end to start. The encoded data must be shift before
-  * the buffer can be used. This is the purpose of the <CODE>trim</CODE> method.
-  *
-  * After a call to the <CODE>trim</CODE> method, the encoder is reinitialized and <CODE>putXXX</CODE>
-  * overwrite any existing encoded data.
-  *
-  * @return The length of the encoded data.
-  */
-
-  public int trim() {
-    final int result = bytes.length - start ;
-
-    // for (int i = start ; i < bytes.length ; i++) {
-    //  bytes[i-start] = bytes[i] ;
-    // }
-    if (result > 0)
-        java.lang.System.arraycopy(bytes,start,bytes,0,result);
-
-    start = bytes.length ;
-    stackTop = 0 ;
-
-    return result ;
-  }
-
-  /**
-  * Put an integer.
-  *
-  * @param v The integer to encode.
-  */
-
-  public void putInteger(int v) {
-    putInteger(v, IntegerTag) ;
-  }
-
-
-  /**
-  * Put an integer with the specified tag.
-  *
-  * @param v The integer to encode.
-  * @param tag The tag to encode.
-  */
-
-  public void putInteger(int v, int tag) {
-    putIntegerValue(v) ;
-    putTag(tag) ;
-  }
-
-
-
-  /**
-  * Put an integer expressed as a long.
-  *
-  * @param v The long to encode.
-  */
-
-  public void putInteger(long v) {
-    putInteger(v, IntegerTag) ;
-  }
-
-
-  /**
-  * Put an integer expressed as a long with the specified tag.
-  *
-  * @param v The long to encode
-  * @param tag The tag to encode.
-  */
-
-  public void putInteger(long v, int tag) {
-    putIntegerValue(v) ;
-    putTag(tag) ;
-  }
-
-
-
-  /**
-  * Put an octet string.
-  *
-  * @param s The bytes to encode
-  */
-
-  public void putOctetString(byte[] s) {
-    putOctetString(s, OctetStringTag) ;
-  }
-
-
-  /**
-  * Put an octet string with a specified tag.
-  *
-  * @param s The bytes to encode
-  * @param tag The tag to encode.
-  */
-
-  public void putOctetString(byte[] s, int tag) {
-    putStringValue(s) ;
-    putTag(tag) ;
-  }
-
-
-  /**
-  * Put an object identifier.
-  *
-  * @param s The oid to encode.
-  */
-
-  public void putOid(long[] s) {
-    putOid(s, OidTag) ;
-  }
-
-
-  /**
-  * Put an object identifier with a specified tag.
-  *
-  * @param s The integer to encode.
-  * @param tag The tag to encode.
-  */
-
-  public void putOid(long[] s, int tag) {
-    putOidValue(s) ;
-    putTag(tag) ;
-  }
-
-
-  /**
-  * Put a <CODE>NULL</CODE> value.
-  */
-
-  public void putNull() {
-    putNull(NullTag) ;
-  }
-
-
-  /**
-  * Put a <CODE>NULL</CODE> value with a specified tag.
-  *
-  * @param tag The tag to encode.
-  */
-
-  public void putNull(int tag) {
-    putLength(0) ;
-    putTag(tag) ;
-  }
-
-
-
-  /**
-  * Put an <CODE>ANY</CODE> value. In fact, this method does not encode anything.
-  * It simply copies the specified bytes into the encoding.
-  *
-  * @param s The encoding of the <CODE>ANY</CODE> value.
-  */
-
-  public void putAny(byte[] s) {
-        putAny(s, s.length) ;
-  }
-
-
-  /**
-  * Put an <CODE>ANY</CODE> value. Only the first <CODE>byteCount</CODE> are considered.
-  *
-  * @param s The encoding of the <CODE>ANY</CODE> value.
-  * @param byteCount The number of bytes of the encoding.
-  */
-
-  public void putAny(byte[] s, int byteCount) {
-      java.lang.System.arraycopy(s,0,bytes,start-byteCount,byteCount);
-      start -= byteCount;
-      //    for (int i = byteCount - 1 ; i >= 0 ; i--) {
-      //      bytes[--start] = s[i] ;
-      //    }
-  }
-
-
-  /**
-  * Open a sequence.
-  * The encoder push the current position on its stack.
-  */
-
-  public void openSequence() {
-    stackBuf[stackTop++] = start ;
-  }
-
-
-  /**
-  * Close a sequence.
-  * The decode pull the stack to know the end of the current sequence.
-  */
-
-  public void closeSequence() {
-    closeSequence(SequenceTag) ;
-  }
-
-
-  /**
-  * Close a sequence with the specified tag.
-  */
-
-  public void closeSequence(int tag) {
-    final int end = stackBuf[--stackTop] ;
-    putLength(end - start) ;
-    putTag(tag) ;
-  }
-
-
-  //
-  // Some standard tags
-  //
-  public final static int BooleanTag      = 1 ;
-  public final static int IntegerTag      = 2 ;
-  public final static int OctetStringTag  = 4 ;
-  public final static int NullTag          = 5 ;
-  public final static int OidTag          = 6 ;
-  public final static int SequenceTag      = 0x30 ;
-
-
-
-
-  ////////////////////////// PROTECTED ///////////////////////////////
-
-
-
-  /**
-  * Put a tag and move the current position backward.
-  *
-  * @param tag The tag to encode.
-  */
-
-  protected final void putTag(int tag) {
-    if (tag < 256) {
-      bytes[--start] = (byte)tag ;
-    }
-    else {
-      while (tag != 0) {
-        bytes[--start] = (byte)(tag & 127) ;
-        tag = tag << 7 ;
-      }
-    }
-  }
-
-
-  /**
-  * Put a length and move the current position backward.
-  *
-  * @param length The length to encode.
-  */
-
-  protected final void putLength(final int length) {
-    if (length < 0) {
-      throw new IllegalArgumentException() ;
-    }
-    else if (length < 128) {
-      bytes[--start] = (byte)length ;
-    }
-    else if (length < 256) {
-      bytes[--start] = (byte)length ;
-      bytes[--start] = (byte)0x81 ;
-    }
-    else if (length < 65536) {
-      bytes[--start] = (byte)(length) ;
-      bytes[--start] = (byte)(length >> 8) ;
-      bytes[--start] = (byte)0x82 ;
-    }
-    else if (length < 16777126) {
-      bytes[--start] = (byte)(length) ;
-      bytes[--start] = (byte)(length >> 8) ;
-      bytes[--start] = (byte)(length >> 16) ;
-      bytes[--start] = (byte)0x83 ;
-    }
-    else {
-      bytes[--start] = (byte)(length) ;
-      bytes[--start] = (byte)(length >> 8) ;
-      bytes[--start] = (byte)(length >> 16) ;
-      bytes[--start] = (byte)(length >> 24) ;
-      bytes[--start] = (byte)0x84 ;
-    }
-  }
-
-
-  /**
-  * Put an integer value and move the current position backward.
-  *
-  * @param v The integer to encode.
-  */
-
-  protected final void putIntegerValue(int v) {
-    final int end = start ;
-    int mask = 0x7f800000 ;
-    int byteNeeded = 4 ;
-    if (v < 0) {
-      while (((mask & v) == mask) && (byteNeeded > 1)) {
-        mask = mask >> 8 ;
-        byteNeeded-- ;
-      }
-    }
-    else {
-      while (((mask & v) == 0) && (byteNeeded > 1)) {
-        mask = mask >> 8 ;
-        byteNeeded-- ;
-      }
-    }
-    for (int i = 0 ; i < byteNeeded ; i++) {
-      bytes[--start] = (byte)v ;
-      v =  v >> 8 ;
-    }
-    putLength(end - start) ;
-  }
-
-
-  /**
-  * Put an integer value expressed as a long.
-  *
-  * @param v The integer to encode.
-  */
-
-  protected final void putIntegerValue(long v) {
-    final int end = start ;
-    long mask = 0x7f80000000000000L ;
-    int byteNeeded = 8 ;
-    if (v < 0) {
-      while (((mask & v) == mask) && (byteNeeded > 1)) {
-        mask = mask >> 8 ;
-        byteNeeded-- ;
-      }
-    }
-    else {
-      while (((mask & v) == 0) && (byteNeeded > 1)) {
-        mask = mask >> 8 ;
-        byteNeeded-- ;
-      }
-    }
-    for (int i = 0 ; i < byteNeeded ; i++) {
-      bytes[--start] = (byte)v ;
-      v =  v >> 8 ;
-    }
-    putLength(end - start) ;
-  }
-
-
-  /**
-  * Put a byte string and move the current position backward.
-  *
-  * @param s The byte string to encode.
-  */
-
-  protected final void putStringValue(byte[] s) {
-      final int datalen = s.length;
-      java.lang.System.arraycopy(s,0,bytes,start-datalen,datalen);
-      start -= datalen;
-      // for (int i = s.length - 1 ; i >= 0 ; i--) {
-      //   bytes[--start] = s[i] ;
-      // }
-      putLength(datalen) ;
-  }
-
-
-
-  /**
-  * Put an oid and move the current position backward.
-  *
-  * @param s The oid to encode.
-  */
-
-  protected final void putOidValue(final long[] s) {
-      final int end = start ;
-      final int slength = s.length;
-
-      // bugId 4641746: 0, 1, and 2 are legal values.
-      if ((slength < 2) || (s[0] > 2) || (s[1] >= 40)) {
-          throw new IllegalArgumentException() ;
-      }
-      for (int i = slength - 1 ; i >= 2 ; i--) {
-          long c = s[i] ;
-          if (c < 0) {
-              throw new IllegalArgumentException() ;
-          }
-          else if (c < 128) {
-              bytes[--start] = (byte)c ;
-          }
-          else {
-              bytes[--start] = (byte)(c & 127) ;
-              c = c >> 7 ;
-              while (c != 0) {
-                  bytes[--start] = (byte)(c | 128) ;
-                  c = c >> 7 ;
-              }
-          }
-      }
-      bytes[--start] = (byte)(s[0] * 40 + s[1]) ;
-      putLength(end - start) ;
-  }
-
-
-  //
-  // This is the byte array containing the encoding.
-  //
-  protected final byte bytes[];
-
-  //
-  // This is the index of the first byte of the encoding.
-  // It is initialized to <CODE>bytes.length</CODE> and decrease each time
-  // an value is put in the encoder.
-  //
-  protected int start = -1 ;
-
-  //
-  // This is the stack where end of sequences are kept.
-  // A value is computed and pushed in it each time the <CODE>openSequence</CODE> method
-  // is invoked.
-  // A value is pulled and checked each time the <CODE>closeSequence</CODE> method is called.
-  //
-  protected final int stackBuf[] = new int[200] ;
-  protected int stackTop = 0 ;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/BerException.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-
-
-/**
- * Exception thrown when a BER encoding/decoding error occurs.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- *
- * @since 1.5
- */
-
-public class BerException extends Exception {
-  private static final long serialVersionUID = 494709767137042951L;
-
-  public static final int BAD_VERSION=1;
-
-  private int errorType= 0;
-
-  public BerException() {
-    errorType= 0;
-  }
-
-  public BerException(int x) {
-    errorType= x;
-  }
-
-  public boolean isInvalidSnmpVersion() {
-    if (errorType == BAD_VERSION)
-      return true;
-    else
-      return false;
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/EnumRowStatus.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,304 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp;
-
-import java.io.Serializable;
-import java.util.Hashtable;
-
-
-/**
- * This class is an internal class which is used to represent RowStatus
- * codes as defined in RFC 2579.
- *
- * It defines an additional code, <i>unspecified</i>, which is
- * implementation specific, and is used to identify
- * unspecified actions (when for instance the RowStatus variable
- * is not present in the varbind list) or uninitialized values.
- *
- * mibgen does not generate objects of this class but any variable
- * using the RowStatus textual convention can be converted into an
- * object of this class thanks to the
- * <code>EnumRowStatus(Enumerated valueIndex)</code> constructor.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- **/
-
-public class EnumRowStatus extends Enumerated implements Serializable {
-    private static final long serialVersionUID = 8966519271130162420L;
-
-    /**
-     * This value is SNMP Runtime implementation specific, and is used to identify
-     * unspecified actions (when for instance the RowStatus variable
-     * is not present in the varbind list) or uninitialized values.
-     */
-    public final static int unspecified   = 0;
-
-    /**
-     * This value corresponds to the <i>active</i> RowStatus, as defined in
-     * RFC 2579 from SMIv2:
-     * <ul>
-     * <i>active</i> indicates that the conceptual row is available for
-     * use by the managed device;
-     * </ul>
-     */
-    public final static int active        = 1;
-
-    /**
-     * This value corresponds to the <i>notInService</i> RowStatus, as
-     * defined in RFC 2579 from SMIv2:
-     * <ul>
-     * <i>notInService</i> indicates that the conceptual
-     * row exists in the agent, but is unavailable for use by
-     * the managed device; <i>notInService</i> has
-     * no implication regarding the internal consistency of
-     * the row, availability of resources, or consistency with
-     * the current state of the managed device;
-     * </ul>
-     **/
-    public final static int notInService  = 2;
-
-    /**
-     * This value corresponds to the <i>notReady</i> RowStatus, as defined
-     * in RFC 2579 from SMIv2:
-     * <ul>
-     * <i>notReady</i> indicates that the conceptual row
-     * exists in the agent, but is missing information
-     * necessary in order to be available for use by the
-     * managed device (i.e., one or more required columns in
-     * the conceptual row have not been instantiated);
-     * </ul>
-     */
-    public final static int notReady      = 3;
-
-    /**
-     * This value corresponds to the <i>createAndGo</i> RowStatus,
-     * as defined in RFC 2579 from SMIv2:
-     * <ul>
-     * <i>createAndGo</i> is supplied by a management
-     * station wishing to create a new instance of a
-     * conceptual row and to have its status automatically set
-     * to active, making it available for use by the managed
-     * device;
-     * </ul>
-     */
-    public final static int createAndGo   = 4;
-
-    /**
-     * This value corresponds to the <i>createAndWait</i> RowStatus,
-     * as defined in RFC 2579 from SMIv2:
-     * <ul>
-     * <i>createAndWait</i> is supplied by a management
-     * station wishing to create a new instance of a
-     * conceptual row (but not make it available for use by
-     * the managed device);
-     * </ul>
-     */
-    public final static int createAndWait = 5;
-
-    /**
-     * This value corresponds to the <i>destroy</i> RowStatus, as defined in
-     * RFC 2579 from SMIv2:
-     * <ul>
-     * <i>destroy</i> is supplied by a management station
-     * wishing to delete all of the instances associated with
-     * an existing conceptual row.
-     * </ul>
-     */
-    public final static int destroy       = 6;
-
-    /**
-     * Build an <code>EnumRowStatus</code> from an <code>int</code>.
-     * @param valueIndex should be either 0 (<i>unspecified</i>), or one of
-     *        the values defined in RFC 2579.
-     * @exception IllegalArgumentException if the given
-     *            <code>valueIndex</code> is not valid.
-     **/
-    public EnumRowStatus(int valueIndex)
-        throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    /**
-     * Build an <code>EnumRowStatus</code> from an <code>Enumerated</code>.
-     * @param valueIndex should be either 0 (<i>unspecified</i>), or one of
-     *        the values defined in RFC 2579.
-     * @exception IllegalArgumentException if the given
-     *            <code>valueIndex</code> is not valid.
-     **/
-    public EnumRowStatus(Enumerated valueIndex)
-        throws IllegalArgumentException {
-        this(valueIndex.intValue());
-    }
-
-    /**
-     * Build an <code>EnumRowStatus</code> from a <code>long</code>.
-     * @param valueIndex should be either 0 (<i>unspecified</i>), or one of
-     *        the values defined in RFC 2579.
-     * @exception IllegalArgumentException if the given
-     *            <code>valueIndex</code> is not valid.
-     **/
-    public EnumRowStatus(long valueIndex)
-        throws IllegalArgumentException {
-        this((int)valueIndex);
-    }
-
-    /**
-     * Build an <code>EnumRowStatus</code> from an <code>Integer</code>.
-     * @param valueIndex should be either 0 (<i>unspecified</i>), or one of
-     *        the values defined in RFC 2579.
-     * @exception IllegalArgumentException if the given
-     *            <code>valueIndex</code> is not valid.
-     **/
-    public EnumRowStatus(Integer valueIndex)
-        throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    /**
-     * Build an <code>EnumRowStatus</code> from a <code>Long</code>.
-     * @param valueIndex should be either 0 (<i>unspecified</i>), or one of
-     *        the values defined in RFC 2579.
-     * @exception IllegalArgumentException if the given
-     *            <code>valueIndex</code> is not valid.
-     **/
-    public EnumRowStatus(Long valueIndex)
-        throws IllegalArgumentException {
-        this(valueIndex.longValue());
-    }
-
-    /**
-     * Build an <code>EnumRowStatus</code> with <i>unspecified</i> value.
-     **/
-    public EnumRowStatus()
-        throws IllegalArgumentException {
-        this(unspecified);
-    }
-
-    /**
-     * Build an <code>EnumRowStatus</code> from a <code>String</code>.
-     * @param x should be either "unspecified", or one of
-     *        the values defined in RFC 2579 ("active", "notReady", etc...)
-     * @exception IllegalArgumentException if the given String
-     *            <code>x</code> is not valid.
-     **/
-    public EnumRowStatus(String x)
-        throws IllegalArgumentException {
-        super(x);
-    }
-
-    /**
-     * Build an <code>EnumRowStatus</code> from an <code>SnmpInt</code>.
-     * @param valueIndex should be either 0 (<i>unspecified</i>), or one of
-     *        the values defined in RFC 2579.
-     * @exception IllegalArgumentException if the given
-     *            <code>valueIndex</code> is not valid.
-     **/
-    public EnumRowStatus(SnmpInt valueIndex)
-        throws IllegalArgumentException {
-        this(valueIndex.intValue());
-    }
-
-    /**
-     * Build an SnmpValue from this object.
-     *
-     * @exception IllegalArgumentException if this object holds an
-     *            <i>unspecified</i> value.
-     * @return an SnmpInt containing this object value.
-     **/
-    public SnmpInt toSnmpValue()
-        throws IllegalArgumentException {
-        if (value == unspecified)
-            throw new
-        IllegalArgumentException("`unspecified' is not a valid SNMP value.");
-        return new SnmpInt(value);
-    }
-
-    /**
-     * Check that the given <code>value</code> is valid.
-     *
-     * Valid values are:
-     * <ul><li><i>unspecified(0)</i></li>
-     *     <li><i>active(1)</i></li>
-     *     <li><i>notInService(2)</i></li>
-     *     <li><i>notReady(3)</i></li>
-     *     <li><i>createAndGo(4)</i></li>
-     *     <li><i>createAndWait(5)</i></li>
-     *     <li><i>destroy(6)</i></li>
-     * </ul>
-     *
-     **/
-    static public boolean isValidValue(int value) {
-        if (value < 0) return false;
-        if (value > 6) return false;
-        return true;
-    }
-
-    // Documented in Enumerated
-    //
-    @Override
-    protected Hashtable<Integer, String> getIntTable() {
-        return EnumRowStatus.getRSIntTable();
-    }
-
-    // Documented in Enumerated
-    //
-    @Override
-    protected Hashtable<String, Integer> getStringTable() {
-        return  EnumRowStatus.getRSStringTable();
-    }
-
-    static Hashtable<Integer, String> getRSIntTable() {
-        return intTable ;
-    }
-
-    static Hashtable<String, Integer> getRSStringTable() {
-        return stringTable ;
-    }
-
-    // Initialize the mapping tables.
-    //
-    final static Hashtable<Integer, String> intTable = new Hashtable<>();
-    final static Hashtable<String, Integer> stringTable = new Hashtable<>();
-    static  {
-        intTable.put(0, "unspecified");
-        intTable.put(3, "notReady");
-        intTable.put(6, "destroy");
-        intTable.put(2, "notInService");
-        intTable.put(5, "createAndWait");
-        intTable.put(1, "active");
-        intTable.put(4, "createAndGo");
-        stringTable.put("unspecified", 0);
-        stringTable.put("notReady", 3);
-        stringTable.put("destroy", 6);
-        stringTable.put("notInService", 2);
-        stringTable.put("createAndWait", 5);
-        stringTable.put("active", 1);
-        stringTable.put("createAndGo", 4);
-    }
-
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/Enumerated.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,221 +0,0 @@
-/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp;
-
-
-import java.io.*;
-import java.util.Hashtable;
-import java.util.*;
-
-
-
-/** This class is used for implementing enumerated values.
- *
- * An enumeration is represented by a class derived from Enumerated.
- * The derived class defines what are the permitted values in the enumeration.
- *
- * An enumerated value is represented by an instance of the derived class.
- * It can be represented :
- *  - as an integer
- *  - as a string
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-@SuppressWarnings("serial") // JDK implementation class
-abstract public class Enumerated  implements Serializable {
-
-  /**
-   * Construct an enumerated with a default value.
-   * The default value is the first available in getIntTable().
-    * @exception IllegalArgumentException One of the arguments passed to the method is illegal or inappropriate.
-   */
-  public Enumerated() throws IllegalArgumentException {
-    Enumeration<Integer> e =getIntTable().keys();
-    if (e.hasMoreElements()) {
-      value = e.nextElement().intValue() ;
-    }
-    else {
-      throw new IllegalArgumentException() ;
-    }
-  }
-
-  /**
-   * Construct an enumerated from its integer form.
-   *
-   * @param valueIndex The integer form.
-   * @exception IllegalArgumentException One of the arguments passed to
-   *            the method is illegal or inappropriate.
-   */
-  public Enumerated(int valueIndex) throws IllegalArgumentException {
-    if (getIntTable().get(valueIndex) == null) {
-      throw new IllegalArgumentException() ;
-    }
-    value = valueIndex ;
-  }
-
-  /**
-   * Construct an enumerated from its Integer form.
-   *
-   * @param valueIndex The Integer form.
-   * @exception IllegalArgumentException One of the arguments passed to
-   *            the method is illegal or inappropriate.
-   */
-  public Enumerated(Integer valueIndex) throws IllegalArgumentException {
-    if (getIntTable().get(valueIndex) == null) {
-      throw new IllegalArgumentException() ;
-    }
-    value = valueIndex.intValue() ;
-  }
-
-
-  /**
-   * Construct an enumerated from its string form.
-   *
-   * @param valueString The string form.
-   * @exception IllegalArgumentException One of the arguments passed
-   *  to the method is illegal or inappropriate.
-   */
-  public Enumerated(String valueString) throws IllegalArgumentException {
-    Integer index = getStringTable().get(valueString) ;
-    if (index == null) {
-      throw new IllegalArgumentException() ;
-    }
-    else {
-      value = index.intValue() ;
-    }
-  }
-
-
-  /**
-   * Return the integer form of the enumerated.
-   *
-   * @return The integer form
-   */
-
-  public int intValue() {
-    return value ;
-  }
-
-
-  /**
-   * Returns an Java enumeration of the permitted integers.
-   *
-   * @return An enumeration of Integer instances
-   */
-
-  public Enumeration<Integer> valueIndexes() {
-    return getIntTable().keys() ;
-  }
-
-
-  /**
-   * Returns an Java enumeration of the permitted strings.
-   *
-   * @return An enumeration of String instances
-   */
-
-  public Enumeration<String> valueStrings() {
-    return getStringTable().keys() ;
-  }
-
-
-  /**
-   * Compares this enumerated to the specified enumerated.
-   *
-   * The result is true if and only if the argument is not null
-   * and is of the same class.
-   *
-   * @param obj The object to compare with.
-   *
-   * @return True if this and obj are the same; false otherwise
-   */
-  @Override
-  public boolean equals(Object obj) {
-
-    return ((obj != null) &&
-            (getClass() == obj.getClass()) &&
-            (value == ((Enumerated)obj).value)) ;
-  }
-
-
-  /**
-   * Returns the hash code for this enumerated.
-   *
-   * @return A hash code value for this object.
-   */
-  @Override
-  public int hashCode() {
-    String hashString = getClass().getName() + String.valueOf(value) ;
-    return hashString.hashCode() ;
-  }
-
-
-  /**
-   * Returns the string form of this enumerated.
-   *
-   * @return The string for for this object.
-   */
-  @Override
-  public String toString() {
-    return getIntTable().get(value);
-  }
-
-
-  /**
-   * Returns the hashtable of the integer forms.
-   * getIntTable().get(x) returns the string form associated
-   * to the integer x.
-   *
-   * This method must be implemented by the derived class.
-   *
-   * @return An hashtable for read-only purpose
-   */
-
-  protected abstract Hashtable<Integer,String>  getIntTable() ;
-
-
-
-  /**
-   * Returns the hashtable of the string forms.
-   * getStringTable().get(s) returns the integer form associated
-   * to the string s.
-   *
-   * This method must be implemented by the derived class.
-   *
-   * @return An hashtable for read-only purpose
-   */
-
-  protected abstract Hashtable<String,Integer> getStringTable() ;
-
-
-  /**
-   * This variable keeps the integer form of the enumerated.
-   * The string form is retrieved using getIntTable().
-   */
-  protected int value ;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ASCII_CharStream.README	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-WARNING : ASCII_CharStream.java must be PATCHED.
-
-The following methods should be removed after javacc generation.
-The goal is to simplify 100%-pure testing (see bug 4127719).
-
-
-  /**
-   * @deprecated 
-   * @see #getEndColumn
-   */
-
-  public final int getColumn() {
-     return bufcolumn[bufpos];
-  }
-
-  /**
-   * @deprecated 
-   * @see #getEndLine
-   */
-
-  public final int getLine() {
-     return bufline[bufpos];
-  }
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ASCII_CharStream.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,402 +0,0 @@
-/*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Generated By:JavaCC: Do not edit this line. ASCII_CharStream.java Version 0.7pre6 */
-package com.sun.jmx.snmp.IPAcl;
-
-/**
- * An implementation of interface CharStream, where the stream is assumed to
- * contain only ASCII characters (without unicode processing).
- */
-
-final class ASCII_CharStream
-{
-  public static final boolean staticFlag = false;
-  int bufsize;
-  int available;
-  int tokenBegin;
-  public int bufpos = -1;
-  private int bufline[];
-  private int bufcolumn[];
-
-  private int column = 0;
-  private int line = 1;
-
-  private boolean prevCharIsCR = false;
-  private boolean prevCharIsLF = false;
-
-  private java.io.Reader inputStream;
-
-  private char[] buffer;
-  private int maxNextCharInd = 0;
-  private int inBuf = 0;
-
-  private final void ExpandBuff(boolean wrapAround)
-  {
-     char[] newbuffer = new char[bufsize + 2048];
-     int newbufline[] = new int[bufsize + 2048];
-     int newbufcolumn[] = new int[bufsize + 2048];
-
-     try
-     {
-        if (wrapAround)
-        {
-           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
-           System.arraycopy(buffer, 0, newbuffer,
-                                             bufsize - tokenBegin, bufpos);
-           buffer = newbuffer;
-
-           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
-           System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
-           bufline = newbufline;
-
-           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
-           System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
-           bufcolumn = newbufcolumn;
-
-           maxNextCharInd = (bufpos += (bufsize - tokenBegin));
-        }
-        else
-        {
-           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
-           buffer = newbuffer;
-
-           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
-           bufline = newbufline;
-
-           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
-           bufcolumn = newbufcolumn;
-
-           maxNextCharInd = (bufpos -= tokenBegin);
-        }
-     }
-     catch (Throwable t)
-     {
-        throw new Error(t.getMessage());
-     }
-
-
-     bufsize += 2048;
-     available = bufsize;
-     tokenBegin = 0;
-  }
-
-  private final void FillBuff() throws java.io.IOException
-  {
-     if (maxNextCharInd == available)
-     {
-        if (available == bufsize)
-        {
-           if (tokenBegin > 2048)
-           {
-              bufpos = maxNextCharInd = 0;
-              available = tokenBegin;
-           }
-           else if (tokenBegin < 0)
-              bufpos = maxNextCharInd = 0;
-           else
-              ExpandBuff(false);
-        }
-        else if (available > tokenBegin)
-           available = bufsize;
-        else if ((tokenBegin - available) < 2048)
-           ExpandBuff(true);
-        else
-           available = tokenBegin;
-     }
-
-     int i;
-     try {
-        if ((i = inputStream.read(buffer, maxNextCharInd,
-                                    available - maxNextCharInd)) == -1)
-        {
-           inputStream.close();
-           throw new java.io.IOException();
-        }
-        else
-           maxNextCharInd += i;
-        return;
-     }
-     catch(java.io.IOException e) {
-        --bufpos;
-        backup(0);
-        if (tokenBegin == -1)
-           tokenBegin = bufpos;
-        throw e;
-     }
-  }
-
-  public final char BeginToken() throws java.io.IOException
-  {
-     tokenBegin = -1;
-     char c = readChar();
-     tokenBegin = bufpos;
-
-     return c;
-  }
-
-  private final void UpdateLineColumn(char c)
-  {
-     column++;
-
-     if (prevCharIsLF)
-     {
-        prevCharIsLF = false;
-        line += (column = 1);
-     }
-     else if (prevCharIsCR)
-     {
-        prevCharIsCR = false;
-        if (c == '\n')
-        {
-           prevCharIsLF = true;
-        }
-        else
-           line += (column = 1);
-     }
-
-     switch (c)
-     {
-        case '\r' :
-           prevCharIsCR = true;
-           break;
-        case '\n' :
-           prevCharIsLF = true;
-           break;
-        case '\t' :
-           column--;
-           column += (8 - (column & 07));
-           break;
-        default :
-           break;
-     }
-
-     bufline[bufpos] = line;
-     bufcolumn[bufpos] = column;
-  }
-
-  public final char readChar() throws java.io.IOException
-  {
-     if (inBuf > 0)
-     {
-        --inBuf;
-        return (char)((char)0xff & buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]);
-     }
-
-     if (++bufpos >= maxNextCharInd)
-        FillBuff();
-
-     char c = (char)((char)0xff & buffer[bufpos]);
-
-     UpdateLineColumn(c);
-     return (c);
-  }
-
-  /**
-   * @deprecated
-   * @see #getEndColumn
-   */
-    @Deprecated
-  public final int getColumn() {
-     return bufcolumn[bufpos];
-  }
-
-  /**
-   * @deprecated
-   * @see #getEndLine
-   */
-    @Deprecated
-  public final int getLine() {
-     return bufline[bufpos];
-  }
-
-  public final int getEndColumn() {
-     return bufcolumn[bufpos];
-  }
-
-  public final int getEndLine() {
-     return bufline[bufpos];
-  }
-
-  public final int getBeginColumn() {
-     return bufcolumn[tokenBegin];
-  }
-
-  public final int getBeginLine() {
-     return bufline[tokenBegin];
-  }
-
-  public final void backup(int amount) {
-
-    inBuf += amount;
-    if ((bufpos -= amount) < 0)
-       bufpos += bufsize;
-  }
-
-  public ASCII_CharStream(java.io.Reader dstream, int startline,
-  int startcolumn, int buffersize)
-  {
-    inputStream = dstream;
-    line = startline;
-    column = startcolumn - 1;
-
-    available = bufsize = buffersize;
-    buffer = new char[buffersize];
-    bufline = new int[buffersize];
-    bufcolumn = new int[buffersize];
-  }
-
-  public ASCII_CharStream(java.io.Reader dstream, int startline,
-                                                           int startcolumn)
-  {
-     this(dstream, startline, startcolumn, 4096);
-  }
-  public void ReInit(java.io.Reader dstream, int startline,
-  int startcolumn, int buffersize)
-  {
-    inputStream = dstream;
-    line = startline;
-    column = startcolumn - 1;
-
-    if (buffer == null || buffersize != buffer.length)
-    {
-      available = bufsize = buffersize;
-      buffer = new char[buffersize];
-      bufline = new int[buffersize];
-      bufcolumn = new int[buffersize];
-    }
-    prevCharIsLF = prevCharIsCR = false;
-    tokenBegin = inBuf = maxNextCharInd = 0;
-    bufpos = -1;
-  }
-
-  public void ReInit(java.io.Reader dstream, int startline,
-                                                           int startcolumn)
-  {
-     ReInit(dstream, startline, startcolumn, 4096);
-  }
-  public ASCII_CharStream(java.io.InputStream dstream, int startline,
-  int startcolumn, int buffersize)
-  {
-     this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
-  }
-
-  public ASCII_CharStream(java.io.InputStream dstream, int startline,
-                                                           int startcolumn)
-  {
-     this(dstream, startline, startcolumn, 4096);
-  }
-
-  public void ReInit(java.io.InputStream dstream, int startline,
-  int startcolumn, int buffersize)
-  {
-     ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
-  }
-  public void ReInit(java.io.InputStream dstream, int startline,
-                                                           int startcolumn)
-  {
-     ReInit(dstream, startline, startcolumn, 4096);
-  }
-  public final String GetImage()
-  {
-     if (bufpos >= tokenBegin)
-        return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
-     else
-        return new String(buffer, tokenBegin, bufsize - tokenBegin) +
-                              new String(buffer, 0, bufpos + 1);
-  }
-
-  public final char[] GetSuffix(int len)
-  {
-     char[] ret = new char[len];
-
-     if ((bufpos + 1) >= len)
-        System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
-     else
-     {
-        System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
-                                                          len - bufpos - 1);
-        System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
-     }
-
-     return ret;
-  }
-
-  public void Done()
-  {
-     buffer = null;
-     bufline = null;
-     bufcolumn = null;
-  }
-
-  /**
-   * Method to adjust line and column numbers for the start of a token.
-   */
-  public void adjustBeginLineColumn(int newLine, int newCol)
-  {
-     int start = tokenBegin;
-     int len;
-
-     if (bufpos >= tokenBegin)
-     {
-        len = bufpos - tokenBegin + inBuf + 1;
-     }
-     else
-     {
-        len = bufsize - tokenBegin + bufpos + 1 + inBuf;
-     }
-
-     int i = 0, j = 0, k = 0;
-     int nextColDiff = 0, columnDiff = 0;
-
-     while (i < len &&
-            bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
-     {
-        bufline[j] = newLine;
-        nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
-        bufcolumn[j] = newCol + columnDiff;
-        columnDiff = nextColDiff;
-        i++;
-     }
-
-     if (i < len)
-     {
-        bufline[j] = newLine++;
-        bufcolumn[j] = newCol + columnDiff;
-
-        while (i++ < len)
-        {
-           if (bufline[j = start % bufsize] != bufline[++start % bufsize])
-              bufline[j] = newLine++;
-           else
-              bufline[j] = newLine;
-        }
-     }
-
-     line = bufline[j];
-     column = bufcolumn[j];
-  }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/AclEntryImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,263 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.IPAcl;
-
-
-
-import java.security.acl.Permission;
-import java.util.Vector;
-import java.util.Enumeration;
-import java.io.Serializable;
-import java.net.UnknownHostException;
-
-import java.security.Principal;
-import java.security.acl.AclEntry;
-
-
-/**
- * Represent one entry in the Access Control List (ACL).
- * This ACL entry object contains a permission associated with a particular principal.
- * (A principal represents an entity such as an individual machine or a group).
- *
- * @see java.security.acl.AclEntry
- */
-
-class AclEntryImpl implements AclEntry, Serializable {
-  private static final long serialVersionUID = -5047185131260073216L;
-
-  private AclEntryImpl (AclEntryImpl i) throws UnknownHostException {
-        setPrincipal(i.getPrincipal());
-        permList = new Vector<Permission>();
-        commList = new Vector<String>();
-
-        for (Enumeration<String> en = i.communities(); en.hasMoreElements();){
-          addCommunity(en.nextElement());
-        }
-
-        for (Enumeration<Permission> en = i.permissions(); en.hasMoreElements();){
-          addPermission(en.nextElement());
-        }
-        if (i.isNegative()) setNegativePermissions();
-  }
-
-  /**
-   * Contructs an empty ACL entry.
-   */
-  public AclEntryImpl (){
-        princ = null;
-        permList = new Vector<Permission>();
-        commList = new Vector<String>();
-  }
-
-  /**
-   * Constructs an ACL entry with a specified principal.
-   *
-   * @param p the principal to be set for this entry.
-   */
-  public AclEntryImpl (Principal p) throws UnknownHostException {
-        princ = p;
-        permList = new Vector<Permission>();
-        commList = new Vector<String>();
-  }
-
-  /**
-   * Clones this ACL entry.
-   *
-   * @return a clone of this ACL entry.
-   */
-  public Object clone() {
-        AclEntryImpl i;
-        try {
-          i = new AclEntryImpl(this);
-        }catch (UnknownHostException e) {
-          i = null;
-        }
-        return (Object) i;
-  }
-
-  /**
-   * Returns true if this is a negative ACL entry (one denying the associated principal
-   * the set of permissions in the entry), false otherwise.
-   *
-   * @return true if this is a negative ACL entry, false if it's not.
-   */
-  public boolean isNegative(){
-        return neg;
-  }
-
-  /**
-   * Adds the specified permission to this ACL entry. Note: An entry can
-   * have multiple permissions.
-   *
-   * @param perm the permission to be associated with the principal in this
-   *        entry
-   * @return true if the permission is removed, false if the permission was
-   *         not part of this entry's permission set.
-   *
-   */
-  public boolean addPermission(java.security.acl.Permission perm){
-        if (permList.contains(perm)) return false;
-        permList.addElement(perm);
-        return true;
-  }
-
-  /**
-   * Removes the specified permission from this ACL entry.
-   *
-   * @param perm the permission to be removed from this entry.
-   * @return true if the permission is removed, false if the permission
-   *         was not part of this entry's permission set.
-   */
-  public boolean removePermission(java.security.acl.Permission perm){
-        if (!permList.contains(perm)) return false;
-        permList.removeElement(perm);
-        return true;
-  }
-
-  /**
-   * Checks if the specified permission is part of the permission set in
-   * this entry.
-   *
-   * @param perm the permission to be checked for.
-   * @return true if the permission is part of the permission set in this
-   *         entry, false otherwise.
-   */
-
-  public boolean checkPermission(java.security.acl.Permission perm){
-        return (permList.contains(perm));
-  }
-
-  /**
-   * Returns an enumeration of the permissions in this ACL entry.
-   *
-   * @return an enumeration of the permissions in this ACL entry.
-   */
-  public Enumeration<Permission> permissions(){
-        return permList.elements();
-  }
-
-  /**
-   * Sets this ACL entry to be a negative one. That is, the associated principal
-   * (e.g., a user or a group) will be denied the permission set specified in the
-   * entry. Note: ACL entries are by default positive. An entry becomes a negative
-   * entry only if this setNegativePermissions method is called on it.
-   *
-   * Not Implemented.
-   */
-  public void setNegativePermissions(){
-        neg = true;
-  }
-
-  /**
-   * Returns the principal for which permissions are granted or denied by this ACL
-   * entry. Returns null if there is no principal set for this entry yet.
-   *
-   * @return the principal associated with this entry.
-   */
-  public Principal getPrincipal(){
-        return princ;
-  }
-
-  /**
-   * Specifies the principal for which permissions are granted or denied by
-   * this ACL entry. If a principal was already set for this ACL entry,
-   * false is returned, otherwise true is returned.
-   *
-   * @param p the principal to be set for this entry.
-   * @return true if the principal is set, false if there was already a
-   *         principal set for this entry.
-   */
-  public boolean setPrincipal(Principal p) {
-        if (princ != null )
-          return false;
-        princ = p;
-        return true;
-  }
-
-  /**
-   * Returns a string representation of the contents of this ACL entry.
-   *
-   * @return a string representation of the contents.
-   */
-  public String toString(){
-        return "AclEntry:"+princ.toString();
-  }
-
-  /**
-   * Returns an enumeration of the communities in this ACL entry.
-   *
-   * @return an enumeration of the communities in this ACL entry.
-   */
-  public Enumeration<String> communities(){
-        return commList.elements();
-  }
-
-  /**
-   * Adds the specified community to this ACL entry. Note: An entry can
-   * have multiple communities.
-   *
-   * @param comm the community to be associated with the principal
-   *        in this entry.
-   * @return true if the community was added, false if the community was
-   *         already part of this entry's community set.
-   */
-  public boolean addCommunity(String comm){
-        if (commList.contains(comm)) return false;
-        commList.addElement(comm);
-        return true;
-  }
-
-  /**
-   * Removes the specified community from this ACL entry.
-   *
-   * @param comm the community  to be removed from this entry.
-   * @return true if the community is removed, false if the community was
-   *         not part of this entry's community set.
-   */
-  public boolean removeCommunity(String comm){
-        if (!commList.contains(comm)) return false;
-        commList.removeElement(comm);
-        return true;
-  }
-
-  /**
-   * Checks if the specified community is part of the community set in this
-   * entry.
-   *
-   * @param  comm the community to be checked for.
-   * @return true if the community is part of the community set in this
-   *         entry, false otherwise.
-   */
-  public boolean checkCommunity(String comm){
-        return (commList.contains(comm));
-  }
-
-  private Principal princ = null;
-  private boolean neg     = false;
-  private Vector<Permission> permList = null;
-  private Vector<String> commList = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/AclImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,295 +0,0 @@
-/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.IPAcl;
-
-
-
-import java.security.Principal;
-import java.security.acl.Acl;
-import java.security.acl.AclEntry;
-import java.security.acl.NotOwnerException;
-
-import java.io.Serializable;
-import java.security.acl.Permission;
-import java.util.Vector;
-import java.util.Enumeration;
-
-
-/**
- * Represent an Access Control List (ACL) which is used to guard access to http adaptor.
- * <P>
- * It is a data structure with multiple ACL entries. Each ACL entry, of interface type
- * AclEntry, contains a set of permissions and a set of communities associated with a
- * particular principal. (A principal represents an entity such as a host or a group of host).
- * Additionally, each ACL entry is specified as being either positive or negative.
- * If positive, the permissions are to be granted to the associated principal.
- * If negative, the permissions are to be denied.
- *
- * @see java.security.acl.Acl
- */
-
-class AclImpl extends OwnerImpl implements Acl, Serializable {
-  private static final long serialVersionUID = -2250957591085270029L;
-
-  private Vector<AclEntry> entryList = null;
-  private String aclName = null;
-
-  /**
-   * Constructs the ACL with a specified owner
-   *
-   * @param owner owner of the ACL.
-   * @param name  name of this ACL.
-   */
-  public AclImpl (PrincipalImpl owner, String name) {
-        super(owner);
-        entryList = new Vector<>();
-        aclName = name;
-  }
-
-  /**
-   * Sets the name of this ACL.
-   *
-   * @param caller the principal invoking this method. It must be an owner
-   *        of this ACL.
-   * @param name the name to be given to this ACL.
-   *
-   * @exception NotOwnerException if the caller principal is not an owner
-   *            of this ACL.
-   * @see java.security.Principal
-   */
-  @Override
-  public void setName(Principal caller, String name)
-        throws NotOwnerException {
-          if (!isOwner(caller))
-                throw new NotOwnerException();
-          aclName = name;
-  }
-
-  /**
-   * Returns the name of this ACL.
-   *
-   * @return the name of this ACL.
-   */
-  @Override
-  public String getName(){
-        return aclName;
-  }
-
-  /**
-   * Adds an ACL entry to this ACL. An entry associates a principal (e.g., an individual or a group)
-   * with a set of permissions. Each principal can have at most one positive ACL entry
-   * (specifying permissions to be granted to the principal) and one negative ACL entry
-   * (specifying permissions to be denied). If there is already an ACL entry
-   * of the same type (negative or positive) already in the ACL, false is returned.
-   *
-   * @param caller the principal invoking this method. It must be an owner
-   *        of this ACL.
-   * @param entry the ACL entry to be added to this ACL.
-   * @return true on success, false if an entry of the same type (positive
-   *       or negative) for the same principal is already present in this ACL.
-   * @exception NotOwnerException if the caller principal is not an owner of
-   *       this ACL.
-   * @see java.security.Principal
-   */
-  @Override
-  public boolean addEntry(Principal caller, AclEntry entry)
-        throws NotOwnerException {
-          if (!isOwner(caller))
-                throw new NotOwnerException();
-
-          if (entryList.contains(entry))
-                return false;
-          /*
-                 for (Enumeration e = entryList.elements();e.hasMoreElements();){
-                 AclEntry ent = (AclEntry) e.nextElement();
-                 if (ent.getPrincipal().equals(entry.getPrincipal()))
-                 return false;
-                 }
-                 */
-
-          entryList.addElement(entry);
-          return true;
-  }
-
-  /**
-   * Removes an ACL entry from this ACL.
-   *
-   * @param caller the principal invoking this method. It must be an owner
-   *        of this ACL.
-   * @param entry the ACL entry to be removed from this ACL.
-   * @return true on success, false if the entry is not part of this ACL.
-   * @exception NotOwnerException if the caller principal is not an owner
-   *   of this Acl.
-   * @see java.security.Principal
-   * @see java.security.acl.AclEntry
-   */
-  @Override
-  public boolean removeEntry(Principal caller, AclEntry entry)
-        throws NotOwnerException {
-          if (!isOwner(caller))
-                throw new NotOwnerException();
-
-          return (entryList.removeElement(entry));
-  }
-
-  /**
-   * Removes all ACL entries from this ACL.
-   *
-   * @param caller the principal invoking this method. It must be an owner
-   *        of this ACL.
-   * @exception NotOwnerException if the caller principal is not an owner of
-   *        this Acl.
-   * @see java.security.Principal
-   */
-  public void removeAll(Principal caller)
-        throws NotOwnerException {
-          if (!isOwner(caller))
-                throw new NotOwnerException();
-        entryList.removeAllElements();
-  }
-
-  /**
-   * Returns an enumeration for the set of allowed permissions for
-   * the specified principal
-   * (representing an entity such as an individual or a group).
-   * This set of allowed permissions is calculated as follows:
-   * <UL>
-   * <LI>If there is no entry in this Access Control List for the specified
-   * principal, an empty permission set is returned.</LI>
-   * <LI>Otherwise, the principal's group permission sets are determined.
-   * (A principal can belong to one or more groups, where a group is a group
-   * of principals, represented by the Group interface.)</LI>
-   * </UL>
-   * @param user the principal whose permission set is to be returned.
-   * @return the permission set specifying the permissions the principal
-   *     is allowed.
-   * @see java.security.Principal
-   */
-  @Override
-  public Enumeration<Permission> getPermissions(Principal user){
-        Vector<Permission> empty = new Vector<>();
-        for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
-          AclEntry ent = e.nextElement();
-          if (ent.getPrincipal().equals(user))
-                return ent.permissions();
-        }
-        return empty.elements();
-  }
-
-  /**
-   * Returns an enumeration of the entries in this ACL. Each element in the
-   * enumeration is of type AclEntry.
-   *
-   * @return an enumeration of the entries in this ACL.
-   */
-  @Override
-  public Enumeration<AclEntry> entries(){
-        return entryList.elements();
-  }
-
-  /**
-   * Checks whether or not the specified principal has the specified
-   * permission.
-   * If it does, true is returned, otherwise false is returned.
-   * More specifically, this method checks whether the passed permission
-   * is a member of the allowed permission set of the specified principal.
-   * The allowed permission set is determined by the same algorithm as is
-   * used by the getPermissions method.
-   *
-   * @param user the principal, assumed to be a valid authenticated Principal.
-   * @param perm the permission to be checked for.
-   * @return true if the principal has the specified permission,
-   *         false otherwise.
-   * @see java.security.Principal
-   * @see java.security.Permission
-   */
-  @Override
-  public boolean checkPermission(Principal user,
-                                 java.security.acl.Permission perm) {
-        for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
-          AclEntry ent = e.nextElement();
-          if (ent.getPrincipal().equals(user))
-                if (ent.checkPermission(perm)) return true;
-        }
-        return false;
-  }
-
-  /**
-   * Checks whether or not the specified principal has the specified
-   * permission.
-   * If it does, true is returned, otherwise false is returned.
-   * More specifically, this method checks whether the passed permission
-   * is a member of the allowed permission set of the specified principal.
-   * The allowed permission set is determined by the same algorithm as is
-   * used by the getPermissions method.
-   *
-   * @param user the principal, assumed to be a valid authenticated Principal.
-   * @param community the community name associated with the principal.
-   * @param perm the permission to be checked for.
-   * @return true if the principal has the specified permission, false
-   *        otherwise.
-   * @see java.security.Principal
-   * @see java.security.Permission
-   */
-  public boolean checkPermission(Principal user, String community,
-                                 java.security.acl.Permission perm) {
-        for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
-          AclEntryImpl ent = (AclEntryImpl) e.nextElement();
-          if (ent.getPrincipal().equals(user))
-                if (ent.checkPermission(perm) && ent.checkCommunity(community)) return true;
-        }
-        return false;
-  }
-
-  /**
-   * Checks whether or not the specified community string is defined.
-   *
-   * @param community the community name associated with the principal.
-   *
-   * @return true if the specified community string is defined, false
-   *      otherwise.
-   * @see java.security.Principal
-   * @see java.security.Permission
-   */
-  public boolean checkCommunity(String community) {
-        for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
-          AclEntryImpl ent = (AclEntryImpl) e.nextElement();
-          if (ent.checkCommunity(community)) return true;
-        }
-        return false;
-  }
-
-  /**
-   * Returns a string representation of the ACL contents.
-   *
-   * @return a string representation of the ACL contents.
-   */
-  @Override
-  public String toString(){
-        return ("AclImpl: "+ getName());
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/GroupImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.IPAcl;
-
-
-
-import java.util.Vector;
-import java.util.Enumeration;
-import java.io.Serializable;
-import java.net.UnknownHostException;
-
-
-import java.security.Principal;
-import java.security.acl.Group;
-
-
-/**
- * This class is used to represent a subnet mask (a group of hosts
- * matching the same
- * IP mask).
- *
- */
-
-class GroupImpl extends PrincipalImpl implements Group, Serializable {
-  private static final long serialVersionUID = -7777387035032541168L;
-
-  /**
-   * Constructs an empty group.
-   * @exception UnknownHostException Not implemented
-   */
-  public GroupImpl () throws UnknownHostException {
-  }
-
-  /**
-   * Constructs a group using the specified subnet mask.
-   *
-   * @param mask The subnet mask to use to build the group.
-   * @exception UnknownHostException if the subnet mask cann't be built.
-   */
-  public GroupImpl (String mask) throws UnknownHostException {
-        super(mask);
-  }
-
-    /**
-     * Adds the specified member to the group.
-     *
-     * @param p the principal to add to this group.
-     * @return true if the member was successfully added, false if the
-     *     principal was already a member.
-     */
-    public boolean addMember(Principal p) {
-        // we don't need to add members because the ip address is a
-        // subnet mask
-        return true;
-    }
-
-  public int hashCode() {
-        return super.hashCode();
-  }
-
-  /**
-   * Compares this group to the specified object. Returns true if the object
-   * passed in matches the group represented.
-   *
-   * @param p the object to compare with.
-   * @return true if the object passed in matches the subnet mask,
-   *   false otherwise.
-   */
-  public boolean equals (Object p) {
-        if (p instanceof PrincipalImpl || p instanceof GroupImpl){
-          if ((super.hashCode() & p.hashCode()) == p.hashCode()) return true;
-          else return false;
-        } else {
-          return false;
-        }
-  }
-
-  /**
-   * Returns true if the passed principal is a member of the group.
-   *
-   * @param p the principal whose membership is to be checked.
-   * @return true if the principal is a member of this group, false otherwise.
-   */
-  public boolean isMember(Principal p) {
-        if ((p.hashCode() & super.hashCode()) == p.hashCode()) return true;
-        else return false;
-  }
-
-  /**
-   * Returns an enumeration which contains the subnet mask.
-   *
-   * @return an enumeration which contains the subnet mask.
-   */
-  public Enumeration<? extends Principal> members(){
-        Vector<Principal> v = new Vector<Principal>(1);
-        v.addElement(this);
-        return v.elements();
-  }
-
-  /**
-   * Removes the specified member from the group. (Not implemented)
-   *
-   * @param p the principal to remove from this group.
-   * @return allways return true.
-   */
-  public boolean removeMember(Principal p) {
-        return true;
-  }
-
-  /**
-   * Prints a string representation of this group.
-   *
-   * @return  a string representation of this group.
-   */
-  public String toString() {
-        return ("GroupImpl :"+super.getAddress().toString());
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Host.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,182 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.IPAcl;
-
-
-
-// java import
-//
-import java.io.Serializable;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Hashtable;
-import java.util.logging.Level;
-import java.util.Vector;
-import java.security.acl.NotOwnerException;
-
-import static com.sun.jmx.defaults.JmxProperties.SNMP_LOGGER;
-
-/**
- * The class defines an abstract representation of a host.
- *
- */
-@SuppressWarnings("serial") // JDK implementation class
-abstract class Host extends SimpleNode implements Serializable {
-
-    public Host(int id) {
-        super(id);
-    }
-
-    public Host(Parser p, int id) {
-        super(p, id);
-    }
-
-    protected abstract PrincipalImpl createAssociatedPrincipal()
-        throws UnknownHostException;
-
-    protected abstract String getHname();
-
-    public void buildAclEntries(PrincipalImpl owner, AclImpl acl) {
-        // Create a principal
-        //
-        PrincipalImpl p=null;
-        try {
-            p = createAssociatedPrincipal();
-        } catch(UnknownHostException e) {
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, Host.class.getName(),
-                        "buildAclEntries",
-                        "Cannot create ACL entry; got exception", e);
-            }
-            throw new IllegalArgumentException("Cannot create ACL entry for " + e.getMessage());
-        }
-
-        // Create an AclEntry
-        //
-        AclEntryImpl entry= null;
-        try {
-            entry = new AclEntryImpl(p);
-            // Add permission
-            //
-            registerPermission(entry);
-            acl.addEntry(owner, entry);
-        } catch(UnknownHostException e) {
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, Host.class.getName(),
-                        "buildAclEntries",
-                        "Cannot create ACL entry; got exception", e);
-            }
-            return;
-        } catch(NotOwnerException a) {
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, Host.class.getName(),
-                        "buildAclEntries",
-                        "Cannot create ACL entry; got exception", a);
-            }
-            return;
-        }
-    }
-
-    private void registerPermission(AclEntryImpl entry) {
-        JDMHost host= (JDMHost) jjtGetParent();
-        JDMManagers manager= (JDMManagers) host.jjtGetParent();
-        JDMAclItem acl= (JDMAclItem) manager.jjtGetParent();
-        JDMAccess access= acl.getAccess();
-        access.putPermission(entry);
-        JDMCommunities comm= acl.getCommunities();
-        comm.buildCommunities(entry);
-    }
-
-    public void buildTrapEntries(Hashtable<InetAddress, Vector<String>> dest) {
-
-        JDMHostTrap host= (JDMHostTrap) jjtGetParent();
-        JDMTrapInterestedHost hosts= (JDMTrapInterestedHost) host.jjtGetParent();
-        JDMTrapItem trap = (JDMTrapItem) hosts.jjtGetParent();
-        JDMTrapCommunity community = trap.getCommunity();
-        String comm = community.getCommunity();
-
-        InetAddress add = null;
-        try {
-            add = java.net.InetAddress.getByName(getHname());
-        } catch(UnknownHostException e) {
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, Host.class.getName(),
-                        "buildTrapEntries",
-                        "Cannot create TRAP entry; got exception", e);
-            }
-            return;
-        }
-
-        Vector<String> list = null;
-        if (dest.containsKey(add)){
-            list = dest.get(add);
-            if (!list.contains(comm)){
-                list.addElement(comm);
-            }
-        } else {
-            list = new Vector<String>();
-            list.addElement(comm);
-            dest.put(add,list);
-        }
-    }
-
-    public void buildInformEntries(Hashtable<InetAddress, Vector<String>> dest) {
-
-        JDMHostInform host= (JDMHostInform) jjtGetParent();
-        JDMInformInterestedHost hosts= (JDMInformInterestedHost) host.jjtGetParent();
-        JDMInformItem inform = (JDMInformItem) hosts.jjtGetParent();
-        JDMInformCommunity community = inform.getCommunity();
-        String comm = community.getCommunity();
-
-        InetAddress add = null;
-        try {
-            add = java.net.InetAddress.getByName(getHname());
-        } catch(UnknownHostException e) {
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, Host.class.getName(),
-                        "buildTrapEntries",
-                        "Cannot create INFORM entry; got exception", e);
-            }
-            return;
-        }
-
-        Vector<String> list = null;
-        if (dest.containsKey(add)){
-            list = dest.get(add);
-            if (!list.contains(comm)){
-                list.addElement(comm);
-            }
-        } else {
-            list = new Vector<String>();
-            list.addElement(comm);
-            dest.put(add,list);
-        }
-    }
-
-
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMAccess.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMAccess.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-
-class JDMAccess extends SimpleNode {
-  protected int access= -1;
-
-  JDMAccess(int id) {
-    super(id);
-  }
-
-  JDMAccess(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMAccess(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMAccess(p, id);
-  }
-
-  protected void putPermission(AclEntryImpl entry) {
-    if (access == ParserConstants.RO) {
-       // We have a read-only access.
-       //
-       entry.addPermission(com.sun.jmx.snmp.IPAcl.SnmpAcl.getREAD());
-    }
-    if (access == ParserConstants.RW) {
-       // We have a read-write access.
-       //
-       entry.addPermission(com.sun.jmx.snmp.IPAcl.SnmpAcl.getREAD());
-       entry.addPermission(com.sun.jmx.snmp.IPAcl.SnmpAcl.getWRITE());
-    }
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMAclBlock.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMAclBlock.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-import java.net.InetAddress;
-import java.util.Hashtable;
-import java.util.Vector;
-
-class JDMAclBlock extends SimpleNode {
-  JDMAclBlock(int id) {
-    super(id);
-  }
-
-  JDMAclBlock(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMAclBlock(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMAclBlock(p, id);
-  }
-
-  /**
-   * Do no need to go through this part of the tree for
-   * building TrapEntry.
-   */
-   @Override
-   public void buildTrapEntries(Hashtable<InetAddress, Vector<String>> dest) {}
-
-  /**
-   * Do no need to go through this part of the tree for
-   * building InformEntry.
-   */
-    @Override
-   public void buildInformEntries(Hashtable<InetAddress, Vector<String>> dest) {}
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMAclItem.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMAclItem.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JDMAclItem extends SimpleNode {
-  protected JDMAccess access= null;
-  protected JDMCommunities com= null;
-
-  JDMAclItem(int id) {
-    super(id);
-  }
-
-  JDMAclItem(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMAclItem(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMAclItem(p, id);
-  }
-
-  public JDMAccess getAccess() {
-    return access;
-  }
-
-  public JDMCommunities getCommunities() {
-    return com;
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMCommunities.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMCommunities.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-
-class JDMCommunities extends SimpleNode {
-  JDMCommunities(int id) {
-    super(id);
-  }
-
-  JDMCommunities(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMCommunities(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMCommunities(p, id);
-  }
-
-  public void buildCommunities(AclEntryImpl entry){
-        for (int i =0 ; i < children.length ; i++)
-          entry.addCommunity(((JDMCommunity)children[i]).getCommunity());
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMCommunity.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMCommunity.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JDMCommunity extends SimpleNode {
-  protected String communityString= "";
-
-  JDMCommunity(int id) {
-    super(id);
-  }
-
-  JDMCommunity(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMCommunity(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMCommunity(p, id);
-  }
-
-  public String getCommunity(){
-        return communityString;
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMEnterprise.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMEnterprise.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JDMEnterprise extends SimpleNode {
-  protected String enterprise= "";
-
-  JDMEnterprise(int id) {
-    super(id);
-  }
-
-  JDMEnterprise(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMEnterprise(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMEnterprise(p, id);
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMHost.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMHost.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-
-class JDMHost extends SimpleNode {
-
-  JDMHost(int id) {
-    super(id);
-  }
-
-  JDMHost(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMHost(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMHost(p, id);
-  }
-
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMHostInform.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Generated By:JJTree: Do not edit this line. JDMHostInform.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JDMHostInform extends SimpleNode {
-    protected String name= "";
-
-    JDMHostInform(int id) {
-        super(id);
-    }
-
-    JDMHostInform(Parser p, int id) {
-        super(p, id);
-    }
-
-    public static Node jjtCreate(int id) {
-        return new JDMHostInform(id);
-    }
-
-    public static Node jjtCreate(Parser p, int id) {
-        return new JDMHostInform(p, id);
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMHostName.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMHostName.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-import java.net.UnknownHostException;
-
-class JDMHostName extends Host {
-  private static final long serialVersionUID = -9120082068923591122L;
-
-  protected StringBuffer name = new StringBuffer();
-
-  JDMHostName(int id) {
-    super(id);
-  }
-
-  JDMHostName(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMHostName(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMHostName(p, id);
-  }
-
-  protected String getHname() {
-        return name.toString();
-  }
-
-  protected PrincipalImpl createAssociatedPrincipal()
-    throws UnknownHostException {
-      return new PrincipalImpl(name.toString());
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMHostTrap.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMHostTrap.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JDMHostTrap extends SimpleNode {
-  protected String name= "";
-
-  JDMHostTrap(int id) {
-    super(id);
-  }
-
-  JDMHostTrap(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMHostTrap(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMHostTrap(p, id);
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMInformBlock.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Generated By:JJTree: Do not edit this line. JDMInformBlock.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-import java.net.InetAddress;
-import java.util.Hashtable;
-import java.util.Vector;
-
-class JDMInformBlock extends SimpleNode {
-    JDMInformBlock(int id) {
-        super(id);
-    }
-
-    JDMInformBlock(Parser p, int id) {
-        super(p, id);
-    }
-
-    public static Node jjtCreate(int id) {
-        return new JDMInformBlock(id);
-    }
-
-    public static Node jjtCreate(Parser p, int id) {
-        return new JDMInformBlock(p, id);
-    }
-
-    /**
-     * Do no need to go through this part of the tree for
-     * building AclEntry.
-     */
-    @Override
-    public void buildAclEntries(PrincipalImpl owner, AclImpl acl) {}
-
-    /**
-     * Do no need to go through this part of the tree for
-     * building TrapEntry.
-     */
-    @Override
-    public void buildTrapEntries(Hashtable<InetAddress, Vector<String>> dest) {}
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMInformCommunity.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Generated By:JJTree: Do not edit this line. JDMInformCommunity.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JDMInformCommunity extends SimpleNode {
-    protected String community= "";
-    JDMInformCommunity(int id) {
-        super(id);
-    }
-
-    JDMInformCommunity(Parser p, int id) {
-        super(p, id);
-    }
-
-    public static Node jjtCreate(int id) {
-        return new JDMInformCommunity(id);
-    }
-
-    public static Node jjtCreate(Parser p, int id) {
-        return new JDMInformCommunity(p, id);
-    }
-
-    public String getCommunity() {
-        return community;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMInformInterestedHost.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Generated By:JJTree: Do not edit this line. JDMInformInterestedHost.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JDMInformInterestedHost extends SimpleNode {
-    JDMInformInterestedHost(int id) {
-        super(id);
-    }
-
-    JDMInformInterestedHost(Parser p, int id) {
-        super(p, id);
-    }
-
-    public static Node jjtCreate(int id) {
-        return new JDMInformInterestedHost(id);
-    }
-
-    public static Node jjtCreate(Parser p, int id) {
-        return new JDMInformInterestedHost(p, id);
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMInformItem.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Generated By:JJTree: Do not edit this line. JDMInformItem.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JDMInformItem extends SimpleNode {
-    protected JDMInformCommunity comm = null;
-    JDMInformItem(int id) {
-        super(id);
-    }
-
-    JDMInformItem(Parser p, int id) {
-        super(p, id);
-    }
-
-    public static Node jjtCreate(int id) {
-        return new JDMInformItem(id);
-    }
-
-    public static Node jjtCreate(Parser p, int id) {
-        return new JDMInformItem(p, id);
-    }
-
-    public JDMInformCommunity getCommunity(){
-        return comm;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMIpAddress.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMIpAddress.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-import java.lang.StringBuffer;
-import java.net.UnknownHostException;
-
-class JDMIpAddress extends Host {
-  private static final long serialVersionUID = 849729919486384484L;
-
-  protected StringBuffer address= new StringBuffer();
-
-  JDMIpAddress(int id) {
-    super(id);
-  }
-
-  JDMIpAddress(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMIpAddress(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMIpAddress(p, id);
-  }
-
-  protected String getHname() {
-          return address.toString();
-  }
-
-  protected PrincipalImpl createAssociatedPrincipal()
-    throws UnknownHostException {
-      return new PrincipalImpl(address.toString());
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMIpMask.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMIpMask.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-import java.lang.StringBuffer;
-import java.net.UnknownHostException;
-
-class JDMIpMask extends Host {
-  private static final long serialVersionUID = -8211312690652331386L;
-
-  protected StringBuffer address= new StringBuffer();
-
-  JDMIpMask(int id) {
-    super(id);
-  }
-
-  JDMIpMask(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMIpMask(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMIpMask(p, id);
-  }
-
-  protected String getHname() {
-        return address.toString();
-  }
-
-  protected PrincipalImpl createAssociatedPrincipal()
-    throws UnknownHostException {
-      return new GroupImpl(address.toString());
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMIpV6Address.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Generated By:JJTree: Do not edit this line. JDMIpV6Address.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JDMIpV6Address extends JDMIpAddress {
-  private static final long serialVersionUID = -5929917334606674243L;
-
-  public JDMIpV6Address(int id) {
-    super(id);
-  }
-
-  public JDMIpV6Address(Parser p, int id) {
-    super(p, id);
-  }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMManagers.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMManagers.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JDMManagers extends SimpleNode {
-  JDMManagers(int id) {
-    super(id);
-  }
-
-  JDMManagers(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMManagers(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMManagers(p, id);
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMNetMask.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/* Generated By:JJTree: Do not edit this line. JDMNetMask.java */
-
-package com.sun.jmx.snmp.IPAcl;
-import java.net.UnknownHostException;
-
-class JDMNetMask extends Host {
-  private static final long serialVersionUID = -1979318280250821787L;
-
-  protected StringBuffer address= new StringBuffer();
-    protected String mask = null;
-  public JDMNetMask(int id) {
-    super(id);
-  }
-
-  public JDMNetMask(Parser p, int id) {
-    super(p, id);
-  }
-public static Node jjtCreate(int id) {
-      return new JDMNetMask(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMNetMask(p, id);
-  }
-
-  protected String getHname() {
-        return address.toString();
-  }
-
-  protected PrincipalImpl createAssociatedPrincipal()
-    throws UnknownHostException {
-      return new NetMaskImpl(address.toString(), Integer.parseInt(mask));
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMNetMaskV6.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Generated By:JJTree: Do not edit this line. JDMNetMaskV6.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-import java.net.UnknownHostException;
-
-class JDMNetMaskV6 extends JDMNetMask {
-  private static final long serialVersionUID = 4505256777680576645L;
-
-  public JDMNetMaskV6(int id) {
-    super(id);
-  }
-
-  public JDMNetMaskV6(Parser p, int id) {
-    super(p, id);
-  }
-    protected PrincipalImpl createAssociatedPrincipal()
-    throws UnknownHostException {
-      return new NetMaskImpl(address.toString(), Integer.parseInt(mask));
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMSecurityDefs.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMSecurityDefs.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JDMSecurityDefs extends SimpleNode {
-  JDMSecurityDefs(int id) {
-    super(id);
-  }
-
-  JDMSecurityDefs(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMSecurityDefs(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMSecurityDefs(p, id);
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapBlock.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMTrapBlock.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-import java.net.InetAddress;
-import java.util.Hashtable;
-import java.util.Vector;
-
-class JDMTrapBlock extends SimpleNode {
-  JDMTrapBlock(int id) {
-    super(id);
-  }
-
-  JDMTrapBlock(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMTrapBlock(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMTrapBlock(p, id);
-  }
-
-  /**
-   * Do no need to go through this part of the tree for
-   * building AclEntry.
-   */
-   @Override
-   public void buildAclEntries(PrincipalImpl owner, AclImpl acl) {}
-
-  /**
-   * Do no need to go through this part of the tree for
-   * building InformEntry.
-   */
-   @Override
-   public void buildInformEntries(Hashtable<InetAddress, Vector<String>> dest) {}
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapCommunity.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMTrapCommunity.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JDMTrapCommunity extends SimpleNode {
-  protected String community= "";
-  JDMTrapCommunity(int id) {
-    super(id);
-  }
-
-  JDMTrapCommunity(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMTrapCommunity(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMTrapCommunity(p, id);
-  }
-
-  public String getCommunity() {
-        return community;
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapInterestedHost.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMTrapInterestedHost.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JDMTrapInterestedHost extends SimpleNode {
-  JDMTrapInterestedHost(int id) {
-    super(id);
-  }
-
-  JDMTrapInterestedHost(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMTrapInterestedHost(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMTrapInterestedHost(p, id);
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapItem.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMTrapItem.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JDMTrapItem extends SimpleNode {
-  protected JDMTrapCommunity comm = null;
-
-  JDMTrapItem(int id) {
-    super(id);
-  }
-
-  JDMTrapItem(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMTrapItem(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMTrapItem(p, id);
-  }
-
-  public JDMTrapCommunity getCommunity(){
-        return comm;
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapNum.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. JDMTrapNum.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JDMTrapNum extends SimpleNode {
-  protected int low=0;
-  protected int high=0;
-
-  JDMTrapNum(int id) {
-    super(id);
-  }
-
-  JDMTrapNum(Parser p, int id) {
-    super(p, id);
-  }
-
-  public static Node jjtCreate(int id) {
-      return new JDMTrapNum(id);
-  }
-
-  public static Node jjtCreate(Parser p, int id) {
-      return new JDMTrapNum(p, id);
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JJTParserState.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Generated By:JJTree: Do not edit this line. JJTParserState.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-class JJTParserState {
-  private java.util.Stack<Node> nodes;
-  private java.util.Stack<Integer> marks;
-
-  private int sp;               // number of nodes on stack
-  private int mk;               // current mark
-  private boolean node_created;
-
-  JJTParserState() {
-    nodes = new java.util.Stack<>();
-    marks = new java.util.Stack<>();
-    sp = 0;
-    mk = 0;
-  }
-
-  /* Determines whether the current node was actually closed and
-     pushed.  This should only be called in the final user action of a
-     node scope.  */
-  boolean nodeCreated() {
-    return node_created;
-  }
-
-  /* Call this to reinitialize the node stack.  It is called
-     automatically by the parser's ReInit() method. */
-  void reset() {
-    nodes.removeAllElements();
-    marks.removeAllElements();
-    sp = 0;
-    mk = 0;
-  }
-
-  /* Returns the root node of the AST.  It only makes sense to call
-     this after a successful parse. */
-  Node rootNode() {
-    return nodes.elementAt(0);
-  }
-
-  /* Pushes a node on to the stack. */
-  void pushNode(Node n) {
-    nodes.push(n);
-    ++sp;
-  }
-
-  /* Returns the node on the top of the stack, and remove it from the
-     stack.  */
-  Node popNode() {
-    if (--sp < mk) {
-      mk = marks.pop().intValue();
-    }
-    return nodes.pop();
-  }
-
-  /* Returns the node currently on the top of the stack. */
-  Node peekNode() {
-    return nodes.peek();
-  }
-
-  /* Returns the number of children on the stack in the current node
-     scope. */
-  int nodeArity() {
-    return sp - mk;
-  }
-
-
-  void clearNodeScope(Node n) {
-    while (sp > mk) {
-      popNode();
-    }
-    mk = marks.pop().intValue();
-  }
-
-
-  void openNodeScope(Node n) {
-    marks.push(mk);
-    mk = sp;
-    n.jjtOpen();
-  }
-
-
-  /* A definite node is constructed from a specified number of
-     children.  That number of nodes are popped from the stack and
-     made the children of the definite node.  Then the definite node
-     is pushed on to the stack. */
-  void closeNodeScope(Node n, int num) {
-    mk = marks.pop().intValue();
-    while (num-- > 0) {
-      Node c = popNode();
-      c.jjtSetParent(n);
-      n.jjtAddChild(c, num);
-    }
-    n.jjtClose();
-    pushNode(n);
-    node_created = true;
-  }
-
-
-  /* A conditional node is constructed if its condition is true.  All
-     the nodes that have been pushed since the node was opened are
-     made children of the the conditional node, which is then pushed
-     on to the stack.  If the condition is false the node is not
-     constructed and they are left on the stack. */
-  void closeNodeScope(Node n, boolean condition) {
-    if (condition) {
-      int a = nodeArity();
-      mk = marks.pop().intValue();
-      while (a-- > 0) {
-        Node c = popNode();
-        c.jjtSetParent(n);
-        n.jjtAddChild(c, a);
-      }
-      n.jjtClose();
-      pushNode(n);
-      node_created = true;
-    } else {
-      mk = marks.pop().intValue();
-      node_created = false;
-    }
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,266 +0,0 @@
-/*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.IPAcl;
-
-import static com.sun.jmx.defaults.JmxProperties.SNMP_LOGGER;
-
-import java.util.logging.Level;
-import java.util.Vector;
-import java.util.Enumeration;
-import java.io.Serializable;
-import java.net.UnknownHostException;
-import java.net.InetAddress;
-
-import java.security.Principal;
-import java.security.acl.Group;
-
-
-/**
- * This class is used to represent a subnet mask (a group of hosts matching the same
- * IP mask).
- *
- * @see java.security.acl.Group
- */
-
-class NetMaskImpl extends PrincipalImpl implements Group, Serializable {
-    private static final long serialVersionUID = -7332541893877932896L;
-
-    protected byte[] subnet = null;
-    protected int prefix = -1;
-    /**
-     * Constructs an empty group.
-     * @exception UnknownHostException Not implemented
-     */
-    public NetMaskImpl () throws UnknownHostException {
-    }
-
-    private byte[] extractSubNet(byte[] b) {
-        int addrLength = b.length;
-        byte[] subnet = null;
-        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(),
-                "extractSubNet", "BINARY ARRAY :");
-            StringBuilder sb = new StringBuilder();
-            for(int i =0; i < addrLength; i++) {
-                sb.append((b[i] & 0xFF) + ":");
-            }
-            SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(),
-                "extractSubNet", sb.toString());
-        }
-
-        // 8 is a byte size. Common to any InetAddress (V4 or V6).
-        int fullyCoveredByte = prefix / 8;
-        if(fullyCoveredByte == addrLength) {
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet",
-                   "The mask is the complete address, strange..." + addrLength);
-            }
-            subnet = b;
-            return subnet;
-        }
-        if(fullyCoveredByte > addrLength) {
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet",
-                   "The number of covered byte is longer than the address. BUG");
-            }
-            throw new IllegalArgumentException("The number of covered byte is longer than the address.");
-        }
-        int partialyCoveredIndex = fullyCoveredByte;
-        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet",
-               "Partially covered index : " + partialyCoveredIndex);
-        }
-        byte toDeal = b[partialyCoveredIndex];
-        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet",
-               "Partially covered byte : " + toDeal);
-        }
-
-        // 8 is a byte size. Common to any InetAddress (V4 or V6).
-        int nbbits = prefix % 8;
-        int subnetSize = 0;
-
-        if(nbbits == 0)
-        subnetSize = partialyCoveredIndex;
-        else
-        subnetSize = partialyCoveredIndex + 1;
-
-        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet",
-               "Remains : " + nbbits);
-        }
-
-        byte mask = 0;
-        for(int i = 0; i < nbbits; i++) {
-            mask |= (1 << (7 - i));
-        }
-        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet",
-               "Mask value : " + (mask & 0xFF));
-        }
-
-        byte maskedValue = (byte) ((int)toDeal & (int)mask);
-
-        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet",
-               "Masked byte : "  + (maskedValue &0xFF));
-        }
-        subnet = new byte[subnetSize];
-        if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet",
-               "Resulting subnet : ");
-        }
-        for(int i = 0; i < partialyCoveredIndex; i++) {
-            subnet[i] = b[i];
-
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet",
-                   (subnet[i] & 0xFF) +":");
-            }
-        }
-
-        if(nbbits != 0) {
-            subnet[partialyCoveredIndex] = maskedValue;
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet",
-                    "Last subnet byte : " + (subnet[partialyCoveredIndex] &0xFF));
-            }
-        }
-        return subnet;
-    }
-
-  /**
-   * Constructs a group using the specified subnet mask.
-   * THIS ALGORITHM IS V4 and V6 compatible.
-   *
-   * @exception UnknownHostException if the subnet mask cann't be built.
-   */
-  public NetMaskImpl (String a, int prefix) throws UnknownHostException {
-        super(a);
-        this.prefix = prefix;
-        subnet = extractSubNet(getAddress().getAddress());
-  }
-
-  /**
-   * Adds the specified member to the group.
-   *
-   * @param p the principal to add to this group.
-   * @return true if the member was successfully added, false if the
-   *      principal was already a member.
-   */
-  public boolean addMember(Principal p) {
-        // we don't need to add members because the ip address is a subnet mask
-        return true;
-  }
-
-  public int hashCode() {
-        return super.hashCode();
-  }
-
-  /**
-   * Compares this group to the specified object. Returns true if the object
-   * passed in matches the group represented.
-   *
-   * @param p the object to compare with.
-   * @return true if the object passed in matches the subnet mask,
-   *    false otherwise.
-   */
-    public boolean equals (Object p) {
-        if (p instanceof PrincipalImpl || p instanceof NetMaskImpl){
-            PrincipalImpl received = (PrincipalImpl) p;
-            InetAddress addr = received.getAddress();
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "equals",
-                    "Received Address : " + addr);
-            }
-            byte[] recAddr = addr.getAddress();
-            for(int i = 0; i < subnet.length; i++) {
-                if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "equals",
-                        "(recAddr[i]) : " + (recAddr[i] & 0xFF));
-                    SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "equals",
-                        "(recAddr[i] & subnet[i]) : " +
-                         ((recAddr[i] & (int)subnet[i]) &0xFF) +
-                         " subnet[i] : " + (subnet[i] &0xFF));
-                }
-                if((recAddr[i] & subnet[i]) != subnet[i]) {
-                    if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "equals",
-                            "FALSE");
-                    }
-                    return false;
-                }
-            }
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "equals",
-                    "TRUE");
-            }
-            return true;
-        } else
-            return false;
-    }
-  /**
-   * Returns true if the passed principal is a member of the group.
-   *
-   * @param p the principal whose membership is to be checked.
-   * @return true if the principal is a member of this group, false otherwise.
-   */
-  public boolean isMember(Principal p) {
-        if ((p.hashCode() & super.hashCode()) == p.hashCode()) return true;
-        else return false;
-  }
-
-  /**
-   * Returns an enumeration which contains the subnet mask.
-   *
-   * @return an enumeration which contains the subnet mask.
-   */
-  public Enumeration<? extends Principal> members(){
-        Vector<Principal> v = new Vector<Principal>(1);
-        v.addElement(this);
-        return v.elements();
-  }
-
-  /**
-   * Removes the specified member from the group. (Not implemented)
-   *
-   * @param p the principal to remove from this group.
-   * @return allways return true.
-   */
-  public boolean removeMember(Principal p) {
-        return true;
-  }
-
-  /**
-   * Prints a string representation of this group.
-   *
-   * @return  a string representation of this group.
-   */
-  public String toString() {
-        return ("NetMaskImpl :"+ super.getAddress().toString() + "/" + prefix);
-  }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Node.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. Node.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-/* All AST nodes must implement this interface.  It provides basic
-   machinery for constructing the parent and child relationships
-   between nodes. */
-
-interface Node {
-
-  /** This method is called after the node has been made the current
-    node.  It indicates that child nodes can now be added to it. */
-  public void jjtOpen();
-
-  /** This method is called after all the child nodes have been
-    added. */
-  public void jjtClose();
-
-  /** This pair of methods are used to inform the node of its
-    parent. */
-  public void jjtSetParent(Node n);
-  public Node jjtGetParent();
-
-  /** This method tells the node to add its argument to the node's
-    list of children.  */
-  public void jjtAddChild(Node n, int i);
-
-  /** This method returns a child node.  The children are numbered
-     from zero, left to right. */
-  public Node jjtGetChild(int i);
-
-  /** Return the number of children the node has. */
-  public int jjtGetNumChildren();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/OwnerImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.IPAcl;
-
-
-
-import java.util.Vector;
-import java.io.Serializable;
-
-import java.security.Principal;
-import java.security.acl.Owner;
-import java.security.acl.LastOwnerException;
-import java.security.acl.NotOwnerException;
-
-
-/**
- * Owner of Access Control Lists (ACLs).
- * The initial owner Principal should be specified as an
- * argument to the constructor of the class AclImpl.
- *
- * @see java.security.acl.Owner
- */
-
-class OwnerImpl implements Owner, Serializable {
-  private static final long serialVersionUID = -576066072046319874L;
-
-  private Vector<Principal> ownerList = null;
-
-  /**
-   * Constructs an empty list of owner.
-   */
-  public OwnerImpl (){
-        ownerList = new Vector<Principal>();
-  }
-
-  /**
-   * Constructs a list of owner with the specified principal as first element.
-   *
-   * @param owner the principal added to the owner list.
-   */
-  public OwnerImpl (PrincipalImpl owner){
-        ownerList = new Vector<Principal>();
-        ownerList.addElement(owner);
-  }
-
-  /**
-   * Adds an owner. Only owners can modify ACL contents. The caller principal
-   * must be an owner of the ACL in order to invoke this method. That is, only
-   * an owner can add another owner. The initial owner is configured at
-   * ACL construction time.
-   *
-   * @param caller the principal invoking this method.
-   *        It must be an owner of the ACL.
-   * @param owner the owner that should be added to the list of owners.
-   * @return true if successful, false if owner is already an owner.
-   * @exception NotOwnerException if the caller principal is not an owner
-   *    of the ACL.
-   */
-  public boolean addOwner(Principal caller, Principal owner)
-        throws NotOwnerException {
-        if (!ownerList.contains(caller))
-          throw new NotOwnerException();
-
-        if (ownerList.contains(owner)) {
-          return false;
-        } else {
-          ownerList.addElement(owner);
-          return true;
-        }
-  }
-
-  /**
-   * Deletes an owner. If this is the last owner in the ACL, an exception is raised.
-   *<P>
-   * The caller principal must be an owner of the ACL in order to invoke this method.
-   *
-   * @param caller the principal invoking this method. It must be an owner
-   *   of the ACL.
-   * @param owner the owner to be removed from the list of owners.
-   * @return true if successful, false if owner is already an owner.
-   * @exception NotOwnerException if the caller principal is not an owner
-   *   of the ACL.
-   * @exception LastOwnerException if there is only one owner left, so that
-   *   deleteOwner would leave the ACL owner-less.
-   */
-  public boolean deleteOwner(Principal caller, Principal owner)
-                throws NotOwnerException,LastOwnerException {
-
-        if (!ownerList.contains(caller))
-          throw new NotOwnerException();
-
-        if (!ownerList.contains(owner)){
-          return false;
-        } else {
-          if (ownerList.size() == 1)
-                throw new LastOwnerException();
-
-          ownerList.removeElement(owner);
-          return true;
-        }
-  }
-
-  /**
-   * Returns true if the given principal is an owner of the ACL.
-   *
-   * @param owner the principal to be checked to determine whether or
-   *        not it is an owner.
-   * @return true if the given principal is an owner of the ACL.
-   */
-  public boolean isOwner(Principal owner){
-        return ownerList.contains(owner);
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ParseError.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JavaCC: Do not edit this line. ParseError.java Version 0.7pre1 */
-package com.sun.jmx.snmp.IPAcl;
-
-class ParseError extends Exception {
-   private static final long serialVersionUID = 4907307342076722310L;
-
-   public ParseError() {
-   }
-   public ParseError(String message) {
-      super(message);
-   }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 0.7pre6 */
-package com.sun.jmx.snmp.IPAcl;
-
-/**
- * This exception is thrown when parse errors are encountered.
- * You can explicitly create objects of this exception type by
- * calling the method generateParseException in the generated
- * parser.
- *
- * You can modify this class to customize your error reporting
- * mechanisms so long as you retain the public fields.
- */
-class ParseException extends Exception {
-  private static final long serialVersionUID = -3695190720704845876L;
-
-  /**
-   * This constructor is used by the method "generateParseException"
-   * in the generated parser.  Calling this constructor generates
-   * a new object of this type with the fields "currentToken",
-   * "expectedTokenSequences", and "tokenImage" set.  The boolean
-   * flag "specialConstructor" is also set to true to indicate that
-   * this constructor was used to create this object.
-   * This constructor calls its super class with the empty string
-   * to force the "toString" method of parent class "Throwable" to
-   * print the error message in the form:
-   *     ParseException: <result of getMessage>
-   */
-  public ParseException(Token currentTokenVal,
-                        int[][] expectedTokenSequencesVal,
-                        String[] tokenImageVal
-                       )
-  {
-    super("");
-    specialConstructor = true;
-    currentToken = currentTokenVal;
-    expectedTokenSequences = expectedTokenSequencesVal;
-    tokenImage = tokenImageVal;
-  }
-
-  /**
-   * The following constructors are for use by you for whatever
-   * purpose you can think of.  Constructing the exception in this
-   * manner makes the exception behave in the normal way - i.e., as
-   * documented in the class "Throwable".  The fields "errorToken",
-   * "expectedTokenSequences", and "tokenImage" do not contain
-   * relevant information.  The JavaCC generated code does not use
-   * these constructors.
-   */
-
-  public ParseException() {
-    super();
-    specialConstructor = false;
-  }
-
-  public ParseException(String message) {
-    super(message);
-    specialConstructor = false;
-  }
-
-  /**
-   * This variable determines which constructor was used to create
-   * this object and thereby affects the semantics of the
-   * "getMessage" method (see below).
-   */
-  protected boolean specialConstructor;
-
-  /**
-   * This is the last token that has been consumed successfully.  If
-   * this object has been created due to a parse error, the token
-   * followng this token will (therefore) be the first error token.
-   */
-  public Token currentToken;
-
-  /**
-   * Each entry in this array is an array of integers.  Each array
-   * of integers represents a sequence of tokens (by their ordinal
-   * values) that is expected at this point of the parse.
-   */
-  public int[][] expectedTokenSequences;
-
-  /**
-   * This is a reference to the "tokenImage" array of the generated
-   * parser within which the parse error occurred.  This array is
-   * defined in the generated ...Constants interface.
-   */
-  public String[] tokenImage;
-
-  /**
-   * This method has the standard behavior when this object has been
-   * created using the standard constructors.  Otherwise, it uses
-   * "currentToken" and "expectedTokenSequences" to generate a parse
-   * error message and returns it.  If this object has been created
-   * due to a parse error, and you do not catch it (it gets thrown
-   * from the parser), then this method is called during the printing
-   * of the final stack trace, and hence the correct error message
-   * gets displayed.
-   */
-  public String getMessage() {
-    if (!specialConstructor) {
-      return super.getMessage();
-    }
-    String expected = "";
-    int maxSize = 0;
-    for (int i = 0; i < expectedTokenSequences.length; i++) {
-      if (maxSize < expectedTokenSequences[i].length) {
-        maxSize = expectedTokenSequences[i].length;
-      }
-      for (int j = 0; j < expectedTokenSequences[i].length; j++) {
-        expected += tokenImage[expectedTokenSequences[i][j]] + " ";
-      }
-      if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
-        expected += "...";
-      }
-      expected += eol + "    ";
-    }
-    String retval = "Encountered \"";
-    Token tok = currentToken.next;
-    for (int i = 0; i < maxSize; i++) {
-      if (i != 0) retval += " ";
-      if (tok.kind == 0) {
-        retval += tokenImage[0];
-        break;
-      }
-      retval += add_escapes(tok.image);
-      tok = tok.next;
-    }
-    retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn + "." + eol;
-    if (expectedTokenSequences.length == 1) {
-      retval += "Was expecting:" + eol + "    ";
-    } else {
-      retval += "Was expecting one of:" + eol + "    ";
-    }
-    retval += expected;
-    return retval;
-  }
-
-  /**
-   * The end of line string for this machine.
-   */
-  protected String eol = System.getProperty("line.separator", "\n");
-
-  /**
-   * Used to convert raw characters to their escaped version
-   * when these raw version cannot be used as part of an ASCII
-   * string literal.
-   */
-  protected String add_escapes(String str) {
-      StringBuilder retval = new StringBuilder();
-      char ch;
-      for (int i = 0; i < str.length(); i++) {
-        switch (str.charAt(i))
-        {
-           case 0 :
-              continue;
-           case '\b':
-              retval.append("\\b");
-              continue;
-           case '\t':
-              retval.append("\\t");
-              continue;
-           case '\n':
-              retval.append("\\n");
-              continue;
-           case '\f':
-              retval.append("\\f");
-              continue;
-           case '\r':
-              retval.append("\\r");
-              continue;
-           case '\"':
-              retval.append("\\\"");
-              continue;
-           case '\'':
-              retval.append("\\\'");
-              continue;
-           case '\\':
-              retval.append("\\\\");
-              continue;
-           default:
-              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
-                 String s = "0000" + Integer.toString(ch, 16);
-                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
-              } else {
-                 retval.append(ch);
-              }
-              continue;
-        }
-      }
-      return retval.toString();
-   }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1285 +0,0 @@
-/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Generated By:JJTree&JavaCC: Do not edit this line. Parser.java */
-package com.sun.jmx.snmp.IPAcl;
-
-import java.io.*;
-
-@SuppressWarnings("unchecked")  // generated code, not worth fixing
-class Parser/*@bgen(jjtree)*/implements ParserTreeConstants, ParserConstants {/*@bgen(jjtree)*/
-  protected JJTParserState jjtree = new JJTParserState();
-
-// A file can contain several acl definitions
-//
-  final public JDMSecurityDefs SecurityDefs() throws ParseException {
-                                   /*@bgen(jjtree) SecurityDefs */
-  JDMSecurityDefs jjtn000 = new JDMSecurityDefs(JJTSECURITYDEFS);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-    try {
-      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-      case ACL:
-        AclBlock();
-        break;
-      default:
-        jj_la1[0] = jj_gen;
-        ;
-      }
-      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-      case TRAP:
-        TrapBlock();
-        break;
-      default:
-        jj_la1[1] = jj_gen;
-        ;
-      }
-      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-      case INFORM:
-        InformBlock();
-        break;
-      default:
-        jj_la1[2] = jj_gen;
-        ;
-      }
-      jj_consume_token(0);
-    jjtree.closeNodeScope(jjtn000, true);
-    jjtc000 = false;
-    {if (true) return jjtn000;}
-    } catch (Throwable jjte000) {
-    if (jjtc000) {
-      jjtree.clearNodeScope(jjtn000);
-      jjtc000 = false;
-    } else {
-      jjtree.popNode();
-    }
-    if (jjte000 instanceof RuntimeException) {
-      {if (true) throw (RuntimeException)jjte000;}
-    }
-    if (jjte000 instanceof ParseException) {
-      {if (true) throw (ParseException)jjte000;}
-    }
-    {if (true) throw (Error)jjte000;}
-    } finally {
-    if (jjtc000) {
-      jjtree.closeNodeScope(jjtn000, true);
-    }
-    }
-    throw new Error("Missing return statement in function");
-  }
-
-  final public void AclBlock() throws ParseException {
-                  /*@bgen(jjtree) AclBlock */
-  JDMAclBlock jjtn000 = new JDMAclBlock(JJTACLBLOCK);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-    try {
-      jj_consume_token(ACL);
-      jj_consume_token(ASSIGN);
-      jj_consume_token(LBRACE);
-      label_1:
-      while (true) {
-        AclItem();
-        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case LBRACE:
-          ;
-          break;
-        default:
-          jj_la1[3] = jj_gen;
-          break label_1;
-        }
-      }
-      jj_consume_token(RBRACE);
-    } catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    {if (true) throw (RuntimeException)jjte000;}
-  }
-  if (jjte000 instanceof ParseException) {
-    {if (true) throw (ParseException)jjte000;}
-  }
-  {if (true) throw (Error)jjte000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public void AclItem() throws ParseException {
-                 /*@bgen(jjtree) AclItem */
-  JDMAclItem jjtn000 = new JDMAclItem(JJTACLITEM);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-    try {
-      jj_consume_token(LBRACE);
-      jjtn000.com = Communities();
-      jjtn000.access = Access();
-      Managers();
-      jj_consume_token(RBRACE);
-    } catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    {if (true) throw (RuntimeException)jjte000;}
-  }
-  if (jjte000 instanceof ParseException) {
-    {if (true) throw (ParseException)jjte000;}
-  }
-  {if (true) throw (Error)jjte000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public JDMCommunities Communities() throws ParseException {
-                               /*@bgen(jjtree) Communities */
-  JDMCommunities jjtn000 = new JDMCommunities(JJTCOMMUNITIES);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-    try {
-      jj_consume_token(COMMUNITIES);
-      jj_consume_token(ASSIGN);
-      Community();
-      label_2:
-      while (true) {
-        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case COMMA:
-          ;
-          break;
-        default:
-          jj_la1[4] = jj_gen;
-          break label_2;
-        }
-        jj_consume_token(COMMA);
-        Community();
-      }
-  jjtree.closeNodeScope(jjtn000, true);
-  jjtc000 = false;
- {if (true) return jjtn000;}
-    } catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    {if (true) throw (RuntimeException)jjte000;}
-  }
-  if (jjte000 instanceof ParseException) {
-    {if (true) throw (ParseException)jjte000;}
-  }
-  {if (true) throw (Error)jjte000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-    throw new Error("Missing return statement in function");
-  }
-
-  final public void Community() throws ParseException {
- /*@bgen(jjtree) Community */
-  JDMCommunity jjtn000 = new JDMCommunity(JJTCOMMUNITY);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);Token t;
-    try {
-      t = jj_consume_token(IDENTIFIER);
-                 jjtree.closeNodeScope(jjtn000, true);
-                 jjtc000 = false;
-                jjtn000.communityString= t.image;
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public JDMAccess Access() throws ParseException {
-                     /*@bgen(jjtree) Access */
-  JDMAccess jjtn000 = new JDMAccess(JJTACCESS);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-    try {
-      jj_consume_token(ACCESS);
-      jj_consume_token(ASSIGN);
-      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-      case RO:
-        jj_consume_token(RO);
-                     jjtn000.access= RO;
-        break;
-      case RW:
-        jj_consume_token(RW);
-                     jjtn000.access= RW;
-        break;
-      default:
-        jj_la1[5] = jj_gen;
-        jj_consume_token(-1);
-        throw new ParseException();
-      }
-  jjtree.closeNodeScope(jjtn000, true);
-  jjtc000 = false;
- {if (true) return jjtn000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-    throw new Error("Missing return statement in function");
-  }
-
-  final public void Managers() throws ParseException {
-                   /*@bgen(jjtree) Managers */
-  JDMManagers jjtn000 = new JDMManagers(JJTMANAGERS);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-    try {
-      jj_consume_token(MANAGERS);
-      jj_consume_token(ASSIGN);
-      Host();
-      label_3:
-      while (true) {
-        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case COMMA:
-          ;
-          break;
-        default:
-          jj_la1[6] = jj_gen;
-          break label_3;
-        }
-        jj_consume_token(COMMA);
-        Host();
-      }
-    } catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    {if (true) throw (RuntimeException)jjte000;}
-  }
-  if (jjte000 instanceof ParseException) {
-    {if (true) throw (ParseException)jjte000;}
-  }
-  {if (true) throw (Error)jjte000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public void Host() throws ParseException {
- /*@bgen(jjtree) Host */
-  JDMHost jjtn000 = new JDMHost(JJTHOST);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);Token t;
-    try {
-      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-      case IDENTIFIER:
-        HostName();
-        break;
-      default:
-        jj_la1[7] = jj_gen;
-        if (jj_2_1(2147483647)) {
-          NetMask();
-        } else if (jj_2_2(2147483647)) {
-          NetMaskV6();
-        } else if (jj_2_3(2147483647)) {
-          IpAddress();
-        } else {
-          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-          case V6_ADDRESS:
-            IpV6Address();
-            break;
-          case INTEGER_LITERAL:
-            IpMask();
-            break;
-          default:
-            jj_la1[8] = jj_gen;
-            jj_consume_token(-1);
-            throw new ParseException();
-          }
-        }
-      }
-    } catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    {if (true) throw (RuntimeException)jjte000;}
-  }
-  if (jjte000 instanceof ParseException) {
-    {if (true) throw (ParseException)jjte000;}
-  }
-  {if (true) throw (Error)jjte000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public void HostName() throws ParseException {
- /*@bgen(jjtree) HostName */
-  JDMHostName jjtn000 = new JDMHostName(JJTHOSTNAME);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);Token t;
-    try {
-      t = jj_consume_token(IDENTIFIER);
-                   jjtn000.name.append(t.image);
-      label_4:
-      while (true) {
-        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case DOT:
-          ;
-          break;
-        default:
-          jj_la1[9] = jj_gen;
-          break label_4;
-        }
-        jj_consume_token(DOT);
-        t = jj_consume_token(IDENTIFIER);
-   jjtn000.name.append( "." + t.image);
-      }
-    } finally {
-    if (jjtc000) {
-      jjtree.closeNodeScope(jjtn000, true);
-    }
-    }
-  }
-
-  final public void IpAddress() throws ParseException {
- /*@bgen(jjtree) IpAddress */
-JDMIpAddress jjtn000 = new JDMIpAddress(JJTIPADDRESS);
-boolean jjtc000 = true;
-jjtree.openNodeScope(jjtn000);Token t;
-    try {
-      t = jj_consume_token(INTEGER_LITERAL);
-   jjtn000.address.append(t.image);
-      label_5:
-      while (true) {
-        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case DOT:
-          ;
-          break;
-        default:
-          jj_la1[10] = jj_gen;
-          break label_5;
-        }
-        jj_consume_token(DOT);
-        t = jj_consume_token(INTEGER_LITERAL);
-   jjtn000.address.append( "." + t.image);
-      }
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public void IpV6Address() throws ParseException {
- /*@bgen(jjtree) IpV6Address */
-JDMIpV6Address jjtn000 = new JDMIpV6Address(JJTIPV6ADDRESS);
-boolean jjtc000 = true;
-jjtree.openNodeScope(jjtn000);Token t;
-    try {
-      t = jj_consume_token(V6_ADDRESS);
-    jjtree.closeNodeScope(jjtn000, true);
-    jjtc000 = false;
-   jjtn000.address.append(t.image);
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public void IpMask() throws ParseException {
- /*@bgen(jjtree) IpMask */
-JDMIpMask jjtn000 = new JDMIpMask(JJTIPMASK);
-boolean jjtc000 = true;
-jjtree.openNodeScope(jjtn000);Token t;
-    try {
-      t = jj_consume_token(INTEGER_LITERAL);
-   jjtn000.address.append(t.image);
-      label_6:
-      while (true) {
-        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case MARK:
-          ;
-          break;
-        default:
-          jj_la1[11] = jj_gen;
-          break label_6;
-        }
-        jj_consume_token(MARK);
-        t = jj_consume_token(INTEGER_LITERAL);
-   jjtn000.address.append( "." + t.image);
-      }
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public void NetMask() throws ParseException {
- /*@bgen(jjtree) NetMask */
-JDMNetMask jjtn000 = new JDMNetMask(JJTNETMASK);
-boolean jjtc000 = true;
-jjtree.openNodeScope(jjtn000);Token t;
-    try {
-      t = jj_consume_token(INTEGER_LITERAL);
-   jjtn000.address.append(t.image);
-      label_7:
-      while (true) {
-        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case DOT:
-          ;
-          break;
-        default:
-          jj_la1[12] = jj_gen;
-          break label_7;
-        }
-        jj_consume_token(DOT);
-        t = jj_consume_token(INTEGER_LITERAL);
-   jjtn000.address.append( "." + t.image);
-      }
-      jj_consume_token(MASK);
-      t = jj_consume_token(INTEGER_LITERAL);
-                              jjtree.closeNodeScope(jjtn000, true);
-                              jjtc000 = false;
-                             jjtn000.mask = t.image;
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public void NetMaskV6() throws ParseException {
- /*@bgen(jjtree) NetMaskV6 */
-JDMNetMaskV6 jjtn000 = new JDMNetMaskV6(JJTNETMASKV6);
-boolean jjtc000 = true;
-jjtree.openNodeScope(jjtn000);Token t;
-    try {
-      t = jj_consume_token(V6_ADDRESS);
-   jjtn000.address.append(t.image);
-      jj_consume_token(MASK);
-      t = jj_consume_token(INTEGER_LITERAL);
-                           jjtree.closeNodeScope(jjtn000, true);
-                           jjtc000 = false;
-                          jjtn000.mask = t.image;
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public void TrapBlock() throws ParseException {
-                   /*@bgen(jjtree) TrapBlock */
-  JDMTrapBlock jjtn000 = new JDMTrapBlock(JJTTRAPBLOCK);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-    try {
-      jj_consume_token(TRAP);
-      jj_consume_token(ASSIGN);
-      jj_consume_token(LBRACE);
-      label_8:
-      while (true) {
-        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case LBRACE:
-          ;
-          break;
-        default:
-          jj_la1[13] = jj_gen;
-          break label_8;
-        }
-        TrapItem();
-      }
-      jj_consume_token(RBRACE);
-    } catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    {if (true) throw (RuntimeException)jjte000;}
-  }
-  if (jjte000 instanceof ParseException) {
-    {if (true) throw (ParseException)jjte000;}
-  }
-  {if (true) throw (Error)jjte000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public void TrapItem() throws ParseException {
-                  /*@bgen(jjtree) TrapItem */
-  JDMTrapItem jjtn000 = new JDMTrapItem(JJTTRAPITEM);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-    try {
-      jj_consume_token(LBRACE);
-      jjtn000.comm = TrapCommunity();
-      TrapInterestedHost();
-      label_9:
-      while (true) {
-        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case LBRACE:
-          ;
-          break;
-        default:
-          jj_la1[14] = jj_gen;
-          break label_9;
-        }
-        Enterprise();
-      }
-      jj_consume_token(RBRACE);
-    } catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    {if (true) throw (RuntimeException)jjte000;}
-  }
-  if (jjte000 instanceof ParseException) {
-    {if (true) throw (ParseException)jjte000;}
-  }
-  {if (true) throw (Error)jjte000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public JDMTrapCommunity TrapCommunity() throws ParseException {
- /*@bgen(jjtree) TrapCommunity */
-  JDMTrapCommunity jjtn000 = new JDMTrapCommunity(JJTTRAPCOMMUNITY);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);Token t;
-    try {
-      jj_consume_token(TRAPCOMMUNITY);
-      jj_consume_token(ASSIGN);
-      t = jj_consume_token(IDENTIFIER);
-                                      jjtree.closeNodeScope(jjtn000, true);
-                                      jjtc000 = false;
-                                      jjtn000.community= t.image; {if (true) return jjtn000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-    throw new Error("Missing return statement in function");
-  }
-
-  final public void TrapInterestedHost() throws ParseException {
-                            /*@bgen(jjtree) TrapInterestedHost */
-  JDMTrapInterestedHost jjtn000 = new JDMTrapInterestedHost(JJTTRAPINTERESTEDHOST);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-    try {
-      jj_consume_token(HOSTS);
-      jj_consume_token(ASSIGN);
-      HostTrap();
-      label_10:
-      while (true) {
-        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case COMMA:
-          ;
-          break;
-        default:
-          jj_la1[15] = jj_gen;
-          break label_10;
-        }
-        jj_consume_token(COMMA);
-        HostTrap();
-      }
-    } catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    {if (true) throw (RuntimeException)jjte000;}
-  }
-  if (jjte000 instanceof ParseException) {
-    {if (true) throw (ParseException)jjte000;}
-  }
-  {if (true) throw (Error)jjte000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public void HostTrap() throws ParseException {
- /*@bgen(jjtree) HostTrap */
-  JDMHostTrap jjtn000 = new JDMHostTrap(JJTHOSTTRAP);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);Token t;
-    try {
-      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-      case IDENTIFIER:
-        HostName();
-        break;
-      case INTEGER_LITERAL:
-        IpAddress();
-        break;
-      case V6_ADDRESS:
-        IpV6Address();
-        break;
-      default:
-        jj_la1[16] = jj_gen;
-        jj_consume_token(-1);
-        throw new ParseException();
-      }
-    } catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    {if (true) throw (RuntimeException)jjte000;}
-  }
-  if (jjte000 instanceof ParseException) {
-    {if (true) throw (ParseException)jjte000;}
-  }
-  {if (true) throw (Error)jjte000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public void Enterprise() throws ParseException {
- /*@bgen(jjtree) Enterprise */
-  JDMEnterprise jjtn000 = new JDMEnterprise(JJTENTERPRISE);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);Token t;
-    try {
-      jj_consume_token(LBRACE);
-      jj_consume_token(ENTERPRISE);
-      jj_consume_token(ASSIGN);
-      t = jj_consume_token(CSTRING);
-                               jjtn000.enterprise= t.image;
-      jj_consume_token(TRAPNUM);
-      jj_consume_token(ASSIGN);
-      TrapNum();
-      label_11:
-      while (true) {
-        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case COMMA:
-          ;
-          break;
-        default:
-          jj_la1[17] = jj_gen;
-          break label_11;
-        }
-        jj_consume_token(COMMA);
-        TrapNum();
-      }
-      jj_consume_token(RBRACE);
-    } catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    {if (true) throw (RuntimeException)jjte000;}
-  }
-  if (jjte000 instanceof ParseException) {
-    {if (true) throw (ParseException)jjte000;}
-  }
-  {if (true) throw (Error)jjte000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public void TrapNum() throws ParseException {
- /*@bgen(jjtree) TrapNum */
-  JDMTrapNum jjtn000 = new JDMTrapNum(JJTTRAPNUM);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);Token t;
-    try {
-      t = jj_consume_token(INTEGER_LITERAL);
-                       jjtn000.low= Integer.parseInt(t.image);
-      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-      case RANGE:
-        jj_consume_token(RANGE);
-        t = jj_consume_token(INTEGER_LITERAL);
-                           jjtn000.high= Integer.parseInt(t.image);
-        break;
-      default:
-        jj_la1[18] = jj_gen;
-        ;
-      }
-    } finally {
-    if (jjtc000) {
-      jjtree.closeNodeScope(jjtn000, true);
-    }
-    }
-  }
-
-  final public void InformBlock() throws ParseException {
-                     /*@bgen(jjtree) InformBlock */
-  JDMInformBlock jjtn000 = new JDMInformBlock(JJTINFORMBLOCK);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-    try {
-      jj_consume_token(INFORM);
-      jj_consume_token(ASSIGN);
-      jj_consume_token(LBRACE);
-      label_12:
-      while (true) {
-        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case LBRACE:
-          ;
-          break;
-        default:
-          jj_la1[19] = jj_gen;
-          break label_12;
-        }
-        InformItem();
-      }
-      jj_consume_token(RBRACE);
-    } catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    {if (true) throw (RuntimeException)jjte000;}
-  }
-  if (jjte000 instanceof ParseException) {
-    {if (true) throw (ParseException)jjte000;}
-  }
-  {if (true) throw (Error)jjte000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public void InformItem() throws ParseException {
-                    /*@bgen(jjtree) InformItem */
-  JDMInformItem jjtn000 = new JDMInformItem(JJTINFORMITEM);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-    try {
-      jj_consume_token(LBRACE);
-      jjtn000.comm = InformCommunity();
-      InformInterestedHost();
-      jj_consume_token(RBRACE);
-    } catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    {if (true) throw (RuntimeException)jjte000;}
-  }
-  if (jjte000 instanceof ParseException) {
-    {if (true) throw (ParseException)jjte000;}
-  }
-  {if (true) throw (Error)jjte000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public JDMInformCommunity InformCommunity() throws ParseException {
- /*@bgen(jjtree) InformCommunity */
-  JDMInformCommunity jjtn000 = new JDMInformCommunity(JJTINFORMCOMMUNITY);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);Token t;
-    try {
-      jj_consume_token(INFORMCOMMUNITY);
-      jj_consume_token(ASSIGN);
-      t = jj_consume_token(IDENTIFIER);
-                                        jjtree.closeNodeScope(jjtn000, true);
-                                        jjtc000 = false;
-                                        jjtn000.community= t.image; {if (true) return jjtn000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-    throw new Error("Missing return statement in function");
-  }
-
-  final public void InformInterestedHost() throws ParseException {
-                              /*@bgen(jjtree) InformInterestedHost */
-  JDMInformInterestedHost jjtn000 = new JDMInformInterestedHost(JJTINFORMINTERESTEDHOST);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-    try {
-      jj_consume_token(HOSTS);
-      jj_consume_token(ASSIGN);
-      HostInform();
-      label_13:
-      while (true) {
-        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case COMMA:
-          ;
-          break;
-        default:
-          jj_la1[20] = jj_gen;
-          break label_13;
-        }
-        jj_consume_token(COMMA);
-        HostInform();
-      }
-    } catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    {if (true) throw (RuntimeException)jjte000;}
-  }
-  if (jjte000 instanceof ParseException) {
-    {if (true) throw (ParseException)jjte000;}
-  }
-  {if (true) throw (Error)jjte000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final public void HostInform() throws ParseException {
- /*@bgen(jjtree) HostInform */
-  JDMHostInform jjtn000 = new JDMHostInform(JJTHOSTINFORM);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);Token t;
-    try {
-      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-      case IDENTIFIER:
-        HostName();
-        break;
-      case INTEGER_LITERAL:
-        IpAddress();
-        break;
-      case V6_ADDRESS:
-        IpV6Address();
-        break;
-      default:
-        jj_la1[21] = jj_gen;
-        jj_consume_token(-1);
-        throw new ParseException();
-      }
-    } catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    {if (true) throw (RuntimeException)jjte000;}
-  }
-  if (jjte000 instanceof ParseException) {
-    {if (true) throw (ParseException)jjte000;}
-  }
-  {if (true) throw (Error)jjte000;}
-    } finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-    }
-  }
-
-  final private boolean jj_2_1(int xla) {
-    jj_la = xla; jj_lastpos = jj_scanpos = token;
-    boolean retval = !jj_3_1();
-    jj_save(0, xla);
-    return retval;
-  }
-
-  final private boolean jj_2_2(int xla) {
-    jj_la = xla; jj_lastpos = jj_scanpos = token;
-    boolean retval = !jj_3_2();
-    jj_save(1, xla);
-    return retval;
-  }
-
-  final private boolean jj_2_3(int xla) {
-    jj_la = xla; jj_lastpos = jj_scanpos = token;
-    boolean retval = !jj_3_3();
-    jj_save(2, xla);
-    return retval;
-  }
-
-  final private boolean jj_3_3() {
-    if (jj_scan_token(INTEGER_LITERAL)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    if (jj_scan_token(DOT)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  final private boolean jj_3_2() {
-    if (jj_scan_token(V6_ADDRESS)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    if (jj_scan_token(MASK)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    if (jj_scan_token(INTEGER_LITERAL)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  final private boolean jj_3_1() {
-    if (jj_scan_token(INTEGER_LITERAL)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    Token xsp;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_14()) { jj_scanpos = xsp; break; }
-      if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    }
-    if (jj_scan_token(MASK)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    if (jj_scan_token(INTEGER_LITERAL)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  final private boolean jj_3R_14() {
-    if (jj_scan_token(DOT)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    if (jj_scan_token(INTEGER_LITERAL)) return true;
-    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
-    return false;
-  }
-
-  public ParserTokenManager token_source;
-  ASCII_CharStream jj_input_stream;
-  public Token token, jj_nt;
-  private int jj_ntk;
-  private Token jj_scanpos, jj_lastpos;
-  private int jj_la;
-  public boolean lookingAhead = false;
-  private boolean jj_semLA;
-  private int jj_gen;
-  final private int[] jj_la1 = new int[22];
-  final private int[] jj_la1_0 = {0x100,0x80000,0x100000,0x2000,0x0,0x60000,0x0,0x80000000,0x11000000,0x0,0x0,0x0,0x0,0x2000,0x2000,0x0,0x91000000,0x0,0x8000,0x2000,0x0,0x91000000,};
-  final private int[] jj_la1_1 = {0x0,0x0,0x0,0x0,0x10,0x0,0x10,0x0,0x0,0x20,0x20,0x40,0x20,0x0,0x0,0x10,0x0,0x10,0x0,0x0,0x10,0x0,};
-  final private JJCalls[] jj_2_rtns = new JJCalls[3];
-  private boolean jj_rescan = false;
-  private int jj_gc = 0;
-
-  public Parser(java.io.InputStream stream) {
-    jj_input_stream = new ASCII_CharStream(stream, 1, 1);
-    token_source = new ParserTokenManager(jj_input_stream);
-    token = new Token();
-    jj_ntk = -1;
-    jj_gen = 0;
-    for (int i = 0; i < 22; i++) jj_la1[i] = -1;
-    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
-  }
-
-  public void ReInit(java.io.InputStream stream) {
-    jj_input_stream.ReInit(stream, 1, 1);
-    token_source.ReInit(jj_input_stream);
-    token = new Token();
-    jj_ntk = -1;
-    jjtree.reset();
-    jj_gen = 0;
-    for (int i = 0; i < 22; i++) jj_la1[i] = -1;
-    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
-  }
-
-  public Parser(java.io.Reader stream) {
-    jj_input_stream = new ASCII_CharStream(stream, 1, 1);
-    token_source = new ParserTokenManager(jj_input_stream);
-    token = new Token();
-    jj_ntk = -1;
-    jj_gen = 0;
-    for (int i = 0; i < 22; i++) jj_la1[i] = -1;
-    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
-  }
-
-  public void ReInit(java.io.Reader stream) {
-    jj_input_stream.ReInit(stream, 1, 1);
-    token_source.ReInit(jj_input_stream);
-    token = new Token();
-    jj_ntk = -1;
-    jjtree.reset();
-    jj_gen = 0;
-    for (int i = 0; i < 22; i++) jj_la1[i] = -1;
-    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
-  }
-
-  public Parser(ParserTokenManager tm) {
-    token_source = tm;
-    token = new Token();
-    jj_ntk = -1;
-    jj_gen = 0;
-    for (int i = 0; i < 22; i++) jj_la1[i] = -1;
-    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
-  }
-
-  public void ReInit(ParserTokenManager tm) {
-    token_source = tm;
-    token = new Token();
-    jj_ntk = -1;
-    jjtree.reset();
-    jj_gen = 0;
-    for (int i = 0; i < 22; i++) jj_la1[i] = -1;
-    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
-  }
-
-  final private Token jj_consume_token(int kind) throws ParseException {
-    Token oldToken;
-    if ((oldToken = token).next != null) token = token.next;
-    else token = token.next = token_source.getNextToken();
-    jj_ntk = -1;
-    if (token.kind == kind) {
-      jj_gen++;
-      if (++jj_gc > 100) {
-        jj_gc = 0;
-        for (int i = 0; i < jj_2_rtns.length; i++) {
-          JJCalls c = jj_2_rtns[i];
-          while (c != null) {
-            if (c.gen < jj_gen) c.first = null;
-            c = c.next;
-          }
-        }
-      }
-      return token;
-    }
-    token = oldToken;
-    jj_kind = kind;
-    throw generateParseException();
-  }
-
-  final private boolean jj_scan_token(int kind) {
-    if (jj_scanpos == jj_lastpos) {
-      jj_la--;
-      if (jj_scanpos.next == null) {
-        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
-      } else {
-        jj_lastpos = jj_scanpos = jj_scanpos.next;
-      }
-    } else {
-      jj_scanpos = jj_scanpos.next;
-    }
-    if (jj_rescan) {
-      int i = 0; Token tok = token;
-      while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
-      if (tok != null) jj_add_error_token(kind, i);
-    }
-    return (jj_scanpos.kind != kind);
-  }
-
-  final public Token getNextToken() {
-    if (token.next != null) token = token.next;
-    else token = token.next = token_source.getNextToken();
-    jj_ntk = -1;
-    jj_gen++;
-    return token;
-  }
-
-  final public Token getToken(int index) {
-    Token t = lookingAhead ? jj_scanpos : token;
-    for (int i = 0; i < index; i++) {
-      if (t.next != null) t = t.next;
-      else t = t.next = token_source.getNextToken();
-    }
-    return t;
-  }
-
-  final private int jj_ntk() {
-    if ((jj_nt=token.next) == null)
-      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
-    else
-      return (jj_ntk = jj_nt.kind);
-  }
-
-  private java.util.Vector<int[]> jj_expentries = new java.util.Vector<>();
-  private int[] jj_expentry;
-  private int jj_kind = -1;
-  private int[] jj_lasttokens = new int[100];
-  private int jj_endpos;
-
-  private void jj_add_error_token(int kind, int pos) {
-    if (pos >= 100) return;
-    if (pos == jj_endpos + 1) {
-      jj_lasttokens[jj_endpos++] = kind;
-    } else if (jj_endpos != 0) {
-      jj_expentry = new int[jj_endpos];
-      for (int i = 0; i < jj_endpos; i++) {
-        jj_expentry[i] = jj_lasttokens[i];
-      }
-      boolean exists = false;
-      for (java.util.Enumeration<int[]> enumv = jj_expentries.elements(); enumv.hasMoreElements();) {
-        int[] oldentry = enumv.nextElement();
-        if (oldentry.length == jj_expentry.length) {
-          exists = true;
-          for (int i = 0; i < jj_expentry.length; i++) {
-            if (oldentry[i] != jj_expentry[i]) {
-              exists = false;
-              break;
-            }
-          }
-          if (exists) break;
-        }
-      }
-      if (!exists) jj_expentries.addElement(jj_expentry);
-      if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
-    }
-  }
-
-  final public ParseException generateParseException() {
-    jj_expentries.removeAllElements();
-    boolean[] la1tokens = new boolean[40];
-    for (int i = 0; i < 40; i++) {
-      la1tokens[i] = false;
-    }
-    if (jj_kind >= 0) {
-      la1tokens[jj_kind] = true;
-      jj_kind = -1;
-    }
-    for (int i = 0; i < 22; i++) {
-      if (jj_la1[i] == jj_gen) {
-        for (int j = 0; j < 32; j++) {
-          if ((jj_la1_0[i] & (1<<j)) != 0) {
-            la1tokens[j] = true;
-          }
-          if ((jj_la1_1[i] & (1<<j)) != 0) {
-            la1tokens[32+j] = true;
-          }
-        }
-      }
-    }
-    for (int i = 0; i < 40; i++) {
-      if (la1tokens[i]) {
-        jj_expentry = new int[1];
-        jj_expentry[0] = i;
-        jj_expentries.addElement(jj_expentry);
-      }
-    }
-    jj_endpos = 0;
-    jj_rescan_token();
-    jj_add_error_token(0, 0);
-    int[][] exptokseq = new int[jj_expentries.size()][];
-    for (int i = 0; i < jj_expentries.size(); i++) {
-      exptokseq[i] = jj_expentries.elementAt(i);
-    }
-    return new ParseException(token, exptokseq, tokenImage);
-  }
-
-  final public void enable_tracing() {
-  }
-
-  final public void disable_tracing() {
-  }
-
-  final private void jj_rescan_token() {
-    jj_rescan = true;
-    for (int i = 0; i < 3; i++) {
-      JJCalls p = jj_2_rtns[i];
-      do {
-        if (p.gen > jj_gen) {
-          jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
-          switch (i) {
-            case 0: jj_3_1(); break;
-            case 1: jj_3_2(); break;
-            case 2: jj_3_3(); break;
-          }
-        }
-        p = p.next;
-      } while (p != null);
-    }
-    jj_rescan = false;
-  }
-
-  final private void jj_save(int index, int xla) {
-    JJCalls p = jj_2_rtns[index];
-    while (p.gen > jj_gen) {
-      if (p.next == null) { p = p.next = new JJCalls(); break; }
-      p = p.next;
-    }
-    p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
-  }
-
-  static final class JJCalls {
-    int gen;
-    Token first;
-    int arg;
-    JJCalls next;
-  }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,948 +0,0 @@
-/*@bgen(jjtree) Generated By:JJTree: Do not edit this line. Parser.jj */
-/*@egen*//*
- * @(#)file      Parser.jjt
- * @(#)author    Sun Microsystems, Inc.
- *
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-options {              
-  STATIC=false;                                                                
-}
-
-
-PARSER_BEGIN(Parser)
-
-package com.sun.jmx.snmp.IPAcl;
-
-import java.io.*;
-
-public class Parser/*@bgen(jjtree)*/implements ParserTreeConstants/*@egen*/ {/*@bgen(jjtree)*/
-  protected JJTParserState jjtree = new JJTParserState();
-
-/*@egen*/
-}
-
-PARSER_END(Parser)
-
-
-SKIP :
-{
-  " "
-| "\t"
-| "\n"
-| "\r"
-| <"--" (~["\n","\r"])* ("\n"|"\r"|"\r\n")>
-| <"#" (~["\n","\r"])* ("\n"|"\r"|"\r\n")>
-
-}
-
-
-
-/* RESERVED WORDS AND LITERALS */
-
-TOKEN : 
-{
-  <ACCESS: "access">
-| <ACL: "acl">
-| <ASSIGN: "=">
-| <COMMUNITIES: "communities">
-| <ENTERPRISE: "enterprise">
-| <HOSTS: "hosts">
-| <LBRACE: "{">
-| <MANAGERS: "managers">
-| <RANGE: "-">
-| <RBRACE: "}">
-| <RO: "read-only">
-| <RW: "read-write">
-| <TRAP: "trap">
-| <INFORM: "inform">
-| <TRAPCOMMUNITY: "trap-community">
-| <INFORMCOMMUNITY: "inform-community">
-| <TRAPNUM: "trap-num">
-}
-
-
-
-TOKEN : /* LITERALS */
-{
-  < INTEGER_LITERAL:
-        <DECIMAL_LITERAL> (["l","L"])?
-      | <HEX_LITERAL> (["l","L"])?
-      | <OCTAL_LITERAL> (["l","L"])?
-  >
-|
-  < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* >
-|
-  < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ >
-|      
-  < #OCTAL_LITERAL: "0" (["0"-"7"])* >
-}
-
-TOKEN : /* V6 LITERALS */
-{ 
-  < V6_ADDRESS: ((( ( (<H> ":")+ (":")?) | "::" ) (<H> ":")* (<H> | (<D> "." <D> "." <D> "." <D>))) | ("::")) | ( (<H> ":")+ ":") >
-|
-  <#H: (["0"-"9","a"-"f","A"-"F"])+ >
-| 
-  <#D: (["0"-"9"])+ >
-}
- 
-TOKEN : /* IDENTIFIERS */
-{
-  < IDENTIFIER: ( (<DIGIT>|<LETTER>)+ (<SEPARATOR>|<LETTER>|<DIGIT>)* (<DIGIT>|<LETTER>)+ ) | (<DIGIT>|<LETTER>)+ >
-|
-  < #LETTER: ["a"-"z","A"-"Z"] >
-|
-  < #SEPARATOR: ["-", "_"] >
-|
-  < #DIGIT: ["0"-"9"] >
-|
- <CSTRING: "\"" (~["\""])* "\"">
-}
-
- 
-
-TOKEN: /* SEPARATOR */
-{
-  < COMMA: "," >
-| < DOT: "." >
-| < MARK: "!" >
-| < MASK: "/">
-}
-
-// A file can contain several acl definitions
-//
-JDMSecurityDefs SecurityDefs()  : {/*@bgen(jjtree) SecurityDefs */
-  JDMSecurityDefs jjtn000 = new JDMSecurityDefs(JJTSECURITYDEFS);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/}
-{/*@bgen(jjtree) SecurityDefs */
-  try {
-/*@egen*/
-  [AclBlock()]
-  [TrapBlock()]
-  [InformBlock()]
-  <EOF>/*@bgen(jjtree)*/
-  {
-    jjtree.closeNodeScope(jjtn000, true);
-    jjtc000 = false;
-  }
-/*@egen*/
-  { return jjtn000;}/*@bgen(jjtree)*/
-  } catch (Throwable jjte000) {
-    if (jjtc000) {
-      jjtree.clearNodeScope(jjtn000);
-      jjtc000 = false;
-    } else {
-      jjtree.popNode();
-    }
-    if (jjte000 instanceof RuntimeException) {
-      throw (RuntimeException)jjte000;
-    }
-    if (jjte000 instanceof ParseException) {
-      throw (ParseException)jjte000;
-    }
-    throw (Error)jjte000;
-  } finally {
-    if (jjtc000) {
-      jjtree.closeNodeScope(jjtn000, true);
-    }
-  }
-/*@egen*/
-}
-
-void AclBlock(): {/*@bgen(jjtree) AclBlock */
-  JDMAclBlock jjtn000 = new JDMAclBlock(JJTACLBLOCK);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/}
-{/*@bgen(jjtree) AclBlock */
-try {
-/*@egen*/
-"acl" "=" "{" (AclItem())+ "}"/*@bgen(jjtree)*/
-} catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    throw (RuntimeException)jjte000;
-  }
-  if (jjte000 instanceof ParseException) {
-    throw (ParseException)jjte000;
-  }
-  throw (Error)jjte000;
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-void AclItem(): {/*@bgen(jjtree) AclItem */
-  JDMAclItem jjtn000 = new JDMAclItem(JJTACLITEM);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/}
-{/*@bgen(jjtree) AclItem */
-try {
-/*@egen*/
-"{" jjtn000.com= Communities() jjtn000.access= Access() Managers() "}"/*@bgen(jjtree)*/
-} catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    throw (RuntimeException)jjte000;
-  }
-  if (jjte000 instanceof ParseException) {
-    throw (ParseException)jjte000;
-  }
-  throw (Error)jjte000;
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-JDMCommunities Communities(): {/*@bgen(jjtree) Communities */
-  JDMCommunities jjtn000 = new JDMCommunities(JJTCOMMUNITIES);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/}
-{/*@bgen(jjtree) Communities */
-try {
-/*@egen*/
-"communities" "=" Community() ( "," Community())*/*@bgen(jjtree)*/
-{
-  jjtree.closeNodeScope(jjtn000, true);
-  jjtc000 = false;
-}
-/*@egen*/
-
-{return jjtn000;}/*@bgen(jjtree)*/
-} catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    throw (RuntimeException)jjte000;
-  }
-  if (jjte000 instanceof ParseException) {
-    throw (ParseException)jjte000;
-  }
-  throw (Error)jjte000;
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-
-}
-
-void Community(): 
-{/*@bgen(jjtree) Community */
-  JDMCommunity jjtn000 = new JDMCommunity(JJTCOMMUNITY);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/
-  Token t;
-}
-{/*@bgen(jjtree) Community */
-try {
-/*@egen*/
-t=<IDENTIFIER>/*@bgen(jjtree)*/
-               {
-                 jjtree.closeNodeScope(jjtn000, true);
-                 jjtc000 = false;
-               }
-/*@egen*/ {jjtn000.communityString= t.image;}/*@bgen(jjtree)*/
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-JDMAccess Access(): {/*@bgen(jjtree) Access */
-  JDMAccess jjtn000 = new JDMAccess(JJTACCESS);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/}
-{/*@bgen(jjtree) Access */
-try {
-/*@egen*/
-"access" "=" ( <RO> {jjtn000.access= RO;}
-              |
-               <RW> {jjtn000.access= RW;}
-             )/*@bgen(jjtree)*/
-{
-  jjtree.closeNodeScope(jjtn000, true);
-  jjtc000 = false;
-}
-/*@egen*/
-{return jjtn000;}/*@bgen(jjtree)*/
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-
-void Managers() : {/*@bgen(jjtree) Managers */
-  JDMManagers jjtn000 = new JDMManagers(JJTMANAGERS);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/ }
-{/*@bgen(jjtree) Managers */
-try {
-/*@egen*/
-"managers" "=" Host() ( "," Host())*/*@bgen(jjtree)*/
-} catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    throw (RuntimeException)jjte000;
-  }
-  if (jjte000 instanceof ParseException) {
-    throw (ParseException)jjte000;
-  }
-  throw (Error)jjte000;
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-void Host() : 
-{/*@bgen(jjtree) Host */
-  JDMHost jjtn000 = new JDMHost(JJTHOST);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/
-  Token t;
-}
-{/*@bgen(jjtree) Host */
-try {
-/*@egen*/
-HostName()
-|
-LOOKAHEAD(<INTEGER_LITERAL> ( "." <INTEGER_LITERAL> )* "/" <INTEGER_LITERAL>)
-NetMask()
-|
-LOOKAHEAD(<V6_ADDRESS> "/" <INTEGER_LITERAL>)
-NetMaskV6()
-|
-LOOKAHEAD(<INTEGER_LITERAL> ".")
-IpAddress()
-|
-IpV6Address()
-|
-IpMask()/*@bgen(jjtree)*/
-} catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    throw (RuntimeException)jjte000;
-  }
-  if (jjte000 instanceof ParseException) {
-    throw (ParseException)jjte000;
-  }
-  throw (Error)jjte000;
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-void HostName():
-{/*@bgen(jjtree) HostName */
-  JDMHostName jjtn000 = new JDMHostName(JJTHOSTNAME);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/
-  Token t;
-}
-{/*@bgen(jjtree) HostName */
-  try {
-/*@egen*/
-  t=<IDENTIFIER> { jjtn000.name.append(t.image); }
-(
-"." t=<IDENTIFIER> 
-  {jjtn000.name.append( "." + t.image); }
-)*/*@bgen(jjtree)*/
-  } finally {
-    if (jjtc000) {
-      jjtree.closeNodeScope(jjtn000, true);
-    }
-  }
-/*@egen*/
-
-}
-
-void IpAddress():
-{/*@bgen(jjtree) IpAddress */
-JDMIpAddress jjtn000 = new JDMIpAddress(JJTIPADDRESS);
-boolean jjtc000 = true;
-jjtree.openNodeScope(jjtn000);
-/*@egen*/
-Token t;
-}
-{/*@bgen(jjtree) IpAddress */
-try {
-/*@egen*/
-
-t= <INTEGER_LITERAL> 
-  {jjtn000.address.append(t.image); }
-(
-"." t= <INTEGER_LITERAL> 
-  {jjtn000.address.append( "." + t.image); }
-)*/*@bgen(jjtree)*/
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-
-}
-
-void IpV6Address():
-{/*@bgen(jjtree) IpV6Address */
-JDMIpV6Address jjtn000 = new JDMIpV6Address(JJTIPV6ADDRESS);
-boolean jjtc000 = true;
-jjtree.openNodeScope(jjtn000);
-/*@egen*/
-Token t;
-}
-{/*@bgen(jjtree) IpV6Address */
-try {
-/*@egen*/
-
-t= <V6_ADDRESS>/*@bgen(jjtree)*/
-  {
-    jjtree.closeNodeScope(jjtn000, true);
-    jjtc000 = false;
-  }
-/*@egen*/ 
-  {jjtn000.address.append(t.image); }/*@bgen(jjtree)*/
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-void IpMask():
-{/*@bgen(jjtree) IpMask */
-JDMIpMask jjtn000 = new JDMIpMask(JJTIPMASK);
-boolean jjtc000 = true;
-jjtree.openNodeScope(jjtn000);
-/*@egen*/
-Token t;
-}
-{/*@bgen(jjtree) IpMask */
-try {
-/*@egen*/
-
-t= <INTEGER_LITERAL> 
-  {jjtn000.address.append(t.image); }
-(
-"!" t= <INTEGER_LITERAL> 
-  {jjtn000.address.append( "." + t.image); }
-)*/*@bgen(jjtree)*/
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-void NetMask():
-{/*@bgen(jjtree) NetMask */
-JDMNetMask jjtn000 = new JDMNetMask(JJTNETMASK);
-boolean jjtc000 = true;
-jjtree.openNodeScope(jjtn000);
-/*@egen*/
-Token t;
-}
-{/*@bgen(jjtree) NetMask */
-try {
-/*@egen*/
-
-t= <INTEGER_LITERAL> 
-  {jjtn000.address.append(t.image); }
-(
-"." t= <INTEGER_LITERAL> 
-  {jjtn000.address.append( "." + t.image); }
-)* "/" t= <INTEGER_LITERAL>/*@bgen(jjtree)*/
-                            {
-                              jjtree.closeNodeScope(jjtn000, true);
-                              jjtc000 = false;
-                            }
-/*@egen*/ {jjtn000.mask = t.image; }/*@bgen(jjtree)*/
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-void NetMaskV6():
-{/*@bgen(jjtree) NetMaskV6 */
-JDMNetMaskV6 jjtn000 = new JDMNetMaskV6(JJTNETMASKV6);
-boolean jjtc000 = true;
-jjtree.openNodeScope(jjtn000);
-/*@egen*/
-Token t;
-}
-{/*@bgen(jjtree) NetMaskV6 */
-try {
-/*@egen*/
-
-t= <V6_ADDRESS> 
-  {jjtn000.address.append(t.image); }
-
-"/" t= <INTEGER_LITERAL>/*@bgen(jjtree)*/
-                         {
-                           jjtree.closeNodeScope(jjtn000, true);
-                           jjtc000 = false;
-                         }
-/*@egen*/ {jjtn000.mask = t.image; }/*@bgen(jjtree)*/
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-void TrapBlock(): {/*@bgen(jjtree) TrapBlock */
-  JDMTrapBlock jjtn000 = new JDMTrapBlock(JJTTRAPBLOCK);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/ }
-{/*@bgen(jjtree) TrapBlock */
-try {
-/*@egen*/
-"trap" "=" "{" (TrapItem())* "}"/*@bgen(jjtree)*/
-} catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    throw (RuntimeException)jjte000;
-  }
-  if (jjte000 instanceof ParseException) {
-    throw (ParseException)jjte000;
-  }
-  throw (Error)jjte000;
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-void TrapItem(): {/*@bgen(jjtree) TrapItem */
-  JDMTrapItem jjtn000 = new JDMTrapItem(JJTTRAPITEM);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/ }
-{/*@bgen(jjtree) TrapItem */
-try {
-/*@egen*/
-"{" jjtn000.comm= TrapCommunity() TrapInterestedHost() (Enterprise())* "}"/*@bgen(jjtree)*/
-} catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    throw (RuntimeException)jjte000;
-  }
-  if (jjte000 instanceof ParseException) {
-    throw (ParseException)jjte000;
-  }
-  throw (Error)jjte000;
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-JDMTrapCommunity TrapCommunity(): 
-{/*@bgen(jjtree) TrapCommunity */
-  JDMTrapCommunity jjtn000 = new JDMTrapCommunity(JJTTRAPCOMMUNITY);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/
-  Token t;
-}
-{/*@bgen(jjtree) TrapCommunity */
-try {
-/*@egen*/
-"trap-community" "=" t=<IDENTIFIER>/*@bgen(jjtree)*/
-                                    {
-                                      jjtree.closeNodeScope(jjtn000, true);
-                                      jjtc000 = false;
-                                    }
-/*@egen*/ { jjtn000.community= t.image; return jjtn000; }/*@bgen(jjtree)*/
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-void TrapInterestedHost(): {/*@bgen(jjtree) TrapInterestedHost */
-  JDMTrapInterestedHost jjtn000 = new JDMTrapInterestedHost(JJTTRAPINTERESTEDHOST);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/ }
-{/*@bgen(jjtree) TrapInterestedHost */
-try {
-/*@egen*/
-"hosts" "=" HostTrap() ("," HostTrap())*/*@bgen(jjtree)*/
-} catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    throw (RuntimeException)jjte000;
-  }
-  if (jjte000 instanceof ParseException) {
-    throw (ParseException)jjte000;
-  }
-  throw (Error)jjte000;
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-void HostTrap() : 
-{/*@bgen(jjtree) HostTrap */
-  JDMHostTrap jjtn000 = new JDMHostTrap(JJTHOSTTRAP);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/
-  Token t;
-}
-{/*@bgen(jjtree) HostTrap */
-try {
-/*@egen*/
-HostName()
-|
-IpAddress()
-|
-IpV6Address()/*@bgen(jjtree)*/
-} catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    throw (RuntimeException)jjte000;
-  }
-  if (jjte000 instanceof ParseException) {
-    throw (ParseException)jjte000;
-  }
-  throw (Error)jjte000;
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-void Enterprise(): 
-{/*@bgen(jjtree) Enterprise */
-  JDMEnterprise jjtn000 = new JDMEnterprise(JJTENTERPRISE);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/
-  Token t;
-}
-{/*@bgen(jjtree) Enterprise */
-try {
-/*@egen*/
-"{"
-"enterprise" "="  t=<CSTRING> {jjtn000.enterprise= t.image;}
-
-"trap-num" "=" TrapNum() ("," TrapNum())*
-
-"}"/*@bgen(jjtree)*/
-} catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    throw (RuntimeException)jjte000;
-  }
-  if (jjte000 instanceof ParseException) {
-    throw (ParseException)jjte000;
-  }
-  throw (Error)jjte000;
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-void TrapNum():
-{/*@bgen(jjtree) TrapNum */
-  JDMTrapNum jjtn000 = new JDMTrapNum(JJTTRAPNUM);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/
-  Token t;
-}
-{/*@bgen(jjtree) TrapNum */
-  try {
-/*@egen*/
-  t=<INTEGER_LITERAL> {jjtn000.low= Integer.parseInt(t.image);}
-[
-  "-" t=<INTEGER_LITERAL> {jjtn000.high= Integer.parseInt(t.image);}
-]/*@bgen(jjtree)*/
-  } finally {
-    if (jjtc000) {
-      jjtree.closeNodeScope(jjtn000, true);
-    }
-  }
-/*@egen*/
-}
-
-
-void InformBlock(): {/*@bgen(jjtree) InformBlock */
-  JDMInformBlock jjtn000 = new JDMInformBlock(JJTINFORMBLOCK);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/ }
-{/*@bgen(jjtree) InformBlock */
-try {
-/*@egen*/
-"inform" "=" "{" (InformItem())* "}"/*@bgen(jjtree)*/
-} catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    throw (RuntimeException)jjte000;
-  }
-  if (jjte000 instanceof ParseException) {
-    throw (ParseException)jjte000;
-  }
-  throw (Error)jjte000;
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-void InformItem(): {/*@bgen(jjtree) InformItem */
-  JDMInformItem jjtn000 = new JDMInformItem(JJTINFORMITEM);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/ }
-{/*@bgen(jjtree) InformItem */
-try {
-/*@egen*/
-"{" jjtn000.comm= InformCommunity() InformInterestedHost() "}"/*@bgen(jjtree)*/
-} catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    throw (RuntimeException)jjte000;
-  }
-  if (jjte000 instanceof ParseException) {
-    throw (ParseException)jjte000;
-  }
-  throw (Error)jjte000;
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-JDMInformCommunity InformCommunity(): 
-{/*@bgen(jjtree) InformCommunity */
-  JDMInformCommunity jjtn000 = new JDMInformCommunity(JJTINFORMCOMMUNITY);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/
-  Token t;
-}
-{/*@bgen(jjtree) InformCommunity */
-try {
-/*@egen*/
-"inform-community" "=" t=<IDENTIFIER>/*@bgen(jjtree)*/
-                                      {
-                                        jjtree.closeNodeScope(jjtn000, true);
-                                        jjtc000 = false;
-                                      }
-/*@egen*/ { jjtn000.community= t.image; return jjtn000; }/*@bgen(jjtree)*/
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-void InformInterestedHost(): {/*@bgen(jjtree) InformInterestedHost */
-  JDMInformInterestedHost jjtn000 = new JDMInformInterestedHost(JJTINFORMINTERESTEDHOST);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/ }
-{/*@bgen(jjtree) InformInterestedHost */
-try {
-/*@egen*/
-"hosts" "=" HostInform() ("," HostInform())*/*@bgen(jjtree)*/
-} catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    throw (RuntimeException)jjte000;
-  }
-  if (jjte000 instanceof ParseException) {
-    throw (ParseException)jjte000;
-  }
-  throw (Error)jjte000;
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
-void HostInform() : 
-{/*@bgen(jjtree) HostInform */
-  JDMHostInform jjtn000 = new JDMHostInform(JJTHOSTINFORM);
-  boolean jjtc000 = true;
-  jjtree.openNodeScope(jjtn000);
-/*@egen*/
-  Token t;
-}
-{/*@bgen(jjtree) HostInform */
-try {
-/*@egen*/
-HostName()
-|
-IpAddress()
-|
-IpV6Address()/*@bgen(jjtree)*/
-} catch (Throwable jjte000) {
-  if (jjtc000) {
-    jjtree.clearNodeScope(jjtn000);
-    jjtc000 = false;
-  } else {
-    jjtree.popNode();
-  }
-  if (jjte000 instanceof RuntimeException) {
-    throw (RuntimeException)jjte000;
-  }
-  if (jjte000 instanceof ParseException) {
-    throw (ParseException)jjte000;
-  }
-  throw (Error)jjte000;
-} finally {
-  if (jjtc000) {
-    jjtree.closeNodeScope(jjtn000, true);
-  }
-}
-/*@egen*/
-}
-
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,380 +0,0 @@
-/*
- * @(#)file      Parser.jjt
- * @(#)author    Sun Microsystems, Inc.
- *
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-options {
-  MULTI=true;
-  STATIC=false;
-  NODE_PREFIX= "JDM";
-  NODE_PACKAGE="com.sun.jmx.snmp.IPAcl";
-}
-
-
-PARSER_BEGIN(Parser)
-
-package com.sun.jmx.snmp.IPAcl;
-
-import java.io.*;
-
-public class Parser {
-}
-
-PARSER_END(Parser)
-
-
-SKIP :
-{
-  " "
-| "\t"
-| "\n"
-| "\r"
-| <"--" (~["\n","\r"])* ("\n"|"\r"|"\r\n")>
-| <"#" (~["\n","\r"])* ("\n"|"\r"|"\r\n")>
-
-}
-
-
-
-/* RESERVED WORDS AND LITERALS */
-
-TOKEN : 
-{
-  <ACCESS: "access">
-| <ACL: "acl">
-| <ASSIGN: "=">
-| <COMMUNITIES: "communities">
-| <ENTERPRISE: "enterprise">
-| <HOSTS: "hosts">
-| <LBRACE: "{">
-| <MANAGERS: "managers">
-| <RANGE: "-">
-| <RBRACE: "}">
-| <RO: "read-only">
-| <RW: "read-write">
-| <TRAP: "trap">
-| <INFORM: "inform">
-| <TRAPCOMMUNITY: "trap-community">
-| <INFORMCOMMUNITY: "inform-community">
-| <TRAPNUM: "trap-num">
-}
-
-
-
-TOKEN : /* LITERALS */
-{
-  < INTEGER_LITERAL:
-        <DECIMAL_LITERAL> (["l","L"])?
-      | <HEX_LITERAL> (["l","L"])?
-      | <OCTAL_LITERAL> (["l","L"])?
-  >
-|
-  < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* >
-|
-  < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ >
-|      
-  < #OCTAL_LITERAL: "0" (["0"-"7"])* >
-}
-
-TOKEN : /* V6 LITERALS */
-{ 
-  < V6_ADDRESS: ((( ( (<H> ":")+ (":")?) | "::" ) (<H> ":")* (<H> | (<D> "." <D> "." <D> "." <D>))) | ("::")) | ( (<H> ":")+ ":") >
-|
-  <#H: (["0"-"9","a"-"f","A"-"F"])+ >
-| 
-  <#D: (["0"-"9"])+ >
-}
- 
-TOKEN : /* IDENTIFIERS */
-{
-  < IDENTIFIER: ( (<DIGIT>|<LETTER>)+ (<SEPARATOR>|<LETTER>|<DIGIT>)* (<DIGIT>|<LETTER>)+ ) | (<DIGIT>|<LETTER>)+ >
-|
-  < #LETTER: ["a"-"z","A"-"Z"] >
-|
-  < #SEPARATOR: ["-", "_"] >
-|
-  < #DIGIT: ["0"-"9"] >
-|
- <CSTRING: "\"" (~["\""])* "\"">
-}
-
- 
-
-TOKEN: /* SEPARATOR */
-{
-  < COMMA: "," >
-| < DOT: "." >
-| < MARK: "!" >
-| < MASK: "/">
-}
-
-// A file can contain several acl definitions
-//
-JDMSecurityDefs SecurityDefs()  : {}
-{
-  [AclBlock()]
-  [TrapBlock()]
-  [InformBlock()]
-  <EOF>
-  { return jjtThis;}
-}
-
-void AclBlock(): {}
-{
-"acl" "=" "{" (AclItem())+ "}"
-}
-
-void AclItem(): {}
-{
-"{" jjtThis.com= Communities() jjtThis.access= Access() Managers() "}"
-}
-
-JDMCommunities Communities(): {}
-{
-"communities" "=" Community() ( "," Community())*
-
-{return jjtThis;}
-
-}
-
-void Community(): 
-{
-  Token t;
-}
-{
-t=<IDENTIFIER> {jjtThis.communityString= t.image;}
-}
-
-JDMAccess Access(): {}
-{
-"access" "=" ( <RO> {jjtThis.access= RO;}
-              |
-               <RW> {jjtThis.access= RW;}
-             )
-{return jjtThis;}
-}
-
-
-void Managers() : { }
-{
-"managers" "=" Host() ( "," Host())*
-}
-
-void Host() : 
-{
-  Token t;
-}
-{
-HostName()
-|
-LOOKAHEAD(<INTEGER_LITERAL> ( "." <INTEGER_LITERAL> )* "/" <INTEGER_LITERAL>)
-NetMask()
-|
-LOOKAHEAD(<V6_ADDRESS> "/" <INTEGER_LITERAL>)
-NetMaskV6()
-|
-LOOKAHEAD(<INTEGER_LITERAL> ".")
-IpAddress()
-|
-IpV6Address()
-|
-IpMask()
-}
-
-void HostName():
-{
-  Token t;
-}
-{
-  t=<IDENTIFIER> { jjtThis.name.append(t.image); }
-(
-"." t=<IDENTIFIER> 
-  {jjtThis.name.append( "." + t.image); }
-)*
-
-}
-
-void IpAddress():
-{
-Token t;
-}
-{
-
-t= <INTEGER_LITERAL> 
-  {jjtThis.address.append(t.image); }
-(
-"." t= <INTEGER_LITERAL> 
-  {jjtThis.address.append( "." + t.image); }
-)*
-
-}
-
-void IpV6Address():
-{
-Token t;
-}
-{
-
-t= <V6_ADDRESS> 
-  {jjtThis.address.append(t.image); }
-}
-
-void IpMask():
-{
-Token t;
-}
-{
-
-t= <INTEGER_LITERAL> 
-  {jjtThis.address.append(t.image); }
-(
-"!" t= <INTEGER_LITERAL> 
-  {jjtThis.address.append( "." + t.image); }
-)*
-}
-
-void NetMask():
-{
-Token t;
-}
-{
-
-t= <INTEGER_LITERAL> 
-  {jjtThis.address.append(t.image); }
-(
-"." t= <INTEGER_LITERAL> 
-  {jjtThis.address.append( "." + t.image); }
-)* "/" t= <INTEGER_LITERAL> {jjtThis.mask = t.image; }
-}
-
-void NetMaskV6():
-{
-Token t;
-}
-{
-
-t= <V6_ADDRESS> 
-  {jjtThis.address.append(t.image); }
-
-"/" t= <INTEGER_LITERAL> {jjtThis.mask = t.image; }
-}
-
-void TrapBlock(): { }
-{
-"trap" "=" "{" (TrapItem())* "}"
-}
-
-void TrapItem(): { }
-{
-"{" jjtThis.comm= TrapCommunity() TrapInterestedHost() (Enterprise())* "}"
-}
-
-JDMTrapCommunity TrapCommunity(): 
-{
-  Token t;
-}
-{
-"trap-community" "=" t=<IDENTIFIER> { jjtThis.community= t.image; return jjtThis; }
-}
-
-void TrapInterestedHost(): { }
-{
-"hosts" "=" HostTrap() ("," HostTrap())*
-}
-
-void HostTrap() : 
-{
-  Token t;
-}
-{
-HostName()
-|
-IpAddress()
-|
-IpV6Address()
-}
-
-void Enterprise(): 
-{
-  Token t;
-}
-{
-"{"
-"enterprise" "="  t=<CSTRING> {jjtThis.enterprise= t.image;}
-
-"trap-num" "=" TrapNum() ("," TrapNum())*
-
-"}"
-}
-
-void TrapNum():
-{
-  Token t;
-}
-{
-  t=<INTEGER_LITERAL> {jjtThis.low= Integer.parseInt(t.image);}
-[
-  "-" t=<INTEGER_LITERAL> {jjtThis.high= Integer.parseInt(t.image);}
-]
-}
-
-
-void InformBlock(): { }
-{
-"inform" "=" "{" (InformItem())* "}"
-}
-
-void InformItem(): { }
-{
-"{" jjtThis.comm= InformCommunity() InformInterestedHost() "}"
-}
-
-JDMInformCommunity InformCommunity(): 
-{
-  Token t;
-}
-{
-"inform-community" "=" t=<IDENTIFIER> { jjtThis.community= t.image; return jjtThis; }
-}
-
-void InformInterestedHost(): { }
-{
-"hosts" "=" HostInform() ("," HostInform())*
-}
-
-void HostInform() : 
-{
-  Token t;
-}
-{
-HostName()
-|
-IpAddress()
-|
-IpV6Address()
-}
-
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ParserConstants.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Generated By:JJTree&JavaCC: Do not edit this line. ParserConstants.java */
-package com.sun.jmx.snmp.IPAcl;
-
-interface ParserConstants {
-
-  int EOF = 0;
-  int ACCESS = 7;
-  int ACL = 8;
-  int ASSIGN = 9;
-  int COMMUNITIES = 10;
-  int ENTERPRISE = 11;
-  int HOSTS = 12;
-  int LBRACE = 13;
-  int MANAGERS = 14;
-  int RANGE = 15;
-  int RBRACE = 16;
-  int RO = 17;
-  int RW = 18;
-  int TRAP = 19;
-  int INFORM = 20;
-  int TRAPCOMMUNITY = 21;
-  int INFORMCOMMUNITY = 22;
-  int TRAPNUM = 23;
-  int INTEGER_LITERAL = 24;
-  int DECIMAL_LITERAL = 25;
-  int HEX_LITERAL = 26;
-  int OCTAL_LITERAL = 27;
-  int V6_ADDRESS = 28;
-  int H = 29;
-  int D = 30;
-  int IDENTIFIER = 31;
-  int LETTER = 32;
-  int SEPARATOR = 33;
-  int DIGIT = 34;
-  int CSTRING = 35;
-  int COMMA = 36;
-  int DOT = 37;
-  int MARK = 38;
-  int MASK = 39;
-
-  int DEFAULT = 0;
-
-  String[] tokenImage = {
-    "<EOF>",
-    "\" \"",
-    "\"\\t\"",
-    "\"\\n\"",
-    "\"\\r\"",
-    "<token of kind 5>",
-    "<token of kind 6>",
-    "\"access\"",
-    "\"acl\"",
-    "\"=\"",
-    "\"communities\"",
-    "\"enterprise\"",
-    "\"hosts\"",
-    "\"{\"",
-    "\"managers\"",
-    "\"-\"",
-    "\"}\"",
-    "\"read-only\"",
-    "\"read-write\"",
-    "\"trap\"",
-    "\"inform\"",
-    "\"trap-community\"",
-    "\"inform-community\"",
-    "\"trap-num\"",
-    "<INTEGER_LITERAL>",
-    "<DECIMAL_LITERAL>",
-    "<HEX_LITERAL>",
-    "<OCTAL_LITERAL>",
-    "<V6_ADDRESS>",
-    "<H>",
-    "<D>",
-    "<IDENTIFIER>",
-    "<LETTER>",
-    "<SEPARATOR>",
-    "<DIGIT>",
-    "<CSTRING>",
-    "\",\"",
-    "\".\"",
-    "\"!\"",
-    "\"/\"",
-  };
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ParserTokenManager.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1514 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Generated By:JJTree&JavaCC: Do not edit this line. ParserTokenManager.java */
-package com.sun.jmx.snmp.IPAcl;
-import java.io.*;
-
-class ParserTokenManager implements ParserConstants
-{
-private final int jjStopStringLiteralDfa_0(int pos, long active0)
-{
-   switch (pos)
-   {
-      case 0:
-         if ((active0 & 0x8000L) != 0L)
-            return 0;
-         if ((active0 & 0xfe5000L) != 0L)
-         {
-            jjmatchedKind = 31;
-            return 47;
-         }
-         if ((active0 & 0xd80L) != 0L)
-         {
-            jjmatchedKind = 31;
-            return 48;
-         }
-         return -1;
-      case 1:
-         if ((active0 & 0xfe5c00L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 1;
-            return 49;
-         }
-         if ((active0 & 0x180L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 1;
-            return 50;
-         }
-         return -1;
-      case 2:
-         if ((active0 & 0xfe5c00L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 2;
-            return 49;
-         }
-         if ((active0 & 0x100L) != 0L)
-            return 49;
-         if ((active0 & 0x80L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 2;
-            return 50;
-         }
-         return -1;
-      case 3:
-         if ((active0 & 0x565c00L) != 0L)
-         {
-            if (jjmatchedPos != 3)
-            {
-               jjmatchedKind = 31;
-               jjmatchedPos = 3;
-            }
-            return 49;
-         }
-         if ((active0 & 0xa80000L) != 0L)
-            return 49;
-         if ((active0 & 0x80L) != 0L)
-         {
-            if (jjmatchedPos != 3)
-            {
-               jjmatchedKind = 31;
-               jjmatchedPos = 3;
-            }
-            return 50;
-         }
-         return -1;
-      case 4:
-         if ((active0 & 0xa00000L) != 0L)
-            return 51;
-         if ((active0 & 0x60000L) != 0L)
-         {
-            if (jjmatchedPos < 3)
-            {
-               jjmatchedKind = 31;
-               jjmatchedPos = 3;
-            }
-            return 51;
-         }
-         if ((active0 & 0x1000L) != 0L)
-            return 49;
-         if ((active0 & 0x504c80L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 4;
-            return 49;
-         }
-         return -1;
-      case 5:
-         if ((active0 & 0x500080L) != 0L)
-            return 49;
-         if ((active0 & 0x4c00L) != 0L)
-         {
-            if (jjmatchedPos != 5)
-            {
-               jjmatchedKind = 31;
-               jjmatchedPos = 5;
-            }
-            return 49;
-         }
-         if ((active0 & 0xa60000L) != 0L)
-         {
-            if (jjmatchedPos != 5)
-            {
-               jjmatchedKind = 31;
-               jjmatchedPos = 5;
-            }
-            return 51;
-         }
-         return -1;
-      case 6:
-         if ((active0 & 0x400000L) != 0L)
-            return 51;
-         if ((active0 & 0x4c00L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 6;
-            return 49;
-         }
-         if ((active0 & 0xa60000L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 6;
-            return 51;
-         }
-         return -1;
-      case 7:
-         if ((active0 & 0x660000L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 7;
-            return 51;
-         }
-         if ((active0 & 0x800000L) != 0L)
-            return 51;
-         if ((active0 & 0x4000L) != 0L)
-            return 49;
-         if ((active0 & 0xc00L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 7;
-            return 49;
-         }
-         return -1;
-      case 8:
-         if ((active0 & 0x20000L) != 0L)
-            return 51;
-         if ((active0 & 0xc00L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 8;
-            return 49;
-         }
-         if ((active0 & 0x640000L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 8;
-            return 51;
-         }
-         return -1;
-      case 9:
-         if ((active0 & 0x40000L) != 0L)
-            return 51;
-         if ((active0 & 0x800L) != 0L)
-            return 49;
-         if ((active0 & 0x600000L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 9;
-            return 51;
-         }
-         if ((active0 & 0x400L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 9;
-            return 49;
-         }
-         return -1;
-      case 10:
-         if ((active0 & 0x600000L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 10;
-            return 51;
-         }
-         if ((active0 & 0x400L) != 0L)
-            return 49;
-         return -1;
-      case 11:
-         if ((active0 & 0x600000L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 11;
-            return 51;
-         }
-         return -1;
-      case 12:
-         if ((active0 & 0x600000L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 12;
-            return 51;
-         }
-         return -1;
-      case 13:
-         if ((active0 & 0x400000L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 13;
-            return 51;
-         }
-         if ((active0 & 0x200000L) != 0L)
-            return 51;
-         return -1;
-      case 14:
-         if ((active0 & 0x400000L) != 0L)
-         {
-            jjmatchedKind = 31;
-            jjmatchedPos = 14;
-            return 51;
-         }
-         return -1;
-      default :
-         return -1;
-   }
-}
-private final int jjStartNfa_0(int pos, long active0)
-{
-   return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
-}
-private final int jjStopAtPos(int pos, int kind)
-{
-   jjmatchedKind = kind;
-   jjmatchedPos = pos;
-   return pos + 1;
-}
-private final int jjStartNfaWithStates_0(int pos, int kind, int state)
-{
-   jjmatchedKind = kind;
-   jjmatchedPos = pos;
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) { return pos + 1; }
-   return jjMoveNfa_0(state, pos + 1);
-}
-private final int jjMoveStringLiteralDfa0_0()
-{
-   switch(curChar)
-   {
-      case 33:
-         return jjStopAtPos(0, 38);
-      case 44:
-         return jjStopAtPos(0, 36);
-      case 45:
-         return jjStartNfaWithStates_0(0, 15, 0);
-      case 46:
-         return jjStopAtPos(0, 37);
-      case 47:
-         return jjStopAtPos(0, 39);
-      case 61:
-         return jjStopAtPos(0, 9);
-      case 97:
-         return jjMoveStringLiteralDfa1_0(0x180L);
-      case 99:
-         return jjMoveStringLiteralDfa1_0(0x400L);
-      case 101:
-         return jjMoveStringLiteralDfa1_0(0x800L);
-      case 104:
-         return jjMoveStringLiteralDfa1_0(0x1000L);
-      case 105:
-         return jjMoveStringLiteralDfa1_0(0x500000L);
-      case 109:
-         return jjMoveStringLiteralDfa1_0(0x4000L);
-      case 114:
-         return jjMoveStringLiteralDfa1_0(0x60000L);
-      case 116:
-         return jjMoveStringLiteralDfa1_0(0xa80000L);
-      case 123:
-         return jjStopAtPos(0, 13);
-      case 125:
-         return jjStopAtPos(0, 16);
-      default :
-         return jjMoveNfa_0(5, 0);
-   }
-}
-private final int jjMoveStringLiteralDfa1_0(long active0)
-{
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_0(0, active0);
-      return 1;
-   }
-   switch(curChar)
-   {
-      case 97:
-         return jjMoveStringLiteralDfa2_0(active0, 0x4000L);
-      case 99:
-         return jjMoveStringLiteralDfa2_0(active0, 0x180L);
-      case 101:
-         return jjMoveStringLiteralDfa2_0(active0, 0x60000L);
-      case 110:
-         return jjMoveStringLiteralDfa2_0(active0, 0x500800L);
-      case 111:
-         return jjMoveStringLiteralDfa2_0(active0, 0x1400L);
-      case 114:
-         return jjMoveStringLiteralDfa2_0(active0, 0xa80000L);
-      default :
-         break;
-   }
-   return jjStartNfa_0(0, active0);
-}
-private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
-{
-   if (((active0 &= old0)) == 0L)
-      return jjStartNfa_0(0, old0);
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_0(1, active0);
-      return 2;
-   }
-   switch(curChar)
-   {
-      case 97:
-         return jjMoveStringLiteralDfa3_0(active0, 0xae0000L);
-      case 99:
-         return jjMoveStringLiteralDfa3_0(active0, 0x80L);
-      case 102:
-         return jjMoveStringLiteralDfa3_0(active0, 0x500000L);
-      case 108:
-         if ((active0 & 0x100L) != 0L)
-            return jjStartNfaWithStates_0(2, 8, 49);
-         break;
-      case 109:
-         return jjMoveStringLiteralDfa3_0(active0, 0x400L);
-      case 110:
-         return jjMoveStringLiteralDfa3_0(active0, 0x4000L);
-      case 115:
-         return jjMoveStringLiteralDfa3_0(active0, 0x1000L);
-      case 116:
-         return jjMoveStringLiteralDfa3_0(active0, 0x800L);
-      default :
-         break;
-   }
-   return jjStartNfa_0(1, active0);
-}
-private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
-{
-   if (((active0 &= old0)) == 0L)
-      return jjStartNfa_0(1, old0);
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_0(2, active0);
-      return 3;
-   }
-   switch(curChar)
-   {
-      case 97:
-         return jjMoveStringLiteralDfa4_0(active0, 0x4000L);
-      case 100:
-         return jjMoveStringLiteralDfa4_0(active0, 0x60000L);
-      case 101:
-         return jjMoveStringLiteralDfa4_0(active0, 0x880L);
-      case 109:
-         return jjMoveStringLiteralDfa4_0(active0, 0x400L);
-      case 111:
-         return jjMoveStringLiteralDfa4_0(active0, 0x500000L);
-      case 112:
-         if ((active0 & 0x80000L) != 0L)
-         {
-            jjmatchedKind = 19;
-            jjmatchedPos = 3;
-         }
-         return jjMoveStringLiteralDfa4_0(active0, 0xa00000L);
-      case 116:
-         return jjMoveStringLiteralDfa4_0(active0, 0x1000L);
-      default :
-         break;
-   }
-   return jjStartNfa_0(2, active0);
-}
-private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
-{
-   if (((active0 &= old0)) == 0L)
-      return jjStartNfa_0(2, old0);
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_0(3, active0);
-      return 4;
-   }
-   switch(curChar)
-   {
-      case 45:
-         return jjMoveStringLiteralDfa5_0(active0, 0xa60000L);
-      case 103:
-         return jjMoveStringLiteralDfa5_0(active0, 0x4000L);
-      case 114:
-         return jjMoveStringLiteralDfa5_0(active0, 0x500800L);
-      case 115:
-         if ((active0 & 0x1000L) != 0L)
-            return jjStartNfaWithStates_0(4, 12, 49);
-         return jjMoveStringLiteralDfa5_0(active0, 0x80L);
-      case 117:
-         return jjMoveStringLiteralDfa5_0(active0, 0x400L);
-      default :
-         break;
-   }
-   return jjStartNfa_0(3, active0);
-}
-private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
-{
-   if (((active0 &= old0)) == 0L)
-      return jjStartNfa_0(3, old0);
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_0(4, active0);
-      return 5;
-   }
-   switch(curChar)
-   {
-      case 99:
-         return jjMoveStringLiteralDfa6_0(active0, 0x200000L);
-      case 101:
-         return jjMoveStringLiteralDfa6_0(active0, 0x4000L);
-      case 109:
-         if ((active0 & 0x100000L) != 0L)
-         {
-            jjmatchedKind = 20;
-            jjmatchedPos = 5;
-         }
-         return jjMoveStringLiteralDfa6_0(active0, 0x400000L);
-      case 110:
-         return jjMoveStringLiteralDfa6_0(active0, 0x800400L);
-      case 111:
-         return jjMoveStringLiteralDfa6_0(active0, 0x20000L);
-      case 112:
-         return jjMoveStringLiteralDfa6_0(active0, 0x800L);
-      case 115:
-         if ((active0 & 0x80L) != 0L)
-            return jjStartNfaWithStates_0(5, 7, 49);
-         break;
-      case 119:
-         return jjMoveStringLiteralDfa6_0(active0, 0x40000L);
-      default :
-         break;
-   }
-   return jjStartNfa_0(4, active0);
-}
-private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
-{
-   if (((active0 &= old0)) == 0L)
-      return jjStartNfa_0(4, old0);
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_0(5, active0);
-      return 6;
-   }
-   switch(curChar)
-   {
-      case 45:
-         return jjMoveStringLiteralDfa7_0(active0, 0x400000L);
-      case 105:
-         return jjMoveStringLiteralDfa7_0(active0, 0x400L);
-      case 110:
-         return jjMoveStringLiteralDfa7_0(active0, 0x20000L);
-      case 111:
-         return jjMoveStringLiteralDfa7_0(active0, 0x200000L);
-      case 114:
-         return jjMoveStringLiteralDfa7_0(active0, 0x44800L);
-      case 117:
-         return jjMoveStringLiteralDfa7_0(active0, 0x800000L);
-      default :
-         break;
-   }
-   return jjStartNfa_0(5, active0);
-}
-private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
-{
-   if (((active0 &= old0)) == 0L)
-      return jjStartNfa_0(5, old0);
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_0(6, active0);
-      return 7;
-   }
-   switch(curChar)
-   {
-      case 99:
-         return jjMoveStringLiteralDfa8_0(active0, 0x400000L);
-      case 105:
-         return jjMoveStringLiteralDfa8_0(active0, 0x40800L);
-      case 108:
-         return jjMoveStringLiteralDfa8_0(active0, 0x20000L);
-      case 109:
-         if ((active0 & 0x800000L) != 0L)
-            return jjStartNfaWithStates_0(7, 23, 51);
-         return jjMoveStringLiteralDfa8_0(active0, 0x200000L);
-      case 115:
-         if ((active0 & 0x4000L) != 0L)
-            return jjStartNfaWithStates_0(7, 14, 49);
-         break;
-      case 116:
-         return jjMoveStringLiteralDfa8_0(active0, 0x400L);
-      default :
-         break;
-   }
-   return jjStartNfa_0(6, active0);
-}
-private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
-{
-   if (((active0 &= old0)) == 0L)
-      return jjStartNfa_0(6, old0);
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_0(7, active0);
-      return 8;
-   }
-   switch(curChar)
-   {
-      case 105:
-         return jjMoveStringLiteralDfa9_0(active0, 0x400L);
-      case 109:
-         return jjMoveStringLiteralDfa9_0(active0, 0x200000L);
-      case 111:
-         return jjMoveStringLiteralDfa9_0(active0, 0x400000L);
-      case 115:
-         return jjMoveStringLiteralDfa9_0(active0, 0x800L);
-      case 116:
-         return jjMoveStringLiteralDfa9_0(active0, 0x40000L);
-      case 121:
-         if ((active0 & 0x20000L) != 0L)
-            return jjStartNfaWithStates_0(8, 17, 51);
-         break;
-      default :
-         break;
-   }
-   return jjStartNfa_0(7, active0);
-}
-private final int jjMoveStringLiteralDfa9_0(long old0, long active0)
-{
-   if (((active0 &= old0)) == 0L)
-      return jjStartNfa_0(7, old0);
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_0(8, active0);
-      return 9;
-   }
-   switch(curChar)
-   {
-      case 101:
-         if ((active0 & 0x800L) != 0L)
-            return jjStartNfaWithStates_0(9, 11, 49);
-         else if ((active0 & 0x40000L) != 0L)
-            return jjStartNfaWithStates_0(9, 18, 51);
-         return jjMoveStringLiteralDfa10_0(active0, 0x400L);
-      case 109:
-         return jjMoveStringLiteralDfa10_0(active0, 0x400000L);
-      case 117:
-         return jjMoveStringLiteralDfa10_0(active0, 0x200000L);
-      default :
-         break;
-   }
-   return jjStartNfa_0(8, active0);
-}
-private final int jjMoveStringLiteralDfa10_0(long old0, long active0)
-{
-   if (((active0 &= old0)) == 0L)
-      return jjStartNfa_0(8, old0);
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_0(9, active0);
-      return 10;
-   }
-   switch(curChar)
-   {
-      case 109:
-         return jjMoveStringLiteralDfa11_0(active0, 0x400000L);
-      case 110:
-         return jjMoveStringLiteralDfa11_0(active0, 0x200000L);
-      case 115:
-         if ((active0 & 0x400L) != 0L)
-            return jjStartNfaWithStates_0(10, 10, 49);
-         break;
-      default :
-         break;
-   }
-   return jjStartNfa_0(9, active0);
-}
-private final int jjMoveStringLiteralDfa11_0(long old0, long active0)
-{
-   if (((active0 &= old0)) == 0L)
-      return jjStartNfa_0(9, old0);
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_0(10, active0);
-      return 11;
-   }
-   switch(curChar)
-   {
-      case 105:
-         return jjMoveStringLiteralDfa12_0(active0, 0x200000L);
-      case 117:
-         return jjMoveStringLiteralDfa12_0(active0, 0x400000L);
-      default :
-         break;
-   }
-   return jjStartNfa_0(10, active0);
-}
-private final int jjMoveStringLiteralDfa12_0(long old0, long active0)
-{
-   if (((active0 &= old0)) == 0L)
-      return jjStartNfa_0(10, old0);
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_0(11, active0);
-      return 12;
-   }
-   switch(curChar)
-   {
-      case 110:
-         return jjMoveStringLiteralDfa13_0(active0, 0x400000L);
-      case 116:
-         return jjMoveStringLiteralDfa13_0(active0, 0x200000L);
-      default :
-         break;
-   }
-   return jjStartNfa_0(11, active0);
-}
-private final int jjMoveStringLiteralDfa13_0(long old0, long active0)
-{
-   if (((active0 &= old0)) == 0L)
-      return jjStartNfa_0(11, old0);
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_0(12, active0);
-      return 13;
-   }
-   switch(curChar)
-   {
-      case 105:
-         return jjMoveStringLiteralDfa14_0(active0, 0x400000L);
-      case 121:
-         if ((active0 & 0x200000L) != 0L)
-            return jjStartNfaWithStates_0(13, 21, 51);
-         break;
-      default :
-         break;
-   }
-   return jjStartNfa_0(12, active0);
-}
-private final int jjMoveStringLiteralDfa14_0(long old0, long active0)
-{
-   if (((active0 &= old0)) == 0L)
-      return jjStartNfa_0(12, old0);
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_0(13, active0);
-      return 14;
-   }
-   switch(curChar)
-   {
-      case 116:
-         return jjMoveStringLiteralDfa15_0(active0, 0x400000L);
-      default :
-         break;
-   }
-   return jjStartNfa_0(13, active0);
-}
-private final int jjMoveStringLiteralDfa15_0(long old0, long active0)
-{
-   if (((active0 &= old0)) == 0L)
-      return jjStartNfa_0(13, old0);
-   try { curChar = input_stream.readChar(); }
-   catch(java.io.IOException e) {
-      jjStopStringLiteralDfa_0(14, active0);
-      return 15;
-   }
-   switch(curChar)
-   {
-      case 121:
-         if ((active0 & 0x400000L) != 0L)
-            return jjStartNfaWithStates_0(15, 22, 51);
-         break;
-      default :
-         break;
-   }
-   return jjStartNfa_0(14, active0);
-}
-private final void jjCheckNAdd(int state)
-{
-   if (jjrounds[state] != jjround)
-   {
-      jjstateSet[jjnewStateCnt++] = state;
-      jjrounds[state] = jjround;
-   }
-}
-private final void jjAddStates(int start, int end)
-{
-   do {
-      jjstateSet[jjnewStateCnt++] = jjnextStates[start];
-   } while (start++ != end);
-}
-private final void jjCheckNAddTwoStates(int state1, int state2)
-{
-   jjCheckNAdd(state1);
-   jjCheckNAdd(state2);
-}
-private final void jjCheckNAddStates(int start, int end)
-{
-   do {
-      jjCheckNAdd(jjnextStates[start]);
-   } while (start++ != end);
-}
-private final void jjCheckNAddStates(int start)
-{
-   jjCheckNAdd(jjnextStates[start]);
-   jjCheckNAdd(jjnextStates[start + 1]);
-}
-static final long[] jjbitVec0 = {
-   0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
-};
-private final int jjMoveNfa_0(int startState, int curPos)
-{
-   int[] nextStates;
-   int startsAt = 0;
-   jjnewStateCnt = 47;
-   int i = 1;
-   jjstateSet[0] = startState;
-   int j, kind = 0x7fffffff;
-   for (;;)
-   {
-      if (++jjround == 0x7fffffff)
-         ReInitRounds();
-      if (curChar < 64)
-      {
-         long l = 1L << curChar;
-         MatchLoop: do
-         {
-            switch(jjstateSet[--i])
-            {
-               case 49:
-                  if ((0x3ff200000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(18, 19);
-                  if ((0x3ff000000000000L & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAddStates(0, 2);
-                  }
-                  if ((0x3ff000000000000L & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAdd(20);
-                  }
-                  if ((0x3ff000000000000L & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAdd(19);
-                  }
-                  break;
-               case 48:
-                  if ((0x3ff200000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(18, 19);
-                  else if (curChar == 58)
-                     jjCheckNAddStates(3, 5);
-                  if ((0x3ff000000000000L & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAddStates(0, 2);
-                  }
-                  else if (curChar == 58)
-                     jjCheckNAddTwoStates(23, 25);
-                  if ((0x3ff000000000000L & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAdd(20);
-                  }
-                  if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(26, 27);
-                  if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(23, 24);
-                  break;
-               case 47:
-                  if ((0x3ff200000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(18, 19);
-                  if ((0x3ff000000000000L & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAddStates(0, 2);
-                  }
-                  if ((0x3ff000000000000L & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAdd(20);
-                  }
-                  break;
-               case 50:
-                  if ((0x3ff200000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(18, 19);
-                  else if (curChar == 58)
-                     jjCheckNAddStates(3, 5);
-                  if ((0x3ff000000000000L & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAddStates(0, 2);
-                  }
-                  else if (curChar == 58)
-                     jjCheckNAddTwoStates(23, 25);
-                  if ((0x3ff000000000000L & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAdd(20);
-                  }
-                  if ((0x3ff000000000000L & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAdd(19);
-                  }
-                  if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(26, 27);
-                  if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(23, 24);
-                  break;
-               case 5:
-                  if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddStates(6, 9);
-                  else if (curChar == 58)
-                     jjAddStates(10, 11);
-                  else if (curChar == 34)
-                     jjCheckNAddTwoStates(15, 16);
-                  else if (curChar == 35)
-                     jjCheckNAddStates(12, 14);
-                  else if (curChar == 45)
-                     jjstateSet[jjnewStateCnt++] = 0;
-                  if ((0x3ff000000000000L & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAddStates(15, 17);
-                  }
-                  if ((0x3fe000000000000L & l) != 0L)
-                  {
-                     if (kind > 24)
-                        kind = 24;
-                     jjCheckNAddTwoStates(12, 13);
-                  }
-                  else if (curChar == 48)
-                  {
-                     if (kind > 24)
-                        kind = 24;
-                     jjCheckNAddStates(18, 20);
-                  }
-                  break;
-               case 51:
-                  if ((0x3ff200000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(18, 19);
-                  if ((0x3ff000000000000L & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAdd(19);
-                  }
-                  break;
-               case 0:
-                  if (curChar == 45)
-                     jjCheckNAddStates(21, 23);
-                  break;
-               case 1:
-                  if ((0xffffffffffffdbffL & l) != 0L)
-                     jjCheckNAddStates(21, 23);
-                  break;
-               case 2:
-                  if ((0x2400L & l) != 0L && kind > 5)
-                     kind = 5;
-                  break;
-               case 3:
-                  if (curChar == 10 && kind > 5)
-                     kind = 5;
-                  break;
-               case 4:
-                  if (curChar == 13)
-                     jjstateSet[jjnewStateCnt++] = 3;
-                  break;
-               case 6:
-                  if (curChar == 35)
-                     jjCheckNAddStates(12, 14);
-                  break;
-               case 7:
-                  if ((0xffffffffffffdbffL & l) != 0L)
-                     jjCheckNAddStates(12, 14);
-                  break;
-               case 8:
-                  if ((0x2400L & l) != 0L && kind > 6)
-                     kind = 6;
-                  break;
-               case 9:
-                  if (curChar == 10 && kind > 6)
-                     kind = 6;
-                  break;
-               case 10:
-                  if (curChar == 13)
-                     jjstateSet[jjnewStateCnt++] = 9;
-                  break;
-               case 11:
-                  if ((0x3fe000000000000L & l) == 0L)
-                     break;
-                  if (kind > 24)
-                     kind = 24;
-                  jjCheckNAddTwoStates(12, 13);
-                  break;
-               case 12:
-                  if ((0x3ff000000000000L & l) == 0L)
-                     break;
-                  if (kind > 24)
-                     kind = 24;
-                  jjCheckNAddTwoStates(12, 13);
-                  break;
-               case 14:
-                  if (curChar == 34)
-                     jjCheckNAddTwoStates(15, 16);
-                  break;
-               case 15:
-                  if ((0xfffffffbffffffffL & l) != 0L)
-                     jjCheckNAddTwoStates(15, 16);
-                  break;
-               case 16:
-                  if (curChar == 34 && kind > 35)
-                     kind = 35;
-                  break;
-               case 17:
-                  if ((0x3ff000000000000L & l) == 0L)
-                     break;
-                  if (kind > 31)
-                     kind = 31;
-                  jjCheckNAddStates(15, 17);
-                  break;
-               case 18:
-                  if ((0x3ff200000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(18, 19);
-                  break;
-               case 19:
-                  if ((0x3ff000000000000L & l) == 0L)
-                     break;
-                  if (kind > 31)
-                     kind = 31;
-                  jjCheckNAdd(19);
-                  break;
-               case 20:
-                  if ((0x3ff000000000000L & l) == 0L)
-                     break;
-                  if (kind > 31)
-                     kind = 31;
-                  jjCheckNAdd(20);
-                  break;
-               case 21:
-                  if ((0x3ff000000000000L & l) == 0L)
-                     break;
-                  if (kind > 31)
-                     kind = 31;
-                  jjCheckNAddStates(0, 2);
-                  break;
-               case 22:
-                  if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddStates(6, 9);
-                  break;
-               case 23:
-                  if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(23, 24);
-                  break;
-               case 24:
-                  if (curChar == 58)
-                     jjCheckNAddTwoStates(23, 25);
-                  break;
-               case 25:
-               case 41:
-                  if (curChar == 58 && kind > 28)
-                     kind = 28;
-                  break;
-               case 26:
-                  if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(26, 27);
-                  break;
-               case 27:
-                  if (curChar == 58)
-                     jjCheckNAddStates(3, 5);
-                  break;
-               case 28:
-               case 42:
-                  if (curChar == 58)
-                     jjCheckNAddTwoStates(29, 36);
-                  break;
-               case 29:
-                  if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(29, 30);
-                  break;
-               case 30:
-                  if (curChar == 46)
-                     jjCheckNAdd(31);
-                  break;
-               case 31:
-                  if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(31, 32);
-                  break;
-               case 32:
-                  if (curChar == 46)
-                     jjCheckNAdd(33);
-                  break;
-               case 33:
-                  if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(33, 34);
-                  break;
-               case 34:
-                  if (curChar == 46)
-                     jjCheckNAdd(35);
-                  break;
-               case 35:
-                  if ((0x3ff000000000000L & l) == 0L)
-                     break;
-                  if (kind > 28)
-                     kind = 28;
-                  jjCheckNAdd(35);
-                  break;
-               case 36:
-                  if ((0x3ff000000000000L & l) == 0L)
-                     break;
-                  if (kind > 28)
-                     kind = 28;
-                  jjCheckNAddStates(24, 26);
-                  break;
-               case 37:
-                  if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(37, 28);
-                  break;
-               case 38:
-                  if ((0x3ff000000000000L & l) == 0L)
-                     break;
-                  if (kind > 28)
-                     kind = 28;
-                  jjCheckNAdd(38);
-                  break;
-               case 39:
-                  if ((0x3ff000000000000L & l) == 0L)
-                     break;
-                  if (kind > 28)
-                     kind = 28;
-                  jjCheckNAddStates(27, 31);
-                  break;
-               case 40:
-                  if (curChar == 58)
-                     jjAddStates(10, 11);
-                  break;
-               case 43:
-                  if (curChar != 48)
-                     break;
-                  if (kind > 24)
-                     kind = 24;
-                  jjCheckNAddStates(18, 20);
-                  break;
-               case 45:
-                  if ((0x3ff000000000000L & l) == 0L)
-                     break;
-                  if (kind > 24)
-                     kind = 24;
-                  jjCheckNAddTwoStates(45, 13);
-                  break;
-               case 46:
-                  if ((0xff000000000000L & l) == 0L)
-                     break;
-                  if (kind > 24)
-                     kind = 24;
-                  jjCheckNAddTwoStates(46, 13);
-                  break;
-               default : break;
-            }
-         } while(i != startsAt);
-      }
-      else if (curChar < 128)
-      {
-         long l = 1L << (curChar & 077);
-         MatchLoop: do
-         {
-            switch(jjstateSet[--i])
-            {
-               case 49:
-                  if ((0x7fffffe87fffffeL & l) != 0L)
-                     jjCheckNAddTwoStates(18, 19);
-                  if ((0x7fffffe07fffffeL & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAddStates(0, 2);
-                  }
-                  if ((0x7fffffe07fffffeL & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAdd(20);
-                  }
-                  if ((0x7fffffe07fffffeL & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAdd(19);
-                  }
-                  break;
-               case 48:
-                  if ((0x7fffffe87fffffeL & l) != 0L)
-                     jjCheckNAddTwoStates(18, 19);
-                  if ((0x7fffffe07fffffeL & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAddStates(0, 2);
-                  }
-                  if ((0x7fffffe07fffffeL & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAdd(20);
-                  }
-                  if ((0x7e0000007eL & l) != 0L)
-                     jjCheckNAddTwoStates(26, 27);
-                  if ((0x7e0000007eL & l) != 0L)
-                     jjCheckNAddTwoStates(23, 24);
-                  break;
-               case 47:
-                  if ((0x7fffffe87fffffeL & l) != 0L)
-                     jjCheckNAddTwoStates(18, 19);
-                  if ((0x7fffffe07fffffeL & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAddStates(0, 2);
-                  }
-                  if ((0x7fffffe07fffffeL & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAdd(20);
-                  }
-                  break;
-               case 50:
-                  if ((0x7fffffe87fffffeL & l) != 0L)
-                     jjCheckNAddTwoStates(18, 19);
-                  if ((0x7fffffe07fffffeL & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAddStates(0, 2);
-                  }
-                  if ((0x7fffffe07fffffeL & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAdd(20);
-                  }
-                  if ((0x7fffffe07fffffeL & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAdd(19);
-                  }
-                  if ((0x7e0000007eL & l) != 0L)
-                     jjCheckNAddTwoStates(26, 27);
-                  if ((0x7e0000007eL & l) != 0L)
-                     jjCheckNAddTwoStates(23, 24);
-                  break;
-               case 5:
-                  if ((0x7fffffe07fffffeL & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAddStates(15, 17);
-                  }
-                  if ((0x7e0000007eL & l) != 0L)
-                     jjCheckNAddStates(6, 9);
-                  break;
-               case 51:
-                  if ((0x7fffffe87fffffeL & l) != 0L)
-                     jjCheckNAddTwoStates(18, 19);
-                  if ((0x7fffffe07fffffeL & l) != 0L)
-                  {
-                     if (kind > 31)
-                        kind = 31;
-                     jjCheckNAdd(19);
-                  }
-                  break;
-               case 1:
-                  jjAddStates(21, 23);
-                  break;
-               case 7:
-                  jjAddStates(12, 14);
-                  break;
-               case 13:
-                  if ((0x100000001000L & l) != 0L && kind > 24)
-                     kind = 24;
-                  break;
-               case 15:
-                  jjAddStates(32, 33);
-                  break;
-               case 17:
-                  if ((0x7fffffe07fffffeL & l) == 0L)
-                     break;
-                  if (kind > 31)
-                     kind = 31;
-                  jjCheckNAddStates(15, 17);
-                  break;
-               case 18:
-                  if ((0x7fffffe87fffffeL & l) != 0L)
-                     jjCheckNAddTwoStates(18, 19);
-                  break;
-               case 19:
-                  if ((0x7fffffe07fffffeL & l) == 0L)
-                     break;
-                  if (kind > 31)
-                     kind = 31;
-                  jjCheckNAdd(19);
-                  break;
-               case 20:
-                  if ((0x7fffffe07fffffeL & l) == 0L)
-                     break;
-                  if (kind > 31)
-                     kind = 31;
-                  jjCheckNAdd(20);
-                  break;
-               case 21:
-                  if ((0x7fffffe07fffffeL & l) == 0L)
-                     break;
-                  if (kind > 31)
-                     kind = 31;
-                  jjCheckNAddStates(0, 2);
-                  break;
-               case 22:
-                  if ((0x7e0000007eL & l) != 0L)
-                     jjCheckNAddStates(6, 9);
-                  break;
-               case 23:
-                  if ((0x7e0000007eL & l) != 0L)
-                     jjCheckNAddTwoStates(23, 24);
-                  break;
-               case 26:
-                  if ((0x7e0000007eL & l) != 0L)
-                     jjCheckNAddTwoStates(26, 27);
-                  break;
-               case 36:
-                  if ((0x7e0000007eL & l) == 0L)
-                     break;
-                  if (kind > 28)
-                     kind = 28;
-                  jjCheckNAddStates(24, 26);
-                  break;
-               case 37:
-                  if ((0x7e0000007eL & l) != 0L)
-                     jjCheckNAddTwoStates(37, 28);
-                  break;
-               case 38:
-                  if ((0x7e0000007eL & l) == 0L)
-                     break;
-                  if (kind > 28)
-                     kind = 28;
-                  jjCheckNAdd(38);
-                  break;
-               case 39:
-                  if ((0x7e0000007eL & l) == 0L)
-                     break;
-                  if (kind > 28)
-                     kind = 28;
-                  jjCheckNAddStates(27, 31);
-                  break;
-               case 44:
-                  if ((0x100000001000000L & l) != 0L)
-                     jjCheckNAdd(45);
-                  break;
-               case 45:
-                  if ((0x7e0000007eL & l) == 0L)
-                     break;
-                  if (kind > 24)
-                     kind = 24;
-                  jjCheckNAddTwoStates(45, 13);
-                  break;
-               default : break;
-            }
-         } while(i != startsAt);
-      }
-      else
-      {
-         int i2 = (curChar & 0xff) >> 6;
-         long l2 = 1L << (curChar & 077);
-         MatchLoop: do
-         {
-            switch(jjstateSet[--i])
-            {
-               case 1:
-                  if ((jjbitVec0[i2] & l2) != 0L)
-                     jjAddStates(21, 23);
-                  break;
-               case 7:
-                  if ((jjbitVec0[i2] & l2) != 0L)
-                     jjAddStates(12, 14);
-                  break;
-               case 15:
-                  if ((jjbitVec0[i2] & l2) != 0L)
-                     jjAddStates(32, 33);
-                  break;
-               default : break;
-            }
-         } while(i != startsAt);
-      }
-      if (kind != 0x7fffffff)
-      {
-         jjmatchedKind = kind;
-         jjmatchedPos = curPos;
-         kind = 0x7fffffff;
-      }
-      ++curPos;
-      if ((i = jjnewStateCnt) == (startsAt = 47 - (jjnewStateCnt = startsAt)))
-         return curPos;
-      try { curChar = input_stream.readChar(); }
-      catch(java.io.IOException e) { return curPos; }
-   }
-}
-static final int[] jjnextStates = {
-   18, 19, 21, 28, 29, 39, 23, 24, 26, 27, 41, 42, 7, 8, 10, 18,
-   20, 21, 44, 46, 13, 1, 2, 4, 37, 28, 38, 26, 27, 37, 28, 38,
-   15, 16,
-};
-public static final String[] jjstrLiteralImages = {
-"", null, null, null, null, null, null, "\141\143\143\145\163\163",
-"\141\143\154", "\75", "\143\157\155\155\165\156\151\164\151\145\163",
-"\145\156\164\145\162\160\162\151\163\145", "\150\157\163\164\163", "\173", "\155\141\156\141\147\145\162\163", "\55",
-"\175", "\162\145\141\144\55\157\156\154\171",
-"\162\145\141\144\55\167\162\151\164\145", "\164\162\141\160", "\151\156\146\157\162\155",
-"\164\162\141\160\55\143\157\155\155\165\156\151\164\171", "\151\156\146\157\162\155\55\143\157\155\155\165\156\151\164\171",
-"\164\162\141\160\55\156\165\155", null, null, null, null, null, null, null, null, null, null, null, null, "\54",
-"\56", "\41", "\57", };
-public static final String[] lexStateNames = {
-   "DEFAULT",
-};
-static final long[] jjtoToken = {
-   0xf891ffff81L,
-};
-static final long[] jjtoSkip = {
-   0x7eL,
-};
-private ASCII_CharStream input_stream;
-private final int[] jjrounds = new int[47];
-private final int[] jjstateSet = new int[94];
-protected char curChar;
-public ParserTokenManager(ASCII_CharStream stream)
-{
-   if (ASCII_CharStream.staticFlag)
-      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
-   input_stream = stream;
-}
-public ParserTokenManager(ASCII_CharStream stream, int lexState)
-{
-   this(stream);
-   SwitchTo(lexState);
-}
-public void ReInit(ASCII_CharStream stream)
-{
-   jjmatchedPos = jjnewStateCnt = 0;
-   curLexState = defaultLexState;
-   input_stream = stream;
-   ReInitRounds();
-}
-private final void ReInitRounds()
-{
-   int i;
-   jjround = 0x80000001;
-   for (i = 47; i-- > 0;)
-      jjrounds[i] = 0x80000000;
-}
-public void ReInit(ASCII_CharStream stream, int lexState)
-{
-   ReInit(stream);
-   SwitchTo(lexState);
-}
-public void SwitchTo(int lexState)
-{
-   if (lexState >= 1 || lexState < 0)
-      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
-   else
-      curLexState = lexState;
-}
-
-private final Token jjFillToken()
-{
-   Token t = Token.newToken(jjmatchedKind);
-   t.kind = jjmatchedKind;
-   String im = jjstrLiteralImages[jjmatchedKind];
-   t.image = (im == null) ? input_stream.GetImage() : im;
-   t.beginLine = input_stream.getBeginLine();
-   t.beginColumn = input_stream.getBeginColumn();
-   t.endLine = input_stream.getEndLine();
-   t.endColumn = input_stream.getEndColumn();
-   return t;
-}
-
-int curLexState = 0;
-int defaultLexState = 0;
-int jjnewStateCnt;
-int jjround;
-int jjmatchedPos;
-int jjmatchedKind;
-
-public final Token getNextToken()
-{
-  int kind;
-  Token specialToken = null;
-  Token matchedToken;
-  int curPos = 0;
-
-  EOFLoop :
-  for (;;)
-  {
-   try
-   {
-      curChar = input_stream.BeginToken();
-   }
-   catch(java.io.IOException e)
-   {
-      jjmatchedKind = 0;
-      matchedToken = jjFillToken();
-      return matchedToken;
-   }
-
-   try { input_stream.backup(0);
-      while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
-         curChar = input_stream.BeginToken();
-   }
-   catch (java.io.IOException e1) { continue EOFLoop; }
-   jjmatchedKind = 0x7fffffff;
-   jjmatchedPos = 0;
-   curPos = jjMoveStringLiteralDfa0_0();
-   if (jjmatchedKind != 0x7fffffff)
-   {
-      if (jjmatchedPos + 1 < curPos)
-         input_stream.backup(curPos - jjmatchedPos - 1);
-      if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
-      {
-         matchedToken = jjFillToken();
-         return matchedToken;
-      }
-      else
-      {
-         continue EOFLoop;
-      }
-   }
-   int error_line = input_stream.getEndLine();
-   int error_column = input_stream.getEndColumn();
-   String error_after = null;
-   boolean EOFSeen = false;
-   try { input_stream.readChar(); input_stream.backup(1); }
-   catch (java.io.IOException e1) {
-      EOFSeen = true;
-      error_after = curPos <= 1 ? "" : input_stream.GetImage();
-      if (curChar == '\n' || curChar == '\r') {
-         error_line++;
-         error_column = 0;
-      }
-      else
-         error_column++;
-   }
-   if (!EOFSeen) {
-      input_stream.backup(1);
-      error_after = curPos <= 1 ? "" : input_stream.GetImage();
-   }
-   throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
-  }
-}
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ParserTreeConstants.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Generated By:JJTree: Do not edit this line. ParserTreeConstants.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-interface ParserTreeConstants
-{
-  public int JJTSECURITYDEFS = 0;
-  public int JJTACLBLOCK = 1;
-  public int JJTACLITEM = 2;
-  public int JJTCOMMUNITIES = 3;
-  public int JJTCOMMUNITY = 4;
-  public int JJTACCESS = 5;
-  public int JJTMANAGERS = 6;
-  public int JJTHOST = 7;
-  public int JJTHOSTNAME = 8;
-  public int JJTIPADDRESS = 9;
-  public int JJTIPV6ADDRESS = 10;
-  public int JJTIPMASK = 11;
-  public int JJTNETMASK = 12;
-  public int JJTNETMASKV6 = 13;
-  public int JJTTRAPBLOCK = 14;
-  public int JJTTRAPITEM = 15;
-  public int JJTTRAPCOMMUNITY = 16;
-  public int JJTTRAPINTERESTEDHOST = 17;
-  public int JJTHOSTTRAP = 18;
-  public int JJTENTERPRISE = 19;
-  public int JJTTRAPNUM = 20;
-  public int JJTINFORMBLOCK = 21;
-  public int JJTINFORMITEM = 22;
-  public int JJTINFORMCOMMUNITY = 23;
-  public int JJTINFORMINTERESTEDHOST = 24;
-  public int JJTHOSTINFORM = 25;
-
-
-  public String[] jjtNodeName = {
-    "SecurityDefs",
-    "AclBlock",
-    "AclItem",
-    "Communities",
-    "Community",
-    "Access",
-    "Managers",
-    "Host",
-    "HostName",
-    "IpAddress",
-    "IpV6Address",
-    "IpMask",
-    "NetMask",
-    "NetMaskV6",
-    "TrapBlock",
-    "TrapItem",
-    "TrapCommunity",
-    "TrapInterestedHost",
-    "HostTrap",
-    "Enterprise",
-    "TrapNum",
-    "InformBlock",
-    "InformItem",
-    "InformCommunity",
-    "InformInterestedHost",
-    "HostInform",
-  };
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/PermissionImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.IPAcl;
-
-
-
-import java.io.Serializable;
-
-
-/**
- * Permission is represented as a String.
- *
- * @see java.security.acl.Permission
- */
-
-class PermissionImpl implements java.security.acl.Permission, Serializable {
-  private static final long serialVersionUID = 4478110422746916589L;
-
-  private String perm = null;
-
-  /**
-   * Constructs a permission.
-   *
-   * @param s the string representing the permission.
-   */
-  public PermissionImpl(String s) {
-        perm = s;
-  }
-
-  public int hashCode() {
-        return super.hashCode();
-  }
-
-  /**
-   * Returns true if the object passed matches the permission represented in.
-   *
-   * @param p the Permission object to compare with.
-   * @return true if the Permission objects are equal, false otherwise.
-   */
-  public boolean equals(Object p){
-        if (p instanceof PermissionImpl){
-          return perm.equals(((PermissionImpl)p).getString());
-        } else {
-          return false;
-        }
-  }
-
-  /**
-   * Prints a string representation of this permission.
-   *
-   * @return a string representation of this permission.
-   */
-  public String toString(){
-        return perm;
-  }
-
-  /**
-   * Prints the permission.
-   *
-   * @return a string representation of this permission.
-   */
-  public String getString(){
-        return perm;
-  }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/PrincipalImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.IPAcl;
-
-
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.io.Serializable;
-
-
-/**
- * Principal represents a host.
- *
- */
-
-class PrincipalImpl implements java.security.Principal, Serializable {
-    private static final long serialVersionUID = -7910027842878976761L;
-
-    private InetAddress[] add = null;
-
-    /**
-     * Constructs a principal with the local host.
-     */
-    public PrincipalImpl () throws UnknownHostException {
-        add = new InetAddress[1];
-        add[0] = java.net.InetAddress.getLocalHost();
-    }
-
-    /**
-     * Construct a principal using the specified host.
-     * <P>
-     * The host can be either:
-     * <UL>
-     * <LI> a host name
-     * <LI> an IP address
-     * </UL>
-     *
-     * @param hostName the host used to make the principal.
-     */
-    public PrincipalImpl(String hostName) throws UnknownHostException {
-        if ((hostName.equals("localhost")) || (hostName.equals("127.0.0.1"))) {
-            add = new InetAddress[1];
-            add[0] = java.net.InetAddress.getByName(hostName);
-        }
-        else
-            add = java.net.InetAddress.getAllByName( hostName );
-    }
-
-    /**
-     * Constructs a principal using an Internet Protocol (IP) address.
-     *
-     * @param address the Internet Protocol (IP) address.
-     */
-    public PrincipalImpl(InetAddress address) {
-        add = new InetAddress[1];
-        add[0] = address;
-    }
-
-    /**
-     * Returns the name of this principal.
-     *
-     * @return the name of this principal.
-     */
-    public String getName() {
-        return add[0].toString();
-    }
-
-    /**
-     * Compares this principal to the specified object. Returns true if the
-     * object passed in matches the principal
-     * represented by the implementation of this interface.
-     *
-     * @param a the principal to compare with.
-     * @return true if the principal passed in is the same as that encapsulated by this principal, false otherwise.
-     */
-    public boolean equals(Object a) {
-        if (a instanceof PrincipalImpl){
-            for(int i = 0; i < add.length; i++) {
-                if(add[i].equals (((PrincipalImpl) a).getAddress()))
-                    return true;
-            }
-            return false;
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * Returns a hashcode for this principal.
-     *
-     * @return a hashcode for this principal.
-     */
-    public int hashCode(){
-        return add[0].hashCode();
-    }
-
-    /**
-     * Returns a string representation of this principal. In case of multiple address, the first one is returned.
-     *
-     * @return a string representation of this principal.
-     */
-    public String toString() {
-        return ("PrincipalImpl :"+add[0].toString());
-    }
-
-    /**
-     * Returns the Internet Protocol (IP) address for this principal. In case of multiple address, the first one is returned.
-     *
-     * @return the Internet Protocol (IP) address for this principal.
-     */
-    public InetAddress getAddress(){
-        return add[0];
-    }
-
-    /**
-     * Returns the Internet Protocol (IP) address for this principal. In case of multiple address, the first one is returned.
-     *
-     * @return the array of Internet Protocol (IP) addresses for this principal.
-     */
-    public InetAddress[] getAddresses(){
-        return add;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/README.update	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-1)Copy Parser.jjt in a dedicated directory.
-
-2) Grammar modificatiobns:
-Grammar located in file Parser.jjt :
-
-3) Command :
-/usr/lang/JAVA/JavaCC_2.0/bin/jjtree Parser.jjt
-/usr/lang/JAVA/JavaCC_2.0/bin/javacc Parser.jj
-
-4) Files to copy back in IPAcl directory:
-If you added new node (eg :IpV6Address()) copy the JDM file (eg:JDMIpV6Address.java)
-In any cases copy back (These files must be checkedout in IPAcl directory):
-ASCII_CharStream.java
-JJTParserState.java
-ParseException.java
-Parser.java
-ParserConstants.java
-ParserTokenManager.java
-ParserTreeConstants.java
-TokenMgrError.java
-
-5) You need to modify any JDM files you copied back. Lauch the compilation and you will see what is wrong.
-Have a look to similar nodes in order to see how to modify. Some protected methods have to be overloaded.
-
-6) Once your updates are running, copy back:
-Parser.jj
-Parser.jjt
-
-7) DONE.
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/SimpleNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JJTree: Do not edit this line. SimpleNode.java */
-
-package com.sun.jmx.snmp.IPAcl;
-
-import java.net.InetAddress;
-import java.util.Hashtable;
-import java.util.Vector;
-
-class SimpleNode implements Node {
-    protected Node parent;
-    protected Node[] children;
-    protected int id;
-    protected Parser parser;
-
-    public SimpleNode(int i) {
-        id = i;
-    }
-
-    public SimpleNode(Parser p, int i) {
-        this(i);
-        parser = p;
-    }
-
-    public static Node jjtCreate(int id) {
-        return new SimpleNode(id);
-    }
-
-    public static Node jjtCreate(Parser p, int id) {
-        return new SimpleNode(p, id);
-    }
-
-    public void jjtOpen() {
-    }
-
-    public void jjtClose() {
-    }
-
-    public void jjtSetParent(Node n) { parent = n; }
-    public Node jjtGetParent() { return parent; }
-
-    public void jjtAddChild(Node n, int i) {
-        if (children == null) {
-            children = new Node[i + 1];
-        } else if (i >= children.length) {
-            Node c[] = new Node[i + 1];
-            System.arraycopy(children, 0, c, 0, children.length);
-            children = c;
-        }
-        children[i] = n;
-    }
-
-    public Node jjtGetChild(int i) {
-        return children[i];
-    }
-
-    public int jjtGetNumChildren() {
-        return (children == null) ? 0 : children.length;
-    }
-
-    /*
-      SR. Extend the SimpleNode definition
-    */
-
-    /**
-     * Build the Trap entries from the syntactic tree.
-     */
-    public void buildTrapEntries(Hashtable<InetAddress, Vector<String>> dest) {
-        if (children != null) {
-            for (int i = 0; i < children.length; ++i) {
-                SimpleNode n = (SimpleNode)children[i];
-                if (n != null) {
-                    n.buildTrapEntries(dest);
-                }
-            } /* end of loop */
-        }
-    }
-    /**
-     * Build the Inform entries from the syntactic tree.
-     */
-    public void buildInformEntries(Hashtable<InetAddress, Vector<String>> dest) {
-        if (children != null) {
-            for (int i = 0; i < children.length; ++i) {
-                SimpleNode n = (SimpleNode)children[i];
-                if (n != null) {
-                    n.buildInformEntries(dest);
-                }
-            } /* end of loop */
-        }
-    }
-
-    /**
-     * Build the Acl entries from the syntactic tree.
-     */
-    public void buildAclEntries(PrincipalImpl owner, AclImpl acl) {
-        if (children != null) {
-            for (int i = 0; i < children.length; ++i) {
-                SimpleNode n = (SimpleNode)children[i];
-                if (n != null) {
-                    n.buildAclEntries(owner, acl);
-                }
-            } /* end of loop */
-        }
-    }
-
-    /* END SR */
-
-    /* You can override these two methods in subclasses of SimpleNode to
-       customize the way the node appears when the tree is dumped.  If
-       your output uses more than one line you should override
-       toString(String), otherwise overriding toString() is probably all
-       you need to do. */
-
-    public String toString() { return ParserTreeConstants.jjtNodeName[id]; }
-    public String toString(String prefix) { return prefix + toString(); }
-
-    /* Override this method if you want to customize how the node dumps
-       out its children. */
-
-    public void dump(String prefix) {
-        if (children != null) {
-            for (int i = 0; i < children.length; ++i) {
-                SimpleNode n = (SimpleNode)children[i];
-                if (n != null) {
-                    n.dump(prefix + " ");
-                }
-            }
-        }
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/SnmpAcl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,486 +0,0 @@
-/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.IPAcl;
-
-
-
-// java import
-//
-import java.io.Serializable;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Hashtable;
-import java.util.logging.Level;
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.security.acl.AclEntry;
-import java.security.acl.NotOwnerException;
-
-// SNMP Runtime import
-//
-import static com.sun.jmx.defaults.JmxProperties.SNMP_LOGGER;
-import com.sun.jmx.snmp.InetAddressAcl;
-
-/**
- * Defines an implementation of the {@link com.sun.jmx.snmp.InetAddressAcl InetAddressAcl} interface.
- * <p>
- * In this implementation the ACL information is stored on a flat file and
- * its default location is "$JRE/lib/snmp.acl" - See
- * {@link #getDefaultAclFileName()}
- * <p>
- * <OL>
-  *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpAcl implements InetAddressAcl, Serializable {
-    private static final long serialVersionUID = -6702287103824397063L;
-
-    static final PermissionImpl READ  = new PermissionImpl("READ");
-    static final PermissionImpl WRITE = new PermissionImpl("WRITE");
-
-    /**
-     * Constructs the Java Dynamic Management(TM) Access Control List
-     * based on IP addresses. The ACL will take the given owner name.
-     * The current IP address will be the owner of the ACL.
-     *
-     * @param Owner The name of the ACL Owner.
-     *
-     * @exception UnknownHostException If the local host is unknown.
-     * @exception IllegalArgumentException If the ACL file doesn't exist.
-     */
-    public SnmpAcl(String Owner)
-        throws UnknownHostException, IllegalArgumentException {
-        this(Owner,null);
-    }
-
-    /**
-     * Constructs the Java Dynamic Management(TM) Access Control List
-     * based on IP addresses. The ACL will take the given owner name.
-     * The current IP address will be the owner of the ACL.
-     *
-     * @param Owner The name of the ACL Owner.
-     * @param aclFileName The name of the ACL File.
-     *
-     * @exception UnknownHostException If the local host is unknown.
-     * @exception IllegalArgumentException If the ACL file doesn't exist.
-     */
-    public SnmpAcl(String Owner, String aclFileName)
-        throws UnknownHostException, IllegalArgumentException {
-        trapDestList= new Hashtable<InetAddress, Vector<String>>();
-        informDestList= new Hashtable<InetAddress, Vector<String>>();
-
-        // PrincipalImpl() take the current host as entry
-        owner = new PrincipalImpl();
-        try {
-            acl = new AclImpl(owner,Owner);
-            AclEntry ownEntry = new AclEntryImpl(owner);
-            ownEntry.addPermission(READ);
-            ownEntry.addPermission(WRITE);
-            acl.addEntry(owner,ownEntry);
-        } catch (NotOwnerException ex) {
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
-                    "SnmpAcl(String,String)",
-                    "Should never get NotOwnerException as the owner " +
-                    "is built in this constructor");
-            }
-        }
-        if (aclFileName == null) setDefaultFileName();
-        else setAuthorizedListFile(aclFileName);
-        readAuthorizedListFile();
-    }
-
-    /**
-     * Returns an enumeration of the entries in this ACL. Each element in the
-     * enumeration is of type <CODE>java.security.acl.AclEntry</CODE>.
-     *
-     * @return An enumeration of the entries in this ACL.
-     */
-    public Enumeration<AclEntry> entries() {
-        return acl.entries();
-    }
-
-    /**
-     * Returns ann enumeration of community strings. Community strings are returned as String.
-     * @return The enumeration of community strings.
-     */
-    public Enumeration<String> communities() {
-        HashSet<String> set = new HashSet<String>();
-        Vector<String> res = new Vector<String>();
-        for (Enumeration<AclEntry> e = acl.entries() ; e.hasMoreElements() ;) {
-            AclEntryImpl entry = (AclEntryImpl) e.nextElement();
-            for (Enumeration<String> cs = entry.communities();
-                 cs.hasMoreElements() ;) {
-                set.add(cs.nextElement());
-            }
-        }
-        String[] objs = set.toArray(new String[0]);
-        for(int i = 0; i < objs.length; i++)
-            res.addElement(objs[i]);
-
-        return res.elements();
-    }
-
-    /**
-     * Returns the name of the ACL.
-     *
-     * @return The name of the ACL.
-     */
-    public String getName() {
-        return acl.getName();
-    }
-
-    /**
-     * Returns the read permission instance used.
-     *
-     * @return The read permission instance.
-     */
-    static public PermissionImpl getREAD() {
-        return READ;
-    }
-
-    /**
-     * Returns the write permission instance used.
-     *
-     * @return  The write permission instance.
-     */
-    static public PermissionImpl getWRITE() {
-        return WRITE;
-    }
-
-    /**
-     * Get the default name for the ACL file.
-     * In this implementation this is "$JRE/lib/snmp.acl"
-     * @return The default name for the ACL file.
-     **/
-    public static String getDefaultAclFileName() {
-        final String fileSeparator =
-            System.getProperty("file.separator");
-        final StringBuilder defaultAclName =
-            new StringBuilder(System.getProperty("java.home")).
-            append(fileSeparator).append("lib").append(fileSeparator).
-            append("snmp.acl");
-        return defaultAclName.toString();
-    }
-
-    /**
-     * Sets the full path of the file containing the ACL information.
-     *
-     * @param filename The full path of the file containing the ACL information.
-     * @throws IllegalArgumentException If the passed ACL file doesn't exist.
-     */
-    public void setAuthorizedListFile(String filename)
-        throws IllegalArgumentException {
-        File file = new File(filename);
-        if (!file.isFile() ) {
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
-                    "setAuthorizedListFile", "ACL file not found: " + filename);
-            }
-            throw new
-                IllegalArgumentException("The specified file ["+file+"] "+
-                                         "doesn't exist or is not a file, "+
-                                         "no configuration loaded");
-        }
-        if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_LOGGER.logp(Level.FINER, SnmpAcl.class.getName(),
-                "setAuthorizedListFile", "Default file set to " + filename);
-        }
-        authorizedListFile = filename;
-    }
-
-    /**
-     * Resets this ACL to the values contained in the configuration file.
-     *
-     * @exception NotOwnerException If the principal attempting the reset is not an owner of this ACL.
-     * @exception UnknownHostException If IP addresses for hosts contained in the ACL file couldn't be found.
-     */
-    public void rereadTheFile() throws NotOwnerException, UnknownHostException {
-        alwaysAuthorized = false;
-        acl.removeAll(owner);
-        trapDestList.clear();
-        informDestList.clear();
-        AclEntry ownEntry = new AclEntryImpl(owner);
-        ownEntry.addPermission(READ);
-        ownEntry.addPermission(WRITE);
-        acl.addEntry(owner,ownEntry);
-        readAuthorizedListFile();
-    }
-
-    /**
-     * Returns the full path of the file used to get ACL information.
-     *
-     * @return The full path of the file used to get ACL information.
-     */
-    public String getAuthorizedListFile() {
-        return authorizedListFile;
-    }
-
-    /**
-     * Checks whether or not the specified host has <CODE>READ</CODE> access.
-     *
-     * @param address The host address to check.
-     *
-     * @return <CODE>true</CODE> if the host has read permission, <CODE>false</CODE> otherwise.
-     */
-    public boolean checkReadPermission(InetAddress address) {
-        if (alwaysAuthorized) return ( true );
-        PrincipalImpl p = new PrincipalImpl(address);
-        return acl.checkPermission(p, READ);
-    }
-
-    /**
-     * Checks whether or not the specified host and community have <CODE>READ</CODE> access.
-     *
-     * @param address The host address to check.
-     * @param community The community associated with the host.
-     *
-     * @return <CODE>true</CODE> if the pair (host, community) has read permission, <CODE>false</CODE> otherwise.
-     */
-    public boolean checkReadPermission(InetAddress address, String community) {
-        if (alwaysAuthorized) return ( true );
-        PrincipalImpl p = new PrincipalImpl(address);
-        return acl.checkPermission(p, community, READ);
-    }
-
-    /**
-     * Checks whether or not a community string is defined.
-     *
-     * @param community The community to check.
-     *
-     * @return <CODE>true</CODE> if the community is known, <CODE>false</CODE> otherwise.
-     */
-    public boolean checkCommunity(String community) {
-        return acl.checkCommunity(community);
-    }
-
-    /**
-     * Checks whether or not the specified host has <CODE>WRITE</CODE> access.
-     *
-     * @param address The host address to check.
-     *
-     * @return <CODE>true</CODE> if the host has write permission, <CODE>false</CODE> otherwise.
-     */
-    public boolean checkWritePermission(InetAddress address) {
-        if (alwaysAuthorized) return ( true );
-        PrincipalImpl p = new PrincipalImpl(address);
-        return acl.checkPermission(p, WRITE);
-    }
-
-    /**
-     * Checks whether or not the specified host and community have <CODE>WRITE</CODE> access.
-     *
-     * @param address The host address to check.
-     * @param community The community associated with the host.
-     *
-     * @return <CODE>true</CODE> if the pair (host, community) has write permission, <CODE>false</CODE> otherwise.
-     */
-    public boolean checkWritePermission(InetAddress address, String community) {
-        if (alwaysAuthorized) return ( true );
-        PrincipalImpl p = new PrincipalImpl(address);
-        return acl.checkPermission(p, community, WRITE);
-    }
-
-    /**
-     * Returns an enumeration of trap destinations.
-     *
-     * @return An enumeration of the trap destinations (enumeration of <CODE>InetAddress</CODE>).
-     */
-    public Enumeration<InetAddress> getTrapDestinations() {
-        return trapDestList.keys();
-    }
-
-    /**
-     * Returns an enumeration of trap communities for a given host.
-     *
-     * @param i The address of the host.
-     *
-     * @return An enumeration of trap communities for a given host (enumeration of <CODE>String</CODE>).
-     */
-    public Enumeration<String> getTrapCommunities(InetAddress i) {
-        Vector<String> list = null;
-        if ((list = trapDestList.get(i)) != null ) {
-            if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_LOGGER.logp(Level.FINER, SnmpAcl.class.getName(),
-                    "getTrapCommunities", "["+i.toString()+"] is in list");
-            }
-            return list.elements();
-        } else {
-            list = new Vector<>();
-            if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_LOGGER.logp(Level.FINER, SnmpAcl.class.getName(),
-                    "getTrapCommunities", "["+i.toString()+"] is not in list");
-            }
-            return list.elements();
-        }
-    }
-
-    /**
-     * Returns an enumeration of inform destinations.
-     *
-     * @return An enumeration of the inform destinations (enumeration of <CODE>InetAddress</CODE>).
-     */
-    public Enumeration<InetAddress> getInformDestinations() {
-        return informDestList.keys();
-    }
-
-    /**
-     * Returns an enumeration of inform communities for a given host.
-     *
-     * @param i The address of the host.
-     *
-     * @return An enumeration of inform communities for a given host (enumeration of <CODE>String</CODE>).
-     */
-    public Enumeration<String> getInformCommunities(InetAddress i) {
-        Vector<String> list = null;
-        if ((list = informDestList.get(i)) != null ) {
-            if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_LOGGER.logp(Level.FINER, SnmpAcl.class.getName(),
-                    "getInformCommunities", "["+i.toString()+"] is in list");
-            }
-            return list.elements();
-        } else {
-            list = new Vector<>();
-            if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_LOGGER.logp(Level.FINER, SnmpAcl.class.getName(),
-                    "getInformCommunities", "["+i.toString()+"] is not in list");
-            }
-            return list.elements();
-        }
-    }
-
-    /**
-     * Converts the input configuration file into ACL.
-     */
-    private void readAuthorizedListFile() {
-
-        alwaysAuthorized = false;
-
-        if (authorizedListFile == null) {
-            if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_LOGGER.logp(Level.FINER, SnmpAcl.class.getName(),
-                    "readAuthorizedListFile", "alwaysAuthorized set to true");
-            }
-            alwaysAuthorized = true ;
-        } else {
-            // Read the file content
-            Parser parser = null;
-            try {
-                parser= new Parser(new FileInputStream(getAuthorizedListFile()));
-            } catch (FileNotFoundException e) {
-                if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
-                            "readAuthorizedListFile",
-                            "The specified file was not found, authorize everybody");
-                }
-                alwaysAuthorized = true ;
-                return;
-            }
-
-            try {
-                JDMSecurityDefs n = parser.SecurityDefs();
-                n.buildAclEntries(owner, acl);
-                n.buildTrapEntries(trapDestList);
-                n.buildInformEntries(informDestList);
-            } catch (ParseException e) {
-                if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
-                        "readAuthorizedListFile", "Got parsing exception", e);
-                }
-                throw new IllegalArgumentException(e.getMessage());
-            } catch (Error err) {
-                if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_LOGGER.logp(Level.FINEST, SnmpAcl.class.getName(),
-                        "readAuthorizedListFile", "Got unexpected error", err);
-                }
-                throw new IllegalArgumentException(err.getMessage());
-            }
-
-            for(Enumeration<AclEntry> e = acl.entries(); e.hasMoreElements();) {
-                AclEntryImpl aa = (AclEntryImpl) e.nextElement();
-                if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-                    SNMP_LOGGER.logp(Level.FINER, SnmpAcl.class.getName(),
-                            "readAuthorizedListFile",
-                            "===> " + aa.getPrincipal().toString());
-                }
-                for (Enumeration<java.security.acl.Permission> eee = aa.permissions();eee.hasMoreElements();) {
-                    java.security.acl.Permission perm = eee.nextElement();
-                    if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_LOGGER.logp(Level.FINER, SnmpAcl.class.getName(),
-                                "readAuthorizedListFile", "perm = " + perm);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Set the default full path for "snmp.acl" input file.
-     * Do not complain if the file does not exists.
-     */
-    private void setDefaultFileName() {
-        try {
-            setAuthorizedListFile(getDefaultAclFileName());
-        } catch (IllegalArgumentException x) {
-            // OK...
-        }
-    }
-
-
-    // PRIVATE VARIABLES
-    //------------------
-
-    /**
-     * Represents the Access Control List.
-     */
-    private AclImpl acl = null;
-    /**
-     * Flag indicating whether the access is always authorized.
-     * <BR>This is the case if there is no flat file defined.
-     */
-    private boolean alwaysAuthorized = false;
-    /**
-     * Represents the Access Control List flat file.
-     */
-    private String authorizedListFile = null;
-    /**
-     * Contains the hosts list for trap destination.
-     */
-    private Hashtable<InetAddress, Vector<String>> trapDestList = null;
-    /**
-     * Contains the hosts list for inform destination.
-     */
-    private Hashtable<InetAddress, Vector<String>> informDestList = null;
-
-    private PrincipalImpl owner = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Token.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-/* Generated By:JavaCC: Do not edit this line. Token.java Version 0.7pre3 */
-package com.sun.jmx.snmp.IPAcl;
-
-/**
- * Describes the input token stream.
- */
-
-class Token {
-
-  /**
-   * An integer that describes the kind of this token.  This numbering
-   * system is determined by JavaCCParser, and a table of these numbers is
-   * stored in the file ...Constants.java.
-   */
-  public int kind;
-
-  /**
-   * beginLine and beginColumn describe the position of the first character
-   * of this token; endLine and endColumn describe the position of the
-   * last character of this token.
-   */
-  public int beginLine, beginColumn, endLine, endColumn;
-
-  /**
-   * The string image of the token.
-   */
-  public String image;
-
-  /**
-   * A reference to the next regular (non-special) token from the input
-   * stream.  If this is the last token from the input stream, or if the
-   * token manager has not read tokens beyond this one, this field is
-   * set to null.  This is true only if this token is also a regular
-   * token.  Otherwise, see below for a description of the contents of
-   * this field.
-   */
-  public Token next;
-
-  /**
-   * This field is used to access special tokens that occur prior to this
-   * token, but after the immediately preceding regular (non-special) token.
-   * If there are no such special tokens, this field is set to null.
-   * When there are more than one such special token, this field refers
-   * to the last of these special tokens, which in turn refers to the next
-   * previous special token through its specialToken field, and so on
-   * until the first special token (whose specialToken field is null).
-   * The next fields of special tokens refer to other special tokens that
-   * immediately follow it (without an intervening regular token).  If there
-   * is no such token, this field is null.
-   */
-  public Token specialToken;
-
-  /**
-   * Returns the image.
-   */
-  public final String toString()
-  {
-     return image;
-  }
-
-  /**
-   * Returns a new Token object, by default. However, if you want, you
-   * can create and return subclass objects based on the value of ofKind.
-   * Simply add the cases to the switch for all those special cases.
-   * For example, if you have a subclass of Token called IDToken that
-   * you want to create if ofKind is ID, simlpy add something like :
-   *
-   *    case MyParserConstants.ID : return new IDToken();
-   *
-   * to the following switch statement. Then you can cast matchedToken
-   * variable to the appropriate type and use it in your lexical actions.
-   */
-  public static final Token newToken(int ofKind)
-  {
-     switch(ofKind)
-     {
-       default : return new Token();
-     }
-  }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 0.7pre2 */
-package com.sun.jmx.snmp.IPAcl;
-
-class TokenMgrError extends Error
-{
-   private static final long serialVersionUID = -6373071623408870347L;
-
-   /*
-    * Ordinals for various reasons why an Error of this type can be thrown.
-    */
-
-   /**
-    * Lexical error occurred.
-    */
-   static final int LEXICAL_ERROR = 0;
-
-   /**
-    * An attempt wass made to create a second instance of a static token manager.
-    */
-   static final int STATIC_LEXER_ERROR = 1;
-
-   /**
-    * Tried to change to an invalid lexical state.
-    */
-   static final int INVALID_LEXICAL_STATE = 2;
-
-   /**
-    * Detected (and bailed out of) an infinite loop in the token manager.
-    */
-   static final int LOOP_DETECTED = 3;
-
-   /**
-    * Indicates the reason why the exception is thrown. It will have
-    * one of the above 4 values.
-    */
-   int errorCode;
-
-   /**
-    * Replaces unprintable characters by their espaced (or unicode escaped)
-    * equivalents in the given string
-    */
-   protected static final String addEscapes(String str) {
-      StringBuilder retval = new StringBuilder();
-      char ch;
-      for (int i = 0; i < str.length(); i++) {
-        switch (str.charAt(i))
-        {
-           case 0 :
-              continue;
-           case '\b':
-              retval.append("\\b");
-              continue;
-           case '\t':
-              retval.append("\\t");
-              continue;
-           case '\n':
-              retval.append("\\n");
-              continue;
-           case '\f':
-              retval.append("\\f");
-              continue;
-           case '\r':
-              retval.append("\\r");
-              continue;
-           case '\"':
-              retval.append("\\\"");
-              continue;
-           case '\'':
-              retval.append("\\\'");
-              continue;
-           case '\\':
-              retval.append("\\\\");
-              continue;
-           default:
-              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
-                 String s = "0000" + Integer.toString(ch, 16);
-                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
-              } else {
-                 retval.append(ch);
-              }
-              continue;
-        }
-      }
-      return retval.toString();
-   }
-
-   /**
-    * Returns a detailed message for the Error when it is thrown by the
-    * token manager to indicate a lexical error.
-    * Parameters :
-    *    EOFSeen     : indicates if EOF caused the lexicl error
-    *    curLexState : lexical state in which this error occurred
-    *    errorLine   : line number when the error occurred
-    *    errorColumn : column number when the error occurred
-    *    errorAfter  : prefix that was seen before this error occurred
-    *    curchar     : the offending character
-    * Note: You can customize the lexical error message by modifying this method.
-    */
-   private static final String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
-      return("Lexical error at line " +
-           errorLine + ", column " +
-           errorColumn + ".  Encountered: " +
-           (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
-           "after : \"" + addEscapes(errorAfter) + "\"");
-   }
-
-   /**
-    * You can also modify the body of this method to customize your error messages.
-    * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
-    * of end-users concern, so you can return something like :
-    *
-    *     "Internal Error : Please file a bug report .... "
-    *
-    * from this method for such cases in the release version of your parser.
-    */
-   public String getMessage() {
-      return super.getMessage();
-   }
-
-   /*
-    * Constructors of various flavors follow.
-    */
-
-   public TokenMgrError() {
-   }
-
-   public TokenMgrError(String message, int reason) {
-      super(message);
-      errorCode = reason;
-   }
-
-   public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
-      this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
-   }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/package.html	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<HTML>
-<HEAD>
-<!--
-
-Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-</HEAD>
-<BODY>
-Provides the classes for storing ACL information in an ASCII file.
-<p><b>This API is a Sun Microsystems internal API  and is subject 
-   to change without notice.</b></p>
-</BODY>
-</HTML>
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/InetAddressAcl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp;
-
-// java import
-//
-import java.net.InetAddress;
-import java.util.Enumeration;
-
-/**
- * Defines the IP address based ACL used by the SNMP protocol adaptor.
- * <p>
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-
-public interface InetAddressAcl {
-
-    /**
-     * Returns the name of the ACL.
-     *
-     * @return The name of the ACL.
-     */
-    public String getName();
-
-    /**
-     * Checks whether or not the specified host has <CODE>READ</CODE> access.
-     *
-     * @param address The host address to check.
-     *
-     * @return <CODE>true</CODE> if the host has read permission, <CODE>false</CODE> otherwise.
-     */
-    public boolean checkReadPermission(InetAddress address);
-
-    /**
-     * Checks whether or not the specified host and community have <CODE>READ</CODE> access.
-     *
-     * @param address The host address to check.
-     * @param community The community associated with the host.
-     *
-     * @return <CODE>true</CODE> if the pair (host, community) has read permission, <CODE>false</CODE> otherwise.
-     */
-    public boolean checkReadPermission(InetAddress address, String community);
-
-    /**
-     * Checks whether or not a community string is defined.
-     *
-     * @param community The community to check.
-     *
-     * @return <CODE>true</CODE> if the community is known, <CODE>false</CODE> otherwise.
-     */
-    public boolean checkCommunity(String community);
-
-    /**
-     * Checks whether or not the specified host has <CODE>WRITE</CODE> access.
-     *
-     * @param address The host address to check.
-     *
-     * @return <CODE>true</CODE> if the host has write permission, <CODE>false</CODE> otherwise.
-     */
-    public boolean checkWritePermission(InetAddress address);
-
-    /**
-     * Checks whether or not the specified host and community have <CODE>WRITE</CODE> access.
-     *
-     * @param address The host address to check.
-     * @param community The community associated with the host.
-     *
-     * @return <CODE>true</CODE> if the pair (host, community) has write permission, <CODE>false</CODE> otherwise.
-     */
-    public boolean checkWritePermission(InetAddress address, String community);
-
-    /**
-     * Returns an enumeration of trap destinations.
-     *
-     * @return An enumeration of the trap destinations (enumeration of <CODE>InetAddress</CODE>).
-     */
-    public Enumeration<InetAddress> getTrapDestinations();
-
-    /**
-     * Returns an enumeration of trap communities for a given host.
-     *
-     * @param address The address of the host.
-     *
-     * @return An enumeration of trap communities for a given host (enumeration of <CODE>String</CODE>).
-     */
-    public Enumeration<String> getTrapCommunities(InetAddress address);
-
-    /**
-     * Returns an enumeration of inform destinations.
-     *
-     * @return An enumeration of the inform destinations (enumeration of <CODE>InetAddress</CODE>).
-     */
-    public Enumeration<InetAddress> getInformDestinations();
-
-    /**
-     * Returns an enumeration of inform communities for a given host.
-     *
-     * @param address The address of the host.
-     *
-     * @return An enumeration of inform communities for a given host (enumeration of <CODE>String</CODE>).
-     */
-    public Enumeration<String> getInformCommunities(InetAddress address);
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/ServiceName.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp;
-
-/**
- * Used for storing default values used by SNMP Runtime services.
- * <p><b>This API is an Oracle Corporation internal API  and is subject
- * to change without notice.</b></p>
- */
-public class ServiceName {
-
-    // private constructor defined to "hide" the default public constructor
-    private ServiceName() {
-    }
-
-    /**
-     * The object name of the MBeanServer delegate object
-     * <BR>
-     * The value is <CODE>JMImplementation:type=MBeanServerDelegate</CODE>.
-     */
-    public static final String DELEGATE = "JMImplementation:type=MBeanServerDelegate" ;
-
-    /**
-     * The default key properties for registering the class loader of the MLet service.
-     * <BR>
-     * The value is <CODE>type=MLet</CODE>.
-     */
-    public static final String MLET = "type=MLet";
-
-    /**
-     * The default domain.
-     * <BR>
-     * The value is <CODE>DefaultDomain</CODE>.
-     */
-    public static final String DOMAIN = "DefaultDomain";
-
-    /**
-     * The default port for the RMI connector.
-     * <BR>
-     * The value is <CODE>1099</CODE>.
-     */
-    public static final int RMI_CONNECTOR_PORT = 1099 ;
-
-    /**
-     * The default key properties for the RMI connector.
-     * <BR>
-     * The value is <CODE>name=RmiConnectorServer</CODE>.
-     */
-    public static final String RMI_CONNECTOR_SERVER = "name=RmiConnectorServer" ;
-
-    /**
-     * The default port for the SNMP adaptor.
-     * <BR>
-     * The value is <CODE>161</CODE>.
-     */
-    public static final int SNMP_ADAPTOR_PORT = 161 ;
-
-    /**
-     * The default key properties for the SNMP protocol adaptor.
-     * <BR>
-     * The value is <CODE>name=SnmpAdaptorServer</CODE>.
-     */
-    public static final String SNMP_ADAPTOR_SERVER = "name=SnmpAdaptorServer" ;
-
-    /**
-     * The default port for the HTTP connector.
-     * <BR>
-     * The value is <CODE>8081</CODE>.
-     */
-    public static final int HTTP_CONNECTOR_PORT = 8081 ;
-
-    /**
-     * The default key properties for the HTTP connector.
-     * <BR>
-     * The value is <CODE>name=HttpConnectorServer</CODE>.
-     */
-    public static final String HTTP_CONNECTOR_SERVER = "name=HttpConnectorServer" ;
-
-    /**
-     * The default port for the HTTPS connector.
-     * <BR>
-     * The value is <CODE>8084</CODE>.
-     */
-    public static final int HTTPS_CONNECTOR_PORT = 8084 ;
-
-    /**
-     * The default key properties for the HTTPS connector.
-     * <BR>
-     * The value is <CODE>name=HttpsConnectorServer</CODE>.
-     */
-    public static final String HTTPS_CONNECTOR_SERVER = "name=HttpsConnectorServer" ;
-
-    /**
-     * The default port for the HTML adaptor.
-     * <BR>
-     * The value is <CODE>8082</CODE>.
-     */
-    public static final int HTML_ADAPTOR_PORT = 8082 ;
-
-    /**
-     * The default key properties for the HTML protocol adaptor.
-     * <BR>
-     * The value is <CODE>name=HtmlAdaptorServer</CODE>.
-     */
-    public static final String HTML_ADAPTOR_SERVER = "name=HtmlAdaptorServer" ;
-
-    /**
-     * The name of the JMX specification implemented by this product.
-     * <BR>
-     * The value is <CODE>Java Management Extensions</CODE>.
-     */
-    public static final String JMX_SPEC_NAME = "Java Management Extensions";
-
-    /**
-     * The version of the JMX specification implemented by this product.
-     * <BR>
-     * The value is <CODE>1.0 Final Release</CODE>.
-     */
-    public static final String JMX_SPEC_VERSION = "1.2 Maintenance Release";
-
-    /**
-     * The vendor of the JMX specification implemented by this product.
-     * <BR>
-     * The value is <CODE>Oracle Corporation</CODE>.
-     */
-    public static final String JMX_SPEC_VENDOR = "Oracle Corporation";
-
-    /**
-     * The name of the vendor of this product implementing the  JMX specification.
-     * <BR>
-     * The value is <CODE>Oracle Corporation</CODE>.
-     */
-    public static final String JMX_IMPL_VENDOR = "Oracle Corporation";
-
-    /**
-      * The build number of the current product version, of the form <CODE>rXX</CODE>.
-      */
-    public static final String BUILD_NUMBER = "r01";
-
-    /**
-     * The version of this product implementing the  JMX specification.
-     * <BR>
-     * The value is <CODE>5.1_rXX</CODE>, where <CODE>rXX</CODE> is the <CODE>BUILD_NUMBER</CODE> .
-     */
-    public static final String JMX_IMPL_VERSION = "5.1_" + BUILD_NUMBER;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpAckPdu.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-/**
- * Interface to be implemented by PDUs that are acknowledged (eg:
- * request, bulk).
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpAckPdu {
-    /**
-     * Returns the PDU to use for the response.
-     * @return The response PDU.
-     */
-    public SnmpPdu getResponsePdu();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpBadSecurityLevelException.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-/**
- * This exception is thrown when an incorrect security level is handled.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public class SnmpBadSecurityLevelException extends Exception {
-    private static final long serialVersionUID = 8863728413063813053L;
-
-    public SnmpBadSecurityLevelException(String msg) {
-        super(msg);
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpCounter.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-/**
- * Represents an SNMP counter.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpCounter extends SnmpUnsignedInt {
-    private static final long serialVersionUID = 4655264728839396879L;
-
-    // CONSTRUCTORS
-    //-------------
-    /**
-     * Constructs a new <CODE>SnmpCounter</CODE> from the specified integer value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is negative
-     * or larger than {@link SnmpUnsignedInt#MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
-     */
-    public SnmpCounter(int v) throws IllegalArgumentException {
-        super(v) ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpCounter</CODE> from the specified <CODE>Integer</CODE> value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is negative
-     * or larger than {@link SnmpUnsignedInt#MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
-     */
-    public SnmpCounter(Integer v) throws IllegalArgumentException {
-        super(v) ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpCounter</CODE> from the specified long value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is negative
-     * or larger than {@link SnmpUnsignedInt#MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
-     */
-    public SnmpCounter(long v) throws IllegalArgumentException {
-        super(v) ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpCounter</CODE> from the specified <CODE>Long</CODE> value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is negative
-     * or larger than {@link SnmpUnsignedInt#MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
-     */
-    public SnmpCounter(Long v) throws IllegalArgumentException {
-        super(v) ;
-    }
-
-    // PUBLIC METHODS
-    //---------------
-    /**
-     * Returns a textual description of the type object.
-     * @return ASN.1 textual description.
-     */
-    final public String getTypeName() {
-        return name ;
-    }
-
-    // VARIABLES
-    //----------
-    /**
-     * Name of the type.
-     */
-    final static String name = "Counter32" ;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpCounter64.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,214 +0,0 @@
-/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-/**
- * Represents an SNMP 64bits counter.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpCounter64 extends SnmpValue {
-    private static final long serialVersionUID = 8784850650494679937L;
-
-    // CONSTRUCTORS
-    //-------------
-    /**
-     * Constructs a new <CODE>SnmpCounter64</CODE> from the specified long value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is negative
-     * or larger than <CODE>Long.MAX_VALUE</CODE>.
-     */
-    public SnmpCounter64(long v) throws IllegalArgumentException {
-
-        // NOTE:
-        // The max value for a counter64 variable is 2^64 - 1.
-        // The max value for a Long is 2^63 - 1.
-        // All the allowed values for a conuter64 variable cannot be covered !!!
-        //
-        if ((v < 0) || (v > Long.MAX_VALUE)) {
-            throw new IllegalArgumentException() ;
-        }
-        value = v ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpCounter64</CODE> from the specified <CODE>Long</CODE> value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is negative
-     * or larger than <CODE>Long.MAX_VALUE</CODE>.
-     */
-    public SnmpCounter64(Long v) throws IllegalArgumentException {
-        this(v.longValue()) ;
-    }
-
-    // PUBLIC METHODS
-    //---------------
-    /**
-     * Returns the counter value of this <CODE>SnmpCounter64</CODE>.
-     * @return The value.
-     */
-    public long longValue() {
-        return value ;
-    }
-
-    /**
-     * Converts the counter value to its <CODE>Long</CODE> form.
-     * @return The <CODE>Long</CODE> representation of the value.
-     */
-    public Long toLong() {
-        return value;
-    }
-
-    /**
-     * Converts the counter value to its integer form.
-     * @return The integer representation of the value.
-     */
-    public int intValue() {
-        return (int)value ;
-    }
-
-    /**
-     * Converts the counter value to its <CODE>Integer</CODE> form.
-     * @return The <CODE>Integer</CODE> representation of the value.
-     */
-    public Integer toInteger() {
-        return (int)value;
-    }
-
-    /**
-     * Converts the counter value to its <CODE>String</CODE> form.
-     * @return The <CODE>String</CODE> representation of the value.
-     */
-    public String toString() {
-        return String.valueOf(value) ;
-    }
-
-    /**
-     * Converts the counter value to its <CODE>SnmpOid</CODE> form.
-     * @return The OID representation of the value.
-     */
-    public SnmpOid toOid() {
-        return new SnmpOid(value) ;
-    }
-
-    /**
-     * Extracts the counter from an index OID and returns its
-     * value converted as an <CODE>SnmpOid</CODE>.
-     * @param index The index array.
-     * @param start The position in the index array.
-     * @return The OID representing the counter value.
-     * @exception SnmpStatusException There is no counter value
-     * available at the start position.
-     */
-    public static SnmpOid toOid(long[] index, int start) throws SnmpStatusException {
-        try {
-            return new SnmpOid(index[start]) ;
-        }
-        catch(IndexOutOfBoundsException e) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
-        }
-    }
-
-    /**
-     * Scans an index OID, skips the counter value and returns the position
-     * of the next value.
-     * @param index The index array.
-     * @param start The position in the index array.
-     * @return The position of the next value.
-     * @exception SnmpStatusException There is no counter value
-     * available at the start position.
-     */
-    public static int nextOid(long[] index, int start) throws SnmpStatusException {
-        if (start >= index.length) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
-        }
-        else {
-            return start + 1 ;
-        }
-    }
-
-    /**
-     * Appends an <CODE>SnmpOid</CODE> representing an <CODE>SnmpCounter64</CODE> to another OID.
-     * @param source An OID representing an <CODE>SnmpCounter64</CODE> value.
-     * @param dest Where source should be appended.
-     */
-    public static void appendToOid(SnmpOid source, SnmpOid dest) {
-        if (source.getLength() != 1) {
-            throw new IllegalArgumentException() ;
-        }
-        dest.append(source) ;
-    }
-
-    /**
-     * Performs a clone action. This provides a workaround for the
-     * <CODE>SnmpValue</CODE> interface.
-     * @return The SnmpValue clone.
-     */
-    final synchronized public SnmpValue duplicate() {
-        return (SnmpValue)clone() ;
-    }
-
-    /**
-     * Clones the <CODE>SnmpCounter64</CODE> object, making a copy of its data.
-     * @return The object clone.
-     */
-    final synchronized public Object clone() {
-        SnmpCounter64  newclone = null ;
-        try {
-            newclone = (SnmpCounter64) super.clone() ;
-            newclone.value = value ;
-        } catch (CloneNotSupportedException e) {
-            throw new InternalError(e) ; // vm bug.
-        }
-        return newclone ;
-    }
-
-    /**
-     * Returns a textual description of the type object.
-     * @return ASN.1 textual description.
-     */
-    final public String getTypeName() {
-        return name ;
-    }
-
-    // VARIABLES
-    //----------
-    /**
-     * Name of the type.
-     */
-    final static String name = "Counter64" ;
-
-    /**
-     * This is where the value is stored. This long is positive.
-     * @serial
-     */
-    private long value = 0 ;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpEngine.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-
-/**
- * This engine is conformant with the RFC 2571. It is the main object within an SNMP entity (agent, manager...).
- * To an engine is associated an {@link SnmpEngineId}.
- * Engine instantiation is based on a factory {@link com.sun.jmx.snmp.SnmpEngineFactory  SnmpEngineFactory}.
- * When an <CODE> SnmpEngine </CODE> is created, a User based Security Model (USM) is initialized. The security configuration is located in a text file.
- * The text file is read when the engine is created.
- * <p>Note that the engine is not used when the agent is SNMPv1/SNMPv2 only.
-<P> The USM configuration text file is remotely updatable using the USM Mib.</P>
-<P> User that are configured in the Usm text file are nonVolatile. </P>
-<P> Usm Mib userEntry supported storage type values are : volatile or nonVolatile only. Other values are rejected and a wrongValue is returned) </P>
-<ul>
-<li> volatile means that user entry is not flushed in security file </li>
-<li> nonVolatile means that user entry is flushed in security file </li>
-<li> If a nonVolatile row is set to be volatile, it will be not flushed in the file </li>
-<li>If a volatile row created from the UsmMib is set to nonVolatile, it will be flushed in the file (if the file exist and is writable otherwise an inconsistentValue is returned)</li>
-</ul>
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpEngine {
-    /**
-     * Gets the engine time in seconds. This is the time from the last reboot.
-     * @return The time from the last reboot.
-     */
-    public int getEngineTime();
-    /**
-     * Gets the engine Id. This is unique for each engine.
-     * @return The engine Id object.
-     */
-    public SnmpEngineId getEngineId();
-
-    /**
-     * Gets the engine boot number. This is the number of time this engine has rebooted. Each time an <CODE>SnmpEngine</CODE> is instantiated, it will read this value in its Lcd, and store back the value incremented by one.
-     * @return The engine's number of reboot.
-     */
-    public int getEngineBoots();
-
-    /**
-     * Gets the Usm key handler.
-     * @return The key handler.
-     */
-    public SnmpUsmKeyHandler getUsmKeyHandler();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpEngineFactory.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-
-/**
- * This <CODE>SnmpEngineFactory</CODE> is instantiating an <CODE>SnmpEngine</CODE> containing :
- * <ul>
- * <li> Message Processing Sub System + V1, V2 et V3 Message Processing Models</li>
- * <li> Security Sub System + User based Security Model (Id 3)</li>
- * <li> Access Control Sub System + Ip Acl + User based Access Control Model. See <CODE> IpAcl </CODE> and <CODE> UserAcl </CODE>.</li>
- * </ul>
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpEngineFactory {
-    /**
-     * The engine instantiation method.
-     * @param p The parameters used to instantiate a new engine.
-     * @throws IllegalArgumentException Throwed if one of the configuration file file doesn't exist (Acl files, security file).
-     * @return The newly created SnmpEngine.
-     */
-    public SnmpEngine createEngine(SnmpEngineParameters p);
-
-    /**
-     * The engine instantiation method.
-     * @param p The parameters used to instantiate a new engine.
-     * @param ipacl The Ip ACL to pass to the Access Control Model.
-     * @throws IllegalArgumentException Throwed if one of the configuration
-     *         file file doesn't exist (Acl files, security file).
-     * @return The newly created SnmpEngine.
-     */
-    public SnmpEngine createEngine(SnmpEngineParameters p,
-                                   InetAddressAcl ipacl);
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpEngineId.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,489 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-
-import java.net.InetAddress;
-import java.io.Serializable;
-import java.net.UnknownHostException;
-import java.util.StringTokenizer;
-import java.util.Arrays;
-import java.util.NoSuchElementException;
-
-import com.sun.jmx.snmp.internal.SnmpTools;
-
-/**
- * This class is handling an <CODE>SnmpEngineId</CODE> data. It copes with binary as well as <CODE>String</CODE> representation of an engine Id. A string format engine is an hex string starting with 0x.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public class SnmpEngineId implements Serializable {
-    private static final long serialVersionUID = 5434729655830763317L;
-
-    byte[] engineId = null;
-    String hexString = null;
-    String humanString = null;
-    /**
-     * New <CODE>SnmpEngineId</CODE> with an hex string value. Can handle engine Id format &lt;host&gt:&lt;port&gt.
-     * @param hexString Hexa string.
-     */
-    SnmpEngineId(String hexString) {
-        engineId = SnmpTools.ascii2binary(hexString);
-        this.hexString = hexString.toLowerCase();
-    }
-    /**
-     * New <CODE>SnmpEngineId</CODE> with a binary value. You can use <CODE> SnmpTools </CODE> to convert from hex string to binary format.
-     * @param bin Binary value
-     */
-    SnmpEngineId(byte[] bin) {
-        engineId = bin;
-        hexString = SnmpTools.binary2ascii(bin).toLowerCase();
-    }
-
-    /**
-     * If a string of the format &lt;address&gt;:&lt;port&gt;:&lt;IANA number&gt; has been provided at creation time, this string is returned.
-     * @return The Id as a readable string or null if not provided.
-     */
-    public String getReadableId() {
-        return humanString;
-    }
-
-    /**
-     * Returns a string format engine Id.
-     * @return String format value.
-     */
-    public String toString() {
-        return hexString;
-    }
-    /**
-     * Returns a binary engine Id.
-     * @return Binary value.
-     */
-    public byte[] getBytes() {
-        return engineId;
-    }
-
-    /**
-     * In order to store the string used to create the engineId.
-     */
-    void setStringValue(String val) {
-        humanString = val;
-    }
-
-    static void validateId(String str) throws IllegalArgumentException {
-        byte[] arr = SnmpTools.ascii2binary(str);
-        validateId(arr);
-    }
-
-    static void validateId(byte[] arr) throws IllegalArgumentException {
-
-        if(arr.length < 5) throw new IllegalArgumentException("Id size lower than 5 bytes.");
-        if(arr.length > 32) throw new IllegalArgumentException("Id size greater than 32 bytes.");
-
-        //octet strings with very first bit = 0 and length != 12 octets
-        if( ((arr[0] & 0x80) == 0) && arr.length != 12)
-            throw new IllegalArgumentException("Very first bit = 0 and length != 12 octets");
-
-        byte[] zeroedArrays = new byte[arr.length];
-        if(Arrays.equals(zeroedArrays, arr)) throw new IllegalArgumentException("Zeroed Id.");
-        byte[] FFArrays = new byte[arr.length];
-        Arrays.fill(FFArrays, (byte)0xFF);
-        if(Arrays.equals(FFArrays, arr)) throw new IllegalArgumentException("0xFF Id.");
-
-    }
-
-    /**
-     * Generates an engine Id based on the passed array.
-     * @return The created engine Id or null if given arr is null or its length == 0;
-     * @exception IllegalArgumentException when:
-     * <ul>
-     *  <li>octet string lower than 5 bytes.</li>
-     *  <li>octet string greater than 32 bytes.</li>
-     *  <li>octet string = all zeros.</li>
-     *  <li>octet string = all 'ff'H.</li>
-     *  <li>octet strings with very first bit = 0 and length != 12 octets</li>
-     * </ul>
-     */
-    public static SnmpEngineId createEngineId(byte[] arr) throws IllegalArgumentException {
-        if( (arr == null) || arr.length == 0) return null;
-        validateId(arr);
-        return new SnmpEngineId(arr);
-    }
-
-    /**
-     * Generates an engine Id that is unique to the host the agent is running on. The engine Id unicity is system time based. The creation algorithm uses the SUN Microsystems IANA number (42).
-     * @return The generated engine Id.
-     */
-    public static SnmpEngineId createEngineId() {
-        byte[] address = null;
-        byte[] engineid = new byte[13];
-        int iana = 42;
-        long mask = 0xFF;
-        long time = System.currentTimeMillis();
-
-        engineid[0] = (byte) ( (iana & 0xFF000000) >> 24 );
-        engineid[0] |= 0x80;
-        engineid[1] = (byte) ( (iana & 0x00FF0000) >> 16 );
-        engineid[2] = (byte) ( (iana & 0x0000FF00) >> 8 );
-        engineid[3] = (byte) (iana & 0x000000FF);
-        engineid[4] = 0x05;
-
-        engineid[5] =  (byte) ( (time & (mask << 56)) >>> 56 );
-        engineid[6] =  (byte) ( (time & (mask << 48) ) >>> 48 );
-        engineid[7] =  (byte) ( (time & (mask << 40) ) >>> 40 );
-        engineid[8] =  (byte) ( (time & (mask << 32) ) >>> 32 );
-        engineid[9] =  (byte) ( (time & (mask << 24) ) >>> 24 );
-        engineid[10] = (byte) ( (time & (mask << 16) ) >>> 16 );
-        engineid[11] = (byte) ( (time & (mask << 8) ) >>> 8 );
-        engineid[12] = (byte) (time & mask);
-
-        return new SnmpEngineId(engineid);
-    }
-
-    /**
-     * Translates an engine Id in an SnmpOid format. This is useful when dealing with USM MIB indexes.
-     * The oid format is : <engine Id length>.<engine Id binary octet1>....<engine Id binary octetn - 1>.<engine Id binary octetn>
-     * Eg: "0x8000002a05819dcb6e00001f96" ==> 13.128.0.0.42.5.129.157.203.110.0.0.31.150
-     *
-     * @return SnmpOid The oid.
-     */
-    public SnmpOid toOid() {
-        long[] oid = new long[engineId.length + 1];
-        oid[0] = engineId.length;
-        for(int i = 1; i <= engineId.length; i++)
-            oid[i] = (long) (engineId[i-1] & 0xFF);
-        return new SnmpOid(oid);
-    }
-
-   /**
-    * <P>Generates a unique engine Id. Hexadecimal strings as well as a textual description are supported. The textual format is as follow:
-    * <BR>  &lt;address&gt;:&lt;port&gt;:&lt;IANA number&gt;</P>
-    * <P>The allowed formats :</P>
-    * <ul>
-    * <li> &lt;address&gt;:&lt;port&gt;:&lt;IANA number&gt
-    * <BR>   All these parameters are used to generate the Id. WARNING, this method is not compliant with IPv6 address format. Use { @link com.sun.jmx.snmp.SnmpEngineId#createEngineId(java.lang.String,java.lang.String) } instead.</li>
-    * <li> &lt;address&gt;:&lt;port&gt;
-    * <BR>   The IANA number will be the SUN Microsystems one (42). </li>
-    * <li> address
-    * <BR>   The port 161 will be used to generate the Id. IANA number will be the SUN Microsystems one (42). </li>
-    * <li> :port
-    * <BR>   The host to use is localhost. IANA number will be the SUN Microsystems one (42). </li>
-    * <li> ::&lt;IANA number&gt &nbsp;&nbsp;&nbsp;
-    * <BR>   The port 161 and localhost will be used to generate the Id. </li>
-    * <li> :&lt;port&gt;:&lt;IANA number&gt;
-    * <BR>   The host to use is localhost. </li>
-    * <li> &lt;address&gt;::&lt;IANA number&gt
-    * <BR>   The port 161 will be used to generate the Id. </li>
-    * <li> :: &nbsp;&nbsp;&nbsp;
-    * <BR>   The port 161, localhost and the SUN Microsystems IANA number will be used to generate the Id. </li>
-    * </ul>
-    * @exception UnknownHostException if the host name contained in the textual format is unknown.
-    * @exception IllegalArgumentException when :
-    * <ul>
-    *  <li>octet string lower than 5 bytes.</li>
-    *  <li>octet string greater than 32 bytes.</li>
-    *  <li>octet string = all zeros.</li>
-    *  <li>octet string = all 'ff'H.</li>
-    *  <li>octet strings with very first bit = 0 and length != 12 octets</li>
-    *  <li>An IPv6 address format is used in conjonction with the ":" separator</li>
-    * </ul>
-    * @param str The string to parse.
-    * @return The generated engine Id or null if the passed string is null.
-    *
-    */
-    public static SnmpEngineId createEngineId(String str)
-        throws IllegalArgumentException, UnknownHostException {
-        return createEngineId(str, null);
-    }
-
-    /**
-     * Idem { @link
-     * com.sun.jmx.snmp.SnmpEngineId#createEngineId(java.lang.String) }
-     * with the ability to provide your own separator. This allows IPv6
-     * address format handling (eg: providing @ as separator).
-     * @param str The string to parse.
-     * @param separator the separator to use. If null is provided, the default
-     * separator ":" is used.
-     * @return The generated engine Id or null if the passed string is null.
-     * @exception UnknownHostException if the host name contained in the
-     * textual format is unknown.
-     * @exception IllegalArgumentException when :
-     * <ul>
-     *  <li>octet string lower than 5 bytes.</li>
-     *  <li>octet string greater than 32 bytes.</li>
-     *  <li>octet string = all zeros.</li>
-     *  <li>octet string = all 'ff'H.</li>
-     *  <li>octet strings with very first bit = 0 and length != 12 octets</li>
-     *  <li>An IPv6 address format is used in conjonction with the ":"
-     *      separator</li>
-     * </ul>
-     * @since 1.5
-     */
-    public static SnmpEngineId createEngineId(String str, String separator)
-        throws IllegalArgumentException, UnknownHostException {
-        if(str == null) return null;
-
-        if(str.startsWith("0x") || str.startsWith("0X")) {
-            validateId(str);
-            return new SnmpEngineId(str);
-        }
-        separator = separator == null ? ":" : separator;
-        StringTokenizer token = new StringTokenizer(str,
-                                                    separator,
-                                                    true);
-
-        String address = null;
-        String port = null;
-        String iana = null;
-        int objPort = 161;
-        int objIana = 42;
-        InetAddress objAddress = null;
-        SnmpEngineId eng = null;
-        try {
-            //Deal with address
-            try {
-                address = token.nextToken();
-            }catch(NoSuchElementException e) {
-                throw new IllegalArgumentException("Passed string is invalid : ["+str+"]");
-            }
-            if(!address.equals(separator)) {
-                objAddress = InetAddress.getByName(address);
-                try {
-                    token.nextToken();
-                }catch(NoSuchElementException e) {
-                    //No need to go further, no port.
-                    eng = SnmpEngineId.createEngineId(objAddress,
-                                                      objPort,
-                                                      objIana);
-                    eng.setStringValue(str);
-                    return eng;
-                }
-            }
-            else
-                objAddress = InetAddress.getLocalHost();
-
-            //Deal with port
-            try {
-                port = token.nextToken();
-            }catch(NoSuchElementException e) {
-                //No need to go further, no port.
-                eng = SnmpEngineId.createEngineId(objAddress,
-                                                  objPort,
-                                                  objIana);
-                eng.setStringValue(str);
-                return eng;
-            }
-
-            if(!port.equals(separator)) {
-                objPort = Integer.parseInt(port);
-                try {
-                    token.nextToken();
-                }catch(NoSuchElementException e) {
-                    //No need to go further, no iana.
-                    eng = SnmpEngineId.createEngineId(objAddress,
-                                                      objPort,
-                                                      objIana);
-                    eng.setStringValue(str);
-                    return eng;
-                }
-            }
-
-            //Deal with iana
-            try {
-                iana = token.nextToken();
-            }catch(NoSuchElementException e) {
-                //No need to go further, no port.
-                eng = SnmpEngineId.createEngineId(objAddress,
-                                                  objPort,
-                                                  objIana);
-                eng.setStringValue(str);
-                return eng;
-            }
-
-            if(!iana.equals(separator))
-                objIana = Integer.parseInt(iana);
-
-            eng = SnmpEngineId.createEngineId(objAddress,
-                                              objPort,
-                                              objIana);
-            eng.setStringValue(str);
-
-            return eng;
-
-        } catch(Exception e) {
-            throw new IllegalArgumentException("Passed string is invalid : ["+str+"]. Check that the used separator ["+ separator + "] is compatible with IPv6 address format.");
-        }
-
-    }
-
-    /**
-     * Generates a unique engine Id. The engine Id unicity is based on
-     * the host IP address and port. The IP address used is the
-     * localhost one. The creation algorithm uses the SUN Microsystems IANA
-     * number (42).
-     * @param port The TCP/IP port the SNMPv3 Adaptor Server is listening to.
-     * @return The generated engine Id.
-     * @exception UnknownHostException if the local host name
-     *            used to calculate the id is unknown.
-     */
-    public static SnmpEngineId createEngineId(int port)
-        throws UnknownHostException {
-        int suniana = 42;
-        InetAddress address = null;
-        address = InetAddress.getLocalHost();
-        return createEngineId(address, port, suniana);
-    }
-    /**
-     * Generates a unique engine Id. The engine Id unicity is based on
-     * the host IP address and port. The IP address used is the passed
-     * one. The creation algorithm uses the SUN Microsystems IANA
-     * number (42).
-     * @param address The IP address the SNMPv3 Adaptor Server is listening to.
-     * @param port The TCP/IP port the SNMPv3 Adaptor Server is listening to.
-     * @return The generated engine Id.
-     * @exception UnknownHostException. if the provided address is null.
-     */
-    public static SnmpEngineId createEngineId(InetAddress address, int port)
-        throws IllegalArgumentException {
-        int suniana = 42;
-        if(address == null)
-            throw new IllegalArgumentException("InetAddress is null.");
-        return createEngineId(address, port, suniana);
-    }
-
-    /**
-     * Generates a unique engine Id. The engine Id unicity is based on
-     * the host IP address and port. The IP address is the localhost one.
-     * The creation algorithm uses the passed IANA number.
-     * @param port The TCP/IP port the SNMPv3 Adaptor Server is listening to.
-     * @param iana Your enterprise IANA number.
-     * @exception UnknownHostException if the local host name used to calculate the id is unknown.
-     * @return The generated engine Id.
-     */
-    public static SnmpEngineId createEngineId(int port, int iana) throws UnknownHostException {
-        InetAddress address = null;
-        address = InetAddress.getLocalHost();
-        return createEngineId(address, port, iana);
-    }
-
-    /**
-     * Generates a unique engine Id. The engine Id unicity is based on the host IP address and port. The IP address is the passed one, it handles IPv4 and IPv6 hosts. The creation algorithm uses the passed IANA number.
-     * @param addr The IP address the SNMPv3 Adaptor Server is listening to.
-     * @param port The TCP/IP port the SNMPv3 Adaptor Server is listening to.
-     * @param iana Your enterprise IANA number.
-     * @return The generated engine Id.
-     * @exception UnknownHostException if the provided <CODE>InetAddress </CODE> is null.
-     */
-    public static SnmpEngineId createEngineId(InetAddress addr,
-                                              int port,
-                                              int iana) {
-        if(addr == null) throw new IllegalArgumentException("InetAddress is null.");
-        byte[] address = addr.getAddress();
-        byte[] engineid = new byte[9 + address.length];
-        engineid[0] = (byte) ( (iana & 0xFF000000) >> 24 );
-        engineid[0] |= 0x80;
-        engineid[1] = (byte) ( (iana & 0x00FF0000) >> 16 );
-        engineid[2] = (byte) ( (iana & 0x0000FF00) >> 8 );
-
-engineid[3] = (byte) (iana & 0x000000FF);
-        engineid[4] = 0x05;
-
-        if(address.length == 4)
-            engineid[4] = 0x01;
-
-        if(address.length == 16)
-            engineid[4] = 0x02;
-
-        for(int i = 0; i < address.length; i++) {
-            engineid[i + 5] = address[i];
-        }
-
-        engineid[5 + address.length] = (byte)  ( (port & 0xFF000000) >> 24 );
-        engineid[6 + address.length] = (byte) ( (port & 0x00FF0000) >> 16 );
-        engineid[7 + address.length] = (byte) ( (port & 0x0000FF00) >> 8 );
-        engineid[8 + address.length] = (byte) (  port & 0x000000FF );
-
-        return new SnmpEngineId(engineid);
-    }
-
-     /**
-     * Generates an engine Id based on an InetAddress. Handles IPv4 and IPv6 addresses. The creation algorithm uses the passed IANA number.
-     * @param iana Your enterprise IANA number.
-     * @param addr The IP address the SNMPv3 Adaptor Server is listening to.
-     * @return The generated engine Id.
-     * @since 1.5
-     * @exception UnknownHostException if the provided <CODE>InetAddress </CODE> is null.
-     */
-    public static SnmpEngineId createEngineId(int iana, InetAddress addr)
-    {
-        if(addr == null) throw new IllegalArgumentException("InetAddress is null.");
-        byte[] address = addr.getAddress();
-        byte[] engineid = new byte[5 + address.length];
-        engineid[0] = (byte) ( (iana & 0xFF000000) >> 24 );
-        engineid[0] |= 0x80;
-        engineid[1] = (byte) ( (iana & 0x00FF0000) >> 16 );
-        engineid[2] = (byte) ( (iana & 0x0000FF00) >> 8 );
-
-        engineid[3] = (byte) (iana & 0x000000FF);
-        if(address.length == 4)
-            engineid[4] = 0x01;
-
-        if(address.length == 16)
-            engineid[4] = 0x02;
-
-        for(int i = 0; i < address.length; i++) {
-            engineid[i + 5] = address[i];
-        }
-
-        return new SnmpEngineId(engineid);
-    }
-
-    /**
-     * Generates an engine Id based on an InetAddress. Handles IPv4 and IPv6
-     * addresses. The creation algorithm uses the sun IANA number (42).
-     * @param addr The IP address the SNMPv3 Adaptor Server is listening to.
-     * @return The generated engine Id.
-     * @since 1.5
-     * @exception UnknownHostException if the provided
-     *            <CODE>InetAddress</CODE> is null.
-     */
-    public static SnmpEngineId createEngineId(InetAddress addr) {
-        return createEngineId(42, addr);
-    }
-
-
-    /**
-     * Tests <CODE>SnmpEngineId</CODE> instance equality. Two <CODE>SnmpEngineId</CODE> are equal if they have the same value.
-     * @return <CODE>true</CODE> if the two <CODE>SnmpEngineId</CODE> are equals, <CODE>false</CODE> otherwise.
-     */
-    public boolean equals(Object a) {
-        if(!(a instanceof SnmpEngineId) ) return false;
-        return hexString.equals(((SnmpEngineId) a).toString());
-    }
-
-    public int hashCode() {
-        return hexString.hashCode();
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpEngineParameters.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp;
-
-import java.io.Serializable;
-
-/**
- * This class is used to pass some specific parameters to an <CODE>
- * SnmpEngineFactory </CODE>.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public class SnmpEngineParameters implements Serializable {
-    private static final long serialVersionUID = 3720556613478400808L;
-
-    private UserAcl uacl = null;
-    private String securityFile = null;
-    private boolean encrypt = false;
-    private SnmpEngineId engineId = null;
-
-    /**
-     * Sets the file to use for SNMP Runtime Lcd. If no file is provided, the default location will be checked.
-     */
-    public void setSecurityFile(String securityFile) {
-        this.securityFile = securityFile;
-    }
-
-    /**
-     * Gets the file to use for SNMP Runtime Lcd.
-     * @return The security file.
-     */
-    public String getSecurityFile() {
-        return securityFile;
-    }
-    /**
-     * Sets a customized user ACL. User Acl is used in order to check
-     * access for SNMP V3 requests. If no ACL is provided,
-     * <CODE>com.sun.jmx.snmp.usm.UserAcl.UserAcl</CODE> is instantiated.
-     * @param uacl The user ACL to use.
-     */
-    public void setUserAcl(UserAcl uacl) {
-        this.uacl = uacl;
-    }
-
-    /**
-     * Gets the customized user ACL.
-     * @return The customized user ACL.
-     */
-    public UserAcl getUserAcl() {
-        return uacl;
-    }
-
-    /**
-     * Activate SNMP V3 encryption. By default the encryption is not activated. Be sure that the security provider classes needed for DES are in your classpath (eg:JCE classes)
-     *
-     */
-    public void activateEncryption() {
-        this.encrypt = true;
-    }
-
-    /**
-     * Deactivate SNMP V3 encryption. By default the encryption is not activated. Be sure that the security provider classes needed for DES are in your classpath (eg:JCE classes)
-     *
-     */
-    public void deactivateEncryption() {
-        this.encrypt = false;
-    }
-
-    /**
-     * Check if encryption is activated. By default the encryption is not activated.
-     * @return The encryption activation status.
-     */
-    public boolean isEncryptionEnabled() {
-        return encrypt;
-    }
-
-    /**
-     * Set the engine Id.
-     * @param engineId The engine Id to use.
-     */
-    public void setEngineId(SnmpEngineId engineId) {
-        this.engineId = engineId;
-    }
-
-    /**
-     * Get the engine Id.
-     * @return The engineId.
-     */
-    public SnmpEngineId getEngineId() {
-        return engineId;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpGauge.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-/**
- * Represents an SNMP gauge.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpGauge extends SnmpUnsignedInt {
-    private static final long serialVersionUID = -8366622742122792945L;
-
-    // CONSTRUCTORS
-    //-------------
-    /**
-     * Constructs a new <CODE>SnmpGauge</CODE> from the specified integer value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is negative
-     * or larger than {@link SnmpUnsignedInt#MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
-     */
-    public SnmpGauge(int v) throws IllegalArgumentException {
-        super(v) ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpGauge</CODE> from the specified <CODE>Integer</CODE> value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is negative
-     * or larger than {@link SnmpUnsignedInt#MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
-     */
-    public SnmpGauge(Integer v) throws IllegalArgumentException {
-        super(v) ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpGauge</CODE> from the specified long value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is negative
-     * or larger than {@link SnmpUnsignedInt#MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
-     */
-    public SnmpGauge(long v) throws IllegalArgumentException {
-        super(v) ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpGauge</CODE> from the specified <CODE>Long</CODE> value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is negative
-     * or larger than {@link SnmpUnsignedInt#MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
-     */
-    public SnmpGauge(Long v) throws IllegalArgumentException {
-        super(v) ;
-    }
-
-    // PUBLIC METHODS
-    //---------------
-    /**
-     * Returns a textual description of the type object.
-     * @return ASN.1 textual description.
-     */
-    final public String getTypeName() {
-        return name ;
-    }
-
-    // VARIABLES
-    //----------
-    /**
-     * Name of the type.
-     */
-    final static String name = "Gauge32" ;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpInt.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,282 +0,0 @@
-/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-import com.sun.jmx.snmp.Enumerated;
-
-/**
- * Represents an SNMP integer.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpInt extends SnmpValue {
-    private static final long serialVersionUID = -7163624758070343373L;
-
-    // CONSTRUCTORS
-    //-------------
-    /**
-     * Constructs a new <CODE>SnmpInt</CODE> from the specified integer value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is smaller than <CODE>Integer.MIN_VALUE</CODE>
-     * or larger than <CODE>Integer.MAX_VALUE</CODE>.
-     */
-    public SnmpInt(int v) throws IllegalArgumentException {
-        if ( isInitValueValid(v) == false ) {
-            throw new IllegalArgumentException() ;
-        }
-        value = (long)v ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpInt</CODE> from the specified <CODE>Integer</CODE> value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is smaller than <CODE>Integer.MIN_VALUE</CODE>
-     * or larger than <CODE>Integer.MAX_VALUE</CODE>.
-     */
-    public SnmpInt(Integer v) throws IllegalArgumentException {
-        this(v.intValue()) ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpInt</CODE> from the specified long value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is smaller than <CODE>Integer.MIN_VALUE</CODE>
-     * or larger than <CODE>Integer.MAX_VALUE</CODE>.
-     */
-    public SnmpInt(long v) throws IllegalArgumentException {
-        if ( isInitValueValid(v) == false ) {
-            throw new IllegalArgumentException() ;
-        }
-        value = v ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpInt</CODE> from the specified <CODE>Long</CODE> value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is smaller than <CODE>Integer.MIN_VALUE</CODE>
-     * or larger than <CODE>Integer.MAX_VALUE</CODE>.
-     */
-    public SnmpInt(Long v) throws IllegalArgumentException {
-        this(v.longValue()) ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpInt</CODE> from the specified <CODE>Enumerated</CODE> value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is smaller than <CODE>Integer.MIN_VALUE</CODE>
-     * or larger than <CODE>Integer.MAX_VALUE</CODE>.
-     * @see Enumerated
-     */
-    public SnmpInt(Enumerated v) throws IllegalArgumentException {
-        this(v.intValue()) ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpInt</CODE> from the specified boolean value.
-     * This constructor applies rfc1903 rule:
-     * <p><blockquote><pre>
-     * TruthValue ::= TEXTUAL-CONVENTION
-     *     STATUS       current
-     *     DESCRIPTION
-     *             "Represents a boolean value."
-     *     SYNTAX       INTEGER { true(1), false(2) }
-     * </pre></blockquote>
-     * @param v The initialization value.
-     */
-    public SnmpInt(boolean v) {
-        value = v ? 1 : 2 ;
-    }
-
-    // PUBLIC METHODS
-    //---------------
-    /**
-     * Returns the long value of this <CODE>SnmpInt</CODE>.
-     * @return The value.
-     */
-    public long longValue() {
-        return value ;
-    }
-
-    /**
-     * Converts the integer value to its <CODE>Long</CODE> form.
-     * @return The <CODE>Long</CODE> representation of the value.
-     */
-    public Long toLong() {
-        return value;
-    }
-
-    /**
-     * Converts the integer value to its integer form.
-     * @return The integer representation of the value.
-     */
-    public int intValue() {
-        return (int) value ;
-    }
-
-    /**
-     * Converts the integer value to its <CODE>Integer</CODE> form.
-     * @return The <CODE>Integer</CODE> representation of the value.
-     */
-    public Integer toInteger() {
-        return (int)value;
-    }
-
-    /**
-     * Converts the integer value to its <CODE>String</CODE> form.
-     * @return The <CODE>String</CODE> representation of the value.
-     */
-    public String toString() {
-        return String.valueOf(value) ;
-    }
-
-    /**
-     * Converts the integer value to its <CODE>SnmpOid</CODE> form.
-     * @return The OID representation of the value.
-     */
-    public SnmpOid toOid() {
-        return new SnmpOid(value) ;
-    }
-
-    /**
-     * Extracts the integer from an index OID and returns its
-     * value converted as an <CODE>SnmpOid</CODE>.
-     * @param index The index array.
-     * @param start The position in the index array.
-     * @return The OID representing the integer value.
-     * @exception SnmpStatusException There is no integer value
-     * available at the start position.
-     */
-    public static SnmpOid toOid(long[] index, int start) throws SnmpStatusException {
-        try {
-            return new SnmpOid(index[start]) ;
-        }
-        catch(IndexOutOfBoundsException e) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
-        }
-    }
-
-    /**
-     * Scans an index OID, skips the integer value and returns the position
-     * of the next value.
-     * @param index The index array.
-     * @param start The position in the index array.
-     * @return The position of the next value.
-     * @exception SnmpStatusException There is no integer value
-     * available at the start position.
-     */
-    public static int nextOid(long[] index, int start) throws SnmpStatusException {
-        if (start >= index.length) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
-        }
-        else {
-            return start + 1 ;
-        }
-    }
-
-    /**
-     * Appends an <CODE>SnmpOid</CODE> representing an <CODE>SnmpInt</CODE> to another OID.
-     * @param source An OID representing an <CODE>SnmpInt</CODE> value.
-     * @param dest Where source should be appended.
-     */
-    public static void appendToOid(SnmpOid source, SnmpOid dest) {
-        if (source.getLength() != 1) {
-            throw new IllegalArgumentException() ;
-        }
-        dest.append(source) ;
-    }
-
-    /**
-     * Performs a clone action. This provides a workaround for the
-     * <CODE>SnmpValue</CODE> interface.
-     * @return The <CODE>SnmpValue</CODE> clone.
-     */
-    final synchronized public SnmpValue duplicate() {
-        return (SnmpValue) clone() ;
-    }
-
-    /**
-     * Clones the <CODE>SnmpInt</CODE> object, making a copy of its data.
-     * @return The object clone.
-     */
-    final synchronized public Object clone() {
-        SnmpInt  newclone = null ;
-        try {
-            newclone = (SnmpInt) super.clone() ;
-            newclone.value = value ;
-        } catch (CloneNotSupportedException e) {
-            throw new InternalError(e) ; // vm bug.
-        }
-        return newclone ;
-    }
-
-    /**
-     * Returns a textual description of the type object.
-     * @return ASN.1 textual description.
-     */
-    public String getTypeName() {
-        return name ;
-    }
-
-    /**
-     * This method has been defined to allow the sub-classes
-     * of SnmpInt to perform their own control at intialization time.
-     */
-    boolean isInitValueValid(int v) {
-        if ((v < Integer.MIN_VALUE) || (v > Integer.MAX_VALUE)) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * This method has been defined to allow the sub-classes
-     * of SnmpInt to perform their own control at intialization time.
-     */
-    boolean isInitValueValid(long v) {
-        if ((v < Integer.MIN_VALUE) || (v > Integer.MAX_VALUE)) {
-            return false;
-        }
-        return true;
-    }
-
-    // VARIABLES
-    //----------
-    /**
-     * Name of the type.
-     */
-    final static String name = "Integer32" ;
-
-    /**
-     * This is where the value is stored. This long is signed.
-     * @serial
-     */
-    protected long value = 0 ;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpIpAddress.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-
-/**
- * Represents an SNMP IpAddress.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpIpAddress extends SnmpOid {
-    private static final long serialVersionUID = 7204629998270874474L;
-
-    // CONSTRUCTORS
-    //-------------
-    /**
-     * Constructs a new <CODE>SnmpIpAddress</CODE> from the specified bytes array.
-     * @param bytes The four bytes composing the address.
-     * @exception IllegalArgumentException The length of the array is not equal to four.
-     */
-    public SnmpIpAddress(byte[] bytes) throws IllegalArgumentException {
-        buildFromByteArray(bytes);
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpIpAddress</CODE> from the specified long value.
-     * @param addr The initialization value.
-     */
-    public SnmpIpAddress(long addr) {
-        int address = (int)addr ;
-        byte[] ipaddr = new byte[4];
-
-        ipaddr[0] = (byte) ((address >>> 24) & 0xFF);
-        ipaddr[1] = (byte) ((address >>> 16) & 0xFF);
-        ipaddr[2] = (byte) ((address >>> 8) & 0xFF);
-        ipaddr[3] = (byte) (address & 0xFF);
-
-        buildFromByteArray(ipaddr);
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpIpAddress</CODE> from a dot-formatted <CODE>String</CODE>.
-     * The dot-formatted <CODE>String</CODE> is formulated x.x.x.x .
-     * @param dotAddress The initialization value.
-     * @exception IllegalArgumentException The string does not correspond to an ip address.
-     */
-    public SnmpIpAddress(String dotAddress) throws IllegalArgumentException {
-        super(dotAddress) ;
-        if ((componentCount > 4) ||
-            (components[0] > 255) ||
-            (components[1] > 255) ||
-            (components[2] > 255) ||
-            (components[3] > 255)) {
-            throw new IllegalArgumentException(dotAddress) ;
-        }
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpIpAddress</CODE> from four long values.
-     * @param b1 Byte 1.
-     * @param b2 Byte 2.
-     * @param b3 Byte 3.
-     * @param b4 Byte 4.
-     * @exception IllegalArgumentException A value is outside of [0-255].
-     */
-    public SnmpIpAddress(long b1, long b2, long b3, long b4) {
-        super(b1, b2, b3, b4) ;
-        if ((components[0] > 255) ||
-            (components[1] > 255) ||
-            (components[2] > 255) ||
-            (components[3] > 255)) {
-            throw new IllegalArgumentException() ;
-        }
-    }
-
-    // PUBLIC METHODS
-    //---------------
-    /**
-     * Converts the address value to its byte array form.
-     * @return The byte array representation of the value.
-     */
-    public byte[] byteValue() {
-        byte[] result = new byte[4] ;
-        result[0] = (byte)components[0] ;
-        result[1] = (byte)components[1] ;
-        result[2] = (byte)components[2] ;
-        result[3] = (byte)components[3] ;
-
-        return result ;
-    }
-
-    /**
-     * Converts the address to its <CODE>String</CODE> form.
-     * Same as <CODE>toString()</CODE>. Exists only to follow a naming scheme.
-     * @return The <CODE>String</CODE> representation of the value.
-     */
-    public String stringValue() {
-        return toString() ;
-    }
-
-    /**
-     * Extracts the ip address from an index OID and returns its
-     * value converted as an <CODE>SnmpOid</CODE>.
-     * @param index The index array.
-     * @param start The position in the index array.
-     * @return The OID representing the ip address value.
-     * @exception SnmpStatusException There is no ip address value
-     * available at the start position.
-     */
-    public static SnmpOid toOid(long[] index, int start) throws SnmpStatusException {
-        if (start + 4 <= index.length) {
-            try {
-                return new SnmpOid(
-                                   index[start],
-                                   index[start+1],
-                                   index[start+2],
-                                   index[start+3]) ;
-            }
-            catch(IllegalArgumentException e) {
-                throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
-            }
-        }
-        else {
-            throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
-        }
-    }
-
-    /**
-     * Scans an index OID, skips the address value and returns the position
-     * of the next value.
-     * @param index The index array.
-     * @param start The position in the index array.
-     * @return The position of the next value.
-     * @exception SnmpStatusException There is no address value
-     * available at the start position.
-     */
-    public static int nextOid(long[] index, int start) throws SnmpStatusException {
-        if (start + 4 <= index.length) {
-            return start + 4 ;
-        }
-        else {
-            throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
-        }
-    }
-
-    /**
-     * Appends an <CODE>SnmpOid</CODE> representing an <CODE>SnmpIpAddress</CODE> to another OID.
-     * @param source An OID representing an <CODE>SnmpIpAddress</CODE> value.
-     * @param dest Where source should be appended.
-     */
-    public static void appendToOid(SnmpOid source, SnmpOid dest) {
-        if (source.getLength() != 4) {
-            throw new IllegalArgumentException() ;
-        }
-        dest.append(source) ;
-    }
-
-    /**
-     * Returns a textual description of the type object.
-     * @return ASN.1 textual description.
-     */
-    final public String getTypeName() {
-        return name ;
-    }
-
-    // PRIVATE METHODS
-    //----------------
-    /**
-     * Build Ip address from byte array.
-     */
-    private void buildFromByteArray(byte[] bytes) {
-        if (bytes.length != 4) {
-            throw new IllegalArgumentException() ;
-        }
-        components = new long[4] ;
-        componentCount= 4;
-        components[0] = (bytes[0] >= 0) ? bytes[0] : bytes[0] + 256 ;
-        components[1] = (bytes[1] >= 0) ? bytes[1] : bytes[1] + 256 ;
-        components[2] = (bytes[2] >= 0) ? bytes[2] : bytes[2] + 256 ;
-        components[3] = (bytes[3] >= 0) ? bytes[3] : bytes[3] + 256 ;
-    }
-
-    // VARIABLES
-    //----------
-    /**
-     * Name of the type.
-     */
-    final static String name = "IpAddress" ;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpMessage.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,362 +0,0 @@
-/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-// java imports
-//
-import java.util.logging.Level;
-import java.util.Vector;
-import java.net.InetAddress;
-
-import static com.sun.jmx.defaults.JmxProperties.SNMP_LOGGER;
-
-/**
- * Is a partially decoded representation of an SNMP packet.
- * <P>
- * You will not normally need to use this class unless you decide to
- * implement your own {@link com.sun.jmx.snmp.SnmpPduFactory SnmpPduFactory} object.
- * <P>
- * The <CODE>SnmpMessage</CODE> class is directly mapped onto the
- * <CODE>Message</CODE> syntax defined in RFC1157 and RFC1902.
- * <BLOCKQUOTE>
- * <PRE>
- * Message ::= SEQUENCE {
- *    version       INTEGER { version(1) }, -- for SNMPv2
- *    community     OCTET STRING,           -- community name
- *    data          ANY                     -- an SNMPv2 PDU
- * }
- * </PRE>
- * </BLOCKQUOTE>
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @see SnmpPduFactory
- * @see SnmpPduPacket
- *
- */
-
-public class SnmpMessage extends SnmpMsg implements SnmpDefinitions {
-    /**
-     * Community name.
-     */
-    public byte[] community ;
-
-    /**
-     * Encodes this message and puts the result in the specified byte array.
-     * For internal use only.
-     *
-     * @param outputBytes An array to receive the resulting encoding.
-     *
-     * @exception ArrayIndexOutOfBoundsException If the result does not fit
-     *                                           into the specified array.
-     */
-    public int encodeMessage(byte[] outputBytes) throws SnmpTooBigException {
-        int encodingLength = 0 ;
-        if (data == null)
-            throw new IllegalArgumentException("Data field is null") ;
-
-        //
-        // Reminder: BerEncoder does backward encoding !
-        //
-        try {
-            BerEncoder benc = new BerEncoder(outputBytes) ;
-            benc.openSequence() ;
-            benc.putAny(data, dataLength) ;
-            benc.putOctetString((community != null) ? community : new byte[0]) ;
-            benc.putInteger(version) ;
-            benc.closeSequence() ;
-            encodingLength = benc.trim() ;
-        }
-        catch(ArrayIndexOutOfBoundsException x) {
-            throw new SnmpTooBigException() ;
-        }
-
-        return encodingLength ;
-    }
-    /**
-     * Returns the associated request ID.
-     * @param inputBytes The flat message.
-     * @return The request ID.
-     *
-     * @since 1.5
-     */
-    public int getRequestId(byte[] inputBytes) throws SnmpStatusException {
-        int requestId = 0;
-        BerDecoder bdec = null;
-        BerDecoder bdec2 = null;
-        byte[] any = null;
-        try {
-            bdec = new BerDecoder(inputBytes);
-            bdec.openSequence();
-            bdec.fetchInteger();
-            bdec.fetchOctetString();
-            any = bdec.fetchAny();
-            bdec2 = new BerDecoder(any);
-            int type = bdec2.getTag();
-            bdec2.openSequence(type);
-            requestId = bdec2.fetchInteger();
-        }
-        catch(BerException x) {
-            throw new SnmpStatusException("Invalid encoding") ;
-        }
-        try {
-            bdec.closeSequence();
-        }
-        catch(BerException x) {
-        }
-        try {
-            bdec2.closeSequence();
-        }
-        catch(BerException x) {
-        }
-        return requestId;
-    }
-    /**
-     * Decodes the specified bytes and initializes this message.
-     * For internal use only.
-     *
-     * @param inputBytes The bytes to be decoded.
-     *
-     * @exception SnmpStatusException If the specified bytes are not a valid encoding.
-     */
-    public void decodeMessage(byte[] inputBytes, int byteCount)
-        throws SnmpStatusException {
-        try {
-            BerDecoder bdec = new BerDecoder(inputBytes/*, byteCount */) ; // FIXME
-            bdec.openSequence() ;
-            version = bdec.fetchInteger() ;
-            community = bdec.fetchOctetString() ;
-            data = bdec.fetchAny() ;
-            dataLength = data.length ;
-            bdec.closeSequence() ;
-        }
-        catch(BerException x) {
-            throw new SnmpStatusException("Invalid encoding") ;
-        }
-    }
-
-    /**
-     * Initializes this message with the specified <CODE>pdu</CODE>.
-     * <P>
-     * This method initializes the data field with an array of
-     * <CODE>maxDataLength</CODE> bytes. It encodes the <CODE>pdu</CODE>.
-     * The resulting encoding is stored in the data field
-     * and the length of the encoding is stored in <CODE>dataLength</CODE>.
-     * <p>
-     * If the encoding length exceeds <CODE>maxDataLength</CODE>,
-     * the method throws an exception.
-     *
-     * @param pdu The PDU to be encoded.
-     * @param maxDataLength The maximum length permitted for the data field.
-     *
-     * @exception SnmpStatusException If the specified <CODE>pdu</CODE> is not valid.
-     * @exception SnmpTooBigException If the resulting encoding does not fit
-     * into <CODE>maxDataLength</CODE> bytes.
-     * @exception ArrayIndexOutOfBoundsException If the encoding exceeds <CODE>maxDataLength</CODE>.
-     *
-     * @since 1.5
-     */
-    public void encodeSnmpPdu(SnmpPdu pdu, int maxDataLength)
-        throws SnmpStatusException, SnmpTooBigException {
-        //
-        // The easy work
-        //
-        SnmpPduPacket pdupacket = (SnmpPduPacket) pdu;
-        version = pdupacket.version ;
-        community = pdupacket.community ;
-        address = pdupacket.address ;
-        port = pdupacket.port ;
-
-        //
-        // Allocate the array to receive the encoding.
-        //
-        data = new byte[maxDataLength] ;
-
-        //
-        // Encode the pdupacket
-        // Reminder: BerEncoder does backward encoding !
-        //
-
-        try {
-            BerEncoder benc = new BerEncoder(data) ;
-            benc.openSequence() ;
-            encodeVarBindList(benc, pdupacket.varBindList) ;
-
-            switch(pdupacket.type) {
-
-            case pduGetRequestPdu :
-            case pduGetNextRequestPdu :
-            case pduInformRequestPdu :
-            case pduGetResponsePdu :
-            case pduSetRequestPdu :
-            case pduV2TrapPdu :
-            case pduReportPdu :
-                SnmpPduRequest reqPdu = (SnmpPduRequest)pdupacket ;
-                benc.putInteger(reqPdu.errorIndex) ;
-                benc.putInteger(reqPdu.errorStatus) ;
-                benc.putInteger(reqPdu.requestId) ;
-                break ;
-
-            case pduGetBulkRequestPdu :
-                SnmpPduBulk bulkPdu = (SnmpPduBulk)pdupacket ;
-                benc.putInteger(bulkPdu.maxRepetitions) ;
-                benc.putInteger(bulkPdu.nonRepeaters) ;
-                benc.putInteger(bulkPdu.requestId) ;
-                break ;
-
-            case pduV1TrapPdu :
-                SnmpPduTrap trapPdu = (SnmpPduTrap)pdupacket ;
-                benc.putInteger(trapPdu.timeStamp, SnmpValue.TimeticksTag) ;
-                benc.putInteger(trapPdu.specificTrap) ;
-                benc.putInteger(trapPdu.genericTrap) ;
-                if(trapPdu.agentAddr != null)
-                    benc.putOctetString(trapPdu.agentAddr.byteValue(), SnmpValue.IpAddressTag) ;
-                else
-                    benc.putOctetString(new byte[0], SnmpValue.IpAddressTag);
-                benc.putOid(trapPdu.enterprise.longValue()) ;
-                break ;
-
-            default:
-                throw new SnmpStatusException("Invalid pdu type " + String.valueOf(pdupacket.type)) ;
-            }
-            benc.closeSequence(pdupacket.type) ;
-            dataLength = benc.trim() ;
-        }
-        catch(ArrayIndexOutOfBoundsException x) {
-            throw new SnmpTooBigException() ;
-        }
-    }
-    /**
-     * Gets the PDU encoded in this message.
-     * <P>
-     * This method decodes the data field and returns the resulting PDU.
-     *
-     * @return The resulting PDU.
-     * @exception SnmpStatusException If the encoding is not valid.
-     *
-     * @since 1.5
-     */
-    public SnmpPdu decodeSnmpPdu()
-        throws SnmpStatusException {
-        //
-        // Decode the pdu
-        //
-        SnmpPduPacket pdu = null ;
-        BerDecoder bdec = new BerDecoder(data) ;
-        try {
-            int type = bdec.getTag() ;
-            bdec.openSequence(type) ;
-            switch(type) {
-
-            case pduGetRequestPdu :
-            case pduGetNextRequestPdu :
-            case pduInformRequestPdu :
-            case pduGetResponsePdu :
-            case pduSetRequestPdu :
-            case pduV2TrapPdu :
-            case pduReportPdu :
-                SnmpPduRequest reqPdu = new SnmpPduRequest() ;
-                reqPdu.requestId = bdec.fetchInteger() ;
-                reqPdu.errorStatus = bdec.fetchInteger() ;
-                reqPdu.errorIndex = bdec.fetchInteger() ;
-                pdu = reqPdu ;
-                break ;
-
-            case pduGetBulkRequestPdu :
-                SnmpPduBulk bulkPdu = new SnmpPduBulk() ;
-                bulkPdu.requestId = bdec.fetchInteger() ;
-                bulkPdu.nonRepeaters = bdec.fetchInteger() ;
-                bulkPdu.maxRepetitions = bdec.fetchInteger() ;
-                pdu = bulkPdu ;
-                break ;
-
-            case pduV1TrapPdu :
-                SnmpPduTrap trapPdu = new SnmpPduTrap() ;
-                trapPdu.enterprise = new SnmpOid(bdec.fetchOid()) ;
-                byte []b = bdec.fetchOctetString(SnmpValue.IpAddressTag);
-                if(b.length != 0)
-                    trapPdu.agentAddr = new SnmpIpAddress(b) ;
-                else
-                    trapPdu.agentAddr = null;
-                trapPdu.genericTrap = bdec.fetchInteger() ;
-                trapPdu.specificTrap = bdec.fetchInteger() ;
-                trapPdu.timeStamp = bdec.fetchInteger(SnmpValue.TimeticksTag) ;
-                pdu = trapPdu ;
-                break ;
-
-            default:
-                throw new SnmpStatusException(snmpRspWrongEncoding) ;
-            }
-            pdu.type = type ;
-            pdu.varBindList = decodeVarBindList(bdec) ;
-            bdec.closeSequence() ;
-        } catch(BerException e) {
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, SnmpMessage.class.getName(),
-                        "decodeSnmpPdu", "BerException", e);
-            }
-            throw new SnmpStatusException(snmpRspWrongEncoding);
-        } catch(IllegalArgumentException e) {
-            // bug id 4654066
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, SnmpMessage.class.getName(),
-                        "decodeSnmpPdu", "IllegalArgumentException", e);
-            }
-            throw new SnmpStatusException(snmpRspWrongEncoding);
-        }
-
-        //
-        // The easy work
-        //
-        pdu.version = version ;
-        pdu.community = community ;
-        pdu.address = address ;
-        pdu.port = port ;
-
-        return pdu;
-    }
-    /**
-     * Dumps this message in a string.
-     *
-     * @return The string containing the dump.
-     */
-    public String printMessage() {
-        StringBuilder sb = new StringBuilder();
-        if (community == null) {
-            sb.append("Community: null") ;
-        }
-        else {
-            sb.append("Community: {\n") ;
-            sb.append(dumpHexBuffer(community, 0, community.length)) ;
-            sb.append("\n}\n") ;
-        }
-        return sb.append(super.printMessage()).toString();
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpMsg.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,476 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp;
-
-import com.sun.jmx.snmp.SnmpSecurityParameters;
-// java imports
-//
-import java.util.Vector;
-import java.net.InetAddress;
-
-
-import com.sun.jmx.snmp.SnmpStatusException;
-/**
- * A partially decoded representation of an SNMP packet. It contains
- * the information contained in any SNMP message (SNMPv1, SNMPv2 or
- * SNMPv3).
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public abstract class SnmpMsg implements SnmpDefinitions {
-    /**
-     * The protocol version.
-     * <P><CODE>decodeMessage</CODE> and <CODE>encodeMessage</CODE> do not
-     * perform any check on this value.
-     * <BR><CODE>decodeSnmpPdu</CODE> and <CODE>encodeSnmpPdu</CODE> only
-     * accept  the values 0 (for SNMPv1), 1 (for SNMPv2) and 3 (for SNMPv3).
-     */
-    public int version = 0;
-
-    /**
-     * Encoding of the PDU.
-     * <P>This is usually the BER encoding of the PDU's syntax
-     * defined in RFC1157 and RFC1902. However, this can be authenticated
-     * or encrypted data (but you need to implemented your own
-     * <CODE>SnmpPduFactory</CODE> class).
-     */
-    public byte[] data = null;
-
-    /**
-     * Number of useful bytes in the <CODE>data</CODE> field.
-     */
-    public int dataLength = 0;
-
-    /**
-     * Source or destination address.
-     * <BR>For an incoming message it's the source.
-     * For an outgoing message it's the destination.
-     */
-    public InetAddress address = null;
-
-    /**
-     * Source or destination port.
-     * <BR>For an incoming message it's the source.
-     * For an outgoing message it's the destination.
-     */
-    public int port = 0;
-    /**
-     * Security parameters. Contain informations according to Security Model (Usm, community string based, ...).
-     */
-    public SnmpSecurityParameters securityParameters = null;
-    /**
-     * Returns the encoded SNMP version present in the passed byte array.
-     * @param data The unmarshalled SNMP message.
-     * @return The SNMP version (0, 1 or 3).
-     */
-    public static int getProtocolVersion(byte[] data)
-        throws SnmpStatusException {
-        int version = 0;
-        BerDecoder bdec = null;
-        try {
-            bdec = new BerDecoder(data);
-            bdec.openSequence();
-            version = bdec.fetchInteger();
-        }
-        catch(BerException x) {
-            throw new SnmpStatusException("Invalid encoding") ;
-        }
-        try {
-            bdec.closeSequence();
-        }
-        catch(BerException x) {
-        }
-        return version;
-    }
-
-    /**
-     * Returns the associated request ID.
-     * @param data The flat message.
-     * @return The request ID.
-     */
-    public abstract int getRequestId(byte[] data) throws SnmpStatusException;
-
-    /**
-     * Encodes this message and puts the result in the specified byte array.
-     * For internal use only.
-     *
-     * @param outputBytes An array to receive the resulting encoding.
-     *
-     * @exception ArrayIndexOutOfBoundsException If the result does not fit
-     *                                           into the specified array.
-     */
-    public abstract int encodeMessage(byte[] outputBytes)
-        throws SnmpTooBigException;
-
-     /**
-     * Decodes the specified bytes and initializes this message.
-     * For internal use only.
-     *
-     * @param inputBytes The bytes to be decoded.
-     *
-     * @exception SnmpStatusException If the specified bytes are not a valid encoding.
-     */
-    public abstract void decodeMessage(byte[] inputBytes, int byteCount)
-        throws SnmpStatusException;
-
-     /**
-     * Initializes this message with the specified <CODE>pdu</CODE>.
-     * <P>
-     * This method initializes the data field with an array of
-     * <CODE>maxDataLength</CODE> bytes. It encodes the <CODE>pdu</CODE>.
-     * The resulting encoding is stored in the data field
-     * and the length of the encoding is stored in <CODE>dataLength</CODE>.
-     * <p>
-     * If the encoding length exceeds <CODE>maxDataLength</CODE>,
-     * the method throws an exception.
-     *
-     * @param pdu The PDU to be encoded.
-     * @param maxDataLength The maximum length permitted for the data field.
-     *
-     * @exception SnmpStatusException If the specified <CODE>pdu</CODE> is not valid.
-     * @exception SnmpTooBigException If the resulting encoding does not fit
-     * into <CODE>maxDataLength</CODE> bytes.
-     * @exception ArrayIndexOutOfBoundsException If the encoding exceeds <CODE>maxDataLength</CODE>.
-     */
-    public abstract void encodeSnmpPdu(SnmpPdu pdu, int maxDataLength)
-        throws SnmpStatusException, SnmpTooBigException;
-
-
-    /**
-     * Gets the PDU encoded in this message.
-     * <P>
-     * This method decodes the data field and returns the resulting PDU.
-     *
-     * @return The resulting PDU.
-     * @exception SnmpStatusException If the encoding is not valid.
-     */
-    public abstract SnmpPdu decodeSnmpPdu()
-        throws SnmpStatusException;
-
-    /**
-     * Dumps the content of a byte buffer using hexadecimal form.
-     *
-     * @param b The buffer to dump.
-     * @param offset The position of the first byte to be dumped.
-     * @param len The number of bytes to be dumped starting from offset.
-     *
-     * @return The string containing the dump.
-     */
-    public static String dumpHexBuffer(byte [] b, int offset, int len) {
-        StringBuilder sb = new StringBuilder(len << 1) ;
-        int k = 1 ;
-        int flen = offset + len ;
-
-        for (int i = offset; i < flen ; i++) {
-            int j = b[i] & 0xFF ;
-            sb.append(Character.forDigit((j >>> 4), 16)) ;
-            sb.append(Character.forDigit((j & 0x0F), 16)) ;
-            k++ ;
-            if (k%16 == 0) {
-                sb.append('\n') ;
-                k = 1 ;
-            } else
-                sb.append(' ') ;
-        }
-        return sb.toString() ;
-    }
-
-    /**
-     * Dumps this message in a string.
-     *
-     * @return The string containing the dump.
-     */
-    public String printMessage() {
-        StringBuilder sb = new StringBuilder() ;
-        sb.append("Version: ") ;
-        sb.append(version) ;
-        sb.append("\n") ;
-        if (data == null) {
-            sb.append("Data: null") ;
-        }
-        else {
-            sb.append("Data: {\n") ;
-            sb.append(dumpHexBuffer(data, 0, dataLength)) ;
-            sb.append("\n}\n") ;
-        }
-
-        return sb.toString() ;
-    }
-
-    /**
-     * For SNMP Runtime private use only.
-     */
-    public void encodeVarBindList(BerEncoder benc,
-                                  SnmpVarBind[] varBindList)
-        throws SnmpStatusException, SnmpTooBigException {
-        //
-        // Remember: the encoder does backward encoding
-        //
-        int encodedVarBindCount = 0 ;
-        try {
-            benc.openSequence() ;
-            if (varBindList != null) {
-                for (int i = varBindList.length - 1 ; i >= 0 ; i--) {
-                    SnmpVarBind bind = varBindList[i] ;
-                    if (bind != null) {
-                        benc.openSequence() ;
-                        encodeVarBindValue(benc, bind.value) ;
-                        benc.putOid(bind.oid.longValue()) ;
-                        benc.closeSequence() ;
-                        encodedVarBindCount++ ;
-                    }
-                }
-            }
-            benc.closeSequence() ;
-        }
-        catch(ArrayIndexOutOfBoundsException x) {
-            throw new SnmpTooBigException(encodedVarBindCount) ;
-        }
-    }
-
-    /**
-     * For SNMP Runtime private use only.
-     */
-    void encodeVarBindValue(BerEncoder benc,
-                            SnmpValue v)throws SnmpStatusException {
-        if (v == null) {
-            benc.putNull() ;
-        }
-        else if (v instanceof SnmpIpAddress) {
-            benc.putOctetString(((SnmpIpAddress)v).byteValue(), SnmpValue.IpAddressTag) ;
-        }
-        else if (v instanceof SnmpCounter) {
-            benc.putInteger(((SnmpCounter)v).longValue(), SnmpValue.CounterTag) ;
-        }
-        else if (v instanceof SnmpGauge) {
-            benc.putInteger(((SnmpGauge)v).longValue(), SnmpValue.GaugeTag) ;
-        }
-        else if (v instanceof SnmpTimeticks) {
-            benc.putInteger(((SnmpTimeticks)v).longValue(), SnmpValue.TimeticksTag) ;
-        }
-        else if (v instanceof SnmpOpaque) {
-            benc.putOctetString(((SnmpOpaque)v).byteValue(), SnmpValue.OpaqueTag) ;
-        }
-        else if (v instanceof SnmpInt) {
-            benc.putInteger(((SnmpInt)v).intValue()) ;
-        }
-        else if (v instanceof SnmpString) {
-            benc.putOctetString(((SnmpString)v).byteValue()) ;
-        }
-        else if (v instanceof SnmpOid) {
-            benc.putOid(((SnmpOid)v).longValue()) ;
-        }
-        else if (v instanceof SnmpCounter64) {
-            if (version == snmpVersionOne) {
-                throw new SnmpStatusException("Invalid value for SNMP v1 : " + v) ;
-            }
-            benc.putInteger(((SnmpCounter64)v).longValue(), SnmpValue.Counter64Tag) ;
-        }
-        else if (v instanceof SnmpNull) {
-            int tag = ((SnmpNull)v).getTag() ;
-            if ((version == snmpVersionOne) && (tag != SnmpValue.NullTag)) {
-                throw new SnmpStatusException("Invalid value for SNMP v1 : " + v) ;
-            }
-            if ((version == snmpVersionTwo) &&
-                (tag != SnmpValue.NullTag) &&
-                (tag != SnmpVarBind.errNoSuchObjectTag) &&
-                (tag != SnmpVarBind.errNoSuchInstanceTag) &&
-                (tag != SnmpVarBind.errEndOfMibViewTag)) {
-                throw new SnmpStatusException("Invalid value " + v) ;
-            }
-            benc.putNull(tag) ;
-        }
-        else {
-            throw new SnmpStatusException("Invalid value " + v) ;
-        }
-
-    }
-
-
-    /**
-     * For SNMP Runtime private use only.
-     */
-    public SnmpVarBind[] decodeVarBindList(BerDecoder bdec)
-        throws BerException {
-            bdec.openSequence() ;
-            Vector<SnmpVarBind> tmp = new Vector<SnmpVarBind>() ;
-            while (bdec.cannotCloseSequence()) {
-                SnmpVarBind bind = new SnmpVarBind() ;
-                bdec.openSequence() ;
-                bind.oid = new SnmpOid(bdec.fetchOid()) ;
-                bind.setSnmpValue(decodeVarBindValue(bdec)) ;
-                bdec.closeSequence() ;
-                tmp.addElement(bind) ;
-            }
-            bdec.closeSequence() ;
-            SnmpVarBind[] varBindList= new SnmpVarBind[tmp.size()] ;
-            tmp.copyInto(varBindList);
-            return varBindList ;
-        }
-
-
-    /**
-     * For SNMP Runtime private use only.
-     */
-    SnmpValue decodeVarBindValue(BerDecoder bdec)
-        throws BerException {
-        SnmpValue result = null ;
-        int tag = bdec.getTag() ;
-
-        // bugId 4641696 : RuntimeExceptions must be transformed in
-        //                 BerException.
-        switch(tag) {
-
-            //
-            // Simple syntax
-            //
-        case BerDecoder.IntegerTag :
-            try {
-                result = new SnmpInt(bdec.fetchInteger()) ;
-            } catch(RuntimeException r) {
-                throw new BerException();
-                // BerException("Can't build SnmpInt from decoded value.");
-            }
-            break ;
-        case BerDecoder.OctetStringTag :
-            try {
-                result = new SnmpString(bdec.fetchOctetString()) ;
-            } catch(RuntimeException r) {
-                throw new BerException();
-                // BerException("Can't build SnmpString from decoded value.");
-            }
-            break ;
-        case BerDecoder.OidTag :
-            try {
-                result = new SnmpOid(bdec.fetchOid()) ;
-            } catch(RuntimeException r) {
-                throw new BerException();
-                // BerException("Can't build SnmpOid from decoded value.");
-            }
-            break ;
-        case BerDecoder.NullTag :
-            bdec.fetchNull() ;
-            try {
-                result = new SnmpNull() ;
-            } catch(RuntimeException r) {
-                throw new BerException();
-                // BerException("Can't build SnmpNull from decoded value.");
-            }
-            break ;
-
-            //
-            // Application syntax
-            //
-        case SnmpValue.IpAddressTag :
-            try {
-                result = new SnmpIpAddress(bdec.fetchOctetString(tag)) ;
-            } catch (RuntimeException r) {
-                throw new  BerException();
-              // BerException("Can't build SnmpIpAddress from decoded value.");
-            }
-            break ;
-        case SnmpValue.CounterTag :
-            try {
-                result = new SnmpCounter(bdec.fetchIntegerAsLong(tag)) ;
-            } catch(RuntimeException r) {
-                throw new BerException();
-                // BerException("Can't build SnmpCounter from decoded value.");
-            }
-            break ;
-        case SnmpValue.GaugeTag :
-            try {
-                result = new SnmpGauge(bdec.fetchIntegerAsLong(tag)) ;
-            } catch(RuntimeException r) {
-                throw new BerException();
-                // BerException("Can't build SnmpGauge from decoded value.");
-            }
-            break ;
-        case SnmpValue.TimeticksTag :
-            try {
-                result = new SnmpTimeticks(bdec.fetchIntegerAsLong(tag)) ;
-            } catch(RuntimeException r) {
-                throw new BerException();
-             // BerException("Can't build SnmpTimeticks from decoded value.");
-            }
-            break ;
-        case SnmpValue.OpaqueTag :
-            try {
-                result = new SnmpOpaque(bdec.fetchOctetString(tag)) ;
-            } catch(RuntimeException r) {
-                throw new BerException();
-                // BerException("Can't build SnmpOpaque from decoded value.");
-            }
-            break ;
-
-            //
-            // V2 syntaxes
-            //
-        case SnmpValue.Counter64Tag :
-            if (version == snmpVersionOne) {
-                throw new BerException(BerException.BAD_VERSION) ;
-            }
-            try {
-                result = new SnmpCounter64(bdec.fetchIntegerAsLong(tag)) ;
-            } catch(RuntimeException r) {
-                throw new BerException();
-             // BerException("Can't build SnmpCounter64 from decoded value.");
-            }
-            break ;
-
-        case SnmpVarBind.errNoSuchObjectTag :
-            if (version == snmpVersionOne) {
-                throw new BerException(BerException.BAD_VERSION) ;
-            }
-            bdec.fetchNull(tag) ;
-            result = SnmpVarBind.noSuchObject ;
-            break ;
-
-        case SnmpVarBind.errNoSuchInstanceTag :
-            if (version == snmpVersionOne) {
-                throw new BerException(BerException.BAD_VERSION) ;
-            }
-            bdec.fetchNull(tag) ;
-            result = SnmpVarBind.noSuchInstance ;
-            break ;
-
-        case SnmpVarBind.errEndOfMibViewTag :
-            if (version == snmpVersionOne) {
-                throw new BerException(BerException.BAD_VERSION) ;
-            }
-            bdec.fetchNull(tag) ;
-            result = SnmpVarBind.endOfMibView ;
-            break ;
-
-        default:
-            throw new BerException() ;
-
-        }
-
-        return result ;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpNull.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-/**
- * Represents an SNMP null value.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpNull extends SnmpValue {
-    private static final long serialVersionUID = 1783782515994279177L;
-
-    // CONSTRUCTORS
-    //-------------
-    /**
-     * Constructs a new <CODE>SnmpNull</CODE>.
-     */
-    public SnmpNull() {
-        tag = NullTag ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpNull</CODE>.
-     * <BR>For mibgen private use only.
-     */
-    public SnmpNull(String dummy) {
-        this();
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpNull</CODE> from the specified tag value.
-     * @param t The initialization value.
-     */
-    public SnmpNull(int t) {
-        tag = t ;
-    }
-
-    // PUBLIC METHODS
-    //---------------
-    /**
-     * Returns the tag value of this <CODE>SnmpNull</CODE>.
-     * @return The value.
-     */
-    public int getTag() {
-        return tag ;
-    }
-
-    /**
-     * Converts the <CODE>NULL</CODE> value to its ASN.1 <CODE>String</CODE> form.
-     * When the tag is not the universal one, it is preprended
-     * to the <CODE>String</CODE> form.
-     * @return The <CODE>String</CODE> representation of the value.
-     */
-    public String toString() {
-        String result = "" ;
-        if (tag != 5) {
-            result += "[" + tag + "] " ;
-        }
-        result += "NULL" ;
-        switch(tag) {
-        case errNoSuchObjectTag :
-            result += " (noSuchObject)" ;
-            break ;
-
-        case errNoSuchInstanceTag :
-            result += " (noSuchInstance)" ;
-            break ;
-
-        case errEndOfMibViewTag :
-            result += " (endOfMibView)" ;
-            break ;
-        }
-        return result ;
-    }
-
-    /**
-     * Converts the <CODE>NULL</CODE> value to its <CODE>SnmpOid</CODE> form.
-     * Normally, a <CODE>NULL</CODE> value cannot be used as an index value,
-     * this method triggers an exception.
-     * @return The OID representation of the value.
-     */
-    public SnmpOid toOid() {
-        throw new IllegalArgumentException() ;
-    }
-
-    /**
-     * Performs a clone action. This provides a workaround for the
-     * <CODE>SnmpValue</CODE> interface.
-     * @return The SnmpValue clone.
-     */
-    final synchronized public SnmpValue duplicate() {
-        return (SnmpValue) clone() ;
-    }
-
-    /**
-     * Clones the <CODE>SnmpNull</CODE> object, making a copy of its data.
-     * @return The object clone.
-     */
-    final synchronized public Object clone() {
-        SnmpNull  newclone = null ;
-        try {
-            newclone = (SnmpNull) super.clone() ;
-            newclone.tag = tag ;
-        } catch (CloneNotSupportedException e) {
-            throw new InternalError(e) ; // vm bug.
-        }
-        return newclone ;
-    }
-
-    /**
-     * Returns a textual description of the type object.
-     * @return ASN.1 textual description.
-     */
-    final public String getTypeName() {
-        return name ;
-    }
-
-    /**
-     * Checks if this <CODE>SnmpNull</CODE> object corresponds to a <CODE>noSuchObject</CODE> value.
-     * @return <CODE>true</CODE> if the tag equals {@link com.sun.jmx.snmp.SnmpDataTypeEnums#errNoSuchObjectTag},
-     * <CODE>false</CODE> otherwise.
-     */
-    public boolean isNoSuchObjectValue() {
-        return (tag == SnmpDataTypeEnums.errNoSuchObjectTag);
-    }
-
-    /**
-     * Checks if this <CODE>SnmpNull</CODE> object corresponds to a <CODE>noSuchInstance</CODE> value.
-     * @return <CODE>true</CODE> if the tag equals {@link com.sun.jmx.snmp.SnmpDataTypeEnums#errNoSuchInstanceTag},
-     * <CODE>false</CODE> otherwise.
-     */
-    public boolean isNoSuchInstanceValue() {
-        return (tag == SnmpDataTypeEnums.errNoSuchInstanceTag);
-    }
-
-    /**
-     * Checks if this <CODE>SnmpNull</CODE> object corresponds to an <CODE>endOfMibView</CODE> value.
-     * @return <CODE>true</CODE> if the tag equals {@link com.sun.jmx.snmp.SnmpDataTypeEnums#errEndOfMibViewTag},
-     * <CODE>false</CODE> otherwise.
-     */
-    public boolean isEndOfMibViewValue() {
-        return (tag == SnmpDataTypeEnums.errEndOfMibViewTag);
-    }
-
-    // VARIABLES
-    //----------
-    /**
-     * Name of the type.
-     */
-    final static String name = "Null" ;
-
-    /**
-     * This is the tag of the NULL value. By default, it is the universal tag value.
-     */
-    private int tag = 5 ;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpOpaque.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-/**
- * Is used to represent an SNMP value.
- * The <CODE>Opaque</CODE> type is defined in RFC 1155.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpOpaque extends SnmpString {
-    private static final long serialVersionUID = 380952213936036664L;
-
-    // CONSTRUCTORS
-    //-------------
-    /**
-     * Constructs a new <CODE>SnmpOpaque</CODE> from the specified bytes array.
-     * @param v The bytes composing the opaque value.
-     */
-    public SnmpOpaque(byte[] v) {
-        super(v) ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpOpaque</CODE> with the specified <CODE>Bytes</CODE> array.
-     * @param v The <CODE>Bytes</CODE> composing the opaque value.
-     */
-    public SnmpOpaque(Byte[] v) {
-        super(v) ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpOpaque</CODE> from the specified <CODE>String</CODE> value.
-     * @param v The initialization value.
-     */
-    public SnmpOpaque(String v) {
-        super(v) ;
-    }
-
-    // PUBLIC METHODS
-    //---------------
-    /**
-     * Converts the opaque to its <CODE>String</CODE> form, that is, a string of
-     * bytes expressed in hexadecimal form.
-     * @return The <CODE>String</CODE> representation of the value.
-     */
-    public String toString() {
-        StringBuilder result = new StringBuilder() ;
-        for (int i = 0 ; i < value.length ; i++) {
-            byte b = value[i] ;
-            int n = (b >= 0) ? b : b + 256 ;
-            result.append(Character.forDigit(n / 16, 16)) ;
-            result.append(Character.forDigit(n % 16, 16)) ;
-        }
-        return result.toString() ;
-    }
-
-    /**
-     * Returns a textual description of the type object.
-     * @return ASN.1 textual description.
-     */
-    final public String getTypeName() {
-        return name ;
-    }
-
-    // VARIABLES
-    //----------
-    /**
-     * Name of the type.
-     */
-    final static String name = "Opaque" ;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpParams.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * This class is the base class of all parameters that are used when making SNMP requests to an <CODE>SnmpPeer</CODE>.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public abstract class SnmpParams implements SnmpDefinitions {
-    private int protocolVersion = snmpVersionOne;
-    SnmpParams(int version) {
-        protocolVersion = version;
-    }
-
-    SnmpParams() {}
-    /**
-     * Checks whether parameters are in place for an SNMP <CODE>set</CODE> operation.
-     * @return <CODE>true</CODE> if parameters are in place, <CODE>false</CODE> otherwise.
-     */
-    public abstract boolean allowSnmpSets();
-    /**
-     * Returns the version of the protocol to use.
-     * The returned value is:
-     * <UL>
-     * <LI>{@link com.sun.jmx.snmp.SnmpDefinitions#snmpVersionOne snmpVersionOne} if the protocol is SNMPv1
-     * <LI>{@link com.sun.jmx.snmp.SnmpDefinitions#snmpVersionTwo snmpVersionTwo} if the protocol is SNMPv2
-     * <LI>{@link com.sun.jmx.snmp.SnmpDefinitions#snmpVersionThree snmpVersionThree} if the protocol is SNMPv3
-     * </UL>
-     * @return The version of the protocol to use.
-     */
-    public int getProtocolVersion() {
-        return protocolVersion ;
-    }
-
-    /**
-     * Sets the version of the protocol to be used.
-     * The version should be identified using the definitions
-     * contained in
-     * {@link com.sun.jmx.snmp.SnmpDefinitions SnmpDefinitions}.
-     * <BR>For instance if you wish to use SNMPv2, you can call the method as follows:
-     * <BLOCKQUOTE><PRE>
-     * setProtocolVersion(SnmpDefinitions.snmpVersionTwo);
-     * </PRE></BLOCKQUOTE>
-     * @param protocolversion The version of the protocol to be used.
-     */
-
-    public void setProtocolVersion(int protocolversion) {
-        this.protocolVersion = protocolversion ;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPdu.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-
-
-import java.io.Serializable;
-import java.net.InetAddress;
-/**
- * Is the fully decoded representation of an SNMP packet.
- * <P>
- * Classes are derived from <CODE>SnmpPdu</CODE> to
- * represent the different forms of SNMP packets
- * ({@link com.sun.jmx.snmp.SnmpPduPacket SnmpPduPacket},
- * {@link com.sun.jmx.snmp.SnmpScopedPduPacket SnmpScopedPduPacket})
- * <BR>The <CODE>SnmpPdu</CODE> class defines the attributes
- * common to every form of SNMP packets.
- *
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @see SnmpMessage
- * @see SnmpPduFactory
- *
- * @since 1.5
- */
-@SuppressWarnings("serial") // JDK implementation class
-public abstract class SnmpPdu implements SnmpDefinitions, Serializable {
-
-    /**
-     * PDU type. Types are defined in
-     * {@link com.sun.jmx.snmp.SnmpDefinitions SnmpDefinitions}.
-     * @serial
-     */
-    public int type=0 ;
-
-    /**
-     * Protocol version. Versions are defined in
-     * {@link com.sun.jmx.snmp.SnmpDefinitions SnmpDefinitions}.
-     * @serial
-     */
-    public int version=0 ;
-
-    /**
-     * List of variables.
-     * @serial
-     */
-    public SnmpVarBind[] varBindList ;
-
-
-    /**
-     * Request identifier.
-     * Note that this field is not used by <CODE>SnmpPduTrap</CODE>.
-     * @serial
-     */
-    public int requestId=0 ;
-
-    /**
-     * Source or destination address.
-     * <P>For an incoming PDU it's the source.
-     * <BR>For an outgoing PDU it's the destination.
-     * @serial
-     */
-    public InetAddress address ;
-
-    /**
-     * Source or destination port.
-     * <P>For an incoming PDU it's the source.
-     * <BR>For an outgoing PDU it's the destination.
-     * @serial
-     */
-    public int port=0 ;
-
-    /**
-     * Returns the <CODE>String</CODE> representation of a PDU type.
-     * For instance, if the PDU type is <CODE>SnmpDefinitions.pduGetRequestPdu</CODE>,
-     * the method will return "SnmpGet".
-     * @param cmd The integer representation of the PDU type.
-     * @return The <CODE>String</CODE> representation of the PDU type.
-     */
-    public static String pduTypeToString(int cmd) {
-        switch (cmd) {
-        case pduGetRequestPdu :
-            return "SnmpGet" ;
-        case pduGetNextRequestPdu :
-            return "SnmpGetNext" ;
-        case pduWalkRequest :
-            return "SnmpWalk(*)" ;
-        case pduSetRequestPdu :
-            return "SnmpSet" ;
-        case pduGetResponsePdu :
-            return "SnmpResponse" ;
-        case pduV1TrapPdu :
-            return "SnmpV1Trap" ;
-        case pduV2TrapPdu :
-            return "SnmpV2Trap" ;
-        case pduGetBulkRequestPdu :
-            return "SnmpGetBulk" ;
-        case pduInformRequestPdu :
-            return "SnmpInform" ;
-        }
-        return "Unknown Command = " + cmd ;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPduBulk.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-/**
- * Represents a <CODE>get-bulk</CODE> PDU as defined in RFC 1448.
- * <P>
- * You will not usually need to use this class, except if you
- * decide to implement your own
- * {@link com.sun.jmx.snmp.SnmpPduFactory SnmpPduFactory} object.
- * <P>
- * The <CODE>SnmpPduBulk</CODE> extends {@link com.sun.jmx.snmp.SnmpPduPacket SnmpPduPacket}
- * and defines attributes specific to the <CODE>get-bulk</CODE> PDU (see RFC 1448).
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpPduBulk extends SnmpPduPacket
-    implements SnmpPduBulkType {
-    private static final long serialVersionUID = -7431306775883371046L;
-
-    /**
-     * The <CODE>non-repeaters</CODE> value.
-     * @serial
-     */
-    public int            nonRepeaters ;
-
-
-    /**
-     * The <CODE>max-repetitions</CODE> value.
-     * @serial
-     */
-    public int            maxRepetitions ;
-
-
-    /**
-     * Builds a new <CODE>get-bulk</CODE> PDU.
-     * <BR><CODE>type</CODE> and <CODE>version</CODE> fields are initialized with
-     * {@link com.sun.jmx.snmp.SnmpDefinitions#pduGetBulkRequestPdu pduGetBulkRequestPdu}
-     * and {@link com.sun.jmx.snmp.SnmpDefinitions#snmpVersionTwo snmpVersionTwo}.
-     */
-    public SnmpPduBulk() {
-        type = pduGetBulkRequestPdu ;
-        version = snmpVersionTwo ;
-    }
-    /**
-     * Implements the <CODE>SnmpPduBulkType</CODE> interface.
-     *
-     * @since 1.5
-     */
-    public void setMaxRepetitions(int i) {
-        maxRepetitions = i;
-    }
-    /**
-     * Implements the <CODE>SnmpPduBulkType</CODE> interface.
-     *
-     * @since 1.5
-     */
-    public void setNonRepeaters(int i) {
-        nonRepeaters = i;
-    }
-    /**
-     * Implements the <CODE>SnmpPduBulkType</CODE> interface.
-     *
-     * @since 1.5
-     */
-    public int getMaxRepetitions() { return maxRepetitions; }
-    /**
-     * Implements the <CODE>SnmpPduBulkType</CODE> interface.
-     *
-     * @since 1.5
-     */
-    public int getNonRepeaters() { return nonRepeaters; }
-    /**
-     * Implements the <CODE>SnmpAckPdu</CODE> interface.
-     *
-     * @since 1.5
-     */
-    public SnmpPdu getResponsePdu() {
-        SnmpPduRequest result = new SnmpPduRequest();
-        result.address = address;
-        result.port = port;
-        result.version = version;
-        result.community = community;
-        result.type = SnmpDefinitions.pduGetResponsePdu;
-        result.requestId = requestId;
-        result.errorStatus = SnmpDefinitions.snmpRspNoError;
-        result.errorIndex = 0;
-
-        return result;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPduBulkType.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-/**
- * Interface implemented by classes modelizing bulk pdu.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-
-public interface SnmpPduBulkType extends SnmpAckPdu {
-
-    /**
-     * The <CODE>max-repetitions</CODE> setter.
-     * @param max Maximum repetition.
-     */
-    public void setMaxRepetitions(int max);
-
-    /**
-     * The <CODE>non-repeaters</CODE> setter.
-     * @param nr Non repeaters.
-     */
-    public void setNonRepeaters(int nr);
-
-    /**
-     * The <CODE>max-repetitions</CODE> getter.
-     * @return Maximum repetition.
-     */
-    public int getMaxRepetitions();
-
-    /**
-     * The <CODE>non-repeaters</CODE> getter.
-     * @return Non repeaters.
-     */
-    public int getNonRepeaters();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPduFactory.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-
-/**
- * Defines the interface of the object in charge of encoding and decoding SNMP packets.
- * <P>
- * You will not usually need to use this interface, except if you
- * decide to replace the default implementation <CODE>SnmpPduFactoryBER</CODE>.
- * <P>
- * An <CODE>SnmpPduFactory</CODE> object is attached to an
- * {@link com.sun.jmx.snmp.daemon.SnmpAdaptorServer SNMP protocol adaptor}
- * or an {@link com.sun.jmx.snmp.SnmpPeer SnmpPeer}.
- * It is used each time an SNMP packet needs to be encoded or decoded.
- * <BR>{@link com.sun.jmx.snmp.SnmpPduFactoryBER SnmpPduFactoryBER} is the default
- * implementation.
- * It simply applies the standard ASN.1 encoding and decoding
- * on the bytes of the SNMP packet.
- * <P>
- * It's possible to implement your own <CODE>SnmpPduFactory</CODE>
- * object and to add authentication and/or encryption to the
- * default encoding/decoding process.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @see SnmpPduFactory
- * @see SnmpPduPacket
- * @see SnmpMessage
- *
- */
-
-public interface SnmpPduFactory {
-
-    /**
-     * Decodes the specified <CODE>SnmpMsg</CODE> and returns the
-     * resulting <CODE>SnmpPdu</CODE>. If this method returns
-     * <CODE>null</CODE>, the message will be considered unsafe
-     * and will be dropped.
-     *
-     * @param msg The <CODE>SnmpMsg</CODE> to be decoded.
-     * @return Null or a fully initialized <CODE>SnmpPdu</CODE>.
-     * @exception SnmpStatusException If the encoding is invalid.
-     *
-     * @since 1.5
-     */
-    public SnmpPdu decodeSnmpPdu(SnmpMsg msg) throws SnmpStatusException ;
-
-    /**
-     * Encodes the specified <CODE>SnmpPdu</CODE> and
-     * returns the resulting <CODE>SnmpMsg</CODE>. If this
-     * method returns null, the specified <CODE>SnmpPdu</CODE>
-     * will be dropped and the current SNMP request will be
-     * aborted.
-     *
-     * @param p The <CODE>SnmpPdu</CODE> to be encoded.
-     * @param maxDataLength The size limit of the resulting encoding.
-     * @return Null or a fully encoded <CODE>SnmpMsg</CODE>.
-     * @exception SnmpStatusException If <CODE>pdu</CODE> contains
-     *            illegal values and cannot be encoded.
-     * @exception SnmpTooBigException If the resulting encoding does not
-     *            fit into <CODE>maxPktSize</CODE> bytes.
-     *
-     * @since 1.5
-     */
-    public SnmpMsg encodeSnmpPdu(SnmpPdu p, int maxDataLength)
-        throws SnmpStatusException, SnmpTooBigException ;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPduFactoryBER.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx import
-//
-import com.sun.jmx.snmp.SnmpPduFactory;
-import com.sun.jmx.snmp.SnmpMessage;
-import com.sun.jmx.snmp.SnmpPduPacket;
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpMsg;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpTooBigException;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-// SNMP Runtime import
-//
-import com.sun.jmx.snmp.SnmpV3Message;
-
-/**
- * Default implementation of the {@link com.sun.jmx.snmp.SnmpPduFactory SnmpPduFactory} interface.
- * <BR>It uses the BER (basic encoding rules) standardized encoding scheme associated with ASN.1.
- * <P>
- * This implementation of the <CODE>SnmpPduFactory</CODE> is very
- * basic: it simply calls encoding and decoding methods from
- * {@link com.sun.jmx.snmp.SnmpMsg}.
- * <BLOCKQUOTE>
- * <PRE>
- * public SnmpPdu decodeSnmpPdu(SnmpMsg msg)
- * throws SnmpStatusException {
- *   return msg.decodeSnmpPdu() ;
- * }
- *
- * public SnmpMsg encodeSnmpPdu(SnmpPdu pdu, int maxPktSize)
- * throws SnmpStatusException, SnmpTooBigException {
- *   SnmpMsg result = new SnmpMessage() ;       // for SNMP v1/v2
- * <I>or</I>
- *   SnmpMsg result = new SnmpV3Message() ;     // for SNMP v3
- *   result.encodeSnmpPdu(pdu, maxPktSize) ;
- *   return result ;
- * }
- * </PRE>
- * </BLOCKQUOTE>
- * To implement your own object, you can implement <CODE>SnmpPduFactory</CODE>
- * or extend <CODE>SnmpPduFactoryBER</CODE>.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpPduFactoryBER implements SnmpPduFactory, Serializable {
-   private static final long serialVersionUID = -3525318344000547635L;
-
-   /**
-     * Calls {@link com.sun.jmx.snmp.SnmpMsg#decodeSnmpPdu SnmpMsg.decodeSnmpPdu}
-     * on the specified message and returns the resulting <CODE>SnmpPdu</CODE>.
-     *
-     * @param msg The SNMP message to be decoded.
-     * @return The resulting SNMP PDU packet.
-     * @exception SnmpStatusException If the encoding is invalid.
-     *
-     * @since 1.5
-     */
-    public SnmpPdu decodeSnmpPdu(SnmpMsg msg) throws SnmpStatusException {
-        return msg.decodeSnmpPdu();
-    }
-
-    /**
-     * Encodes the specified <CODE>SnmpPdu</CODE> and
-     * returns the resulting <CODE>SnmpMsg</CODE>. If this
-     * method returns null, the specified <CODE>SnmpPdu</CODE>
-     * will be dropped and the current SNMP request will be
-     * aborted.
-     *
-     * @param p The <CODE>SnmpPdu</CODE> to be encoded.
-     * @param maxDataLength The size limit of the resulting encoding.
-     * @return Null or a fully encoded <CODE>SnmpMsg</CODE>.
-     * @exception SnmpStatusException If <CODE>pdu</CODE> contains
-     *            illegal values and cannot be encoded.
-     * @exception SnmpTooBigException If the resulting encoding does not
-     *            fit into <CODE>maxPktSize</CODE> bytes.
-     *
-     * @since 1.5
-     */
-    public SnmpMsg encodeSnmpPdu(SnmpPdu p, int maxDataLength)
-        throws SnmpStatusException, SnmpTooBigException {
-        switch(p.version) {
-        case SnmpDefinitions.snmpVersionOne:
-        case SnmpDefinitions.snmpVersionTwo: {
-            SnmpMessage result = new SnmpMessage();
-            result.encodeSnmpPdu((SnmpPduPacket) p, maxDataLength);
-            return result;
-        }
-        case SnmpDefinitions.snmpVersionThree: {
-            SnmpV3Message result = new SnmpV3Message();
-            result.encodeSnmpPdu(p, maxDataLength);
-            return result;
-        }
-        default:
-            return null;
-        }
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPduRequest.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-
-/**
- * Is used to represent <CODE>get</CODE>, <CODE>get-next</CODE>, <CODE>set</CODE>, <CODE>response</CODE> and <CODE>SNMPv2-trap</CODE> PDUs.
- * <P>
- * You will not usually need to use this class, except if you
- * decide to implement your own
- * {@link com.sun.jmx.snmp.SnmpPduFactory SnmpPduFactory} object.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpPduRequest extends SnmpPduPacket
-    implements SnmpPduRequestType {
-    private static final long serialVersionUID = 2218754017025258979L;
-
-
-    /**
-     * Error status. Statuses are defined in
-     * {@link com.sun.jmx.snmp.SnmpDefinitions SnmpDefinitions}.
-     * @serial
-     */
-    public int errorStatus=0 ;
-
-
-    /**
-     * Error index. Remember that SNMP indices start from 1.
-     * Thus the corresponding <CODE>SnmpVarBind</CODE> is
-     * <CODE>varBindList[errorIndex-1]</CODE>.
-     * @serial
-     */
-    public int errorIndex=0 ;
-    /**
-     * Implements <CODE>SnmpPduRequestType</CODE> interface.
-     *
-     * @since 1.5
-     */
-    public void setErrorIndex(int i) {
-        errorIndex = i;
-    }
-    /**
-     * Implements <CODE>SnmpPduRequestType</CODE> interface.
-     *
-     * @since 1.5
-     */
-    public void setErrorStatus(int i) {
-        errorStatus = i;
-    }
-    /**
-     * Implements <CODE>SnmpPduRequestType</CODE> interface.
-     *
-     * @since 1.5
-     */
-    public int getErrorIndex() { return errorIndex; }
-    /**
-     * Implements <CODE>SnmpPduRequestType</CODE> interface.
-     *
-     * @since 1.5
-     */
-    public int getErrorStatus() { return errorStatus; }
-    /**
-     * Implements <CODE>SnmpAckPdu</CODE> interface.
-     *
-     * @since 1.5
-     */
-    public SnmpPdu getResponsePdu() {
-        SnmpPduRequest result = new SnmpPduRequest();
-        result.address = address;
-        result.port = port;
-        result.version = version;
-        result.community = community;
-        result.type = SnmpDefinitions.pduGetResponsePdu;
-        result.requestId = requestId;
-        result.errorStatus = SnmpDefinitions.snmpRspNoError;
-        result.errorIndex = 0;
-
-        return result;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPduRequestType.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-
-/**
- * Interface implemented by classes modelizing request pdu.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpPduRequestType extends SnmpAckPdu {
-    /**
-     * Error index setter. Remember that SNMP indices start from 1.
-     * Thus the corresponding <CODE>SnmpVarBind</CODE> is
-     * <CODE>varBindList[errorIndex-1]</CODE>.
-     * @param i Error index.
-     */
-    public void setErrorIndex(int i);
-    /**
-     * Error status setter. Statuses are defined in
-     * {@link com.sun.jmx.snmp.SnmpDefinitions SnmpDefinitions}.
-     * @param i Error status.
-     */
-    public void setErrorStatus(int i);
-    /**
-     * Error index getter. Remember that SNMP indices start from 1.
-     * Thus the corresponding <CODE>SnmpVarBind</CODE> is
-     * <CODE>varBindList[errorIndex-1]</CODE>.
-     * @return Error index.
-     */
-    public int getErrorIndex();
-    /**
-     * Error status getter. Statuses are defined in
-     * {@link com.sun.jmx.snmp.SnmpDefinitions SnmpDefinitions}.
-     * @return Error status.
-     */
-    public int getErrorStatus();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPduTrap.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-/**
- * Represents an SNMPv1-trap PDU.
- * <P>
- * You will not usually need to use this class, except if you
- * decide to implement your own
- * {@link com.sun.jmx.snmp.SnmpPduFactory SnmpPduFactory} object.
- * <P>
- * The <CODE>SnmpPduTrap</CODE> extends {@link com.sun.jmx.snmp.SnmpPduPacket SnmpPduPacket}
- * and defines attributes specific to an SNMPv1 trap (see RFC1157).
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpPduTrap extends SnmpPduPacket {
-    private static final long serialVersionUID = -3670886636491433011L;
-
-    /**
-     * Enterprise object identifier.
-     * @serial
-     */
-    public SnmpOid        enterprise ;
-
-    /**
-     * Agent address. If the agent address source was not an IPv4 one (eg : IPv6), this field is null.
-     * @serial
-     */
-    public SnmpIpAddress  agentAddr ;
-
-    /**
-     * Generic trap number.
-     * <BR>
-     * The possible values are defined in
-     * {@link com.sun.jmx.snmp.SnmpDefinitions#trapColdStart SnmpDefinitions}.
-     * @serial
-     */
-    public int            genericTrap ;
-
-    /**
-     * Specific trap number.
-     * @serial
-     */
-    public int            specificTrap ;
-
-    /**
-     * Time-stamp.
-     * @serial
-     */
-    public long            timeStamp ;
-
-
-
-    /**
-     * Builds a new trap PDU.
-     * <BR><CODE>type</CODE> and <CODE>version</CODE> fields are initialized with
-     * {@link com.sun.jmx.snmp.SnmpDefinitions#pduV1TrapPdu pduV1TrapPdu}
-     * and {@link com.sun.jmx.snmp.SnmpDefinitions#snmpVersionOne snmpVersionOne}.
-     */
-    public SnmpPduTrap() {
-        type = pduV1TrapPdu ;
-        version = snmpVersionOne ;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpScopedPduBulk.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-/**
- * Represents a <CODE>get-bulk</CODE> PDU as defined in RFC 1448.
- * <P>
- * <P>
- * The <CODE>SnmpSocpedPduBulk</CODE> extends {@link com.sun.jmx.snmp.SnmpScopedPduPacket SnmpScopedPduPacket}
- * and defines attributes specific to the <CODE>get-bulk</CODE> PDU (see RFC 1448).
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-
-public class SnmpScopedPduBulk extends SnmpScopedPduPacket
-    implements SnmpPduBulkType {
-    private static final long serialVersionUID = -1648623646227038885L;
-
-    /**
-     * The <CODE>non-repeaters</CODE> value.
-     * @serial
-     */
-    int            nonRepeaters;
-
-
-    /**
-     * The <CODE>max-repetitions</CODE> value.
-     * @serial
-     */
-    int            maxRepetitions;
-
-    public SnmpScopedPduBulk() {
-        type = pduGetBulkRequestPdu;
-        version = snmpVersionThree;
-    }
-
-    /**
-     * The <CODE>max-repetitions</CODE> setter.
-     * @param max Maximum repetition.
-     */
-    public void setMaxRepetitions(int max) {
-        maxRepetitions = max;
-    }
-
-    /**
-     * The <CODE>non-repeaters</CODE> setter.
-     * @param nr Non repeaters.
-     */
-    public void setNonRepeaters(int nr) {
-        nonRepeaters = nr;
-    }
-
-    /**
-     * The <CODE>max-repetitions</CODE> getter.
-     * @return Maximum repetition.
-     */
-    public int getMaxRepetitions() { return maxRepetitions; }
-
-    /**
-     * The <CODE>non-repeaters</CODE> getter.
-     * @return Non repeaters.
-     */
-    public int getNonRepeaters() { return nonRepeaters; }
-
-    /**
-     * Generates the pdu to use for response.
-     * @return Response pdu.
-     */
-    public SnmpPdu getResponsePdu() {
-        SnmpScopedPduRequest result = new SnmpScopedPduRequest();
-        result.address = address ;
-        result.port = port ;
-        result.version = version ;
-        result.requestId = requestId;
-        result.msgId = msgId;
-        result.msgMaxSize = msgMaxSize;
-        result.msgFlags = msgFlags;
-        result.msgSecurityModel = msgSecurityModel;
-        result.contextEngineId = contextEngineId;
-        result.contextName = contextName;
-        result.securityParameters = securityParameters;
-        result.type = pduGetResponsePdu ;
-        result.errorStatus = SnmpDefinitions.snmpRspNoError ;
-        result.errorIndex = 0 ;
-        return result;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpScopedPduPacket.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp;
-
-import java.io.Serializable;
-
-import com.sun.jmx.snmp.SnmpSecurityParameters;
-
-import com.sun.jmx.snmp.SnmpDefinitions;
-/**
- * Is the fully decoded representation of an SNMP V3 packet.
- * <P>
- *
- * Classes are derived from <CODE>SnmpPdu</CODE> to
- * represent the different forms of SNMP pdu
- * ({@link com.sun.jmx.snmp.SnmpScopedPduRequest SnmpScopedPduRequest},
- * {@link com.sun.jmx.snmp.SnmpScopedPduBulk SnmpScopedPduBulk}).
- * <BR>The <CODE>SnmpScopedPduPacket</CODE> class defines the attributes
- * common to every scoped SNMP packets.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @see SnmpV3Message
- *
- * @since 1.5
- */
-@SuppressWarnings("serial") // JDK implementation class
-public abstract class SnmpScopedPduPacket extends SnmpPdu
-    implements Serializable {
-    /**
-     * Message max size the pdu sender can deal with.
-     */
-    public int msgMaxSize = 0;
-
-    /**
-     * Message identifier.
-     */
-    public int msgId = 0;
-
-    /**
-     * Message flags. Reportable flag  and security level.</P>
-     *<PRE>
-     * --  .... ...1   authFlag
-     * --  .... ..1.   privFlag
-     * --  .... .1..   reportableFlag
-     * --              Please observe:
-     * --  .... ..00   is OK, means noAuthNoPriv
-     * --  .... ..01   is OK, means authNoPriv
-     * --  .... ..10   reserved, must NOT be used.
-     * --  .... ..11   is OK, means authPriv
-     *</PRE>
-     */
-    public byte msgFlags = 0;
-
-    /**
-     * The security model the security sub system MUST use in order to deal with this pdu (eg: User based Security Model Id = 3).
-     */
-    public int msgSecurityModel = 0;
-
-    /**
-     * The context engine Id in which the pdu must be handled (Generaly the local engine Id).
-     */
-    public byte[] contextEngineId = null;
-
-    /**
-     * The context name in which the OID have to be interpreted.
-     */
-    public byte[] contextName = null;
-
-    /**
-     * The security parameters. This is an opaque member that is
-     * interpreted by the concerned security model.
-     */
-    public SnmpSecurityParameters securityParameters = null;
-
-    /**
-     * Constructor. Is only called by a son. Set the version to <CODE>SnmpDefinitions.snmpVersionThree</CODE>.
-     */
-    protected SnmpScopedPduPacket() {
-        version = SnmpDefinitions.snmpVersionThree;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpScopedPduRequest.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-/**
- * Is used to represent <CODE>get</CODE>, <CODE>get-next</CODE>, <CODE>set</CODE>, <CODE>response</CODE> SNMP V3 scoped PDUs.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public class SnmpScopedPduRequest extends SnmpScopedPduPacket
-    implements SnmpPduRequestType {
-    private static final long serialVersionUID = 6463060973056773680L;
-
-    int errorStatus=0 ;
-
-    int errorIndex=0 ;
-
-    /**
-     * Error index setter. Remember that SNMP indices start from 1.
-     * Thus the corresponding <CODE>SnmpVarBind</CODE> is
-     * <CODE>varBindList[errorIndex-1]</CODE>.
-     * @param i Error index.
-     */
-    public void setErrorIndex(int i) {
-        errorIndex = i;
-    }
-    /**
-     * Error status setter. Statuses are defined in
-     * {@link com.sun.jmx.snmp.SnmpDefinitions SnmpDefinitions}.
-     * @param s Error status.
-     */
-    public void setErrorStatus(int s) {
-        errorStatus = s;
-    }
-
-    /**
-     * Error index getter. Remember that SNMP indices start from 1.
-     * Thus the corresponding <CODE>SnmpVarBind</CODE> is
-     * <CODE>varBindList[errorIndex-1]</CODE>.
-     * @return Error index.
-     */
-    public int getErrorIndex() { return errorIndex; }
-    /**
-     * Error status getter. Statuses are defined in
-     * {@link com.sun.jmx.snmp.SnmpDefinitions SnmpDefinitions}.
-     * @return Error status.
-     */
-    public int getErrorStatus() { return errorStatus; }
-
-    /**
-     * Generates the pdu to use for response.
-     * @return Response pdu.
-     */
-    public SnmpPdu getResponsePdu() {
-        SnmpScopedPduRequest result = new SnmpScopedPduRequest();
-        result.address = address ;
-        result.port = port ;
-        result.version = version ;
-        result.requestId = requestId;
-        result.msgId = msgId;
-        result.msgMaxSize = msgMaxSize;
-        result.msgFlags = msgFlags;
-        result.msgSecurityModel = msgSecurityModel;
-        result.contextEngineId = contextEngineId;
-        result.contextName = contextName;
-        result.securityParameters = securityParameters;
-        result.type = pduGetResponsePdu ;
-        result.errorStatus = SnmpDefinitions.snmpRspNoError ;
-        result.errorIndex = 0 ;
-        return result;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpSecurityException.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-
-/**
- * This exception is thrown when an error occurs in an <CODE> SnmpSecurityModel </CODE>.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public class SnmpSecurityException extends Exception {
-    private static final long serialVersionUID = 5574448147432833480L;
-
-    /**
-     * The current request varbind list.
-     */
-    public SnmpVarBind[] list = null;
-    /**
-     * The status of the exception. See {@link com.sun.jmx.snmp.SnmpDefinitions} for possible values.
-     */
-    public int status = SnmpDefinitions.snmpReqUnknownError;
-    /**
-     * The current security model related security parameters.
-     */
-    public SnmpSecurityParameters params = null;
-    /**
-     * The current context engine Id.
-     */
-    public byte[] contextEngineId = null;
-     /**
-     * The current context name.
-     */
-    public byte[] contextName = null;
-     /**
-     * The current flags.
-     */
-    public byte flags = (byte) SnmpDefinitions.noAuthNoPriv;
-    /**
-     * Constructor.
-     * @param msg The exception msg to display.
-     */
-    public SnmpSecurityException(String msg) {
-        super(msg);
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpSecurityParameters.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpTooBigException;
-
-/**
- * Security parameters are security model dependent. Every security parameters class wishing to be passed to a security model must implement this marker interface.
- * This interface has to be implemented when developing customized security models.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpSecurityParameters {
-    /**
-     * BER encoding of security parameters.
-     * @param outputBytes Array to fill.
-     * @return Encoded parameters length.
-     */
-    int encode(byte[] outputBytes) throws SnmpTooBigException;
-    /**
-     * BER decoding of security parameters.
-     * @param params Encoded parameters.
-     */
-    void decode(byte[] params) throws SnmpStatusException;
-
-    /**
-     * Principal coded inside the security parameters.
-     * @return The security principal.
-     */
-    String getPrincipal();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpStatusException.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-/**
- * Reports an error which occurred during a get/set operation on a mib node.
- *
- * This exception includes a status error code as defined in the SNMP protocol.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpStatusException extends Exception implements SnmpDefinitions {
-    private static final long serialVersionUID = 5809485694133115675L;
-
-    /**
-     * Error code as defined in RFC 1448 for: <CODE>noSuchName</CODE>.
-     */
-    public static final int noSuchName         = 2 ;
-
-    /**
-     * Error code as defined in RFC 1448 for: <CODE>badValue</CODE>.
-     */
-    public static final int badValue           = 3 ;
-
-    /**
-     * Error code as defined in RFC 1448 for: <CODE>readOnly</CODE>.
-     */
-    public static final int readOnly           = 4 ;
-
-
-    /**
-     * Error code as defined in RFC 1448 for: <CODE>noAccess</CODE>.
-     */
-    public static final int noAccess           = 6 ;
-
-    /**
-     * Error code for reporting a no such instance error.
-     */
-    public static final int noSuchInstance     = 0xE0;
-
-    /**
-     * Error code for reporting a no such object error.
-     */
-    public static final int noSuchObject     = 0xE1;
-
-    /**
-     * Constructs a new <CODE>SnmpStatusException</CODE> with the specified status error.
-     * @param status The error status.
-     */
-    public SnmpStatusException(int status) {
-        errorStatus = status ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpStatusException</CODE> with the specified status error and status index.
-     * @param status The error status.
-     * @param index The error index.
-     */
-    public SnmpStatusException(int status, int index) {
-        errorStatus = status ;
-        errorIndex = index ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpStatusException</CODE> with an error message.
-     * The error status is set to 0 (noError) and the index to -1.
-     * @param s The error message.
-     */
-    public SnmpStatusException(String s) {
-        super(s);
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpStatusException</CODE> with an error index.
-     * @param x The original <CODE>SnmpStatusException</CODE>.
-     * @param index The error index.
-     */
-    public SnmpStatusException(SnmpStatusException x, int index) {
-        super(x.getMessage());
-        errorStatus= x.errorStatus;
-        errorIndex= index;
-    }
-
-    /**
-     * Return the error status.
-     * @return The error status.
-     */
-    public int getStatus() {
-        return errorStatus ;
-    }
-
-    /**
-     * Returns the index of the error.
-     * A value of -1 means that the index is not known/applicable.
-     * @return The error index.
-     */
-    public int getErrorIndex() {
-        return errorIndex;
-    }
-
-
-    // PRIVATE VARIABLES
-    //--------------------
-
-    /**
-     * Status of the error.
-     * @serial
-     */
-    private int errorStatus = 0 ;
-
-    /**
-     * Index of the error.
-     * If different from -1, indicates the index where the error occurs.
-     * @serial
-     */
-    private int errorIndex= -1;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpString.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,278 +0,0 @@
-/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-/**
- * Represents an SNMP string.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpString extends SnmpValue {
-    private static final long serialVersionUID = -7011986973225194188L;
-
-    // CONSTRUCTORS
-    //-------------
-    /**
-     * Constructs a new empty <CODE>SnmpString</CODE>.
-     */
-    public SnmpString() {
-        value = new byte[0] ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpString</CODE> from the specified bytes array.
-     * @param v The bytes composing the string value.
-     */
-    public SnmpString(byte[] v) {
-        value = v.clone() ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpString</CODE> from the specified <CODE>Bytes</CODE> array.
-     * @param v The <CODE>Bytes</CODE> composing the string value.
-     */
-    public SnmpString(Byte[] v) {
-        value = new byte[v.length] ;
-        for (int i = 0 ; i < v.length ; i++) {
-            value[i] = v[i].byteValue() ;
-        }
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpString</CODE> from the specified <CODE>String</CODE> value.
-     * @param v The initialization value.
-     */
-    public SnmpString(String v) {
-        value = v.getBytes() ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpString</CODE> from the specified <CODE> InetAddress </Code>.
-     * @param address The <CODE>InetAddress </CODE>.
-     *
-     * @since 1.5
-     */
-    public SnmpString(InetAddress address) {
-        value = address.getAddress();
-    }
-
-    // PUBLIC METHODS
-    //---------------
-
-    /**
-     * Converts the string value to its <CODE> InetAddress </CODE> form.
-     * @return an {@link InetAddress} defined by the string value.
-     * @exception UnknownHostException If string value is not a legal address format.
-     *
-     * @since 1.5
-     */
-    public InetAddress inetAddressValue() throws UnknownHostException {
-        return InetAddress.getByAddress(value);
-    }
-
-    /**
-     * Converts the specified binary string into a character string.
-     * @param bin The binary string value to convert.
-     * @return The character string representation.
-     */
-    public static String BinToChar(String bin) {
-        char value[] = new char[bin.length()/8];
-        int binLength = value.length;
-        for (int i = 0; i < binLength; i++)
-            value[i] = (char)Integer.parseInt(bin.substring(8*i, 8*i+8), 2);
-        return new String(value);
-    }
-
-    /**
-     * Converts the specified hexadecimal string into a character string.
-     * @param hex The hexadecimal string value to convert.
-     * @return The character string representation.
-     */
-    public static String HexToChar(String hex) {
-        char value[] = new char[hex.length()/2];
-        int hexLength = value.length;
-        for (int i = 0; i < hexLength; i++)
-            value[i] = (char)Integer.parseInt(hex.substring(2*i, 2*i+2), 16);
-        return new String(value);
-    }
-
-    /**
-     * Returns the bytes array of this <CODE>SnmpString</CODE>.
-     * @return The value.
-     */
-    public byte[] byteValue() {
-        return value.clone() ;
-    }
-
-    /**
-     * Converts the string value to its array of <CODE>Bytes</CODE> form.
-     * @return The array of <CODE>Bytes</CODE> representation of the value.
-     */
-    public Byte[] toByte() {
-        Byte[] result = new Byte[value.length] ;
-        for (int i = 0 ; i < value.length ; i++) {
-            result[i] = value[i];
-        }
-        return result ;
-    }
-
-    /**
-     * Converts the string value to its <CODE>String</CODE> form.
-     * @return The <CODE>String</CODE> representation of the value.
-     */
-    public String toString() {
-        return new String(value) ;
-    }
-
-    /**
-     * Converts the string value to its <CODE>SnmpOid</CODE> form.
-     * @return The OID representation of the value.
-     */
-    public SnmpOid toOid() {
-        long[] ids = new long[value.length] ;
-        for (int i = 0 ; i < value.length ; i++) {
-            ids[i] = (long)(value[i] & 0xFF) ;
-        }
-        return new SnmpOid(ids) ;
-    }
-
-    /**
-     * Extracts the string from an index OID and returns its
-     * value converted as an <CODE>SnmpOid</CODE>.
-     * @param index The index array.
-     * @param start The position in the index array.
-     * @return The OID representing the string value.
-     * @exception SnmpStatusException There is no string value
-     * available at the start position.
-     */
-    public static SnmpOid toOid(long[] index, int start) throws SnmpStatusException {
-        try {
-            if (index[start] > Integer.MAX_VALUE) {
-                throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
-            }
-            int strLen = (int)index[start++] ;
-            long[] ids = new long[strLen] ;
-            for (int i = 0 ; i < strLen ; i++) {
-                ids[i] = index[start + i] ;
-            }
-            return new SnmpOid(ids) ;
-        }
-        catch(IndexOutOfBoundsException e) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
-        }
-    }
-
-    /**
-     * Scans an index OID, skips the string value and returns the position
-     * of the next value.
-     * @param index The index array.
-     * @param start The position in the index array.
-     * @return The position of the next value.
-     * @exception SnmpStatusException There is no string value
-     * available at the start position.
-     */
-    public static int nextOid(long[] index, int start) throws SnmpStatusException {
-        try {
-            if (index[start] > Integer.MAX_VALUE) {
-                throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
-            }
-            int strLen = (int)index[start++] ;
-            start += strLen ;
-            if (start <= index.length) {
-                return start ;
-            }
-            else {
-                throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
-            }
-        }
-        catch(IndexOutOfBoundsException e) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
-        }
-    }
-
-    /**
-     * Appends an <CODE>SnmpOid</CODE> representing an <CODE>SnmpString</CODE> to another OID.
-     * @param source An OID representing an <CODE>SnmpString</CODE> value.
-     * @param dest Where source should be appended.
-     */
-    public static void appendToOid(SnmpOid source, SnmpOid dest) {
-        dest.append(source.getLength()) ;
-        dest.append(source) ;
-    }
-
-    /**
-     * Performs a clone action. This provides a workaround for the
-     * <CODE>SnmpValue</CODE> interface.
-     * @return The SnmpValue clone.
-     */
-    final synchronized public SnmpValue duplicate() {
-        return (SnmpValue) clone() ;
-    }
-
-    /**
-     * Clones the <CODE>SnmpString</CODE> object, making a copy of its data.
-     * @return The object clone.
-     */
-    synchronized public Object clone() {
-        SnmpString newclone = null ;
-
-        try {
-            newclone = (SnmpString) super.clone() ;
-            newclone.value = new byte[value.length] ;
-            System.arraycopy(value, 0, newclone.value, 0, value.length) ;
-        } catch (CloneNotSupportedException e) {
-            throw new InternalError(e) ; // vm bug.
-        }
-        return newclone ;
-    }
-
-    /**
-     * Returns a textual description of the type object.
-     * @return ASN.1 textual description.
-     */
-    public String getTypeName() {
-        return name ;
-    }
-
-    // VARIABLES
-    //----------
-    /**
-     * Name of the type.
-     */
-    final static String name = "String" ;
-
-    /**
-     * This is the bytes array of the string value.
-     * @serial
-     */
-    protected byte[] value = null ;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpStringFixed.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-// java imports
-//
-import java.lang.Math;
-
-/**
- * Represents an SNMP String defined with a fixed length.
- * The class is mainly used when dealing with table indexes for which one of the keys
- * is defined as a <CODE>String</CODE>.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpStringFixed extends SnmpString {
-    private static final long serialVersionUID = -9120939046874646063L;
-
-    // CONSTRUCTORS
-    //-------------
-    /**
-     * Constructs a new <CODE>SnmpStringFixed</CODE> from the specified bytes array.
-     * @param v The bytes composing the fixed-string value.
-     */
-    public SnmpStringFixed(byte[] v) {
-        super(v) ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpStringFixed</CODE> with the specified <CODE>Bytes</CODE> array.
-     * @param v The <CODE>Bytes</CODE> composing the fixed-string value.
-     */
-    public SnmpStringFixed(Byte[] v) {
-        super(v) ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpStringFixed</CODE> from the specified <CODE>String</CODE> value.
-     * @param v The initialization value.
-     */
-    public SnmpStringFixed(String v) {
-        super(v) ;
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpStringFixed</CODE> from the specified <CODE>bytes</CODE> array
-     * with the specified length.
-     * @param l The length of the fixed-string.
-     * @param v The <CODE>bytes</CODE> composing the fixed-string value.
-     * @exception IllegalArgumentException Either the length or the <CODE>byte</CODE> array is not valid.
-     */
-    public SnmpStringFixed(int l, byte[] v) throws IllegalArgumentException {
-        if ((l <= 0) || (v == null)) {
-            throw new IllegalArgumentException() ;
-        }
-        int length = Math.min(l, v.length);
-        value = new byte[l] ;
-        for (int i = 0 ; i < length ; i++) {
-            value[i] = v[i] ;
-        }
-        for (int i = length ; i < l ; i++) {
-            value[i] = 0 ;
-        }
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpStringFixed</CODE> from the specified <CODE>Bytes</CODE> array
-     * with the specified length.
-     * @param l The length of the fixed-string.
-     * @param v The <CODE>Bytes</CODE> composing the fixed-string value.
-     * @exception IllegalArgumentException Either the length or the <CODE>Byte</CODE> array is not valid.
-     */
-    public SnmpStringFixed(int l, Byte[] v) throws IllegalArgumentException {
-        if ((l <= 0) || (v == null)) {
-            throw new IllegalArgumentException() ;
-        }
-        int length = Math.min(l, v.length);
-        value = new byte[l] ;
-        for (int i = 0 ; i < length ; i++) {
-            value[i] = v[i].byteValue() ;
-        }
-        for (int i = length ; i < l ; i++) {
-            value[i] = 0 ;
-        }
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpStringFixed</CODE> from the specified <CODE>String</CODE>
-     * with the specified length.
-     * @param l The length of the fixed-string.
-     * @param s The <CODE>String</CODE> composing the fixed-string value.
-     * @exception IllegalArgumentException Either the length or the <CODE>String</CODE> is not valid.
-     */
-    public SnmpStringFixed(int l, String s) throws IllegalArgumentException {
-        if ((l <= 0) || (s == null)) {
-            throw new IllegalArgumentException() ;
-        }
-        byte[] v = s.getBytes();
-        int length = Math.min(l, v.length);
-        value = new byte[l] ;
-        for (int i = 0 ; i < length ; i++) {
-            value[i] = v[i] ;
-        }
-        for (int i = length ; i < l ; i++) {
-            value[i] = 0 ;
-        }
-    }
-
-    // PUBLIC METHODS
-    //---------------
-    /**
-     * Extracts the fixed-string from an index OID and returns its
-     * value converted as an <CODE>SnmpOid</CODE>.
-     * @param l The number of successive array elements to be retreived
-     * in order to construct the OID.
-     * These elements are retreived starting at the <CODE>start</CODE> position.
-     * @param index The index array.
-     * @param start The position in the index array.
-     * @return The OID representing the fixed-string value.
-     * @exception SnmpStatusException There is no string value
-     * available at the start position.
-     */
-    public static SnmpOid toOid(int l, long[] index, int start) throws SnmpStatusException {
-        try {
-            long[] ids = new long[l] ;
-            for (int i = 0 ; i < l ; i++) {
-                ids[i] = index[start + i] ;
-            }
-            return new SnmpOid(ids) ;
-        }
-        catch(IndexOutOfBoundsException e) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
-        }
-    }
-
-    /**
-     * Scans an index OID, skip the string value and returns the position
-     * of the next value.
-     * @param l The number of successive array elements to be passed
-     * in order to get the position of the next value.
-     * These elements are passed starting at the <CODE>start</CODE> position.
-     * @param index The index array.
-     * @param start The position in the index array.
-     * @return The position of the next value.
-     * @exception SnmpStatusException There is no string value
-     * available at the start position.
-     */
-    public static int nextOid(int l, long[] index, int start) throws SnmpStatusException {
-        int result = start + l ;
-        if (result > index.length) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchName) ;
-        }
-        return result ;
-    }
-
-    /**
-     * Appends an <CODE>SnmpOid</CODE> representing an <CODE>SnmpStringFixed</CODE> to another OID.
-     * @param l Unused.
-     * @param source An OID representing an <CODE>SnmpStringFixed</CODE> value.
-     * @param dest Where source should be appended.
-     */
-    public static void appendToOid(int l, SnmpOid source, SnmpOid dest) {
-        dest.append(source) ;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpTooBigException.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-/**
- * Is used internally to signal that the size of a PDU exceeds the packet size limitation.
- * <p>
- * You will not usually need to use this class, except if you
- * decide to implement your own
- * {@link com.sun.jmx.snmp.SnmpPduFactory SnmPduFactory} object.
- * <p>
- * The <CODE>varBindCount</CODE> property contains the
- * number of <CODE>SnmpVarBind</CODE> successfully encoded
- * before the exception was thrown. Its value is 0
- * when this number is unknown.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpTooBigException extends Exception {
-  private static final long serialVersionUID = 4754796246674803969L;
-
-  /**
-   * Builds an <CODE>SnmpTooBigException</CODE> with
-   * <CODE>varBindCount</CODE> set to 0.
-   */
-  public SnmpTooBigException() {
-    varBindCount = 0 ;
-  }
-
-  /**
-   * Builds an <CODE>SnmpTooBigException</CODE> with
-   * <CODE>varBindCount</CODE> set to the specified value.
-   * @param n The <CODE>varBindCount</CODE> value.
-   */
-  public SnmpTooBigException(int n) {
-    varBindCount = n ;
-  }
-
-
-  /**
-   * Returns the number of <CODE>SnmpVarBind</CODE> successfully
-   * encoded before the exception was thrown.
-   *
-   * @return A positive integer (0 means the number is unknown).
-   */
-  public int getVarBindCount() {
-    return varBindCount ;
-  }
-
-  /**
-   * The <CODE>varBindCount</CODE>.
-   * @serial
-   */
-  private int varBindCount ;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUnknownAccContrModelException.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-
-import com.sun.jmx.snmp.SnmpUnknownModelException;
-
-/**
- * This exception is thrown when an
- * <CODE>SnmpAccessControlSubSystem</CODE> doesn't know the passed ID.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public class SnmpUnknownAccContrModelException extends SnmpUnknownModelException {
-    private static final long serialVersionUID = -8831186713954487538L;
-
-    /**
-     * Constructor.
-     * @param msg The exception msg to display.
-     */
-    public SnmpUnknownAccContrModelException(String msg) {
-        super(msg);
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUnknownModelException.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-/**
- * This exception is thrown when a needed model is not present in the engine.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public class SnmpUnknownModelException extends Exception {
-    private static final long serialVersionUID = -8667664269418048003L;
-
-    /**
-     * Constructor.
-     * @param msg The exception msg to display.
-     */
-    public SnmpUnknownModelException(String msg) {
-        super(msg);
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUnknownModelLcdException.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-/**
- * This exception is thrown when an <CODE>SnmpLcd</CODE> has no ModelLcd associated to the model.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public class SnmpUnknownModelLcdException extends Exception {
-    private static final long serialVersionUID = 6369064741633646317L;
-
-    /**
-     * Constructor.
-     * @param msg The exception msg to display.
-     */
-    public SnmpUnknownModelLcdException(String msg) {
-        super(msg);
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUnknownMsgProcModelException.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-
-import com.sun.jmx.snmp.SnmpUnknownModelException;
-
-/**
- * This exception is thrown when an <CODE>SnmpMsgProcessingSubSystem</CODE> doesn't know the passed ID.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public class SnmpUnknownMsgProcModelException extends SnmpUnknownModelException {
-    private static final long serialVersionUID = -4179907244861284771L;
-
-    /**
-     * Constructor.
-     * @param msg The exception msg to display.
-     */
-    public SnmpUnknownMsgProcModelException(String msg) {
-        super(msg);
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUnknownSecModelException.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-
-import com.sun.jmx.snmp.SnmpUnknownModelException;
-
-/**
- * This exception is thrown when an <CODE>SnmpSecuritySubSystem</CODE> doesn't know the passed ID.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public class SnmpUnknownSecModelException extends SnmpUnknownModelException {
-    private static final long serialVersionUID = -2173491650805292799L;
-
-    /**
-     * Constructor.
-     * @param msg The exception msg to display.
-     */
-    public SnmpUnknownSecModelException(String msg) {
-        super(msg);
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUnknownSubSystemException.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-/**
- * This exception is thrown when the handled <CODE> SnmpSubSystem </CODE> is unknown.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public class SnmpUnknownSubSystemException extends Exception {
-    private static final long serialVersionUID = 4463202140045245052L;
-
-    /**
-     * Constructor.
-     * @param msg The exception msg to display.
-     */
-    public SnmpUnknownSubSystemException(String msg) {
-        super(msg);
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUnsignedInt.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-/**
- * Is the base for all SNMP syntaxes based on unsigned integers.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-@SuppressWarnings("serial") // JDK implementation class
-public abstract class SnmpUnsignedInt extends SnmpInt {
-
-    /**
-     * The largest value of the type <code>unsigned int</code> (2^32 - 1).
-     */
-    public static final long   MAX_VALUE = 0x0ffffffffL;
-
-    // CONSTRUCTORS
-    //-------------
-    /**
-     * Constructs a new <CODE>SnmpUnsignedInt</CODE> from the specified integer value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is negative
-     * or larger than {@link #MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
-     */
-    public SnmpUnsignedInt(int v) throws IllegalArgumentException {
-        super(v);
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpUnsignedInt</CODE> from the specified <CODE>Integer</CODE> value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is negative
-     * or larger than {@link #MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
-     */
-    public SnmpUnsignedInt(Integer v) throws IllegalArgumentException {
-        super(v);
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpUnsignedInt</CODE> from the specified long value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is negative
-     * or larger than {@link #MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
-     */
-    public SnmpUnsignedInt(long v) throws IllegalArgumentException {
-        super(v);
-    }
-
-    /**
-     * Constructs a new <CODE>SnmpUnsignedInt</CODE> from the specified <CODE>Long</CODE> value.
-     * @param v The initialization value.
-     * @exception IllegalArgumentException The specified value is negative
-     * or larger than {@link #MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
-     */
-    public SnmpUnsignedInt(Long v) throws IllegalArgumentException {
-        super(v);
-    }
-
-    // PUBLIC METHODS
-    //---------------
-    /**
-     * Returns a textual description of the type object.
-     * @return ASN.1 textual description.
-     */
-    public String getTypeName() {
-        return name ;
-    }
-
-    /**
-     * This method has been defined to allow the sub-classes
-     * of SnmpInt to perform their own control at intialization time.
-     */
-    boolean isInitValueValid(int v) {
-        if ((v < 0) || (v > SnmpUnsignedInt.MAX_VALUE)) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * This method has been defined to allow the sub-classes
-     * of SnmpInt to perform their own control at intialization time.
-     */
-    boolean isInitValueValid(long v) {
-        if ((v < 0) || (v > SnmpUnsignedInt.MAX_VALUE)) {
-            return false;
-        }
-        return true;
-    }
-
-    // VARIABLES
-    //----------
-    /**
-     * Name of the type.
-     */
-    final static String name = "Unsigned32" ;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUsmKeyHandler.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-
-/**
- * This interface allows you to compute key localization and delta generation. It is useful when adding user in USM MIB. An instance of <CODE> SnmpUsmKeyHandler </CODE> is associated to each <CODE> SnmpEngine </CODE> object.
- * When computing key, an authentication algorithm is needed. The supported ones are : usmHMACMD5AuthProtocol and usmHMACSHAAuthProtocol.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpUsmKeyHandler {
-
-    /**
-     * DES privacy algorithm key size. To be used when localizing privacy key
-     */
-    public static int DES_KEY_SIZE = 16;
-
-    /**
-     * DES privacy algorithm delta size. To be used when calculing privacy key delta.
-     */
-    public static int DES_DELTA_SIZE = 16;
-
-    /**
-     * Translate a password to a key. It MUST be compliant to RFC 2574 description.
-     * @param algoName The authentication algorithm to use.
-     * @param password Password to convert.
-     * @return The key.
-     * @exception IllegalArgumentException If the algorithm is unknown.
-     */
-    public byte[] password_to_key(String algoName, String password) throws IllegalArgumentException;
-    /**
-     * Localize the passed key using the passed <CODE>SnmpEngineId</CODE>. It MUST be compliant to RFC 2574 description.
-     * @param algoName The authentication algorithm to use.
-     * @param key The key to localize;
-     * @param engineId The Id used to localize the key.
-     * @return The localized key.
-     * @exception IllegalArgumentException If the algorithm is unknown.
-     */
-    public byte[] localizeAuthKey(String algoName, byte[] key, SnmpEngineId engineId) throws IllegalArgumentException;
-
-    /**
-     * Localize the passed privacy key using the passed <CODE>SnmpEngineId</CODE>. It MUST be compliant to RFC 2574 description.
-     * @param algoName The authentication algorithm to use.
-     * @param key The key to localize;
-     * @param engineId The Id used to localize the key.
-     * @param keysize The privacy algorithm key size.
-     * @return The localized key.
-     * @exception IllegalArgumentException If the algorithm is unknown.
-     */
-    public byte[] localizePrivKey(String algoName, byte[] key, SnmpEngineId engineId,int keysize) throws IllegalArgumentException;
-
-    /**
-     * Calculate the delta parameter needed when processing key change. This computation is done by the key change initiator. It MUST be compliant to RFC 2574 description.
-     * @param algoName The authentication algorithm to use.
-     * @param oldKey The old key.
-     * @param newKey The new key.
-     * @param random The random value.
-     * @return The delta.
-     * @exception IllegalArgumentException If the algorithm is unknown.
-     */
-    public byte[] calculateAuthDelta(String algoName, byte[] oldKey, byte[] newKey, byte[] random) throws IllegalArgumentException;
-
-    /**
-     * Calculate the delta parameter needed when processing key change for a privacy algorithm. This computation is done by the key change initiator. It MUST be compliant to RFC 2574 description.
-     * @param algoName The authentication algorithm to use.
-     * @param oldKey The old key.
-     * @param newKey The new key.
-     * @param random The random value.
-     * @param deltaSize The algo delta size.
-     * @return The delta.
-     * @exception IllegalArgumentException If the algorithm is unknown.
-     */
-    public byte[] calculatePrivDelta(String algoName, byte[] oldKey, byte[] newKey, byte[] random, int deltaSize) throws IllegalArgumentException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpV3Message.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,511 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp;
-
-// java imports
-//
-import java.util.Vector;
-import java.util.logging.Level;
-import java.net.InetAddress;
-
-// import debug stuff
-//
-import static com.sun.jmx.defaults.JmxProperties.SNMP_LOGGER;
-import com.sun.jmx.snmp.internal.SnmpMsgProcessingSubSystem;
-import com.sun.jmx.snmp.internal.SnmpSecurityModel;
-import com.sun.jmx.snmp.internal.SnmpDecryptedPdu;
-import com.sun.jmx.snmp.internal.SnmpSecurityCache;
-
-import com.sun.jmx.snmp.SnmpMsg;
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpTooBigException;
-import com.sun.jmx.snmp.SnmpScopedPduBulk;
-import com.sun.jmx.snmp.BerException;
-import com.sun.jmx.snmp.SnmpScopedPduRequest;
-import com.sun.jmx.snmp.BerDecoder;
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpEngineId;
-import com.sun.jmx.snmp.SnmpScopedPduPacket;
-import com.sun.jmx.snmp.BerEncoder;
-import com.sun.jmx.snmp.SnmpPduRequestType;
-import com.sun.jmx.snmp.SnmpPduBulkType;
-
-/**
- * Is a partially decoded representation of an SNMP V3 packet.
- * <P>
- * This class can be used when developing customized manager or agent.
- * <P>
- * The <CODE>SnmpV3Message</CODE> class is directly mapped onto the
- * message syntax defined in RFC 2572.
- * <BLOCKQUOTE>
- * <PRE>
- * SNMPv3Message ::= SEQUENCE {
- *          msgVersion INTEGER ( 0 .. 2147483647 ),
- *          -- administrative parameters
- *          msgGlobalData HeaderData,
- *          -- security model-specific parameters
- *          -- format defined by Security Model
- *          msgSecurityParameters OCTET STRING,
- *          msgData  ScopedPduData
- *      }
- *     HeaderData ::= SEQUENCE {
- *         msgID      INTEGER (0..2147483647),
- *         msgMaxSize INTEGER (484..2147483647),
- *
- *         msgFlags   OCTET STRING (SIZE(1)),
- *                    --  .... ...1   authFlag
- *                    --  .... ..1.   privFlag
- *                    --  .... .1..   reportableFlag
- *                    --              Please observe:
- *                    --  .... ..00   is OK, means noAuthNoPriv
- *                    --  .... ..01   is OK, means authNoPriv
- *                    --  .... ..10   reserved, must NOT be used.
- *                    --  .... ..11   is OK, means authPriv
- *
- *         msgSecurityModel INTEGER (1..2147483647)
- *     }
- * </BLOCKQUOTE>
- * </PRE>
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public class SnmpV3Message extends SnmpMsg {
-
-    /**
-     * Message identifier.
-     */
-    public int msgId = 0;
-
-    /**
-     * Message max size the pdu sender can deal with.
-     */
-    public int msgMaxSize = 0;
-    /**
-     * Message flags. Reportable flag  and security level.</P>
-     *<PRE>
-     * --  .... ...1   authFlag
-     * --  .... ..1.   privFlag
-     * --  .... .1..   reportableFlag
-     * --              Please observe:
-     * --  .... ..00   is OK, means noAuthNoPriv
-     * --  .... ..01   is OK, means authNoPriv
-     * --  .... ..10   reserved, must NOT be used.
-     * --  .... ..11   is OK, means authPriv
-     *</PRE>
-     */
-    public byte msgFlags = 0;
-    /**
-     * The security model the security sub system MUST use in order to deal with this pdu (eg: User based Security Model Id = 3).
-     */
-    public int msgSecurityModel = 0;
-    /**
-     * The unmarshalled security parameters.
-     */
-    public byte[] msgSecurityParameters = null;
-    /**
-     * The context engine Id in which the pdu must be handled (Generaly the local engine Id).
-     */
-    public byte[] contextEngineId = null;
-    /**
-     * The context name in which the OID has to be interpreted.
-     */
-    public byte[] contextName = null;
-    /** The encrypted form of the scoped pdu (Only relevant when dealing with privacy).
-     */
-    public byte[] encryptedPdu = null;
-
-    /**
-     * Constructor.
-     *
-     */
-    public SnmpV3Message() {
-    }
-    /**
-     * Encodes this message and puts the result in the specified byte array.
-     * For internal use only.
-     *
-     * @param outputBytes An array to receive the resulting encoding.
-     *
-     * @exception ArrayIndexOutOfBoundsException If the result does not fit
-     *                                           into the specified array.
-     */
-    public int encodeMessage(byte[] outputBytes)
-        throws SnmpTooBigException {
-        int encodingLength = 0;
-        if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
-                    "encodeMessage",
-                    "Can't encode directly V3Message! Need a SecuritySubSystem");
-        }
-        throw new IllegalArgumentException("Can't encode");
-    }
-
-    /**
-     * Decodes the specified bytes and initializes this message.
-     * For internal use only.
-     *
-     * @param inputBytes The bytes to be decoded.
-     *
-     * @exception SnmpStatusException If the specified bytes are not a valid encoding.
-     */
-    public void decodeMessage(byte[] inputBytes, int byteCount)
-        throws SnmpStatusException {
-
-        try {
-            BerDecoder bdec = new BerDecoder(inputBytes);
-            bdec.openSequence();
-            version = bdec.fetchInteger();
-            bdec.openSequence();
-            msgId = bdec.fetchInteger();
-            msgMaxSize = bdec.fetchInteger();
-            msgFlags = bdec.fetchOctetString()[0];
-            msgSecurityModel =bdec.fetchInteger();
-            bdec.closeSequence();
-            msgSecurityParameters = bdec.fetchOctetString();
-            if( (msgFlags & SnmpDefinitions.privMask) == 0 ) {
-                bdec.openSequence();
-                contextEngineId = bdec.fetchOctetString();
-                contextName = bdec.fetchOctetString();
-                data = bdec.fetchAny();
-                dataLength = data.length;
-                bdec.closeSequence();
-            }
-            else {
-                encryptedPdu = bdec.fetchOctetString();
-            }
-            bdec.closeSequence() ;
-        }
-        catch(BerException x) {
-            x.printStackTrace();
-            throw new SnmpStatusException("Invalid encoding") ;
-        }
-
-        if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-            final StringBuilder strb = new StringBuilder()
-            .append("Unmarshalled message : \n")
-            .append("version : ").append(version)
-            .append("\n")
-            .append("msgId : ").append(msgId)
-            .append("\n")
-            .append("msgMaxSize : ").append(msgMaxSize)
-            .append("\n")
-            .append("msgFlags : ").append(msgFlags)
-            .append("\n")
-            .append("msgSecurityModel : ").append(msgSecurityModel)
-            .append("\n")
-            .append("contextEngineId : ").append(contextEngineId == null ? null :
-                SnmpEngineId.createEngineId(contextEngineId))
-            .append("\n")
-            .append("contextName : ").append(contextName)
-            .append("\n")
-            .append("data : ").append(data)
-            .append("\n")
-            .append("dat len : ").append((data == null) ? 0 : data.length)
-            .append("\n")
-            .append("encryptedPdu : ").append(encryptedPdu)
-            .append("\n");
-            SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
-                    "decodeMessage", strb.toString());
-        }
-    }
-
-    /**
-     * Returns the associated request Id.
-     * @param data The flat message.
-     * @return The request Id.
-     */
-    public int getRequestId(byte[] data) throws SnmpStatusException {
-        BerDecoder bdec = null;
-        int msgId = 0;
-        try {
-            bdec = new BerDecoder(data);
-            bdec.openSequence();
-            bdec.fetchInteger();
-            bdec.openSequence();
-            msgId = bdec.fetchInteger();
-        }catch(BerException x) {
-            throw new SnmpStatusException("Invalid encoding") ;
-        }
-        try {
-            bdec.closeSequence();
-        }
-        catch(BerException x) {
-        }
-
-        return msgId;
-    }
-
-    /**
-     * Initializes this message with the specified <CODE>pdu</CODE>.
-     * <P>
-     * This method initializes the data field with an array of
-     * <CODE>maxDataLength</CODE> bytes. It encodes the <CODE>pdu</CODE>.
-     * The resulting encoding is stored in the data field
-     * and the length of the encoding is stored in <CODE>dataLength</CODE>.
-     * <p>
-     * If the encoding length exceeds <CODE>maxDataLength</CODE>,
-     * the method throws an exception.
-     *
-     * @param p The PDU to be encoded.
-     * @param maxDataLength The maximum length permitted for the data field.
-     *
-     * @exception SnmpStatusException If the specified <CODE>pdu</CODE>
-     *   is not valid.
-     * @exception SnmpTooBigException If the resulting encoding does not fit
-     * into <CODE>maxDataLength</CODE> bytes.
-     * @exception ArrayIndexOutOfBoundsException If the encoding exceeds
-     *    <CODE>maxDataLength</CODE>.
-     */
-    public void encodeSnmpPdu(SnmpPdu p,
-                              int maxDataLength)
-        throws SnmpStatusException, SnmpTooBigException {
-
-        SnmpScopedPduPacket pdu = (SnmpScopedPduPacket) p;
-
-        if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-            final StringBuilder strb = new StringBuilder()
-            .append("PDU to marshall: \n")
-            .append("security parameters : ").append(pdu.securityParameters)
-            .append("\n")
-            .append("type : ").append(pdu.type)
-            .append("\n")
-            .append("version : ").append(pdu.version)
-            .append("\n")
-            .append("requestId : ").append(pdu.requestId)
-            .append("\n")
-            .append("msgId : ").append(pdu.msgId)
-            .append("\n")
-            .append("msgMaxSize : ").append(pdu.msgMaxSize)
-            .append("\n")
-            .append("msgFlags : ").append(pdu.msgFlags)
-            .append("\n")
-            .append("msgSecurityModel : ").append(pdu.msgSecurityModel)
-            .append("\n")
-            .append("contextEngineId : ").append(pdu.contextEngineId)
-            .append("\n")
-            .append("contextName : ").append(pdu.contextName)
-            .append("\n");
-            SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
-                    "encodeSnmpPdu", strb.toString());
-        }
-
-        version = pdu.version;
-        address = pdu.address;
-        port = pdu.port;
-        msgId = pdu.msgId;
-        msgMaxSize = pdu.msgMaxSize;
-        msgFlags = pdu.msgFlags;
-        msgSecurityModel = pdu.msgSecurityModel;
-
-        contextEngineId = pdu.contextEngineId;
-        contextName = pdu.contextName;
-
-        securityParameters = pdu.securityParameters;
-
-        //
-        // Allocate the array to receive the encoding.
-        //
-        data = new byte[maxDataLength];
-
-        //
-        // Encode the pdu
-        // Reminder: BerEncoder does backward encoding !
-        //
-
-        try {
-            BerEncoder benc = new BerEncoder(data) ;
-            benc.openSequence() ;
-            encodeVarBindList(benc, pdu.varBindList) ;
-
-            switch(pdu.type) {
-
-            case pduGetRequestPdu :
-            case pduGetNextRequestPdu :
-            case pduInformRequestPdu :
-            case pduGetResponsePdu :
-            case pduSetRequestPdu :
-            case pduV2TrapPdu :
-            case pduReportPdu :
-                SnmpPduRequestType reqPdu = (SnmpPduRequestType) pdu;
-                benc.putInteger(reqPdu.getErrorIndex());
-                benc.putInteger(reqPdu.getErrorStatus());
-                benc.putInteger(pdu.requestId);
-                break;
-
-            case pduGetBulkRequestPdu :
-                SnmpPduBulkType bulkPdu = (SnmpPduBulkType) pdu;
-                benc.putInteger(bulkPdu.getMaxRepetitions());
-                benc.putInteger(bulkPdu.getNonRepeaters());
-                benc.putInteger(pdu.requestId);
-                break ;
-
-            default:
-                throw new SnmpStatusException("Invalid pdu type " + String.valueOf(pdu.type)) ;
-            }
-            benc.closeSequence(pdu.type) ;
-            dataLength = benc.trim() ;
-        }
-        catch(ArrayIndexOutOfBoundsException x) {
-            throw new SnmpTooBigException() ;
-        }
-    }
-
-
-    /**
-     * Gets the PDU encoded in this message.
-     * <P>
-     * This method decodes the data field and returns the resulting PDU.
-     *
-     * @return The resulting PDU.
-     * @exception SnmpStatusException If the encoding is not valid.
-     */
-
-    public SnmpPdu decodeSnmpPdu()
-        throws SnmpStatusException {
-
-        SnmpScopedPduPacket pdu = null;
-
-        BerDecoder bdec = new BerDecoder(data) ;
-        try {
-            int type = bdec.getTag() ;
-            bdec.openSequence(type) ;
-            switch(type) {
-
-            case pduGetRequestPdu :
-            case pduGetNextRequestPdu :
-            case pduInformRequestPdu :
-            case pduGetResponsePdu :
-            case pduSetRequestPdu :
-            case pduV2TrapPdu :
-            case pduReportPdu :
-                SnmpScopedPduRequest reqPdu = new SnmpScopedPduRequest() ;
-                reqPdu.requestId = bdec.fetchInteger() ;
-                reqPdu.setErrorStatus(bdec.fetchInteger());
-                reqPdu.setErrorIndex(bdec.fetchInteger());
-                pdu = reqPdu ;
-                break ;
-
-            case pduGetBulkRequestPdu :
-                SnmpScopedPduBulk bulkPdu = new SnmpScopedPduBulk() ;
-                bulkPdu.requestId = bdec.fetchInteger() ;
-                bulkPdu.setNonRepeaters(bdec.fetchInteger());
-                bulkPdu.setMaxRepetitions(bdec.fetchInteger());
-                pdu = bulkPdu ;
-                break ;
-            default:
-                throw new SnmpStatusException(snmpRspWrongEncoding) ;
-            }
-            pdu.type = type;
-            pdu.varBindList = decodeVarBindList(bdec);
-            bdec.closeSequence() ;
-        } catch(BerException e) {
-            if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_LOGGER.logp(Level.FINEST, SnmpV3Message.class.getName(),
-                        "decodeSnmpPdu", "BerException", e);
-            }
-            throw new SnmpStatusException(snmpRspWrongEncoding);
-        }
-
-        //
-        // The easy work.
-        //
-        pdu.address = address;
-        pdu.port = port;
-        pdu.msgFlags = msgFlags;
-        pdu.version = version;
-        pdu.msgId = msgId;
-        pdu.msgMaxSize = msgMaxSize;
-        pdu.msgSecurityModel = msgSecurityModel;
-        pdu.contextEngineId = contextEngineId;
-        pdu.contextName = contextName;
-
-        pdu.securityParameters = securityParameters;
-
-        if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-            final StringBuilder strb = new StringBuilder()
-            .append("Unmarshalled PDU : \n")
-            .append("type : ").append(pdu.type)
-            .append("\n")
-            .append("version : ").append(pdu.version)
-            .append("\n")
-            .append("requestId : ").append(pdu.requestId)
-            .append("\n")
-            .append("msgId : ").append(pdu.msgId)
-            .append("\n")
-            .append("msgMaxSize : ").append(pdu.msgMaxSize)
-            .append("\n")
-            .append("msgFlags : ").append(pdu.msgFlags)
-            .append("\n")
-            .append("msgSecurityModel : ").append(pdu.msgSecurityModel)
-            .append("\n")
-            .append("contextEngineId : ").append(pdu.contextEngineId)
-            .append("\n")
-            .append("contextName : ").append(pdu.contextName)
-            .append("\n");
-            SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
-                    "decodeSnmpPdu", strb.toString());
-        }
-        return pdu ;
-    }
-
-    /**
-     * Dumps this message in a string.
-     *
-     * @return The string containing the dump.
-     */
-    public String printMessage() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("msgId : " + msgId + "\n");
-        sb.append("msgMaxSize : " + msgMaxSize + "\n");
-        sb.append("msgFlags : " + msgFlags + "\n");
-        sb.append("msgSecurityModel : " + msgSecurityModel + "\n");
-
-        if (contextEngineId == null) {
-            sb.append("contextEngineId : null");
-        }
-        else {
-            sb.append("contextEngineId : {\n");
-            sb.append(dumpHexBuffer(contextEngineId,
-                                    0,
-                                    contextEngineId.length));
-            sb.append("\n}\n");
-        }
-
-        if (contextName == null) {
-            sb.append("contextName : null");
-        }
-        else {
-            sb.append("contextName : {\n");
-            sb.append(dumpHexBuffer(contextName,
-                                    0,
-                                    contextName.length));
-            sb.append("\n}\n");
-        }
-        return sb.append(super.printMessage()).toString();
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpValue.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-
-
-import java.io.Serializable;
-
-/**
- * Is an abstract representation of an SNMP Value.
- * All classes provided for dealing with SNMP types should derive from this
- * class.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-@SuppressWarnings("serial") // JDK implementation class
-public abstract class SnmpValue implements Cloneable, Serializable, SnmpDataTypeEnums {
-
-    /**
-     * Returns a <CODE>String</CODE> form containing ASN.1 tagging information.
-     * @return The <CODE>String</CODE> form.
-     */
-    public String toAsn1String() {
-        return "[" + getTypeName() + "] " + toString();
-    }
-
-    /**
-     * Returns the value encoded as an OID.
-     * The method is particularly useful when dealing with indexed table made of
-     * several SNMP variables.
-     * @return The value encoded as an OID.
-     */
-    public abstract SnmpOid toOid() ;
-
-    /**
-     * Returns a textual description of the object.
-     * @return ASN.1 textual description.
-     */
-    public abstract String getTypeName() ;
-
-    /**
-     * Same as clone, but you cannot perform cloning using this object because
-     * clone is protected. This method should call <CODE>clone()</CODE>.
-     * @return The <CODE>SnmpValue</CODE> clone.
-     */
-    public abstract SnmpValue duplicate() ;
-
-    /**
-     * This method returns <CODE>false</CODE> by default and is redefined
-     * in the {@link com.sun.jmx.snmp.SnmpNull} class.
-     */
-    public boolean isNoSuchObjectValue() {
-        return false;
-    }
-
-    /**
-     * This method returns <CODE>false</CODE> by default and is redefined
-     * in the {@link com.sun.jmx.snmp.SnmpNull} class.
-     */
-    public boolean isNoSuchInstanceValue() {
-        return false;
-    }
-
-    /**
-     * This method returns <CODE>false</CODE> by default and is redefined
-     * in the {@link com.sun.jmx.snmp.SnmpNull} class.
-     */
-    public boolean isEndOfMibViewValue() {
-        return false;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/ThreadContext.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,326 +0,0 @@
-/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp;
-
-import java.util.Stack;
-import java.util.EmptyStackException;
-
-/**
- * <p><b>Warning: The interface of this class is subject to change.
- * Use at your own risk.</b></p>
- *
- * <p>This class associates a context with each thread that
- * references it.  The context is a set of mappings between Strings
- * and Objects.  It is managed as a stack, typically with code like
- * this:</p>
- *
- * <pre>
- * ThreadContext oldContext = ThreadContext.push(myKey, myObject);
- * // plus possibly further calls to ThreadContext.push...
- * try {
- *      doSomeOperation();
- * } finally {
- *      ThreadContext.restore(oldContext);
- * }
- * </pre>
- *
- * <p>The <code>try</code>...<code>finally</code> block ensures that
- * the <code>restore</code> is done even if
- * <code>doSomeOperation</code> terminates abnormally (with an
- * exception).</p>
- *
- * <p>A thread can consult its own context using
- * <code>ThreadContext.get(myKey)</code>.  The result is the
- * value that was most recently pushed with the given key.</p>
- *
- * <p>A thread cannot read or modify the context of another thread.</p>
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-public class ThreadContext implements Cloneable {
-
-    /* The context of a thread is stored as a linked list.  At the
-       head of the list is the value returned by localContext.get().
-       At the tail of the list is a sentinel ThreadContext value with
-       "previous" and "key" both null.  There is a different sentinel
-       object for each thread.
-
-       Because a null key indicates the sentinel, we reject attempts to
-       push context entries with a null key.
-
-       The reason for using a sentinel rather than just terminating
-       the list with a null reference is to protect against incorrect
-       or even malicious code.  If you have a reference to the
-       sentinel value, you can erase the context stack.  Only the
-       caller of the first "push" that put something on the stack can
-       get such a reference, so if that caller does not give this
-       reference away, no one else can erase the stack.
-
-       If the restore method took a null reference to mean an empty
-       stack, anyone could erase the stack, since anyone can make a
-       null reference.
-
-       When the stack is empty, we discard the sentinel object and
-       have localContext.get() return null.  Then we recreate the
-       sentinel object on the first subsequent push.
-
-       ThreadContext objects are immutable.  As a consequence, you can
-       give a ThreadContext object to setInitialContext that is no
-       longer current.  But the interface says this can be rejected,
-       in case we remove immutability later.  */
-
-    /* We have to comment out "final" here because of a bug in the JDK1.1
-       compiler.  Uncomment it when we discard 1.1 compatibility.  */
-    private /*final*/ ThreadContext previous;
-    private /*final*/ String key;
-    private /*final*/ Object value;
-
-    private ThreadContext(ThreadContext previous, String key, Object value) {
-        this.previous = previous;
-        this.key = key;
-        this.value = value;
-    }
-
-    /**
-     * <p>Get the Object that was most recently pushed with the given key.</p>
-     *
-     * @param key the key of interest.
-     *
-     * @return the last Object that was pushed (using
-     * <code>push</code>) with that key and not subsequently canceled
-     * by a <code>restore</code>; or null if there is no such object.
-     * A null return value may also indicate that the last Object
-     * pushed was the value <code>null</code>.  Use the
-     * <code>contains</code> method to distinguish this case from the
-     * case where there is no Object.
-     *
-     * @exception IllegalArgumentException if <code>key</code> is null.
-     */
-    public static Object get(String key) throws IllegalArgumentException {
-        ThreadContext context = contextContaining(key);
-        if (context == null)
-            return null;
-        else
-            return context.value;
-    }
-
-    /**
-     * <p>Check whether a value with the given key exists in the stack.
-     * This means that the <code>push</code> method was called with
-     * this key and it was not cancelled by a subsequent
-     * <code>restore</code>.  This method is useful when the
-     * <code>get</code> method returns null, to distinguish between
-     * the case where the key exists in the stack but is associated
-     * with a null value, and the case where the key does not exist in
-     * the stack.</p>
-     *
-     * @return true if the key exists in the stack.
-     *
-     * @exception IllegalArgumentException if <code>key</code> is null.
-     */
-    public static boolean contains(String key)
-            throws IllegalArgumentException {
-        return (contextContaining(key) != null);
-    }
-
-    /**
-     * <p>Find the ThreadContext in the stack that contains the given key,
-     * or return null if there is none.</p>
-     *
-     * @exception IllegalArgumentException if <code>key</code> is null.
-     */
-    private static ThreadContext contextContaining(String key)
-            throws IllegalArgumentException {
-        if (key == null)
-            throw new IllegalArgumentException("null key");
-        for (ThreadContext context = getContext();
-             context != null;
-             context = context.previous) {
-            if (key.equals(context.key))
-                return context;
-            /* Note that "context.key" may be null if "context" is the
-               sentinel, so don't write "if (context.key.equals(key))"!  */
-        }
-        return null;
-    }
-
-//  /**
-//   * Change the value that was most recently associated with the given key
-//   * in a <code>push</code> operation not cancelled by a subsequent
-//   * <code>restore</code>.  If there is no such association, nothing happens
-//   * and the return value is null.
-//   *
-//   * @param key the key of interest.
-//   * @param value the new value to associate with that key.
-//   *
-//   * @return the value that was previously associated with the key, or null
-//   * if the key does not exist in the stack.
-//   *
-//   * @exception IllegalArgumentException if <code>key</code> is null.
-//   */
-//  public static Object set(String key, Object value)
-//          throws IllegalArgumentException {
-//      ThreadContext context = contextContaining(key);
-//      if (context == null)
-//          return null;
-//      Object old = context.value;
-//      context.value = value;
-//      return old;
-//  }
-
-    /**
-     * <p>Push an object on the context stack with the given key.
-     * This operation can subsequently be undone by calling
-     * <code>restore</code> with the ThreadContext value returned
-     * here.</p>
-     *
-     * @param key the key that will be used to find the object while it is
-     * on the stack.
-     * @param value the value to be associated with that key.  It may be null.
-     *
-     * @return a ThreadContext that can be given to <code>restore</code> to
-     * restore the stack to its state before the <code>push</code>.
-     *
-     * @exception IllegalArgumentException if <code>key</code> is null.
-     */
-    public static ThreadContext push(String key, Object value)
-            throws IllegalArgumentException {
-        if (key == null)
-            throw new IllegalArgumentException("null key");
-
-        ThreadContext oldContext = getContext();
-        if (oldContext == null)
-            oldContext = new ThreadContext(null, null, null);  // make sentinel
-        ThreadContext newContext = new ThreadContext(oldContext, key, value);
-        setContext(newContext);
-        return oldContext;
-    }
-
-    /**
-     * <p>Return an object that can later be supplied to <code>restore</code>
-     * to restore the context stack to its current state.  The object can
-     * also be given to <code>setInitialContext</code>.</p>
-     *
-     * @return a ThreadContext that represents the current context stack.
-     */
-    public static ThreadContext getThreadContext() {
-        return getContext();
-    }
-
-    /**
-     * <p>Restore the context stack to an earlier state.  This typically
-     * undoes the effect of one or more <code>push</code> calls.</p>
-     *
-     * @param oldContext the state to return.  This is usually the return
-     * value of an earlier <code>push</code> operation.
-     *
-     * @exception NullPointerException if <code>oldContext</code> is null.
-     * @exception IllegalArgumentException if <code>oldContext</code>
-     * does not represent a context from this thread, or if that
-     * context was undone by an earlier <code>restore</code>.
-     */
-    public static void restore(ThreadContext oldContext)
-            throws NullPointerException, IllegalArgumentException {
-        /* The following test is not strictly necessary in the code as it
-           stands today, since the reference to "oldContext.key" would
-           generate a NullPointerException anyway.  But if someone
-           didn't notice that during subsequent changes, they could
-           accidentally permit restore(null) with the semantics of
-           trashing the context stack.  */
-        if (oldContext == null)
-            throw new NullPointerException();
-
-        /* Check that the restored context is in the stack.  */
-        for (ThreadContext context = getContext();
-             context != oldContext;
-             context = context.previous) {
-            if (context == null) {
-                throw new IllegalArgumentException("Restored context is not " +
-                                                   "contained in current " +
-                                                   "context");
-            }
-        }
-
-        /* Discard the sentinel if the stack is empty.  This means that it
-           is an error to call "restore" a second time with the
-           ThreadContext value that means an empty stack.  That's why we
-           don't say that it is all right to restore the stack to the
-           state it was already in.  */
-        if (oldContext.key == null)
-            oldContext = null;
-
-        setContext(oldContext);
-    }
-
-    /**
-     * <p>Set the initial context of the calling thread to a context obtained
-     * from another thread.  After this call, the calling thread will see
-     * the same results from the <code>get</code> method as the thread
-     * from which the <code>context</code> argument was obtained, at the
-     * time it was obtained.</p>
-     *
-     * <p>The <code>context</code> argument must be the result of an earlier
-     * <code>push</code> or <code>getThreadContext</code> call.  It is an
-     * error (which may or may not be detected) if this context has been
-     * undone by a <code>restore</code>.</p>
-     *
-     * <p>The context stack of the calling thread must be empty before this
-     * call, i.e., there must not have been a <code>push</code> not undone
-     * by a subsequent <code>restore</code>.</p>
-     *
-     * @exception IllegalArgumentException if the context stack was
-     * not empty before the call.  An implementation may also throw this
-     * exception if <code>context</code> is no longer current in the
-     * thread from which it was obtained.
-     */
-    /* We rely on the fact that ThreadContext objects are immutable.
-       This means that we don't have to check that the "context"
-       argument is valid.  It necessarily represents the head of a
-       valid chain of ThreadContext objects, even if the thread from
-       which it was obtained has subsequently been set to a point
-       later in that chain using "restore".  */
-    public void setInitialContext(ThreadContext context)
-            throws IllegalArgumentException {
-        /* The following test assumes that we discard sentinels when the
-           stack is empty.  */
-        if (getContext() != null)
-            throw new IllegalArgumentException("previous context not empty");
-        setContext(context);
-    }
-
-    private static ThreadContext getContext() {
-        return localContext.get();
-    }
-
-    private static void setContext(ThreadContext context) {
-        localContext.set(context);
-    }
-
-    private static ThreadLocal<ThreadContext> localContext =
-            new ThreadLocal<ThreadContext>();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/UserAcl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp;
-
-
-// java import
-//
-import java.util.Enumeration;
-import java.net.InetAddress;
-
-/**
- * Defines the user based ACL used by the SNMP protocol adaptor.
- * <p>
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-
-public interface UserAcl {
-
-    /**
-     * Returns the name of the ACL.
-     *
-     * @return The name of the ACL.
-     */
-    public String getName();
-
-    /**
-     * Checks whether or not the specified user has <CODE>READ</CODE> access.
-     *
-     * @param user The user name to check.
-     *
-     * @return <CODE>true</CODE> if the host has read permission, <CODE>false</CODE> otherwise.
-     */
-    public boolean checkReadPermission(String user);
-
-    /**
-     * Checks whether or not the specified user and context name have <CODE>READ</CODE> access.
-     *
-     * @param user The user name to check.
-     * @param contextName The context name associated with the user.
-     * @param securityLevel The request security level.
-     * @return <CODE>true</CODE> if the pair (user, context) has read permission, <CODE>false</CODE> otherwise.
-     */
-    public boolean checkReadPermission(String user, String contextName, int securityLevel);
-
-    /**
-     * Checks whether or not a context name is defined.
-     *
-     * @param contextName The context name to check.
-     *
-     * @return <CODE>true</CODE> if the context is known, <CODE>false</CODE> otherwise.
-     */
-    public boolean checkContextName(String contextName);
-
-    /**
-     * Checks whether or not the specified user has <CODE>WRITE</CODE> access.
-     *
-     * @param user The user to check.
-     *
-     * @return <CODE>true</CODE> if the user has write permission, <CODE>false</CODE> otherwise.
-     */
-    public boolean checkWritePermission(String user);
-
-    /**
-     * Checks whether or not the specified user and context name have <CODE>WRITE</CODE> access.
-     *
-     * @param user The user name to check.
-     * @param contextName The context name associated with the user.
-     * @param securityLevel The request security level.
-     * @return <CODE>true</CODE> if the pair (user, context) has write permission, <CODE>false</CODE> otherwise.
-     */
-    public boolean checkWritePermission(String user, String contextName, int securityLevel);
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/AcmChecker.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.agent;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.logging.Level;
-import java.util.Vector;
-
-import javax.management.ObjectName;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.MBeanRegistrationException;
-import javax.management.NotCompliantMBeanException;
-
-import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpEngine;
-import com.sun.jmx.snmp.SnmpUnknownModelException;
-import com.sun.jmx.snmp.internal.SnmpAccessControlModel;
-import com.sun.jmx.snmp.internal.SnmpEngineImpl;
-
-/**
- * Oid Checker makes use of ACM to check each OID during the getnext process.
- */
-class AcmChecker {
-
-
-    SnmpAccessControlModel model = null;
-    String principal = null;
-    int securityLevel = -1;
-    int version = -1;
-    int pduType = -1;
-    int securityModel = -1;
-    byte[] contextName = null;
-    SnmpEngineImpl engine = null;
-    LongList l = null;
-    AcmChecker(SnmpMibRequest req) {
-        engine = (SnmpEngineImpl) req.getEngine();
-        //We are in V3 architecture, ACM is in the picture.
-        if(engine != null) {
-            if(engine.isCheckOidActivated()) {
-                try {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                                SnmpMib.class.getName(),
-                                "AcmChecker(SnmpMibRequest)",
-                                "SNMP V3 Access Control to be done");
-                    }
-                    model = (SnmpAccessControlModel)
-                        engine.getAccessControlSubSystem().
-                        getModel(SnmpDefinitions.snmpVersionThree);
-                    principal = req.getPrincipal();
-                    securityLevel = req.getSecurityLevel();
-                    pduType = req.getPdu().type;
-                    version = req.getRequestPduVersion();
-                    securityModel = req.getSecurityModel();
-                    contextName = req.getAccessContextName();
-                    l = new LongList();
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        final StringBuilder strb = new StringBuilder()
-                        .append("Will check oid for : principal : ")
-                        .append(principal)
-                        .append("; securityLevel : ").append(securityLevel)
-                        .append("; pduType : ").append(pduType)
-                        .append("; version : ").append(version)
-                        .append("; securityModel : ").append(securityModel)
-                        .append("; contextName : ").append(contextName);
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                                SnmpMib.class.getName(),
-                                "AcmChecker(SnmpMibRequest)", strb.toString());
-                    }
-
-                }catch(SnmpUnknownModelException e) {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                                SnmpMib.class.getName(),
-                                "AcmChecker(SnmpMibRequest)",
-                                "Unknown Model, no ACM check.");
-                    }
-                }
-            }
-        }
-    }
-
-    void add(int index, long arc) {
-        if(model != null)
-            l.add(index, arc);
-    }
-
-    void remove(int index) {
-        if(model != null)
-            l.remove(index);
-    }
-
-    void add(final int at,final long[] src, final int from,
-             final int count) {
-        if(model != null)
-            l.add(at,src,from,count);
-    }
-
-    void remove(final int from, final int count) {
-        if(model != null)
-            l.remove(from,count);
-    }
-
-    void checkCurrentOid() throws SnmpStatusException {
-        if(model != null) {
-            SnmpOid oid = new SnmpOid(l.toArray());
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMib.class.getName(),
-                        "checkCurrentOid", "Checking access for : " + oid);
-            }
-            model.checkAccess(version,
-                              principal,
-                              securityLevel,
-                              pduType,
-                              securityModel,
-                              contextName,
-                              oid);
-        }
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/LongList.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.agent;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.logging.Level;
-import java.util.Vector;
-
-import javax.management.ObjectName;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.MBeanRegistrationException;
-import javax.management.NotCompliantMBeanException;
-
-import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpEngine;
-import com.sun.jmx.snmp.SnmpUnknownModelException;
-import com.sun.jmx.snmp.internal.SnmpAccessControlModel;
-import com.sun.jmx.snmp.internal.SnmpEngineImpl;
-
-/**
- * This list is used in order to construct the OID during the getnext.
- * The constructed oid is checked by the checker AcmChecker.
- */
-final class LongList {
-
-    public static int DEFAULT_CAPACITY = 10;
-
-    public static int DEFAULT_INCREMENT = 10;
-
-
-    private final int DELTA;
-    private int size;
-
-    /**
-     * The list content. Any access to this variable must be protected
-     * by a synchronized block on the LongList object.
-     * Only read-only action should be performed on this object.
-     **/
-    public  long[] list;
-
-    LongList() {
-        this(DEFAULT_CAPACITY,DEFAULT_INCREMENT);
-    }
-
-    LongList(int initialCapacity) {
-        this(initialCapacity,DEFAULT_INCREMENT);
-    }
-
-    LongList(int initialCapacity, int delta) {
-        size = 0;
-        DELTA = delta;
-        list = allocate(initialCapacity);
-    }
-
-    /**
-     * Same behaviour than size() in {@link java.util.List}.
-     **/
-    public final int size() { return size;}
-
-    /**
-     * Same behaviour than add(long o) in {@link java.util.List}.
-     * Any access to this method should be protected in a synchronized
-     * block on the LongList object.
-     **/
-    public final boolean add(final long o) {
-        if (size >= list.length)
-            resize();
-        list[size++]=o;
-        return true;
-    }
-
-    /**
-     * Same behaviour than add(int index, long o) in
-     * {@link java.util.List}.
-     * Any access to this method should be protected in a synchronized
-     * block on the LongList object.
-     **/
-    public final void add(final int index, final long o) {
-        if (index >  size) throw new IndexOutOfBoundsException();
-        if (index >= list.length) resize();
-        if (index == size) {
-            list[size++]=o;
-            return;
-        }
-
-        java.lang.System.arraycopy(list,index,list,index+1,size-index);
-        list[index]=o;
-        size++;
-    }
-
-    /**
-     * Adds <var>count</var> elements to the list.
-     * @param at index at which the elements must be inserted. The
-     *        first element will be inserted at this index.
-     * @param src  An array containing the elements we want to insert.
-     * @param from Index of the first element from <var>src</var> that
-     *        must be inserted.
-     * @param count number of elements to insert.
-     * Any access to this method should be protected in a synchronized
-     * block on the LongList object.
-     **/
-    public final void add(final int at,final long[] src, final int from,
-                          final int count) {
-        if (count <= 0) return;
-        if (at > size) throw new IndexOutOfBoundsException();
-        ensure(size+count);
-        if (at < size) {
-            java.lang.System.arraycopy(list,at,list,at+count,size-at);
-        }
-        java.lang.System.arraycopy(src,from,list,at,count);
-        size+=count;
-    }
-
-    /**
-     * Any access to this method should be protected in a synchronized
-     * block on the LongList object.
-     **/
-    public final long remove(final int from, final int count) {
-        if (count < 1 || from < 0) return -1;
-        if (from+count > size) return -1;
-
-        final long o = list[from];
-        final int oldsize = size;
-        size = size - count;
-
-        if (from == size) return o;
-
-        java.lang.System.arraycopy(list,from+count,list,from,
-                                   size-from);
-        return o;
-    }
-
-    /**
-     * Same behaviour than remove(int index) in {@link java.util.List}.
-     * Any access to this method should be protected in a synchronized
-     * block on the LongList object.
-     **/
-    public final long remove(final int index) {
-        if (index >= size) return -1;
-        final long o = list[index];
-        list[index]=0;
-        if (index == --size) return o;
-
-        java.lang.System.arraycopy(list,index+1,list,index,
-                                   size-index);
-        return o;
-    }
-
-    /**
-     * Same behaviour than the toArray(long[] a) method in
-     * {@link java.util.List}.
-     * Any access to this method should be protected in a synchronized
-     * block on the LongList object.
-     **/
-    public final long[] toArray(long[] a) {
-        java.lang.System.arraycopy(list,0,a,0,size);
-        return a;
-    }
-
-    /**
-     * Same behaviour than the toArray() method in
-     * {@link java.util.List}.
-     * Any access to this method should be protected in a synchronized
-     * block on the LongList object.
-     **/
-    public final long[] toArray() {
-        return toArray(new long[size]);
-    }
-
-    /**
-     * Resize the list. Increase its capacity by DELTA elements.
-     * Any call to this method must be protected by a synchronized
-     * block on this LongList.
-     **/
-    private final void resize() {
-        final long[] newlist = allocate(list.length + DELTA);
-        java.lang.System.arraycopy(list,0,newlist,0,size);
-        list = newlist;
-    }
-
-    /**
-     * Resize the list. Insure that the new length will be at
-     * least equal to <var>length</var>.
-     * @param length new minimal length requested.
-     * Any call to this method must be protected by a synchronized
-     * block on this LongList.
-     **/
-    private final void ensure(int length) {
-        if (list.length < length) {
-            final int min = list.length+DELTA;
-            length=(length<min)?min:length;
-            final long[] newlist = allocate(length);
-            java.lang.System.arraycopy(list,0,newlist,0,size);
-            list = newlist;
-        }
-    }
-
-    /**
-     * Allocate a new array of object of specified length.
-     **/
-    private final long[] allocate(final int length) {
-        return new long[length];
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpEntryOid.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.agent;
-
-import com.sun.jmx.snmp.SnmpOid;
-
-/**
- * This class only adds a new constructor to SnmpOid...
- *
- **/
-class SnmpEntryOid extends SnmpOid {
-    private static final long serialVersionUID = 9212653887791059564L;
-
-    /**
-     * Constructs a new <CODE>SnmpOid</CODE> from the specified
-     * component array, starting at given position.
-     *
-     * @param oid   The original OID array
-     * @param start The position at which to begin.
-     *
-     **/
-    public SnmpEntryOid(long[] oid, int start) {
-        final int subLength = oid.length - start;
-        final long[] subOid = new long[subLength];
-        java.lang.System.arraycopy(oid, start, subOid, 0, subLength) ;
-        components = subOid;
-        componentCount = subLength;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,214 +0,0 @@
-/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.agent;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.logging.Level;
-
-import javax.management.ObjectName;
-import javax.management.MBeanServer;
-
-import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpVarBind;
-
-/**
- * A simple MIB agent that implements SNMP calls (get, set, getnext and getbulk) in a way that only errors or exceptions are returned. Every call done on this agent fails. Error handling is done according to the manager's SNMP protocol version.
- * <P>It is used by <CODE>SnmpAdaptorServer</CODE> for its default agent behavior. When a received Oid doesn't match, this agent is called to fill the result list with errors.</P>
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- *
- */
-
-public class SnmpErrorHandlerAgent extends SnmpMibAgent
-        implements Serializable {
-    private static final long serialVersionUID = 7751082923508885650L;
-
-    public SnmpErrorHandlerAgent() {}
-
-    /**
-     * Initializes the MIB (with no registration of the MBeans into the
-     * MBean server). Does nothing.
-     *
-     * @exception IllegalAccessException The MIB cannot be initialized.
-     */
-
-    @Override
-    public void init() throws IllegalAccessException {
-    }
-
-    /**
-     * Initializes the MIB but each single MBean representing the MIB
-     * is inserted into the MBean server.
-     *
-     * @param server The MBean server to register the service with.
-     * @param name The object name.
-     *
-     * @return The passed name parameter.
-     *
-     * @exception java.lang.Exception
-     */
-
-    @Override
-    public ObjectName preRegister(MBeanServer server, ObjectName name)
-        throws Exception {
-        return name;
-    }
-
-    /**
-     * Gets the root object identifier of the MIB.
-     * <P>The root object identifier is the object identifier uniquely
-     * identifying the MIB.
-     *
-     * @return The returned oid is null.
-     */
-
-    @Override
-    public long[] getRootOid() {
-        return null;
-    }
-
-    /**
-     * Processes a <CODE>get</CODE> operation. It will throw an exception for V1 requests or it will set exceptions within the list for V2 requests.
-     *
-     * @param inRequest The SnmpMibRequest object holding the list of variable to be retrieved.
-     *
-     * @exception SnmpStatusException An error occurred during the operation.
-     */
-
-    @Override
-    public void get(SnmpMibRequest inRequest) throws SnmpStatusException {
-
-        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                SnmpErrorHandlerAgent.class.getName(),
-                "get", "Get in Exception");
-
-        if(inRequest.getVersion() == SnmpDefinitions.snmpVersionOne)
-            throw new SnmpStatusException(SnmpStatusException.noSuchName);
-
-        Enumeration<SnmpVarBind> l = inRequest.getElements();
-        while(l.hasMoreElements()) {
-            SnmpVarBind varbind = l.nextElement();
-            varbind.setNoSuchObject();
-        }
-    }
-
-    /**
-     * Checks if a <CODE>set</CODE> operation can be performed.
-     * If the operation can not be performed, the method should emit a
-     * <CODE>SnmpStatusException</CODE>.
-     *
-     * @param inRequest The SnmpMibRequest object holding the list of variables to
-     *            be set. This list is composed of
-     *            <CODE>SnmpVarBind</CODE> objects.
-     *
-     * @exception SnmpStatusException The <CODE>set</CODE> operation
-     *    cannot be performed.
-     */
-
-    @Override
-    public void check(SnmpMibRequest inRequest) throws SnmpStatusException {
-
-        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                SnmpErrorHandlerAgent.class.getName(),
-                "check", "Check in Exception");
-
-        throw new SnmpStatusException(SnmpDefinitions.snmpRspNotWritable);
-    }
-
-    /**
-     * Processes a <CODE>set</CODE> operation. Should never be called (check previously called having failed).
-     *
-     * @param inRequest The SnmpMibRequest object holding the list of variable to be set.
-     *
-     * @exception SnmpStatusException An error occurred during the operation.
-     */
-
-    @Override
-    public void set(SnmpMibRequest inRequest) throws SnmpStatusException {
-
-        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                SnmpErrorHandlerAgent.class.getName(),
-                "set", "Set in Exception, CANNOT be called");
-
-        throw new SnmpStatusException(SnmpDefinitions.snmpRspNotWritable);
-    }
-
-    /**
-     * Processes a <CODE>getNext</CODE> operation. It will throw an exception for V1 requests or it will set exceptions within the list for V2 requests..
-     *
-     * @param inRequest The SnmpMibRequest object holding the list of variables to be retrieved.
-     *
-     * @exception SnmpStatusException An error occurred during the operation.
-     */
-
-    @Override
-    public void getNext(SnmpMibRequest inRequest) throws SnmpStatusException {
-
-        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                SnmpErrorHandlerAgent.class.getName(),
-                "getNext", "GetNext in Exception");
-
-        if(inRequest.getVersion() == SnmpDefinitions.snmpVersionOne)
-            throw new SnmpStatusException(SnmpStatusException.noSuchName);
-
-        Enumeration<SnmpVarBind> l = inRequest.getElements();
-        while(l.hasMoreElements()) {
-            SnmpVarBind varbind = l.nextElement();
-            varbind.setEndOfMibView();
-        }
-    }
-
-    /**
-     * Processes a <CODE>getBulk</CODE> operation. It will throw an exception if the request is a V1 one or it will set exceptions within the list for V2 ones.
-     *
-     * @param inRequest The SnmpMibRequest object holding the list of variable to be retrieved.
-     *
-     * @exception SnmpStatusException An error occurred during the operation.
-     */
-
-    @Override
-    public void getBulk(SnmpMibRequest inRequest, int nonRepeat, int maxRepeat)
-        throws SnmpStatusException {
-
-        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                SnmpErrorHandlerAgent.class.getName(),
-                "getBulk", "GetBulk in Exception");
-
-        if(inRequest.getVersion() == SnmpDefinitions.snmpVersionOne)
-            throw new SnmpStatusException(SnmpDefinitions.snmpRspGenErr, 0);
-
-        Enumeration<SnmpVarBind> l = inRequest.getElements();
-        while(l.hasMoreElements()) {
-            SnmpVarBind varbind = l.nextElement();
-            varbind.setEndOfMibView();
-        }
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpGenericMetaServer.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.agent;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * <p>
- * This interface defines the methods that must be implemented by an
- * SNMP metadata object that needs to interact with an
- * {@link com.sun.jmx.snmp.agent.SnmpGenericObjectServer} object.
- * </p>
- *
- * <p>
- * All these methods are usually generated by <code>mibgen</code> when
- * run in generic-metadata mode.
- * </p>
- *
- * <p><b><i>
- * This interface is used internally between the generated Metadata and
- * the SNMP runtime and you shouldn't need to worry about it, because
- * you will never have to use it directly.
- * </b></i></p>
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- **/
-public interface SnmpGenericMetaServer {
-
-    /**
-     * Construct an attribute value (as returned by Attribute::getValue())
-     * from an SnmpValue. The returned attribute value can be used to
-     * construct an Attribute object.
-     *
-     * @param id The OID arc identifying the variable for which the
-     *           value is constructed.
-     * @param value The SnmpValue from which the Attribute::value will be
-     *              constructed.
-     * @return The attribute value built from the given <code>value</code>.
-     * @exception SnmpStatusException if the attribute value cannot be built
-     *            from the given SnmpValue <code>value</code>.
-     *
-     */
-    Object buildAttributeValue(long id, SnmpValue value)
-        throws SnmpStatusException;
-
-    /**
-     * Construct an SnmpValue from an Attribute value as returned by
-     * Attribute::getValue().
-     *
-     * @param id The OID arc identifying the variable for which the
-     *           value is constructed.
-     * @param value The attribute value as returned by Attribute::getValue().
-     *
-     * @return The SnmpValue built from the given <code>value</code>.
-     * @exception SnmpStatusException if the SnmpValue cannot be built from
-     *            the given <code>value</code>.
-     **/
-    SnmpValue buildSnmpValue(long id, Object value)
-        throws SnmpStatusException;
-
-    /**
-     * Return the name of the attribute corresponding to the
-     * SNMP variable identified by the given <code>id</code>.
-     *
-     * @param id The OID arc identifying the variable.
-     *
-     * @return The name of the variable identified by the given
-     *         <code>id</code>.
-     *
-     * @exception SnmpStatusException if the given <code>id</code> does not
-     *            correspond to a known variable.
-     */
-    String getAttributeName(long id)
-        throws SnmpStatusException;
-
-    /**
-     * Check the access rights for a SET operation.
-     *
-     * @param x  The new requested value.
-     * @param id The OID arc identifying the variable for which the SET is
-     *           requested.
-     * @param data A contextual object containing user-data.
-     *           This object is allocated through the <code>
-     *           {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *           for each incoming SNMP request.
-     * @exception SnmpStatusException if the SET operation must be rejected.
-     */
-    void checkSetAccess(SnmpValue x, long id, Object data)
-        throws SnmpStatusException;
-
-    /**
-     * Check the access rights for a GET operation.
-     *
-     * @param id The OID arc identifying the variable for which the SET is
-     *           requested.
-     * @param data A contextual object containing user-data.
-     *           This object is allocated through the <code>
-     *           {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *           for each incoming SNMP request.
-     * @exception SnmpStatusException if the SET operation must be rejected.
-     */
-    void checkGetAccess(long id, Object data)
-        throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpGenericObjectServer.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,572 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.agent;
-
-
-// java imports
-//
-import java.util.Enumeration;
-import java.util.Iterator;
-
-// jmx imports
-//
-import javax.management.AttributeList;
-import javax.management.Attribute;
-import javax.management.MBeanException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import javax.management.InstanceNotFoundException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.MBeanRegistrationException;
-import javax.management.NotCompliantMBeanException;
-import javax.management.RuntimeOperationsException;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-
-/**
- * <p>
- * This class is a utility class that transforms SNMP GET / SET requests
- * into standard JMX getAttributes() setAttributes() requests.
- * </p>
- *
- * <p>
- * The transformation relies on the metadata information provided by the
- * {@link com.sun.jmx.snmp.agent.SnmpGenericMetaServer} object which is
- * passed as the first parameter to every method. This SnmpGenericMetaServer
- * object is usually a Metadata object generated by <code>mibgen</code>.
- * </p>
- *
- * <p><b><i>
- * This class is used internally by mibgen generated metadata objects and
- * you should never need to use it directly.
- * </b></i></p>
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- **/
-
-public class SnmpGenericObjectServer {
-
-    // ----------------------------------------------------------------------
-    //
-    //    Protected variables
-    //
-    // ----------------------------------------------------------------------
-
-    /**
-     * The MBean server through which the MBeans will be accessed.
-     **/
-    protected final MBeanServer server;
-
-    // ----------------------------------------------------------------------
-    //
-    // Constructors
-    //
-    // ----------------------------------------------------------------------
-
-    /**
-     * Builds a new SnmpGenericObjectServer. Usually there will be a single
-     * object of this type per MIB.
-     *
-     * @param server The MBeanServer in which the MBean accessed by this
-     *               MIB are registered.
-     **/
-    public SnmpGenericObjectServer(MBeanServer server) {
-        this.server = server;
-    }
-
-    /**
-     * Execute an SNMP GET request.
-     *
-     * <p>
-     * This method first builds the list of attributes that need to be
-     * retrieved from the MBean and then calls getAttributes() on the
-     * MBean server. Then it updates the SnmpMibSubRequest with the values
-     * retrieved from the MBean.
-     * </p>
-     *
-     * <p>
-     * The SNMP metadata information is obtained through the given
-     * <code>meta</code> object, which usually is an instance of a
-     * <code>mibgen</code> generated class.
-     * </p>
-     *
-     * <p><b><i>
-     * This method is called internally by <code>mibgen</code> generated
-     * objects and you should never need to call it directly.
-     * </i></b></p>
-     *
-     * @param meta  The metadata object impacted by the subrequest
-     * @param name  The ObjectName of the MBean impacted by this subrequest
-     * @param req   The SNMP subrequest to execute on the MBean
-     * @param depth The depth of the SNMP object in the OID tree.
-     *
-     * @exception SnmpStatusException whenever an SNMP exception must be
-     *      raised. Raising an exception will abort the request.<br>
-     *      Exceptions should never be raised directly, but only by means of
-     * <code>
-     * req.registerGetException(<i>VariableId</i>,<i>SnmpStatusException</i>)
-     * </code>
-     **/
-    public void get(SnmpGenericMetaServer meta, ObjectName name,
-                    SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-
-        // java.lang.System.out.println(">>>>>>>>> GET " + name);
-
-        final int           size     = req.getSize();
-        final Object        data     = req.getUserData();
-        final String[]      nameList = new String[size];
-        final SnmpVarBind[] varList  = new SnmpVarBind[size];
-        final long[]        idList   = new long[size];
-        int   i = 0;
-
-        for (Enumeration<SnmpVarBind> e=req.getElements(); e.hasMoreElements();) {
-            final SnmpVarBind var= e.nextElement();
-            try {
-                final long id = var.oid.getOidArc(depth);
-                nameList[i]   = meta.getAttributeName(id);
-                varList[i]    = var;
-                idList[i]     = id;
-
-                // Check the access rights according to the MIB.
-                // The MBean might be less restrictive (have a getter
-                // while the MIB defines the variable as AFN)
-                //
-                meta.checkGetAccess(id,data);
-
-                //java.lang.System.out.println(nameList[i] + " added.");
-                i++;
-            } catch(SnmpStatusException x) {
-                //java.lang.System.out.println("exception for " + nameList[i]);
-                //x.printStackTrace();
-                req.registerGetException(var,x);
-            }
-        }
-
-        AttributeList result = null;
-        int errorCode = SnmpStatusException.noSuchInstance;
-
-        try {
-            result = server.getAttributes(name,nameList);
-        } catch (InstanceNotFoundException f) {
-            //java.lang.System.out.println(name + ": instance not found.");
-            //f.printStackTrace();
-            result = new AttributeList();
-        } catch (ReflectionException r) {
-            //java.lang.System.out.println(name + ": reflexion error.");
-            //r.printStackTrace();
-            result = new AttributeList();
-        } catch (Exception x) {
-            result = new AttributeList();
-        }
-
-
-        final Iterator<?> it = result.iterator();
-
-        for (int j=0; j < i; j++) {
-            if (!it.hasNext()) {
-                //java.lang.System.out.println(name + "variable[" + j +
-                //                           "] absent");
-                final SnmpStatusException x =
-                    new SnmpStatusException(errorCode);
-                req.registerGetException(varList[j],x);
-                continue;
-            }
-
-            final Attribute att = (Attribute) it.next();
-
-            while ((j < i) && (! nameList[j].equals(att.getName()))) {
-                //java.lang.System.out.println(name + "variable[" +j +
-                //                           "] not found");
-                final SnmpStatusException x =
-                    new SnmpStatusException(errorCode);
-                req.registerGetException(varList[j],x);
-                j++;
-            }
-
-            if ( j == i) break;
-
-            try {
-                varList[j].value =
-                    meta.buildSnmpValue(idList[j],att.getValue());
-            } catch (SnmpStatusException x) {
-                req.registerGetException(varList[j],x);
-            }
-            //java.lang.System.out.println(att.getName() + " retrieved.");
-        }
-        //java.lang.System.out.println(">>>>>>>>> END GET");
-    }
-
-    /**
-     * Get the value of an SNMP variable.
-     *
-     * <p><b><i>
-     * You should never need to use this method directly.
-     * </i></b></p>
-     *
-     * @param meta  The impacted metadata object
-     * @param name  The ObjectName of the impacted MBean
-     * @param id    The OID arc identifying the variable we're trying to set.
-     * @param data  User contextual data allocated through the
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}
-     *
-     * @return The value of the variable.
-     *
-     * @exception SnmpStatusException whenever an SNMP exception must be
-     *      raised. Raising an exception will abort the request. <br>
-     *      Exceptions should never be raised directly, but only by means of
-     * <code>
-     * req.registerGetException(<i>VariableId</i>,<i>SnmpStatusException</i>)
-     * </code>
-     **/
-    public SnmpValue get(SnmpGenericMetaServer meta, ObjectName name,
-                         long id, Object data)
-        throws SnmpStatusException {
-        final String attname = meta.getAttributeName(id);
-        Object result = null;
-
-        try {
-            result = server.getAttribute(name,attname);
-        } catch (MBeanException m) {
-            Exception t = m.getTargetException();
-            if (t instanceof SnmpStatusException)
-                throw (SnmpStatusException) t;
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        } catch (Exception e) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        return meta.buildSnmpValue(id,result);
-    }
-
-    /**
-     * Execute an SNMP SET request.
-     *
-     * <p>
-     * This method first builds the list of attributes that need to be
-     * set on the MBean and then calls setAttributes() on the
-     * MBean server. Then it updates the SnmpMibSubRequest with the new
-     * values retrieved from the MBean.
-     * </p>
-     *
-     * <p>
-     * The SNMP metadata information is obtained through the given
-     * <code>meta</code> object, which usually is an instance of a
-     * <code>mibgen</code> generated class.
-     * </p>
-     *
-     * <p><b><i>
-     * This method is called internally by <code>mibgen</code> generated
-     * objects and you should never need to call it directly.
-     * </i></b></p>
-     *
-     * @param meta  The metadata object impacted by the subrequest
-     * @param name  The ObjectName of the MBean impacted by this subrequest
-     * @param req   The SNMP subrequest to execute on the MBean
-     * @param depth The depth of the SNMP object in the OID tree.
-     *
-     * @exception SnmpStatusException whenever an SNMP exception must be
-     *      raised. Raising an exception will abort the request. <br>
-     *      Exceptions should never be raised directly, but only by means of
-     * <code>
-     * req.registerGetException(<i>VariableId</i>,<i>SnmpStatusException</i>)
-     * </code>
-     **/
-    public void set(SnmpGenericMetaServer meta, ObjectName name,
-                    SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-
-        final int size               = req.getSize();
-        final AttributeList attList  = new AttributeList(size);
-        final String[]      nameList = new String[size];
-        final SnmpVarBind[] varList  = new SnmpVarBind[size];
-        final long[]        idList   = new long[size];
-        int   i = 0;
-
-        for (Enumeration<SnmpVarBind> e=req.getElements(); e.hasMoreElements();) {
-            final SnmpVarBind var= e.nextElement();
-            try {
-                final long id = var.oid.getOidArc(depth);
-                final String attname = meta.getAttributeName(id);
-                final Object attvalue=
-                    meta.buildAttributeValue(id,var.value);
-                final Attribute att = new Attribute(attname,attvalue);
-                attList.add(att);
-                nameList[i]   = attname;
-                varList[i]    = var;
-                idList[i]     = id;
-                i++;
-            } catch(SnmpStatusException x) {
-                req.registerSetException(var,x);
-            }
-        }
-
-        AttributeList result;
-        int errorCode = SnmpStatusException.noAccess;
-
-        try {
-            result = server.setAttributes(name,attList);
-        } catch (InstanceNotFoundException f) {
-            result = new AttributeList();
-            errorCode = SnmpStatusException.snmpRspInconsistentName;
-        } catch (ReflectionException r) {
-            errorCode = SnmpStatusException.snmpRspInconsistentName;
-            result = new AttributeList();
-        } catch (Exception x) {
-            result = new AttributeList();
-        }
-
-        final Iterator<?> it = result.iterator();
-
-        for (int j=0; j < i; j++) {
-            if (!it.hasNext()) {
-                final SnmpStatusException x =
-                    new SnmpStatusException(errorCode);
-                req.registerSetException(varList[j],x);
-                continue;
-            }
-
-            final Attribute att = (Attribute) it.next();
-
-            while ((j < i) && (! nameList[j].equals(att.getName()))) {
-                final SnmpStatusException x =
-                    new SnmpStatusException(SnmpStatusException.noAccess);
-                req.registerSetException(varList[j],x);
-                j++;
-            }
-
-            if ( j == i) break;
-
-            try {
-                varList[j].value =
-                    meta.buildSnmpValue(idList[j],att.getValue());
-            } catch (SnmpStatusException x) {
-                req.registerSetException(varList[j],x);
-            }
-
-        }
-    }
-
-    /**
-     * Set the value of an SNMP variable.
-     *
-     * <p><b><i>
-     * You should never need to use this method directly.
-     * </i></b></p>
-     *
-     * @param meta  The impacted metadata object
-     * @param name  The ObjectName of the impacted MBean
-     * @param x     The new requested SnmpValue
-     * @param id    The OID arc identifying the variable we're trying to set.
-     * @param data  User contextual data allocated through the
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}
-     *
-     * @return The new value of the variable after the operation.
-     *
-     * @exception SnmpStatusException whenever an SNMP exception must be
-     *      raised. Raising an exception will abort the request. <br>
-     *      Exceptions should never be raised directly, but only by means of
-     * <code>
-     * req.registerSetException(<i>VariableId</i>,<i>SnmpStatusException</i>)
-     * </code>
-     **/
-    public SnmpValue set(SnmpGenericMetaServer meta, ObjectName name,
-                         SnmpValue x, long id, Object data)
-        throws SnmpStatusException {
-        final String attname = meta.getAttributeName(id);
-        final Object attvalue=
-            meta.buildAttributeValue(id,x);
-        final Attribute att = new Attribute(attname,attvalue);
-
-        Object result = null;
-
-        try {
-            server.setAttribute(name,att);
-            result = server.getAttribute(name,attname);
-        } catch(InvalidAttributeValueException iv) {
-            throw new
-                SnmpStatusException(SnmpStatusException.snmpRspWrongValue);
-        } catch (InstanceNotFoundException f) {
-            throw new
-                SnmpStatusException(SnmpStatusException.snmpRspInconsistentName);
-        } catch (ReflectionException r) {
-            throw new
-                SnmpStatusException(SnmpStatusException.snmpRspInconsistentName);
-        } catch (MBeanException m) {
-            Exception t = m.getTargetException();
-            if (t instanceof SnmpStatusException)
-                throw (SnmpStatusException) t;
-            throw new
-                SnmpStatusException(SnmpStatusException.noAccess);
-        } catch (Exception e) {
-            throw new
-                SnmpStatusException(SnmpStatusException.noAccess);
-        }
-
-        return meta.buildSnmpValue(id,result);
-    }
-
-    /**
-     * Checks whether an SNMP SET request can be successfully performed.
-     *
-     * <p>
-     * For each variable in the subrequest, this method calls
-     * checkSetAccess() on the meta object, and then tries to invoke the
-     * check<i>AttributeName</i>() method on the MBean. If this method
-     * is not defined then it is assumed that the SET won't fail.
-     * </p>
-     *
-     * <p><b><i>
-     * This method is called internally by <code>mibgen</code> generated
-     * objects and you should never need to call it directly.
-     * </i></b></p>
-     *
-     * @param meta  The metadata object impacted by the subrequest
-     * @param name  The ObjectName of the MBean impacted by this subrequest
-     * @param req   The SNMP subrequest to execute on the MBean
-     * @param depth The depth of the SNMP object in the OID tree.
-     *
-     * @exception SnmpStatusException if the requested SET operation must
-     *      be rejected. Raising an exception will abort the request. <br>
-     *      Exceptions should never be raised directly, but only by means of
-     * <code>
-     * req.registerCheckException(<i>VariableId</i>,<i>SnmpStatusException</i>)
-     * </code>
-     *
-     **/
-    public void check(SnmpGenericMetaServer meta, ObjectName name,
-                      SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-
-        final Object data = req.getUserData();
-
-        for (Enumeration<SnmpVarBind> e=req.getElements(); e.hasMoreElements();) {
-            final SnmpVarBind var= e.nextElement();
-            try {
-                final long id = var.oid.getOidArc(depth);
-                // call meta.check() here, and meta.check will call check()
-                check(meta,name,var.value,id,data);
-            } catch(SnmpStatusException x) {
-                req.registerCheckException(var,x);
-            }
-        }
-    }
-
-    /**
-     * Checks whether a SET operation can be performed on a given SNMP
-     * variable.
-     *
-     * @param meta  The impacted metadata object
-     * @param name  The ObjectName of the impacted MBean
-     * @param x     The new requested SnmpValue
-     * @param id    The OID arc identifying the variable we're trying to set.
-     * @param data  User contextual data allocated through the
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}
-     *
-     * <p>
-     * This method calls checkSetAccess() on the meta object, and then
-     * tries to invoke the check<i>AttributeName</i>() method on the MBean.
-     * If this method is not defined then it is assumed that the SET
-     * won't fail.
-     * </p>
-     *
-     * <p><b><i>
-     * This method is called internally by <code>mibgen</code> generated
-     * objects and you should never need to call it directly.
-     * </i></b></p>
-     *
-     * @exception SnmpStatusException if the requested SET operation must
-     *      be rejected. Raising an exception will abort the request. <br>
-     *      Exceptions should never be raised directly, but only by means of
-     * <code>
-     * req.registerCheckException(<i>VariableId</i>,<i>SnmpStatusException</i>)
-     * </code>
-     *
-     **/
-    // XXX xxx ZZZ zzz Maybe we should go through the MBeanInfo here?
-    public void check(SnmpGenericMetaServer meta, ObjectName name,
-                      SnmpValue x, long id, Object data)
-        throws SnmpStatusException {
-
-        meta.checkSetAccess(x,id,data);
-        try {
-            final String attname = meta.getAttributeName(id);
-            final Object attvalue= meta.buildAttributeValue(id,x);
-            final  Object[] params = new Object[1];
-            final  String[] signature = new String[1];
-
-            params[0]    = attvalue;
-            signature[0] = attvalue.getClass().getName();
-            server.invoke(name,"check"+attname,params,signature);
-
-        } catch( SnmpStatusException e) {
-            throw e;
-        }
-        catch (InstanceNotFoundException i) {
-            throw new
-                SnmpStatusException(SnmpStatusException.snmpRspInconsistentName);
-        } catch (ReflectionException r) {
-            // checkXXXX() not defined => do nothing
-        } catch (MBeanException m) {
-            Exception t = m.getTargetException();
-            if (t instanceof SnmpStatusException)
-                throw (SnmpStatusException) t;
-            throw new SnmpStatusException(SnmpStatusException.noAccess);
-        } catch (Exception e) {
-            throw new
-                SnmpStatusException(SnmpStatusException.noAccess);
-        }
-    }
-
-    public void registerTableEntry(SnmpMibTable meta, SnmpOid rowOid,
-                                   ObjectName objname, Object entry)
-        throws SnmpStatusException {
-        if (objname == null)
-           throw new
-             SnmpStatusException(SnmpStatusException.snmpRspInconsistentName);
-        try  {
-            if (entry != null && !server.isRegistered(objname))
-                server.registerMBean(entry, objname);
-        } catch (InstanceAlreadyExistsException e) {
-            throw new
-              SnmpStatusException(SnmpStatusException.snmpRspInconsistentName);
-        } catch (MBeanRegistrationException e) {
-            throw new SnmpStatusException(SnmpStatusException.snmpRspNoAccess);
-        } catch (NotCompliantMBeanException e) {
-            throw new SnmpStatusException(SnmpStatusException.snmpRspGenErr);
-        } catch (RuntimeOperationsException e) {
-            throw new SnmpStatusException(SnmpStatusException.snmpRspGenErr);
-        } catch(Exception e) {
-            throw new SnmpStatusException(SnmpStatusException.snmpRspGenErr);
-        }
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpIndex.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.agent;
-
-
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Vector;
-import java.util.Enumeration;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpOid;
-
-/**
- * Represents a SNMP index.
- * An <CODE>SnmpIndex</CODE> is represented as a <CODE>Vector</CODE> of <CODE>SnmpOid</CODE>.
- * <P>
- * This class is used internally and by the classes generated by <CODE>mibgen</CODE>.
- * You should not need to use this class directly.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpIndex implements Serializable {
-    private static final long serialVersionUID = 8712159739982192146L;
-
-    /**
-     * Initializes an <CODE>SnmpIndex</CODE> using a vector of object identifiers.
-     * <P>Following the RFC recommendations, every syntax that is used as a
-     * table index should have an object identifier representation. There are
-     * some guidelines on how to map the different syntaxes into an object identifier.
-     * In the different <CODE>SnmpValue</CODE> classes provided, there is a <CODE>toOid</CODE> method to get
-     * the object identifier of the value.
-     *
-     * @param oidList The list of Object Identifiers.
-     */
-    public SnmpIndex(SnmpOid[] oidList) {
-        size= oidList.length;
-        for(int i= 0; i <size; i++) {
-            // The order is important ...
-            //
-            oids.addElement(oidList[i]);
-        }
-    }
-
-    /**
-     * Initializes an <CODE>SnmpIndex</CODE> using the specified Object Identifier.
-     *
-     * @param oid The Object Identifier.
-     */
-    public SnmpIndex(SnmpOid oid) {
-        oids.addElement(oid);
-        size= 1;
-    }
-
-    /**
-     * Gets the number of Object Identifiers the index is made of.
-     *
-     * @return The number of Object Identifiers.
-     */
-    public int getNbComponents() {
-        return size;
-    }
-
-    /**
-     * Gets the index as a vector of Object Identifiers.
-     *
-     * @return The index as a vector.
-     */
-    public Vector<SnmpOid> getComponents() {
-        return oids;
-    }
-
-    /**
-     * Compares two indexes for equality.
-     *
-     * @param index The index to compare <CODE>this</CODE> with.
-     *
-     * @return <CODE>true</CODE> if the two indexes are equal, <CODE>false</CODE> otherwise.
-     */
-    public boolean equals(SnmpIndex index) {
-
-        if (size != index.getNbComponents())
-            return false;
-
-        // The two vectors have the same length.
-        // Compare each single element ...
-        //
-        SnmpOid oid1;
-        SnmpOid oid2;
-        Vector<SnmpOid> components= index.getComponents();
-        for(int i=0; i <size; i++) {
-            oid1= oids.elementAt(i);
-            oid2= components.elementAt(i);
-            if (oid1.equals(oid2) == false)
-                return false;
-        }
-        return true;
-    }
-
-    /**
-     * Compares two indexes.
-     *
-     * @param index The index to compare <CODE>this</CODE> with.
-     *
-     * @return The value 0 if the two OID vectors have the same elements, another value otherwise.
-     */
-    public int compareTo(SnmpIndex index) {
-
-        int length= index.getNbComponents();
-        Vector<SnmpOid> components= index.getComponents();
-        SnmpOid oid1;
-        SnmpOid oid2;
-        int comp;
-        for(int i=0; i < size; i++) {
-            if ( i > length) {
-                // There is no more element in the index
-                //
-                return 1;
-            }
-            // Access the element ...
-            //
-            oid1= oids.elementAt(i);
-            oid2= components.elementAt(i);
-            comp= oid1.compareTo(oid2);
-            if (comp == 0)
-                continue;
-            return comp;
-        }
-        return 0;
-    }
-
-    /**
-     * Returns a <CODE>String</CODE> representation of the index.
-     * The different elements are separated by "//".
-     *
-     * @return A string representation of the index.
-     */
-    @Override
-    public String toString() {
-        final StringBuilder msg= new StringBuilder();
-        for(Enumeration<SnmpOid> e= oids.elements(); e.hasMoreElements(); ) {
-            SnmpOid val= e.nextElement();
-            msg.append("//").append( val.toString());
-        }
-        return msg.toString();
-    }
-
-    // PRIVATE VARIABLES
-    //------------------
-
-    /**
-     * The list of OIDs.
-     * @serial
-     */
-    private Vector<SnmpOid> oids = new Vector<>();
-
-    /**
-     * The number of elements in the index.
-     * @serial
-     */
-    private int size = 0;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,738 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.agent;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.logging.Level;
-import java.util.Vector;
-
-import javax.management.ObjectName;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.MBeanRegistrationException;
-import javax.management.NotCompliantMBeanException;
-
-import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * Abstract class for representing an SNMP MIB.
- * <P>
- * When compiling a SNMP MIB, among all the classes generated by
- * <CODE>mibgen</CODE>, there is one which extends <CODE>SnmpMib</CODE>
- * for representing a whole MIB.
- * <BR>The class is used by the SNMP protocol adaptor as the entry point in
- * the MIB.
- *
- * <p>This generated class can be subclassed in your code in order to
- * plug in your own specific behaviour.
- * </p>
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-@SuppressWarnings("serial") // JDK implementation class
-public abstract class SnmpMib extends SnmpMibAgent implements Serializable {
-
-    /**
-     * Default constructor.
-     * Initializes the OID tree.
-     */
-    public SnmpMib() {
-        root= new SnmpMibOid();
-    }
-
-
-    // --------------------------------------------------------------------
-    // POLYMORHIC METHODS
-    // --------------------------------------------------------------------
-
-    /**
-     * <p>
-     * This callback should return the OID associated to the group
-     * identified by the given <code>groupName</code>.
-     * </p>
-     *
-     * <p>
-     * This method is provided as a hook to plug-in some custom
-     * specific behavior. Although doing so is discouraged you might
-     * want to subclass this method in order to store & provide more metadata
-     * information (mapping OID <-> symbolic name) within the agent,
-     * or to "change" the root of the MIB OID by prefixing the
-     * defaultOid by an application dependant OID string, for instance.
-     * </p>
-     *
-     * <p>
-     * The default implementation of this method is to return the given
-     * <code>defaultOid</code>
-     * </p>
-     *
-     * @param groupName   The java-ized name of the SNMP group.
-     * @param defaultOid  The OID defined in the MIB for that group
-     *                    (in dot notation).
-     *
-     * @return The OID of the group identified by <code>groupName</code>,
-     *         in dot-notation.
-     */
-    protected String getGroupOid(String groupName, String defaultOid) {
-        return defaultOid;
-    }
-
-    /**
-     * <p>
-     * This callback should return the ObjectName associated to the
-     * group identified by the given <code>groupName</code>.
-     * </p>
-     *
-     * <p>
-     * This method is provided as a hook to plug-in some custom
-     * specific behavior. You might want to override this method
-     * in order to provide a different object naming scheme than
-     * that proposed by default by <code>mibgen</code>.
-     * </p>
-     *
-     * <p>
-     * This method is only meaningful if the MIB is registered
-     * in the MBeanServer, otherwise, it will not be called.
-     * </p>
-     *
-     * <p>
-     * The default implementation of this method is to return an ObjectName
-     * built from the given <code>defaultName</code>.
-     * </p>
-     *
-     * @param name  The java-ized name of the SNMP group.
-     * @param oid   The OID returned by getGroupOid() - in dot notation.
-     * @param defaultName The name by default generated by <code>
-     *                    mibgen</code>
-     *
-     * @return The ObjectName of the group identified by <code>name</code>
-     */
-    protected ObjectName getGroupObjectName(String name, String oid,
-                                            String defaultName)
-        throws MalformedObjectNameException {
-        return new ObjectName(defaultName);
-    }
-
-    /**
-     * <p>
-     * Register an SNMP group and its metadata node in the MIB.
-     * </p>
-     *
-     * <p>
-     * This method is provided as a hook to plug-in some custom
-     * specific behavior. You might want to override this method
-     * if you want to set special links between the MBean, its metadata
-     * node, its OID or ObjectName etc..
-     * </p>
-     *
-     * <p>
-     * If the MIB is not registered in the MBeanServer, the <code>
-     * server</code> and <code>groupObjName</code> parameters will be
-     * <code>null</code>.<br>
-     * If the given group MBean is not <code>null</code>, and if the
-     * <code>server</code> and <code>groupObjName</code> parameters are
-     * not null, then this method will also automatically register the
-     * group MBean with the given MBeanServer <code>server</code>.
-     * </p>
-     *
-     * @param groupName  The java-ized name of the SNMP group.
-     * @param groupOid   The OID as returned by getGroupOid() - in dot
-     *                   notation.
-     * @param groupObjName The ObjectName as returned by getGroupObjectName().
-     *                   This parameter may be <code>null</code> if the
-     *                   MIB is not registered in the MBeanServer.
-     * @param node       The metadata node, as returned by the metadata
-     *                   factory method for this group.
-     * @param group      The MBean for this group, as returned by the
-     *                   MBean factory method for this group.
-     * @param server     The MBeanServer in which the groups are to be
-     *                   registered. This parameter will be <code>null</code>
-     *                   if the MIB is not registered, otherwise it is a
-     *                   reference to the MBeanServer in which the MIB is
-     *                   registered.
-     *
-     */
-    protected void registerGroupNode(String groupName,   String groupOid,
-                                     ObjectName groupObjName, SnmpMibNode node,
-                                     Object group, MBeanServer server)
-        throws NotCompliantMBeanException, MBeanRegistrationException,
-        InstanceAlreadyExistsException, IllegalAccessException {
-        root.registerNode(groupOid,node);
-        if (server != null && groupObjName != null && group != null)
-            server.registerMBean(group,groupObjName);
-    }
-
-    /**
-     * <p>
-     * Register an SNMP Table metadata node in the MIB.
-     * </p>
-     *
-     * <p>
-     * <b><i>
-     * This method is used internally and you should never need to
-     * call it directly.</i></b><br> It is used to establish the link
-     * between an SNMP table metadata node and its bean-like counterpart.
-     * <br>
-     * The group metadata nodes will create and register their
-     * underlying table metadata nodes in the MIB using this
-     * method. <br>
-     * The metadata nodes will be later retrieved from the MIB by the
-     * bean-like table objects using the getRegisterTableMeta() method.
-     * </p>
-     *
-     * @param name      The java-ized name of the SNMP table.
-     * @param table     The SNMP table metadata node - usually this
-     *                  corresponds to a <code>mibgen</code> generated
-     *                  object.
-     */
-    public abstract void registerTableMeta(String name, SnmpMibTable table);
-
-    /**
-     * Returns a registered SNMP Table metadata node.
-     *
-     * <p><b><i>
-     * This method is used internally and you should never need to
-     * call it directly.
-     * </i></b></p>
-     *
-     */
-    public abstract SnmpMibTable getRegisteredTableMeta(String name);
-
-    // --------------------------------------------------------------------
-    // PUBLIC METHODS
-    // --------------------------------------------------------------------
-
-    /**
-     * Processes a <CODE>get</CODE> operation.
-     *
-     **/
-    // Implements the method defined in SnmpMibAgent. See SnmpMibAgent
-    // for java-doc
-    //
-    @Override
-    public void get(SnmpMibRequest req) throws SnmpStatusException {
-
-        // Builds the request tree: creation is not allowed, operation
-        // is not atomic.
-
-        final int reqType = SnmpDefinitions.pduGetRequestPdu;
-        SnmpRequestTree handlers = getHandlers(req,false,false,reqType);
-
-        SnmpRequestTree.Handler h = null;
-        SnmpMibNode meta = null;
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMib.class.getName(),
-                    "get", "Processing handlers for GET... ");
-        }
-
-        // For each sub-request stored in the request-tree, invoke the
-        // get() method.
-        for (Enumeration<SnmpRequestTree.Handler> eh=handlers.getHandlers();eh.hasMoreElements();) {
-            h = eh.nextElement();
-
-            // Gets the Meta node. It can be either a Group Meta or a
-            // Table Meta.
-            //
-            meta = handlers.getMetaNode(h);
-
-            // Gets the depth of the Meta node in the OID tree
-            final int depth = handlers.getOidDepth(h);
-
-            for (Enumeration<SnmpMibSubRequest> rqs=handlers.getSubRequests(h);
-                 rqs.hasMoreElements();) {
-
-                // Invoke the get() operation.
-                meta.get(rqs.nextElement(),depth);
-            }
-        }
-    }
-
-    /**
-     * Processes a <CODE>set</CODE> operation.
-     *
-     */
-    // Implements the method defined in SnmpMibAgent. See SnmpMibAgent
-    // for java-doc
-    //
-    @Override
-    public void set(SnmpMibRequest req) throws SnmpStatusException {
-
-        SnmpRequestTree handlers = null;
-
-        // Optimization: we're going to get the whole SnmpRequestTree
-        // built in the "check" method, so that we don't have to rebuild
-        // it here.
-        //
-        if (req instanceof SnmpMibRequestImpl)
-            handlers = ((SnmpMibRequestImpl)req).getRequestTree();
-
-        // Optimization didn't work: we have to rebuild the tree.
-        //
-        // Builds the request tree: creation is not allowed, operation
-        // is atomic.
-        //
-        final int reqType = SnmpDefinitions.pduSetRequestPdu;
-        if (handlers == null) handlers = getHandlers(req,false,true,reqType);
-        handlers.switchCreationFlag(false);
-        handlers.setPduType(reqType);
-
-        SnmpRequestTree.Handler h;
-        SnmpMibNode meta;
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMib.class.getName(),
-                    "set", "Processing handlers for SET... ");
-        }
-
-        // For each sub-request stored in the request-tree, invoke the
-        // get() method.
-        for (Enumeration<SnmpRequestTree.Handler> eh=handlers.getHandlers();eh.hasMoreElements();) {
-            h = eh.nextElement();
-
-            // Gets the Meta node. It can be either a Group Meta or a
-            // Table Meta.
-            //
-            meta = handlers.getMetaNode(h);
-
-            // Gets the depth of the Meta node in the OID tree
-            final int depth = handlers.getOidDepth(h);
-
-            for (Enumeration<SnmpMibSubRequest> rqs=handlers.getSubRequests(h);
-                 rqs.hasMoreElements();) {
-
-                // Invoke the set() operation
-                meta.set(rqs.nextElement(),depth);
-            }
-        }
-    }
-
-    /**
-     * Checks if a <CODE>set</CODE> operation can be performed.
-     * If the operation cannot be performed, the method will raise a
-     * <CODE>SnmpStatusException</CODE>.
-     *
-     */
-    // Implements the method defined in SnmpMibAgent. See SnmpMibAgent
-    // for java-doc
-    //
-    @Override
-    public void check(SnmpMibRequest req) throws SnmpStatusException {
-
-        final int reqType = SnmpDefinitions.pduWalkRequest;
-        // Builds the request tree: creation is allowed, operation
-        // is atomic.
-        SnmpRequestTree handlers = getHandlers(req,true,true,reqType);
-
-        SnmpRequestTree.Handler h;
-        SnmpMibNode meta;
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMib.class.getName(),
-                    "check", "Processing handlers for CHECK... ");
-        }
-
-        // For each sub-request stored in the request-tree, invoke the
-        // check() method.
-        for (Enumeration<SnmpRequestTree.Handler> eh=handlers.getHandlers();eh.hasMoreElements();) {
-            h = eh.nextElement();
-
-            // Gets the Meta node. It can be either a Group Meta or a
-            // Table Meta.
-            //
-            meta = handlers.getMetaNode(h);
-
-            // Gets the depth of the Meta node in the OID tree
-            final int depth = handlers.getOidDepth(h);
-
-            for (Enumeration<SnmpMibSubRequest> rqs=handlers.getSubRequests(h);
-                 rqs.hasMoreElements();) {
-
-                // Invoke the check() operation
-                meta.check(rqs.nextElement(),depth);
-            }
-        }
-
-        // Optimization: we're going to pass the whole SnmpRequestTree
-        // to the "set" method, so that we don't have to rebuild it there.
-        //
-        if (req instanceof SnmpMibRequestImpl) {
-            ((SnmpMibRequestImpl)req).setRequestTree(handlers);
-        }
-
-    }
-
-    /**
-     * Processes a <CODE>getNext</CODE> operation.
-     *
-     */
-    // Implements the method defined in SnmpMibAgent. See SnmpMibAgent
-    // for java-doc
-    //
-    @Override
-    public void getNext(SnmpMibRequest req) throws SnmpStatusException {
-        // Build the request tree for the operation
-        // The subrequest stored in the request tree are valid GET requests
-        SnmpRequestTree handlers = getGetNextHandlers(req);
-
-        SnmpRequestTree.Handler h;
-        SnmpMibNode meta;
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMib.class.getName(),
-                    "getNext", "Processing handlers for GET-NEXT... ");
-        }
-
-        // Now invoke get() for each subrequest of the request tree.
-        for (Enumeration<SnmpRequestTree.Handler> eh=handlers.getHandlers();eh.hasMoreElements();) {
-            h = eh.nextElement();
-
-            // Gets the Meta node. It can be either a Group Meta or a
-            // Table Meta.
-            //
-            meta = handlers.getMetaNode(h);
-
-            // Gets the depth of the Meta node in the OID tree
-            int depth = handlers.getOidDepth(h);
-
-            for (Enumeration<SnmpMibSubRequest> rqs=handlers.getSubRequests(h);
-                 rqs.hasMoreElements();) {
-
-                // Invoke the get() operation
-                meta.get(rqs.nextElement(),depth);
-            }
-        }
-    }
-
-
-    /**
-     * Processes a <CODE>getBulk</CODE> operation.
-     * The method implements the <CODE>getBulk</CODE> operation by calling
-     * appropriately the <CODE>getNext</CODE> method.
-     *
-     */
-    // Implements the method defined in SnmpMibAgent. See SnmpMibAgent
-    // for java-doc
-    //
-    @Override
-    public void getBulk(SnmpMibRequest req, int nonRepeat, int maxRepeat)
-        throws SnmpStatusException {
-
-        getBulkWithGetNext(req, nonRepeat, maxRepeat);
-    }
-
-    /**
-     * Gets the root object identifier of the MIB.
-     * <P>In order to be accurate, the method should be called once the
-     * MIB is fully initialized (that is, after a call to <CODE>init</CODE>
-     * or <CODE>preRegister</CODE>).
-     *
-     * @return The root object identifier.
-     */
-    @Override
-    public long[] getRootOid() {
-
-        if( rootOid == null) {
-            Vector<Integer> list= new Vector<>(10);
-
-            // Ask the tree to do the job !
-            //
-            root.getRootOid(list);
-
-            // Now format the result
-            //
-            rootOid= new long[list.size()];
-            int i=0;
-            for(Enumeration<Integer> e= list.elements(); e.hasMoreElements(); ) {
-                Integer val= e.nextElement();
-                rootOid[i++]= val.longValue();
-            }
-        }
-        return rootOid.clone();
-    }
-
-    // --------------------------------------------------------------------
-    // PRIVATE METHODS
-    //---------------------------------------------------------------------
-
-    /**
-     * This method builds the temporary request-tree that will be used to
-     * perform the SNMP request associated with the given vector of varbinds
-     * `list'.
-     *
-     * @param req The SnmpMibRequest object holding the varbind list
-     *             concerning this MIB.
-     * @param createflag Indicates whether the operation allow for creation
-     *        of new instances (ie: it is a SET).
-     * @param atomic Indicates whether the operation is atomic or not.
-     * @param type Request type (from SnmpDefinitions).
-     *
-     * @return The request-tree where the original varbind list has been
-     *         dispatched to the appropriate nodes.
-     */
-    private SnmpRequestTree getHandlers(SnmpMibRequest req,
-                                        boolean createflag, boolean atomic,
-                                        int type)
-        throws SnmpStatusException {
-
-        // Build an empty request tree
-        SnmpRequestTree handlers =
-            new SnmpRequestTree(req,createflag,type);
-
-        int index=0;
-        SnmpVarBind var;
-        final int ver= req.getVersion();
-
-        // For each varbind in the list finds its handling node.
-        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements(); index++) {
-
-            var= e.nextElement();
-
-            try {
-                // Find the handling node for this varbind.
-                root.findHandlingNode(var,var.oid.longValue(false),
-                                      0,handlers);
-            } catch(SnmpStatusException x) {
-
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                            SnmpMib.class.getName(),
-                            "getHandlers",
-                            "Couldn't find a handling node for " +
-                            var.oid.toString());
-                }
-
-                // If the operation is atomic (Check/Set) or the version
-                // is V1 we must generate an exception.
-                //
-                if (ver == SnmpDefinitions.snmpVersionOne) {
-
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                                SnmpMib.class.getName(),
-                                "getHandlers", "\tV1: Throwing exception");
-                    }
-
-                    // The index in the exception must correspond to the
-                    // SNMP index ...
-                    //
-                    final SnmpStatusException sse =
-                        new SnmpStatusException(x, index + 1);
-                    sse.initCause(x);
-                    throw sse;
-                } else if ((type == SnmpDefinitions.pduWalkRequest)   ||
-                           (type == SnmpDefinitions.pduSetRequestPdu)) {
-                    final int status =
-                        SnmpRequestTree.mapSetException(x.getStatus(),ver);
-
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                                SnmpMib.class.getName(),
-                                "getHandlers", "\tSET: Throwing exception");
-                    }
-
-                    final SnmpStatusException sse =
-                        new SnmpStatusException(status, index + 1);
-                    sse.initCause(x);
-                    throw sse;
-                } else if (atomic) {
-
-                    // Should never come here...
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                                SnmpMib.class.getName(),
-                                "getHandlers", "\tATOMIC: Throwing exception");
-                    }
-
-                    final SnmpStatusException sse =
-                        new SnmpStatusException(x, index + 1);
-                    sse.initCause(x);
-                    throw sse;
-                }
-
-                final int status =
-                    SnmpRequestTree.mapGetException(x.getStatus(),ver);
-
-                if (status == SnmpStatusException.noSuchInstance) {
-
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                                SnmpMib.class.getName(),
-                                "getHandlers",
-                                "\tGET: Registering noSuchInstance");
-                    }
-
-                    var.value= SnmpVarBind.noSuchInstance;
-
-                } else if (status == SnmpStatusException.noSuchObject) {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                                SnmpMib.class.getName(),
-                                "getHandlers",
-                                "\tGET: Registering noSuchObject");
-                    }
-
-                        var.value= SnmpVarBind.noSuchObject;
-
-                } else {
-
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                                SnmpMib.class.getName(),
-                                "getHandlers",
-                                "\tGET: Registering global error: " + status);
-                    }
-
-                    final SnmpStatusException sse =
-                        new SnmpStatusException(status, index + 1);
-                    sse.initCause(x);
-                    throw sse;
-                }
-            }
-        }
-        return handlers;
-    }
-
-    /**
-     * This method builds the temporary request-tree that will be used to
-     * perform the SNMP GET-NEXT request associated with the given vector
-     * of varbinds `list'.
-     *
-     * @param req The SnmpMibRequest object holding the varbind list
-     *             concerning this MIB.
-     *
-     * @return The request-tree where the original varbind list has been
-     *         dispatched to the appropriate nodes, and where the original
-     *         OIDs have been replaced with the correct "next" OID.
-     */
-    private SnmpRequestTree getGetNextHandlers(SnmpMibRequest req)
-        throws SnmpStatusException {
-
-        // Creates an empty request tree, no entry creation is allowed (false)
-        SnmpRequestTree handlers = new
-            SnmpRequestTree(req,false,SnmpDefinitions.pduGetNextRequestPdu);
-
-        // Sets the getNext flag: if version=V2, status exception are
-        // transformed in  endOfMibView
-        handlers.setGetNextFlag();
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMib.class.getName(),
-                    "getGetNextHandlers", "Received MIB request : " + req);
-        }
-        AcmChecker checker = new AcmChecker(req);
-        int index=0;
-        SnmpVarBind var = null;
-        final int ver= req.getVersion();
-        SnmpOid original = null;
-        // For each varbind, finds the handling node.
-        // This function has the side effect of transforming a GET-NEXT
-        // request into a valid GET request, replacing the OIDs in the
-        // original GET-NEXT request with the OID of the first leaf that
-        // follows.
-        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements(); index++) {
-
-            var = e.nextElement();
-            SnmpOid result;
-            try {
-                // Find the node handling the OID that follows the varbind
-                // OID. `result' contains this next leaf OID.
-                //ACM loop.
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                            SnmpMib.class.getName(),
-                            "getGetNextHandlers", " Next OID of : " + var.oid);
-                }
-                result = new SnmpOid(root.findNextHandlingNode
-                                     (var,var.oid.longValue(false),0,
-                                      0,handlers, checker));
-
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                            SnmpMib.class.getName(),
-                            "getGetNextHandlers", " is : " + result);
-                }
-                // We replace the varbind original OID with the OID of the
-                // leaf object we have to return.
-                var.oid = result;
-            } catch(SnmpStatusException x) {
-
-                // if (isDebugOn())
-                //    debug("getGetNextHandlers",
-                //        "Couldn't find a handling node for "
-                //        + var.oid.toString());
-
-                if (ver == SnmpDefinitions.snmpVersionOne) {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                                SnmpMib.class.getName(),
-                                "getGetNextHandlers",
-                                "\tThrowing exception " + x.toString());
-                    }
-                    // The index in the exception must correspond to the
-                    // SNMP index ...
-                    //
-                    throw new SnmpStatusException(x, index + 1);
-                }
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                            SnmpMib.class.getName(),
-                            "getGetNextHandlers",
-                            "Exception : " + x.getStatus());
-                }
-
-                var.setSnmpValue(SnmpVarBind.endOfMibView);
-            }
-        }
-        return handlers;
-    }
-
-    // --------------------------------------------------------------------
-    // PROTECTED VARIABLES
-    // --------------------------------------------------------------------
-
-    /**
-     * The top element in the Mib tree.
-     * @serial
-     */
-    protected SnmpMibOid root;
-
-
-    // --------------------------------------------------------------------
-    // PRIVATE VARIABLES
-    // --------------------------------------------------------------------
-
-    /**
-     * The root object identifier of the MIB.
-     */
-    private transient long[] rootOid= null;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,768 +0,0 @@
-/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.agent;
-
-
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Vector;
-import java.util.Enumeration;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.MBeanRegistration;
-import javax.management.ObjectName;
-import javax.management.InstanceNotFoundException;
-import javax.management.ServiceNotFoundException;
-import javax.management.ReflectionException;
-import javax.management.MBeanException;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpEngine;
-
-/**
- * Abstract class for representing an SNMP agent.
- *
- * The class is used by the SNMP protocol adaptor as the entry point in
- * the SNMP agent to query.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-@SuppressWarnings("serial") // JDK implementation class
-public abstract class SnmpMibAgent
-    implements SnmpMibAgentMBean, MBeanRegistration, Serializable {
-
-    /**
-     * Default constructor.
-     */
-    public SnmpMibAgent() {
-    }
-
-    // ---------------------------------------------------------------------
-    // PUBLIC METHODS
-    //----------------------------------------------------------------------
-
-    /**
-     * Initializes the MIB (with no registration of the MBeans into the
-     * MBean server).
-     *
-     * @exception IllegalAccessException The MIB can not be initialized.
-     */
-    public abstract void init() throws IllegalAccessException;
-
-    /**
-     * Initializes the MIB but each single MBean representing the MIB
-     * is inserted into the MBean server.
-     *
-     * @param server The MBean server to register the service with.
-     * @param name The object name.
-     *
-     * @return The name of the SNMP MIB registered.
-     *
-     * @exception java.lang.Exception
-     */
-    @Override
-    public abstract ObjectName preRegister(MBeanServer server,
-                                           ObjectName name)
-        throws java.lang.Exception;
-
-    /**
-     * Not used in this context.
-     */
-    @Override
-    public void postRegister (Boolean registrationDone) {
-    }
-
-    /**
-     * Not used in this context.
-     */
-    @Override
-    public void preDeregister() throws java.lang.Exception {
-    }
-
-    /**
-     * Not used in this context.
-     */
-    @Override
-    public void postDeregister() {
-    }
-
-    /**
-     * Processes a <CODE>get</CODE> operation.
-     * This method must update the SnmpVarBinds contained in the
-     * <var>{@link SnmpMibRequest} req</var> parameter.
-     *
-     * @param req The SnmpMibRequest object holding the list of variable to
-     *            be retrieved. This list is composed of
-     *            <CODE>SnmpVarBind</CODE> objects.
-     *
-     * @exception SnmpStatusException An error occurred during the operation.
-     */
-    @Override
-    public abstract void get(SnmpMibRequest req)
-        throws SnmpStatusException;
-
-    /**
-     * Processes a <CODE>getNext</CODE> operation.
-     * This method must update the SnmpVarBinds contained in the
-     * <var>{@link SnmpMibRequest} req</var> parameter.
-     *
-     * @param req The SnmpMibRequest object holding the list of
-     *            OIDs from which the next variables should be retrieved.
-     *            This list is composed of <CODE>SnmpVarBind</CODE> objects.
-     *
-     * @exception SnmpStatusException An error occurred during the operation.
-     */
-    @Override
-    public abstract void getNext(SnmpMibRequest req)
-        throws SnmpStatusException;
-
-    /**
-     * Processes a <CODE>getBulk</CODE> operation.
-     * This method must update the SnmpVarBinds contained in the
-     * <var>{@link SnmpMibRequest} req</var> parameter.
-     *
-     * @param req The SnmpMibRequest object holding the list of variable to
-     *            be retrieved. This list is composed of
-     *            <CODE>SnmpVarBind</CODE> objects.
-     *
-     * @param nonRepeat The number of variables, starting with the first
-     *    variable in the variable-bindings, for which a single
-     *    lexicographic successor is requested.
-     *
-     * @param maxRepeat The number of lexicographic successors requested
-     *    for each of the last R variables. R is the number of variables
-     *    following the first <CODE>nonRepeat</CODE> variables for which
-     *    multiple lexicographic successors are requested.
-     *
-     * @exception SnmpStatusException An error occurred during the operation.
-     */
-    @Override
-    public abstract void getBulk(SnmpMibRequest req, int nonRepeat,
-                                 int maxRepeat)
-        throws SnmpStatusException;
-
-    /**
-     * Processes a <CODE>set</CODE> operation.
-     * This method must update the SnmpVarBinds contained in the
-     * <var>{@link SnmpMibRequest} req</var> parameter.
-     * This method is called during the second phase of the SET two-phase
-     * commit.
-     *
-     * @param req The SnmpMibRequest object holding the list of variable to
-     *            be set. This list is composed of
-     *            <CODE>SnmpVarBind</CODE> objects.
-     *
-     * @exception SnmpStatusException An error occurred during the operation.
-     *            Throwing an exception in this method will break the
-     *            atomicity of the SET operation. Care must be taken so that
-     *            the exception is thrown in the {@link #check(SnmpMibRequest)}
-     *            method instead.
-     */
-    @Override
-    public abstract void set(SnmpMibRequest req)
-        throws SnmpStatusException;
-
-
-    /**
-     * Checks if a <CODE>set</CODE> operation can be performed.
-     * If the operation can not be performed, the method should throw an
-     * <CODE>SnmpStatusException</CODE>.
-     * This method is called during the first phase of the SET two-phase
-     * commit.
-     *
-     * @param req The SnmpMibRequest object holding the list of variable to
-     *            be set. This list is composed of
-     *            <CODE>SnmpVarBind</CODE> objects.
-     *
-     * @exception SnmpStatusException The <CODE>set</CODE> operation
-     *    cannot be performed.
-     */
-    @Override
-    public abstract void check(SnmpMibRequest req)
-        throws SnmpStatusException;
-
-    /**
-     * Gets the root object identifier of the MIB.
-     * <P>The root object identifier is the object identifier uniquely
-     * identifying the MIB.
-     *
-     * @return The root object identifier.
-     */
-    public abstract long[] getRootOid();
-
-    // ---------------------------------------------------------------------
-    // GETTERS AND SETTERS
-    // ---------------------------------------------------------------------
-
-    /**
-     * Gets the reference to the MBean server in which the SNMP MIB is
-     * registered.
-     *
-     * @return The MBean server or null if the MIB is not registered in any
-     *     MBean server.
-     */
-    @Override
-    public MBeanServer getMBeanServer() {
-        return server;
-    }
-
-    /**
-     * Gets the reference to the SNMP protocol adaptor to which the MIB is
-     * bound.
-     *
-     * @return The SNMP MIB handler.
-     */
-    @Override
-    public SnmpMibHandler getSnmpAdaptor() {
-        return adaptor;
-    }
-
-    /**
-     * Sets the reference to the SNMP protocol adaptor through which the MIB
-     * will be SNMP accessible and add this new MIB in the SNMP MIB handler.
-     *
-     * @param stack The SNMP MIB handler.
-     */
-    @Override
-    public void setSnmpAdaptor(SnmpMibHandler stack) {
-        if (adaptor != null) {
-            adaptor.removeMib(this);
-        }
-        adaptor = stack;
-        if (adaptor != null) {
-            adaptor.addMib(this);
-        }
-    }
-
-     /**
-     * Sets the reference to the SNMP protocol adaptor through which the MIB
-     * will be SNMP accessible and add this new MIB in the SNMP MIB handler.
-     * This method is to be called to set a specific agent to a specific OID. This can be useful when dealing with MIB overlapping.
-     * Some OID can be implemented in more than one MIB. In this case, the OID nearest the agent will be used on SNMP operations.
-     * @param stack The SNMP MIB handler.
-     * @param oids The set of OIDs this agent implements.
-     *
-     * @since 1.5
-     */
-    @Override
-    public void setSnmpAdaptor(SnmpMibHandler stack, SnmpOid[] oids) {
-        if (adaptor != null) {
-            adaptor.removeMib(this);
-        }
-        adaptor = stack;
-        if (adaptor != null) {
-            adaptor.addMib(this, oids);
-        }
-    }
-
-    /**
-     * Sets the reference to the SNMP protocol adaptor through which the MIB
-     * will be SNMP accessible and adds this new MIB in the SNMP MIB handler.
-     * Adds a new contextualized MIB in the SNMP MIB handler.
-     *
-     * @param stack The SNMP MIB handler.
-     * @param contextName The MIB context name. If null is passed, will be registered in the default context.
-     *
-     * @exception IllegalArgumentException If the parameter is null.
-     *
-     * @since 1.5
-     */
-    @Override
-    public void setSnmpAdaptor(SnmpMibHandler stack, String contextName) {
-        if (adaptor != null) {
-            adaptor.removeMib(this, contextName);
-        }
-        adaptor = stack;
-        if (adaptor != null) {
-            adaptor.addMib(this, contextName);
-        }
-    }
-    /**
-     * Sets the reference to the SNMP protocol adaptor through which the MIB
-     * will be SNMP accessible and adds this new MIB in the SNMP MIB handler.
-     * Adds a new contextualized MIB in the SNMP MIB handler.
-     *
-     * @param stack The SNMP MIB handler.
-     * @param contextName The MIB context name. If null is passed, will be registered in the default context.
-     * @param oids The set of OIDs this agent implements.
-     * @exception IllegalArgumentException If the parameter is null.
-     *
-     * @since 1.5
-     */
-    @Override
-    public void setSnmpAdaptor(SnmpMibHandler stack,
-                               String contextName,
-                               SnmpOid[] oids) {
-        if (adaptor != null) {
-            adaptor.removeMib(this, contextName);
-        }
-        adaptor = stack;
-        if (adaptor != null) {
-            adaptor.addMib(this, contextName, oids);
-        }
-    }
-
-    /**
-     * Gets the object name of the SNMP protocol adaptor to which the MIB
-     * is bound.
-     *
-     * @return The name of the SNMP protocol adaptor.
-     */
-    @Override
-    public ObjectName getSnmpAdaptorName() {
-        return adaptorName;
-    }
-
-    /**
-     * Sets the reference to the SNMP protocol adaptor through which the MIB
-     * will be SNMP accessible and add this new MIB in the SNMP MIB handler
-     * associated to the specified <CODE>name</CODE>.
-     *
-     * @param name The name of the SNMP protocol adaptor.
-     *
-     * @exception InstanceNotFoundException The SNMP protocol adaptor does
-     *     not exist in the MBean server.
-     *
-     * @exception ServiceNotFoundException This SNMP MIB is not registered
-     *     in the MBean server or the requested service is not supported.
-     */
-    @Override
-    public void setSnmpAdaptorName(ObjectName name)
-        throws InstanceNotFoundException, ServiceNotFoundException {
-
-        if (server == null) {
-            throw new ServiceNotFoundException(mibName + " is not registered in the MBean server");
-        }
-        // First remove the reference on the old adaptor server.
-        //
-        if (adaptor != null) {
-            adaptor.removeMib(this);
-        }
-
-        // Then update the reference to the new adaptor server.
-        //
-        Object[] params = {this};
-        String[] signature = {"com.sun.jmx.snmp.agent.SnmpMibAgent"};
-        try {
-            adaptor = (SnmpMibHandler)(server.invoke(name, "addMib", params,
-                                                     signature));
-        } catch (InstanceNotFoundException e) {
-            throw new InstanceNotFoundException(name.toString());
-        } catch (ReflectionException e) {
-            throw new ServiceNotFoundException(name.toString());
-        } catch (MBeanException e) {
-            // Should never occur...
-        }
-
-        adaptorName = name;
-    }
-    /**
-     * Sets the reference to the SNMP protocol adaptor through which the MIB
-     * will be SNMP accessible and add this new MIB in the SNMP MIB handler
-     * associated to the specified <CODE>name</CODE>.
-     * This method is to be called to set a specific agent to a specific OID. This can be useful when dealing with MIB overlapping.
-     * Some OID can be implemented in more than one MIB. In this case, the OID nearer agent will be used on SNMP operations.
-     * @param name The name of the SNMP protocol adaptor.
-     * @param oids The set of OIDs this agent implements.
-     * @exception InstanceNotFoundException The SNMP protocol adaptor does
-     *     not exist in the MBean server.
-     *
-     * @exception ServiceNotFoundException This SNMP MIB is not registered
-     *     in the MBean server or the requested service is not supported.
-     *
-     * @since 1.5
-     */
-    @Override
-    public void setSnmpAdaptorName(ObjectName name, SnmpOid[] oids)
-        throws InstanceNotFoundException, ServiceNotFoundException {
-
-        if (server == null) {
-            throw new ServiceNotFoundException(mibName + " is not registered in the MBean server");
-        }
-        // First remove the reference on the old adaptor server.
-        //
-        if (adaptor != null) {
-            adaptor.removeMib(this);
-        }
-
-        // Then update the reference to the new adaptor server.
-        //
-        Object[] params = {this, oids};
-        String[] signature = {"com.sun.jmx.snmp.agent.SnmpMibAgent",
-        oids.getClass().getName()};
-        try {
-            adaptor = (SnmpMibHandler)(server.invoke(name, "addMib", params,
-                                                     signature));
-        } catch (InstanceNotFoundException e) {
-            throw new InstanceNotFoundException(name.toString());
-        } catch (ReflectionException e) {
-            throw new ServiceNotFoundException(name.toString());
-        } catch (MBeanException e) {
-            // Should never occur...
-        }
-
-        adaptorName = name;
-    }
-    /**
-     * Sets the reference to the SNMP protocol adaptor through which the MIB
-     * will be SNMP accessible and add this new MIB in the SNMP MIB handler
-     * associated to the specified <CODE>name</CODE>.
-     *
-     * @param name The name of the SNMP protocol adaptor.
-     * @param contextName The MIB context name. If null is passed, will be registered in the default context.
-     * @exception InstanceNotFoundException The SNMP protocol adaptor does
-     *     not exist in the MBean server.
-     *
-     * @exception ServiceNotFoundException This SNMP MIB is not registered
-     *     in the MBean server or the requested service is not supported.
-     *
-     * @since 1.5
-     */
-    @Override
-    public void setSnmpAdaptorName(ObjectName name, String contextName)
-        throws InstanceNotFoundException, ServiceNotFoundException {
-
-        if (server == null) {
-            throw new ServiceNotFoundException(mibName + " is not registered in the MBean server");
-        }
-
-        // First remove the reference on the old adaptor server.
-        //
-        if (adaptor != null) {
-            adaptor.removeMib(this, contextName);
-        }
-
-        // Then update the reference to the new adaptor server.
-        //
-        Object[] params = {this, contextName};
-        String[] signature = {"com.sun.jmx.snmp.agent.SnmpMibAgent", "java.lang.String"};
-        try {
-            adaptor = (SnmpMibHandler)(server.invoke(name, "addMib", params,
-                                                     signature));
-        } catch (InstanceNotFoundException e) {
-            throw new InstanceNotFoundException(name.toString());
-        } catch (ReflectionException e) {
-            throw new ServiceNotFoundException(name.toString());
-        } catch (MBeanException e) {
-            // Should never occur...
-        }
-
-        adaptorName = name;
-    }
-
-    /**
-     * Sets the reference to the SNMP protocol adaptor through which the MIB
-     * will be SNMP accessible and add this new MIB in the SNMP MIB handler
-     * associated to the specified <CODE>name</CODE>.
-     *
-     * @param name The name of the SNMP protocol adaptor.
-     * @param contextName The MIB context name. If null is passed, will be registered in the default context.
-     * @param oids The set of OIDs this agent implements.
-     * @exception InstanceNotFoundException The SNMP protocol adaptor does
-     *     not exist in the MBean server.
-     *
-     * @exception ServiceNotFoundException This SNMP MIB is not registered
-     *     in the MBean server or the requested service is not supported.
-     *
-     * @since 1.5
-     */
-    @Override
-    public void setSnmpAdaptorName(ObjectName name,
-                                   String contextName, SnmpOid[] oids)
-        throws InstanceNotFoundException, ServiceNotFoundException {
-
-        if (server == null) {
-            throw new ServiceNotFoundException(mibName + " is not registered in the MBean server");
-        }
-
-        // First remove the reference on the old adaptor server.
-        //
-        if (adaptor != null) {
-            adaptor.removeMib(this, contextName);
-        }
-
-        // Then update the reference to the new adaptor server.
-        //
-        Object[] params = {this, contextName, oids};
-        String[] signature = {"com.sun.jmx.snmp.agent.SnmpMibAgent", "java.lang.String", oids.getClass().getName()};
-        try {
-            adaptor = (SnmpMibHandler)(server.invoke(name, "addMib", params,
-                                                     signature));
-        } catch (InstanceNotFoundException e) {
-            throw new InstanceNotFoundException(name.toString());
-        } catch (ReflectionException e) {
-            throw new ServiceNotFoundException(name.toString());
-        } catch (MBeanException e) {
-            // Should never occur...
-        }
-
-        adaptorName = name;
-    }
-
-    /**
-     * Indicates whether or not the MIB module is bound to a SNMP protocol
-     * adaptor.
-     * As a reminder, only bound MIBs can be accessed through SNMP protocol
-     * adaptor.
-     *
-     * @return <CODE>true</CODE> if the MIB module is bound,
-     *         <CODE>false</CODE> otherwise.
-     */
-    @Override
-    public boolean getBindingState() {
-        if (adaptor == null)
-            return false;
-        else
-            return true;
-    }
-
-    /**
-     * Gets the MIB name.
-     *
-     * @return The MIB name.
-     */
-    @Override
-    public String getMibName() {
-        return mibName;
-    }
-
-    /**
-     * This is a factory method for creating new SnmpMibRequest objects.
-     * @param reqPdu The received PDU.
-     * @param vblist   The vector of SnmpVarBind objects in which the
-     *        MIB concerned by this request is involved.
-     * @param version  The protocol version of the SNMP request.
-     * @param userData User allocated contextual data.
-     *
-     * @return A new SnmpMibRequest object.
-     *
-     * @since 1.5
-     **/
-    public static SnmpMibRequest newMibRequest(SnmpPdu reqPdu,
-                                               Vector<SnmpVarBind> vblist,
-                                               int version,
-                                               Object userData)
-    {
-        return new SnmpMibRequestImpl(null,
-                                      reqPdu,
-                                      vblist,
-                                      version,
-                                      userData,
-                                      null,
-                                      SnmpDefinitions.noAuthNoPriv,
-                                      getSecurityModel(version),
-                                      null,null);
-    }
-    /**
-     * This is a factory method for creating new SnmpMibRequest objects.
-     * @param engine The local engine.
-     * @param reqPdu The received pdu.
-     * @param vblist The vector of SnmpVarBind objects in which the
-     *        MIB concerned by this request is involved.
-     * @param version The protocol version of the SNMP request.
-     * @param userData User allocated contextual data.
-     *
-     * @return A new SnmpMibRequest object.
-     *
-     * @since 1.5
-     **/
-    public static SnmpMibRequest newMibRequest(SnmpEngine engine,
-                                               SnmpPdu reqPdu,
-                                               Vector<SnmpVarBind> vblist,
-                                               int version,
-                                               Object userData,
-                                               String principal,
-                                               int securityLevel,
-                                               int securityModel,
-                                               byte[] contextName,
-                                               byte[] accessContextName) {
-        return new SnmpMibRequestImpl(engine,
-                                      reqPdu,
-                                      vblist,
-                                      version,
-                                      userData,
-                                      principal,
-                                      securityLevel,
-                                      securityModel,
-                                      contextName,
-                                      accessContextName);
-    }
-    // ---------------------------------------------------------------------
-    // PACKAGE METHODS
-    // ---------------------------------------------------------------------
-
-    /**
-     * Processes a <CODE>getBulk</CODE> operation using call to
-     * <CODE>getNext</CODE>.
-     * The method implements the <CODE>getBulk</CODE> operation by calling
-     * appropriately the <CODE>getNext</CODE> method.
-     *
-     * @param req The SnmpMibRequest containing the variable list to be
-     *        retrieved.
-     *
-     * @param nonRepeat The number of variables, starting with the first
-     *    variable in the variable-bindings, for which a single lexicographic
-     *    successor is requested.
-     *
-     * @param maxRepeat The number of lexicographic successors
-     *    requested for each of the last R variables. R is the number of
-     *    variables following the first nonRepeat variables for which
-     *    multiple lexicographic successors are requested.
-     *
-     * @return The variable list containing returned values.
-     *
-     * @exception SnmpStatusException An error occurred during the operation.
-     */
-    void getBulkWithGetNext(SnmpMibRequest req, int nonRepeat, int maxRepeat)
-        throws SnmpStatusException {
-        final Vector<SnmpVarBind> list = req.getSubList();
-
-        // RFC 1905, Section 4.2.3, p14
-        final int L = list.size() ;
-        final int N = Math.max(Math.min(nonRepeat, L), 0) ;
-        final int M = Math.max(maxRepeat, 0) ;
-        final int R = L - N ;
-
-        // Let's build the varBindList for the response pdu
-        //
-        // int errorStatus = SnmpDefinitions.snmpRspNoError ;
-        // int errorIndex = 0 ;
-        if (L != 0) {
-
-            // Non-repeaters and first row of repeaters
-            //
-            getNext(req);
-
-            // Now the remaining repeaters
-            //
-            Vector<SnmpVarBind> repeaters= splitFrom(list, N);
-            SnmpMibRequestImpl repeatedReq =
-                new SnmpMibRequestImpl(req.getEngine(),
-                                       req.getPdu(),
-                                       repeaters,
-                                       SnmpDefinitions.snmpVersionTwo,
-                                       req.getUserData(),
-                                       req.getPrincipal(),
-                                       req.getSecurityLevel(),
-                                       req.getSecurityModel(),
-                                       req.getContextName(),
-                                       req.getAccessContextName());
-            for (int i = 2 ; i <= M ; i++) {
-                getNext(repeatedReq);
-                concatVector(req, repeaters);
-            }
-        }
-    }
-
-
-    // ---------------------------------------------------------------------
-    // PRIVATE METHODS
-    // ---------------------------------------------------------------------
-
-    /**
-     * This method creates a new Vector which does not contain the first
-     * element up to the specified limit.
-     *
-     * @param original The original vector.
-     * @param limit The limit.
-     */
-    private Vector<SnmpVarBind> splitFrom(Vector<SnmpVarBind> original, int limit) {
-
-        int max= original.size();
-        Vector<SnmpVarBind> result= new Vector<>(max - limit);
-        int i= limit;
-
-        // Ok the loop looks a bit strange. But in order to improve the
-        // perf, we try to avoid reference to the limit variable from
-        // within the loop ...
-        //
-        for(Enumeration<SnmpVarBind> e= original.elements(); e.hasMoreElements(); --i) {
-            SnmpVarBind var= e.nextElement();
-            if (i >0)
-                continue;
-            result.addElement(new SnmpVarBind(var.oid, var.value));
-        }
-        return result;
-    }
-
-    private void concatVector(SnmpMibRequest req, Vector<SnmpVarBind> source) {
-        for(Enumeration<SnmpVarBind> e= source.elements(); e.hasMoreElements(); ) {
-            SnmpVarBind var= e.nextElement();
-            // We need to duplicate the SnmpVarBind otherwise it is going
-            // to be overloaded by the next get Next ...
-            req.addVarBind(new SnmpVarBind(var.oid, var.value));
-        }
-    }
-
-    private static int getSecurityModel(int version) {
-        switch(version) {
-        case SnmpDefinitions.snmpVersionOne:
-            return SnmpDefinitions.snmpV1SecurityModel;
-        default:
-            return SnmpDefinitions.snmpV2SecurityModel;
-        }
-    }
-
-    // ---------------------------------------------------------------------
-    // PROTECTED VARIABLES
-    // ---------------------------------------------------------------------
-
-    /**
-     * The object name of the MIB.
-     * @serial
-     */
-    protected String mibName;
-
-    /**
-     * The reference to the MBean server.
-     * @serial
-     */
-    protected MBeanServer server;
-
-    // ---------------------------------------------------------------------
-    // PRIVATE VARIABLES
-    // ---------------------------------------------------------------------
-
-    /**
-     * The object name of the SNMP protocol adaptor.
-     * @serial
-     */
-    private ObjectName adaptorName;
-
-    /**
-     * The reference to the SNMP stack.
-     */
-    private transient SnmpMibHandler adaptor;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgentMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,316 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.agent;
-
-
-
-// java imports
-//
-import java.util.Vector;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
-import javax.management.InstanceNotFoundException;
-import javax.management.ServiceNotFoundException;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * Exposes the remote management interface of the <CODE>SnmpMibAgent</CODE> MBean.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public interface SnmpMibAgentMBean {
-
-    // PUBLIC METHODS
-    //---------------
-
-    /**
-     * Processes a <CODE>get</CODE> operation.
-     * This method must not be called from remote.
-     *
-     * @param req The SnmpMibRequest object holding the list of variables to
-     *            be retrieved. This list is composed of
-     *            <CODE>SnmpVarBind</CODE> objects.
-     *
-     * @exception SnmpStatusException An error occurred during the operation.
-     * @see SnmpMibAgent#get(SnmpMibRequest)
-     */
-    public void get(SnmpMibRequest req) throws SnmpStatusException;
-
-    /**
-     * Processes a <CODE>getNext</CODE> operation.
-     * This method must not be called from remote.
-     *
-     * @param req The SnmpMibRequest object holding the list of variables to
-     *            be retrieved. This list is composed of
-     *            <CODE>SnmpVarBind</CODE> objects.
-     *
-     * @exception SnmpStatusException An error occurred during the operation.
-     * @see SnmpMibAgent#getNext(SnmpMibRequest)
-     */
-    public void getNext(SnmpMibRequest req) throws SnmpStatusException;
-
-    /**
-     * Processes a <CODE>getBulk</CODE> operation.
-     * This method must not be called from remote.
-     *
-     * @param req The SnmpMibRequest object holding the list of variables to
-     *            be retrieved. This list is composed of
-     *            <CODE>SnmpVarBind</CODE> objects.
-     *
-     * @param nonRepeat The number of variables, starting with the first
-     *    variable in the variable-bindings, for which a single
-     *    lexicographic successor is requested.
-     *
-     * @param maxRepeat The number of lexicographic successors requested
-     *    for each of the last R variables. R is the number of variables
-     *    following the first <CODE>nonRepeat</CODE> variables for which
-     *    multiple lexicographic successors are requested.
-     *
-     * @exception SnmpStatusException An error occurred during the operation.
-     * @see SnmpMibAgent#getBulk(SnmpMibRequest,int,int)
-     */
-    public void getBulk(SnmpMibRequest req, int nonRepeat, int maxRepeat)
-        throws SnmpStatusException;
-
-    /**
-     * Processes a <CODE>set</CODE> operation.
-     * This method must not be called from remote.
-     *
-     * @param req The SnmpMibRequest object holding the list of variables to
-     *            be set. This list is composed of
-     *            <CODE>SnmpVarBind</CODE> objects.
-     *
-     * @exception SnmpStatusException An error occurred during the operation.
-     * @see SnmpMibAgent#set(SnmpMibRequest)
-     */
-    public void set(SnmpMibRequest req) throws SnmpStatusException;
-
-    /**
-     * Checks if a <CODE>set</CODE> operation can be performed.
-     * If the operation cannot be performed, the method should emit a
-     * <CODE>SnmpStatusException</CODE>.
-     *
-     * @param req The SnmpMibRequest object holding the list of variables to
-     *            be set. This list is composed of
-     *            <CODE>SnmpVarBind</CODE> objects.
-     *
-     * @exception SnmpStatusException The <CODE>set</CODE> operation
-     *    cannot be performed.
-     * @see SnmpMibAgent#check(SnmpMibRequest)
-     */
-    public void check(SnmpMibRequest req) throws SnmpStatusException;
-
-    // GETTERS AND SETTERS
-    //--------------------
-
-    /**
-     * Gets the reference to the MBean server in which the SNMP MIB is
-     * registered.
-     *
-     * @return The MBean server or null if the MIB is not registered in any
-     *         MBean server.
-     */
-    public MBeanServer getMBeanServer();
-
-    /**
-     * Gets the reference to the SNMP protocol adaptor to which the MIB is
-     * bound.
-     * <BR>This method is used for accessing the SNMP MIB handler property
-     * of the SNMP MIB agent in case of a standalone agent.
-     *
-     * @return The SNMP MIB handler.
-     */
-    public SnmpMibHandler getSnmpAdaptor();
-
-    /**
-     * Sets the reference to the SNMP protocol adaptor through which the
-     * MIB will be SNMP accessible and add this new MIB in the SNMP MIB
-     * handler.
-     * <BR>This method is used for setting the SNMP MIB handler property of
-     * the SNMP MIB agent in case of a standalone agent.
-     *
-     * @param stack The SNMP MIB handler.
-     */
-    public void setSnmpAdaptor(SnmpMibHandler stack);
-
-    /**
-     * Sets the reference to the SNMP protocol adaptor through which the MIB
-     * will be SNMP accessible and add this new MIB in the SNMP MIB handler.
-     * This method is to be called to set a specific agent to a specific OID.
-     * This can be useful when dealing with MIB overlapping.
-     * Some OID can be implemented in more than one MIB. In this case, the
-     * OID nearer agent will be used on SNMP operations.
-     * @param stack The SNMP MIB handler.
-     * @param oids The set of OIDs this agent implements.
-     *
-     * @since 1.5
-     */
-    public void setSnmpAdaptor(SnmpMibHandler stack, SnmpOid[] oids);
-
-    /**
-     * Sets the reference to the SNMP protocol adaptor through which the MIB
-     * will be SNMP accessible and add this new MIB in the SNMP MIB handler.
-     * Adds a new contextualized MIB in the SNMP MIB handler.
-     *
-     * @param stack The SNMP MIB handler.
-     * @param contextName The MIB context name. If null is passed, will be
-     *        registered in the default context.
-     *
-     * @exception IllegalArgumentException If the parameter is null.
-     *
-     * @since 1.5
-     */
-    public void setSnmpAdaptor(SnmpMibHandler stack, String contextName);
-
-    /**
-     * Sets the reference to the SNMP protocol adaptor through which the MIB
-     * will be SNMP accessible and adds this new MIB in the SNMP MIB handler.
-     * Adds a new contextualized MIB in the SNMP MIB handler.
-     *
-     * @param stack The SNMP MIB handler.
-     * @param contextName The MIB context name. If null is passed, will be
-     *        registered in the default context.
-     * @param oids The set of OIDs this agent implements.
-     * @exception IllegalArgumentException If the parameter is null.
-     *
-     * @since 1.5
-     */
-    public void setSnmpAdaptor(SnmpMibHandler stack,
-                               String contextName,
-                               SnmpOid[] oids);
-
-    /**
-     * Gets the object name of the SNMP protocol adaptor to which the MIB is
-     * bound.
-     *
-     * @return The name of the SNMP protocol adaptor.
-     */
-    public ObjectName getSnmpAdaptorName();
-
-    /**
-     * Sets the reference to the SNMP protocol adaptor through which the MIB
-     * will be SNMP accessible and add this new MIB in the SNMP MIB handler
-     * associated to the specified <CODE>name</CODE>.
-     *
-     * @param name The object name of the SNMP MIB handler.
-     *
-     * @exception InstanceNotFoundException The MBean does not exist in the
-     *        MBean server.
-     * @exception ServiceNotFoundException This SNMP MIB is not registered
-     *        in the MBean server or the requested service is not supported.
-     */
-    public void setSnmpAdaptorName(ObjectName name)
-        throws InstanceNotFoundException, ServiceNotFoundException;
-
-
-    /**
-     * Sets the reference to the SNMP protocol adaptor through which the MIB
-     * will be SNMP accessible and add this new MIB in the SNMP MIB handler
-     * associated to the specified <CODE>name</CODE>.
-     * This method is to be called to set a specific agent to a specific OID.
-     * This can be useful when dealing with MIB overlapping.
-     * Some OID can be implemented in more than one MIB. In this case, the
-     * OID nearer agent will be used on SNMP operations.
-     * @param name The name of the SNMP protocol adaptor.
-     * @param oids The set of OIDs this agent implements.
-     * @exception InstanceNotFoundException The SNMP protocol adaptor does
-     *     not exist in the MBean server.
-     *
-     * @exception ServiceNotFoundException This SNMP MIB is not registered
-     *     in the MBean server or the requested service is not supported.
-     *
-     * @since 1.5
-     */
-    public void setSnmpAdaptorName(ObjectName name, SnmpOid[] oids)
-        throws InstanceNotFoundException, ServiceNotFoundException;
-
-    /**
-     * Sets the reference to the SNMP protocol adaptor through which the MIB
-     * will be SNMP accessible and add this new MIB in the SNMP MIB handler
-     * associated to the specified <CODE>name</CODE>.
-     *
-     * @param name The name of the SNMP protocol adaptor.
-     * @param contextName The MIB context name. If null is passed, will be
-     *     registered in the default context.
-     * @exception InstanceNotFoundException The SNMP protocol adaptor does
-     *     not exist in the MBean server.
-     *
-     * @exception ServiceNotFoundException This SNMP MIB is not registered
-     *     in the MBean server or the requested service is not supported.
-     *
-     * @since 1.5
-     */
-    public void setSnmpAdaptorName(ObjectName name, String contextName)
-        throws InstanceNotFoundException, ServiceNotFoundException;
-
-     /**
-     * Sets the reference to the SNMP protocol adaptor through which the MIB
-     * will be SNMP accessible and add this new MIB in the SNMP MIB handler
-     * associated to the specified <CODE>name</CODE>.
-     *
-     * @param name The name of the SNMP protocol adaptor.
-     * @param contextName The MIB context name. If null is passed, will be
-     *        registered in the default context.
-     * @param oids The set of OIDs this agent implements.
-     * @exception InstanceNotFoundException The SNMP protocol adaptor does
-     *     not exist in the MBean server.
-     *
-     * @exception ServiceNotFoundException This SNMP MIB is not registered
-     *     in the MBean server or the requested service is not supported.
-     *
-     * @since 1.5
-     */
-    public void setSnmpAdaptorName(ObjectName name,
-                                   String contextName,
-                                   SnmpOid[] oids)
-        throws InstanceNotFoundException, ServiceNotFoundException;
-
-    /**
-     * Indicates whether or not the MIB module is bound to a SNMP protocol
-     * adaptor.
-     * As a reminder, only bound MIBs can be accessed through SNMP protocol
-     * adaptor.
-     *
-     * @return <CODE>true</CODE> if the MIB module is bound,
-     *         <CODE>false</CODE> otherwise.
-     */
-    public boolean getBindingState();
-
-    /**
-     * Gets the MIB name.
-     *
-     * @return The MIB name.
-     */
-    public String getMibName();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibEntry.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.agent;
-
-// java imports
-//
-import com.sun.jmx.snmp.SnmpDefinitions;
-import java.io.Serializable;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * Represents a node in an SNMP MIB which corresponds to a table entry
- * meta node.
- * <P>
- * This class is used by the class generated by <CODE>mibgen</CODE>.
- * You should not need to use this class directly.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-@SuppressWarnings("serial") // JDK implementation class
-public abstract class SnmpMibEntry extends SnmpMibNode
-    implements Serializable {
-
-    /**
-     * Tells whether the given arc identifies a variable (scalar object) in
-     * this entry.
-     *
-     * @param arc An OID arc.
-     *
-     * @return <CODE>true</CODE> if `arc' leads to a variable.
-     */
-    public abstract boolean isVariable(long arc);
-
-    /**
-     * Tells whether the given arc identifies a readable scalar object in
-     * this entry.
-     *
-     * @param arc An OID arc.
-     *
-     * @return <CODE>true</CODE> if `arc' leads to a readable variable.
-     */
-    public abstract boolean isReadable(long arc);
-
-    /**
-     * Get the next OID arc corresponding to a readable scalar variable.
-     *
-     */
-    public long getNextVarId(long id, Object userData)
-        throws SnmpStatusException {
-        long nextvar = super.getNextVarId(id,userData);
-        while (!isReadable(nextvar))
-            nextvar = super.getNextVarId(nextvar,userData);
-        return nextvar;
-    }
-
-    /**
-     * Checks whether the given OID arc identifies a variable (columnar
-     * object).
-     *
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @exception If the given `arc' does not identify any variable in this
-     *    group, throws an SnmpStatusException.
-     */
-    public void validateVarId(long arc, Object userData)
-        throws SnmpStatusException {
-        if (isVariable(arc) == false) {
-            throw new SnmpStatusException(SnmpDefinitions.snmpRspNoSuchName);
-        }
-    }
-
-    /**
-     * Generic handling of the <CODE>get</CODE> operation.
-     * <p>The actual implementation of this method will be generated
-     * by mibgen. Usually, this implementation only delegates the
-     * job to some other provided runtime class, which knows how to
-     * access the MBean. The current toolkit thus provides two
-     * implementations:
-     * <ul><li>The standard implementation will directly access the
-     *         MBean through a java reference,</li>
-     *     <li>The generic implementation will access the MBean through
-     *         the MBean server.</li>
-     * </ul>
-     * <p>Both implementations rely upon specific - and distinct, set of
-     * mibgen generated methods.
-     * <p> You can override this method if you need to implement some
-     * specific policies for minimizing the accesses made to some remote
-     * underlying resources.
-     * <p>
-     *
-     * @param req   The sub-request that must be handled by this node.
-     *
-     * @param depth The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException An error occurred while accessing
-     *  the MIB node.
-     */
-    abstract public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException;
-
-    /**
-     * Generic handling of the <CODE>set</CODE> operation.
-     * <p>The actual implementation of this method will be generated
-     * by mibgen. Usually, this implementation only delegates the
-     * job to some other provided runtime class, which knows how to
-     * access the MBean. The current toolkit thus provides two
-     * implementations:
-     * <ul><li>The standard implementation will directly access the
-     *         MBean through a java reference,</li>
-     *     <li>The generic implementation will access the MBean through
-     *         the MBean server.</li>
-     * </ul>
-     * <p>Both implementations rely upon specific - and distinct, set of
-     * mibgen generated methods.
-     * <p> You can override this method if you need to implement some
-     * specific policies for minimizing the accesses made to some remote
-     * underlying resources.
-     * <p>
-     *
-     * @param req   The sub-request that must be handled by this node.
-     *
-     * @param depth The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException An error occurred while accessing
-     *  the MIB node.
-     */
-    abstract public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException;
-
-    /**
-     * Generic handling of the <CODE>check</CODE> operation.
-     *
-     * <p>The actual implementation of this method will be generated
-     * by mibgen. Usually, this implementation only delegates the
-     * job to some other provided runtime class, which knows how to
-     * access the MBean. The current toolkit thus provides two
-     * implementations:
-     * <ul><li>The standard implementation will directly access the
-     *         MBean through a java reference,</li>
-     *     <li>The generic implementation will access the MBean through
-     *         the MBean server.</li>
-     * </ul>
-     * <p>Both implementations rely upon specific - and distinct, set of
-     * mibgen generated methods.
-     * <p> You can override this method if you need to implement some
-     * specific policies for minimizing the accesses made to some remote
-     * underlying resources, or if you need to implement some consistency
-     * checks between the different values provided in the varbind list.
-     * <p>
-     *
-     * @param req   The sub-request that must be handled by this node.
-     *
-     * @param depth The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException An error occurred while accessing
-     *  the MIB node.
-     */
-    abstract public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,521 +0,0 @@
-/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.agent;
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Hashtable;
-import java.util.Vector;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-
-/**
- * Represents a node in an SNMP MIB which corresponds to a group.
- * This class allows subnodes to be registered below a group, providing
- * support for nested groups. The subnodes are registered at run time
- * when registering the nested groups in the global MIB OID tree.
- * <P>
- * This class is used by the class generated by <CODE>mibgen</CODE>.
- * You should not need to use this class directly.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-@SuppressWarnings("serial") // JDK implementation class
-public abstract class SnmpMibGroup extends SnmpMibOid
-    implements Serializable {
-
-    // We will register the OID arcs leading to subgroups in this hashtable.
-    // So for each arc in varList, if the arc is also in subgroups, it leads
-    // to a subgroup, if it is not in subgroup, it leads either to a table
-    // or to a variable.
-    protected Hashtable<Long, Long> subgroups = null;
-
-    /**
-     * Tells whether the given arc identifies a table in this group.
-     *
-     * @param arc An OID arc.
-     *
-     * @return <CODE>true</CODE> if `arc' leads to a table.
-     */
-    public abstract boolean      isTable(long arc);
-
-    /**
-     * Tells whether the given arc identifies a variable (scalar object) in
-     * this group.
-     *
-     * @param arc An OID arc.
-     *
-     * @return <CODE>true</CODE> if `arc' leads to a variable.
-     */
-    public abstract boolean      isVariable(long arc);
-
-    /**
-     * Tells whether the given arc identifies a readable scalar object in
-     * this group.
-     *
-     * @param arc An OID arc.
-     *
-     * @return <CODE>true</CODE> if `arc' leads to a readable variable.
-     */
-    public abstract boolean      isReadable(long arc);
-
-
-    /**
-     * Gets the table identified by the given `arc'.
-     *
-     * @param arc An OID arc.
-     *
-     * @return The <CODE>SnmpMibTable</CODE> identified by `arc', or
-     *    <CODE>null</CODE> if `arc' does not identify any table.
-     */
-    public abstract SnmpMibTable getTable(long arc);
-
-    /**
-     * Checks whether the given OID arc identifies a variable (scalar
-     * object).
-     *
-     * @exception If the given `arc' does not identify any variable in this
-     *    group, throws an SnmpStatusException.
-     */
-    public void validateVarId(long arc, Object userData)
-        throws SnmpStatusException {
-        if (isVariable(arc) == false) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-        }
-    }
-
-
-    // -------------------------------------------------------------------
-    // We use a hashtable (subgroup) in order to determine whether an
-    // OID arc leads to a subgroup. This implementation can be changed if
-    // needed...
-    // For instance, the subclass could provide a generated isNestedArc()
-    // method in which the subgroup OID arcs would be hardcoded.
-    // However, the generic approach was preferred because at this time
-    // groups and subgroups are dynamically registered in the MIB.
-    //
-    /**
-     * Tell whether the given OID arc identifies a sub-tree
-     * leading to a nested SNMP sub-group. This method is used internally.
-     * You shouldn't need to call it directly.
-     *
-     * @param arc An OID arc.
-     *
-     * @return <CODE>true</CODE> if the given OID arc identifies a subtree
-     * leading to a nested SNMP sub-group.
-     *
-     */
-    public boolean isNestedArc(long arc) {
-        if (subgroups == null) return false;
-        Object obj = subgroups.get(arc);
-        // if the arc is registered in the hashtable,
-        // it leads to a subgroup.
-        return (obj != null);
-    }
-
-    /**
-     * Generic handling of the <CODE>get</CODE> operation.
-     * <p>The actual implementation of this method will be generated
-     * by mibgen. Usually, this implementation only delegates the
-     * job to some other provided runtime class, which knows how to
-     * access the MBean. The current toolkit thus provides two
-     * implementations:
-     * <ul><li>The standard implementation will directly access the
-     *         MBean through a java reference,</li>
-     *     <li>The generic implementation will access the MBean through
-     *         the MBean server.</li>
-     * </ul>
-     * <p>Both implementations rely upon specific - and distinct, set of
-     * mibgen generated methods.
-     * <p> You can override this method if you need to implement some
-     * specific policies for minimizing the accesses made to some remote
-     * underlying resources.
-     * <p>
-     *
-     * @param req   The sub-request that must be handled by this node.
-     *
-     * @param depth The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException An error occurred while accessing
-     *  the MIB node.
-     */
-    @Override
-    abstract public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException;
-
-    /**
-     * Generic handling of the <CODE>set</CODE> operation.
-     * <p>The actual implementation of this method will be generated
-     * by mibgen. Usually, this implementation only delegates the
-     * job to some other provided runtime class, which knows how to
-     * access the MBean. The current toolkit thus provides two
-     * implementations:
-     * <ul><li>The standard implementation will directly access the
-     *         MBean through a java reference,</li>
-     *     <li>The generic implementation will access the MBean through
-     *         the MBean server.</li>
-     * </ul>
-     * <p>Both implementations rely upon specific - and distinct, set of
-     * mibgen generated methods.
-     * <p> You can override this method if you need to implement some
-     * specific policies for minimizing the accesses made to some remote
-     * underlying resources.
-     * <p>
-     *
-     * @param req   The sub-request that must be handled by this node.
-     *
-     * @param depth The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException An error occurred while accessing
-     *  the MIB node.
-     */
-    @Override
-    abstract public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException;
-
-    /**
-     * Generic handling of the <CODE>check</CODE> operation.
-     *
-     * <p>The actual implementation of this method will be generated
-     * by mibgen. Usually, this implementation only delegates the
-     * job to some other provided runtime class, which knows how to
-     * access the MBean. The current toolkit thus provides two
-     * implementations:
-     * <ul><li>The standard implementation will directly access the
-     *         MBean through a java reference,</li>
-     *     <li>The generic implementation will access the MBean through
-     *         the MBean server.</li>
-     * </ul>
-     * <p>Both implementations rely upon specific - and distinct, set of
-     * mibgen generated methods.
-     * <p> You can override this method if you need to implement some
-     * specific policies for minimizing the accesses made to some remote
-     * underlying resources, or if you need to implement some consistency
-     * checks between the different values provided in the varbind list.
-     * <p>
-     *
-     * @param req   The sub-request that must be handled by this node.
-     *
-     * @param depth The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException An error occurred while accessing
-     *  the MIB node.
-     */
-    @Override
-    abstract public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException;
-
-    // --------------------------------------------------------------------
-    // If we reach this node, we are below the root OID, so we just
-    // return.
-    // --------------------------------------------------------------------
-    @Override
-    public void getRootOid(Vector<Integer> result) {
-    }
-
-    // -------------------------------------------------------------------
-    // PACKAGE METHODS
-    // -------------------------------------------------------------------
-
-    // -------------------------------------------------------------------
-    // This method can also be overriden in a subclass to provide a
-    // different implementation of the isNestedArc() method.
-    // => if isNestedArc() is hardcoded, then registerSubArc() becomes
-    //    useless and can become empty.
-    /**
-     * Register an OID arc that identifies a sub-tree
-     * leading to a nested SNMP sub-group. This method is used internally.
-     * You shouldn't ever call it directly.
-     *
-     * @param arc An OID arc.
-     *
-     */
-    void registerNestedArc(long arc) {
-        Long obj = arc;
-        if (subgroups == null) subgroups = new Hashtable<>();
-        // registers the arc in the hashtable.
-        subgroups.put(obj,obj);
-    }
-
-    // -------------------------------------------------------------------
-    // The SnmpMibOid algorithm relies on the fact that for every arc
-    // registered in varList, there is a corresponding node at the same
-    // position in children.
-    // So the trick is to register a null node in children for each variable
-    // in varList, so that the real subgroup nodes can be inserted at the
-    // correct location.
-    // registerObject() should be called for each scalar object and each
-    // table arc by the generated subclass.
-    /**
-     * Register an OID arc that identifies a scalar object or a table.
-     * This method is used internally. You shouldn't ever call it directly.
-     *
-     * @param arc An OID arc.
-     *
-     */
-    protected void registerObject(long arc)
-        throws IllegalAccessException {
-
-        // this will register the variable in both varList and children
-        // The node registered in children will be null, so that the parent
-        // algorithm will behave as if no node were registered. This is a
-        // trick that makes the parent algorithm behave as if only subgroups
-        // were registered in varList and children.
-        long[] oid = new long[1];
-        oid[0] = arc;
-        super.registerNode(oid,0,null);
-    }
-
-    // -------------------------------------------------------------------
-    // registerNode() will be called at runtime when nested groups are
-    // registered in the MIB. So we do know that this method will only
-    // be called to register nested-groups.
-    // We trap registerNode() in order to call registerSubArc()
-    /**
-     * Register a child node of this node in the OID tree.
-     * This method is used internally. You shouldn't ever call it directly.
-     *
-     * @param oid The oid of the node being registered.
-     * @param cursor The position reached in the oid.
-     * @param node The node being registered.
-     *
-     */
-    @Override
-    void registerNode(long[] oid, int cursor ,SnmpMibNode node)
-        throws IllegalAccessException {
-        super.registerNode(oid,cursor,node);
-        if (cursor < 0) return;
-        if (cursor >= oid.length) return;
-        // if we get here, then it means we are registering a subgroup.
-        // We will thus register the sub arc in the subgroups hashtable.
-        registerNestedArc(oid[cursor]);
-    }
-
-    // -------------------------------------------------------------------
-    // see comments in SnmpMibNode
-    // -------------------------------------------------------------------
-    @Override
-    void findHandlingNode(SnmpVarBind varbind,
-                          long[] oid, int depth,
-                          SnmpRequestTree handlers)
-        throws SnmpStatusException {
-
-        int length = oid.length;
-
-        if (handlers == null)
-            throw new SnmpStatusException(SnmpStatusException.snmpRspGenErr);
-
-        final Object data = handlers.getUserData();
-
-        if (depth >= length) {
-            // Nothing is left... the oid is not valid
-            throw new SnmpStatusException(SnmpStatusException.noAccess);
-        }
-
-        long arc = oid[depth];
-
-        if (isNestedArc(arc)) {
-            // This arc leads to a subgroup: delegates the search to the
-            // method defined in SnmpMibOid
-            super.findHandlingNode(varbind,oid,depth,handlers);
-        } else if (isTable(arc)) {
-            // This arc leads to a table: forward the search to the table.
-
-            // Gets the table
-            SnmpMibTable table = getTable(arc);
-
-            // Forward the search to the table
-            table.findHandlingNode(varbind,oid,depth+1,handlers);
-
-        } else {
-            // If it's not a variable, throws an exception
-            validateVarId(arc, data);
-
-            // The trailing .0 is missing in the OID
-            if (depth+2 > length) {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-            }
-
-            // There are too many arcs left in the OID (there should remain
-            // a single trailing .0)
-            if (depth+2 < length) {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-            }
-
-            // The last trailing arc is not .0
-            if (oid[depth+1] != 0L) {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-            }
-
-            // It's one of our variable, register this node.
-            handlers.add(this,depth,varbind);
-        }
-    }
-
-    // -------------------------------------------------------------------
-    // See comments in SnmpMibNode.
-    // -------------------------------------------------------------------
-    @Override
-    long[] findNextHandlingNode(SnmpVarBind varbind,
-                                long[] oid, int pos, int depth,
-                                SnmpRequestTree handlers, AcmChecker checker)
-        throws SnmpStatusException {
-
-        int length = oid.length;
-        SnmpMibNode node = null;
-
-        if (handlers == null) {
-            // This should be considered as a genErr, but we do not want to
-            // abort the whole request, so we're going to throw
-            // a noSuchObject...
-            //
-            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-        }
-
-        final Object data = handlers.getUserData();
-        final int pduVersion = handlers.getRequestPduVersion();
-
-
-        // The generic case where the end of the OID has been reached is
-        // handled in the superclass
-        // XXX Revisit: this works but it is somewhat convoluted. Just setting
-        //              arc to -1 would work too.
-        if (pos >= length)
-            return super.findNextHandlingNode(varbind,oid,pos,depth,
-                                              handlers, checker);
-
-        // Ok, we've got the arc.
-        long arc = oid[pos];
-
-        long[] result = null;
-
-        // We have a recursive logic. Should we have a loop instead?
-        try {
-
-            if (isTable(arc)) {
-                // If the arc identifies a table, then we need to forward
-                // the search to the table.
-
-                // Gets the table identified by `arc'
-                SnmpMibTable table = getTable(arc);
-
-                // Forward to the table
-                checker.add(depth, arc);
-                try {
-                    result = table.findNextHandlingNode(varbind,oid,pos+1,
-                                                        depth+1,handlers,
-                                                        checker);
-                }catch(SnmpStatusException ex) {
-                    throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-                } finally {
-                    checker.remove(depth);
-                }
-                // Build up the leaf OID
-                result[depth] = arc;
-                return result;
-            } else if (isReadable(arc)) {
-                // If the arc identifies a readable variable, then two cases:
-
-                if (pos == (length - 1)) {
-                    // The end of the OID is reached, so we return the leaf
-                    // corresponding to the variable identified by `arc'
-
-                    // Build up the OID
-                    // result = new SnmpOid(0);
-                    // result.insert((int)arc);
-                    result = new long[depth+2];
-                    result[depth+1] = 0L;
-                    result[depth] = arc;
-
-                    checker.add(depth, result, depth, 2);
-                    try {
-                        checker.checkCurrentOid();
-                    } catch(SnmpStatusException e) {
-                        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-                    } finally {
-                        checker.remove(depth,2);
-                    }
-
-                    // Registers this node
-                    handlers.add(this,depth,varbind);
-                    return result;
-                }
-
-                // The end of the OID is not yet reached, so we must return
-                // the next leaf following the variable identified by `arc'.
-                // We cannot return the variable because whatever follows in
-                // the OID will be greater or equals to 0, and 0 identifies
-                // the variable itself - so we have indeed to return the
-                // next object.
-                // So we do nothing, because this case is handled at the
-                // end of the if ... else if ... else ... block.
-
-            } else if (isNestedArc(arc)) {
-                // Now if the arc leads to a subgroup, we delegate the
-                // search to the child, just as done in SnmpMibNode.
-                //
-
-                // get the child ( = nested arc node).
-                //
-                final SnmpMibNode child = getChild(arc);
-
-                if (child != null) {
-                    checker.add(depth, arc);
-                    try {
-                        result = child.findNextHandlingNode(varbind,oid,pos+1,
-                                                            depth+1,handlers,
-                                                            checker);
-                        result[depth] = arc;
-                        return result;
-                    } finally {
-                        checker.remove(depth);
-                    }
-                }
-            }
-
-            // The oid is not valid, we will throw an exception in order
-            // to try with the next valid identifier...
-            //
-            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-
-        } catch (SnmpStatusException e) {
-            // We didn't find anything at the given arc, so we're going
-            // to try with the next valid arc
-            //
-            long[] newOid = new long[1];
-            newOid[0] = getNextVarId(arc,data,pduVersion);
-            return findNextHandlingNode(varbind,newOid,0,depth,
-                                        handlers,checker);
-        }
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibHandler.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.agent;
-
-
-
-// java imports
-//
-import java.util.Vector;
-import java.io.IOException;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * The logical link between an SNMP MIB and the SNMP communication stack.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public interface SnmpMibHandler {
-
-    /**
-     * Adds a new MIB in the SNMP MIB handler.
-     * This method is called automatically by {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptor(SnmpMibHandler)} and
-     * {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptorName(ObjectName)} and should not be called directly.
-     *
-     * @param mib The MIB to add.
-     *
-     * @return A reference on the SNMP MIB handler.
-     *
-     * @exception IllegalArgumentException If the parameter is null.
-     */
-    public SnmpMibHandler addMib(SnmpMibAgent mib) throws IllegalArgumentException;
-
-/**
-     * Adds a new MIB in the SNMP MIB handler.
-     *
-     * @param mib The MIB to add.
-     * @param oids The array of oid used to add the mib. Each oid is a root oid for the mib.
-     * @return A reference on the SNMP MIB handler.
-     *
-     * @exception IllegalArgumentException If the parameter is null.
-     *
-     * @since 1.5
-     */
-    public SnmpMibHandler addMib(SnmpMibAgent mib, SnmpOid[] oids) throws IllegalArgumentException;
-
-    /**
-     * Adds a new contextualized MIB in the SNMP MIB handler.
-     *
-     * @param mib The MIB to add.
-     * @param contextName The MIB context name. If null is passed, will be registered in the default context.
-     *
-     * @return A reference to the SNMP MIB handler.
-     *
-     * @exception IllegalArgumentException If the parameter is null.
-     *
-     * @since 1.5
-     */
-    public SnmpMibHandler addMib(SnmpMibAgent mib, String contextName)
-        throws IllegalArgumentException;
-
-    /**
-     * Adds a new contextualized MIB in the SNMP MIB handler.
-     *
-     * @param mib The MIB to add.
-     * @param contextName The MIB context name. If null is passed, will be registered in the default context.
-     * @param oids The array of oid used to add the mib. Each oid is a root oid for the mib.
-     *
-     * @return A reference to the SNMP MIB handler.
-     *
-     * @exception IllegalArgumentException If the parameter is null.
-     *
-     * @since 1.5
-     */
-    public SnmpMibHandler addMib(SnmpMibAgent mib, String contextName, SnmpOid[] oids)
-        throws IllegalArgumentException;
-
-    /**
-     * Removes the specified MIB from the SNMP protocol adaptor.
-     * This method is called automatically by {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptor(SnmpMibHandler)} and
-     * {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptorName(ObjectName)} and should not be called directly.
-     *
-     * @param mib The MIB to be removed.
-     *
-     * @return <CODE>true</CODE> if the specified <CODE>mib</CODE> was a MIB included in the SNMP MIB handler,
-     * <CODE>false</CODE> otherwise.
-     */
-    public boolean removeMib(SnmpMibAgent mib);
-  /**
-     * Removes the specified MIB from the SNMP protocol adaptor.
-     * This method is called automatically by {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptor(SnmpMibHandler)} and
-     * {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptorName(ObjectName)} and should not be called directly.
-     *
-     * @param mib The MIB to be removed.
-     * @param oids The oid the MIB was previously registered for.
-     * @return <CODE>true</CODE> if the specified <CODE>mib</CODE> was a MIB included in the SNMP MIB handler,
-     * <CODE>false</CODE> otherwise.
-     *
-     * @since 1.5
-     */
-    public boolean removeMib(SnmpMibAgent mib, SnmpOid[] oids);
-     /**
-     * Removes the specified MIB from the SNMP protocol adaptor.
-     *
-     * @param mib The MIB to be removed.
-     * @param contextName The context name used at registration time.
-     *
-     * @return <CODE>true</CODE> if the specified <CODE>mib</CODE> was a MIB included in the SNMP MIB handler,
-     * <CODE>false</CODE> otherwise.
-     *
-     * @since 1.5
-     */
-    public boolean removeMib(SnmpMibAgent mib, String contextName);
-     /**
-     * Removes the specified MIB from the SNMP protocol adaptor.
-     *
-     * @param mib The MIB to be removed.
-     * @param contextName The context name used at registration time.
-     * @param oids The oid the MIB was previously registered for.
-     * @return <CODE>true</CODE> if the specified <CODE>mib</CODE> was a MIB included in the SNMP MIB handler,
-     * <CODE>false</CODE> otherwise.
-     *
-     * @since 1.5
-     */
-    public boolean removeMib(SnmpMibAgent mib, String contextName, SnmpOid[] oids);
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,406 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.agent;
-
-
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Vector;
-import java.util.Hashtable;
-import java.util.Enumeration;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * The <CODE>SnmpMibNode</CODE> class represents a node in an SNMP MIB.
- * <P>
- * This class is used internally and by the class generated by
- * <CODE>mibgen</CODE>.
- * You should not need to use this class directly.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-@SuppressWarnings("serial") // JDK implementation class
-public abstract class SnmpMibNode implements Serializable {
-
-    // ---------------------------------------------------------------------
-    // PUBLIC METHODS
-    //----------------------------------------------------------------------
-
-    /**
-     * Get the next OID arc corresponding to a readable scalar variable,
-     * a branch leading to a subgroub, or a table.
-     *
-     * @param id Id we start from looking for the next.
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @return The next id in this group.
-     *
-     * @exception SnmpStatusException If no id is found after the given id.
-     */
-    public long getNextVarId(long id, Object userData)
-        throws SnmpStatusException {
-        return getNextIdentifier(varList,id);
-    }
-
-    /**
-     * Get the next OID arc corresponding to a readable scalar variable,
-     * a branch leading to a subgroub, or a table, possibly skipping over
-     * those arcs that must not or cannot be returned.
-     *
-     * Calls {@link #getNextVarId(long,java.lang.Object)} until
-     * {@link #skipVariable(long,java.lang.Object,int)} returns false.
-     *
-     * @param id Id we start from looking for the next.
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     * @param pduVersion Protocol version of the original request PDU.
-     *
-     * @return The next id in this group which can be returned using
-     *         the given PDU's protocol version.
-     *
-     * @exception SnmpStatusException If no id is found after the given id.
-     */
-    public long getNextVarId(long id, Object userData, int pduVersion)
-        throws SnmpStatusException {
-        long varid=id;
-        do {
-            varid = getNextVarId(varid,userData);
-        } while (skipVariable(varid,userData,pduVersion));
-
-        return varid;
-    }
-
-    /**
-     * Hook for subclasses.
-     * The default implementation of this method is to always return
-     * false. Subclasses should redefine this method so that it returns
-     * true when:
-     * <ul><li>the variable is a leaf that is not instantiated,</li>
-     * <li>or the variable is a leaf whose type cannot be returned by that
-     *     version of the protocol (e.g. an Counter64 with SNMPv1).</li>
-     * </ul>
-     *
-     * @param id Id we start from looking for the next.
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     * @param pduVersion Protocol version of the original request PDU.
-     *
-     * @return true if the variable must be skipped by the get-next
-     *         algorithm.
-     */
-    protected boolean skipVariable(long id, Object userData, int pduVersion) {
-        return false;
-    }
-
-    /**
-     * Find the node which handles a varbind, and register it in the
-     * SnmpRequestTree. This method is a pure internal method. You should
-     * never try to call it directly.
-     *
-     * @param varbind  The varbind to be handled
-     *
-     * @param oid      The OID array extracted from the varbind
-     *
-     * @param depth    The depth reached in the OID at this step of the
-     *                 processing.
-     *
-     * @param handlers The Hashtable in which the varbind will be registered
-     *                 with its handling node. This hashtable contains
-     *                 <CODE>SnmpRequestTree.Handler</CODE> items.
-     *
-     * @exception SnmpStatusException No handling node was found.
-     **/
-    void findHandlingNode(SnmpVarBind varbind,
-                          long[] oid, int depth,
-                          SnmpRequestTree handlers)
-        throws SnmpStatusException {
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Find the node which handles the leaf that immediately follows the
-     * given varbind OID, and register the it in the SnmpRequestTree.
-     * This method is a pure internal method. You should never try to call
-     * it directly.
-     *
-     * @param varbind  The varbind to be handled
-     *
-     * @param oid      The OID array extracted from the varbind
-     *
-     * @param depth    The depth reached in the OID at this step of the
-     *                 processing.
-     *
-     * @param handlers The Hashtable in which the varbind will be registered
-     *                 with its handling node. This hashtable contains
-     *                 SnmpRequestTree.Handler items.
-     *
-     * @return The SnmpOid of the next leaf.
-     *
-     * @exception SnmpStatusException No handling node was found.
-     **/
-    long[] findNextHandlingNode(SnmpVarBind varbind,
-                                 long[] oid, int pos, int depth,
-                                 SnmpRequestTree handlers, AcmChecker checker)
-        throws SnmpStatusException {
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Generic handling of the <CODE>get</CODE> operation.
-     *
-     * <p> You can override this method if you need to implement some
-     * specific policies for minimizing the accesses made to some remote
-     * underlying resources.
-     * <p>
-     *
-     * @param req   The sub-request that must be handled by this node.
-     *
-     * @param depth The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException An error occurred while accessing
-     *  the MIB node.
-     */
-    public abstract void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException;
-
-    /**
-     * Generic handling of the <CODE>set</CODE> operation.
-     * <p> You can override this method if you need to implement some
-     * specific policies for minimizing the accesses made to some remote
-     * underlying resources.
-     * <p>
-     *
-     * @param req   The sub-request that must be handled by this node.
-     *
-     * @param depth The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException An error occurred while accessing
-     *  the MIB node.
-     */
-    public abstract void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException;
-
-    /**
-     * Generic handling of the <CODE>check</CODE> operation.
-     * <p> You can override this method if you need to implement some
-     * specific policies for minimizing the accesses made to some remote
-     * underlying resources, or if you need to implement some consistency
-     * checks between the different values provided in the varbind list.
-     * <p>
-     *
-     * @param req   The sub-request that must be handled by this node.
-     *
-     * @param depth The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException An error occurred while accessing
-     *  the MIB node.
-     */
-    public abstract void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException;
-
-    /**
-     * Sorts the specified integer array.
-     *
-     * @param array An integer array.
-     */
-    static public void sort(int array[]) {
-        QuickSort(array, 0, array.length - 1);
-    }
-
-    /**
-     * Computes the root OID of the MIB.
-     */
-    public void getRootOid(Vector<Integer> result) {
-        return;
-    }
-
-    //----------------------------------------------------------------------
-    // PACKAGE METHODS
-    //----------------------------------------------------------------------
-
-    /**
-     * This is a generic version of C.A.R Hoare's Quick Sort
-     * algorithm.  This will handle arrays that are already
-     * sorted, and arrays with duplicate keys.
-     *
-     * If you think of a one dimensional array as going from
-     * the lowest index on the left to the highest index on the right
-     * then the parameters to this function are lowest index or
-     * left and highest index or right.  The first time you call
-     * this function it will be with the parameters 0, a.length - 1.
-     *
-     * @param a An integer array.
-     * @param lo0 Left boundary of array partition.
-     * @param hi0 Right boundary of array partition.
-     */
-    static void QuickSort(int a[], int lo0, int hi0) {
-        int lo = lo0;
-        int hi = hi0;
-        int mid;
-
-        if ( hi0 > lo0) {
-
-            /* Arbitrarily establishing partition element as the midpoint of
-             * the array.
-             */
-            mid = a[ ( lo0 + hi0 ) / 2 ];
-
-            // loop through the array until indices cross
-            while( lo <= hi ) {
-                /* find the first element that is greater than or equal to
-                 * the partition element starting from the left Index.
-                 */
-                while( ( lo < hi0 )  && ( a[lo] < mid ))
-                    ++lo;
-
-                /* find an element that is smaller than or equal to
-                 * the partition element starting from the right Index.
-                 */
-                while( ( hi > lo0 ) && ( a[hi] > mid ))
-                    --hi;
-
-                // if the indexes have not crossed, swap
-                if( lo <= hi ) {
-                    swap(a, lo, hi);
-                    ++lo;
-                    --hi;
-                }
-            }
-
-            /* If the right index has not reached the left side of array
-             * must now sort the left partition.
-             */
-            if( lo0 < hi )
-                QuickSort( a, lo0, hi );
-
-            /* If the left index has not reached the right side of array
-             * must now sort the right partition.
-             */
-            if( lo < hi0 )
-                QuickSort( a, lo, hi0 );
-
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // PROTECTED METHODS
-    //----------------------------------------------------------------------
-
-    /**
-     * This will give the first element greater than <CODE>value</CODE>
-     * in a sorted array.
-     * If there is no element of the array greater than <CODE>value</CODE>,
-     * the method will throw a <CODE>SnmpStatusException</CODE>.
-     *
-     * @param table A sorted integer array.
-     *
-     * @param value The greatest value.
-     *
-     * @exception SnmpStatusException If there is no element greater than
-     *     <CODE>value</CODE>.
-     */
-    final static protected int getNextIdentifier(int table[], long value)
-        throws SnmpStatusException {
-
-        final int[] a = table;
-        final int val= (int) value;
-
-        if (a == null) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-        }
-
-        int low= 0;
-        int max= a.length;
-        int curr= low + (max-low)/2;
-        int elmt= 0;
-
-        // Basic check
-        //
-        if (max < 1) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-        }
-
-        if (a[max-1] <= val) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-        }
-
-        while (low <= max) {
-            elmt= a[curr];
-            if (val == elmt) {
-                // We ned to get the next index ...
-                //
-                curr++;
-                return a[curr];
-            }
-            if (elmt < val) {
-                low= curr +1;
-            } else {
-                max= curr -1;
-            }
-            curr= low + (max-low)/2;
-        }
-        return a[curr];
-    }
-
-
-    //----------------------------------------------------------------------
-    // PRIVATE METHODS
-    //----------------------------------------------------------------------
-
-    final static private void swap(int a[], int i, int j) {
-        int T;
-        T = a[i];
-        a[i] = a[j];
-        a[j] = T;
-    }
-
-    //----------------------------------------------------------------------
-    // PROTECTED VARIABLES
-    //----------------------------------------------------------------------
-
-    /**
-     * Contains the list of variable identifiers.
-     */
-    protected int[] varList;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibOid.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,566 +0,0 @@
-/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.agent;
-
-
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Vector;
-import java.util.Enumeration;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * Represents a node in an SNMP MIB which is neither a group nor a variable.
- * This class defines a list of sub-nodes and the methods that allow to
- * manipulate the sub-nodes.
- * <P>
- * This class is used internally and by the class generated by
- * <CODE>mibgen</CODE>.
- * You should not need to use this class directly.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpMibOid extends SnmpMibNode implements Serializable {
-    private static final long serialVersionUID = 5012254771107446812L;
-
-    /**
-     * Default constructor.
-     */
-    public SnmpMibOid() {
-    }
-
-    // PUBLIC METHODS
-    //---------------
-
-    /**
-     * Generic handling of the <CODE>get</CODE> operation.
-     *
-     * <p> This method should be overridden in subclasses.
-     * <p>
-     *
-     * @param req   The sub-request that must be handled by this node.
-     *
-     * @param depth The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException The default implementation (if not
-     *            overridden) is to generate a SnmpStatusException.
-     */
-    @Override
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements();) {
-            SnmpVarBind var= e.nextElement();
-            SnmpStatusException x =
-                new SnmpStatusException(SnmpStatusException.noSuchObject);
-            req.registerGetException(var,x);
-        }
-    }
-
-    /**
-     * Generic handling of the <CODE>set</CODE> operation.
-     *
-     * <p> This method should be overridden in subclasses.
-     * <p>
-     *
-     * @param req   The sub-request that must be handled by this node.
-     *
-     * @param depth The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException The default implementation (if not
-     *            overridden) is to generate a SnmpStatusException.
-     */
-    @Override
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements();) {
-            SnmpVarBind var= e.nextElement();
-            SnmpStatusException x =
-                new SnmpStatusException(SnmpStatusException.noAccess);
-            req.registerSetException(var,x);
-        }
-    }
-
-    /**
-     * Generic handling of the <CODE>check</CODE> operation.
-     *
-     * <p> This method should be overridden in subclasses.
-     * <p>
-     *
-     * @param req   The sub-request that must be handled by this node.
-     *
-     * @param depth The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException The default implementation (if not
-     *            overridden) is to generate a SnmpStatusException.
-     */
-    @Override
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements();) {
-            SnmpVarBind var= e.nextElement();
-            SnmpStatusException x =
-                new SnmpStatusException(SnmpStatusException.noAccess);
-            req.registerCheckException(var,x);
-        }
-    }
-
-
-
-    // ---------------------------------------------------------------------
-    //
-    // Implements the method defined in SnmpMibNode.
-    //
-    // ---------------------------------------------------------------------
-    //
-    @Override
-    void findHandlingNode(SnmpVarBind varbind,
-                          long[] oid, int depth,
-                          SnmpRequestTree handlers)
-        throws SnmpStatusException {
-
-
-        final int length = oid.length;
-        SnmpMibNode node = null;
-
-        if (handlers == null)
-            throw new SnmpStatusException(SnmpStatusException.snmpRspGenErr);
-
-        if (depth > length) {
-            // Nothing is left... the oid is not valid
-            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-        } else if (depth == length) {
-            // The oid is not complete...
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        } else {
-            // Some children variable or subobject is being querried
-            // getChild() will raise an exception if no child is found.
-            //
-            final SnmpMibNode child= getChild(oid[depth]);
-
-            // XXXX zzzz : what about null children?
-            //             (variables for nested groups)
-            // if child==null, then we're dealing with a variable or
-            // a table: we register this node.
-            // This behaviour should be overriden in subclasses,
-            // in particular in group meta classes: the group
-            // meta classes that hold tables should take care
-            // of forwarding this call to all the tables involved.
-            //
-            if (child == null)
-                handlers.add(this,depth,varbind);
-            else
-                child.findHandlingNode(varbind,oid,depth+1,handlers);
-        }
-    }
-
-    // ---------------------------------------------------------------------
-    //
-    // Implements the method defined in SnmpMibNode.
-    //
-    // ---------------------------------------------------------------------
-    //
-    @Override
-    long[] findNextHandlingNode(SnmpVarBind varbind,
-                                long[] oid, int pos, int depth,
-                                SnmpRequestTree handlers,
-                                AcmChecker checker)
-        throws SnmpStatusException {
-
-
-        final int length = oid.length;
-        SnmpMibNode node = null;
-        long[] result = null;
-        if (handlers == null) {
-            // This should be considered as a genErr, but we do not want to
-            // abort the whole request, so we're going to throw
-            // a noSuchObject...
-            //
-            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-        }
-
-        final Object data = handlers.getUserData();
-        final int pduVersion = handlers.getRequestPduVersion();
-
-        if (pos >= length) {
-            long[] newOid= new long[1];
-            newOid[0]=  getNextVarId(-1,data,pduVersion);
-            result = findNextHandlingNode(varbind,newOid,0,depth,handlers,
-                                          checker);
-            return result;
-        }
-
-        // search the element specified in the oid
-        //
-        long[] newOid= new long[1];
-        long index= oid[pos];
-
-        while (true) {
-
-            try {
-                final SnmpMibNode child = getChild(index);
-                // SnmpOid result = null;
-                if (child == null) {
-                    // shouldn't happen
-                    throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-                    // validateVarId(index);
-                    // handlers.add(this,varbind,depth);
-                    // result = new SnmpOid(0);
-                } else {
-                    checker.add(depth, index);
-                    try {
-                        result = child.findNextHandlingNode(varbind,oid,pos+1,
-                                                            depth+1,handlers,
-                                                            checker);
-                    } finally {
-                        checker.remove(depth);
-                    }
-                }
-
-                // Build up the leaf OID
-                result[depth] = index;
-                return result;
-
-            } catch(SnmpStatusException e) {
-                // If there is no such element go one level up ...
-                //
-                index= getNextVarId(index,data,pduVersion);
-
-                // There is no need to carry the original oid ...
-                newOid[0]=index;
-                pos= 1;
-                oid=newOid;
-            }
-        }
-    }
-
-
-    /**
-     * Computes the root OID of the MIB.
-     */
-    @Override
-    public void getRootOid(Vector<Integer> result) {
-
-        // If a node has several children, let assume that we are one step to
-        // far in order to get the MIB root.
-        //
-        if (nbChildren != 1)
-            return;
-
-        result.addElement(varList[0]);
-
-        // Now query our child.
-        //
-        children.firstElement().getRootOid(result);
-
-    }
-
-    /**
-     * Registers a specific node in the tree.
-     */
-    public void registerNode(String oidString ,SnmpMibNode node)
-        throws IllegalAccessException {
-        SnmpOid oid= new SnmpOid(oidString);
-        registerNode(oid.longValue(), 0, node);
-    }
-
-    // PROTECTED METHODS
-    //------------------
-
-    /**
-     * Registers a specific node in the tree.
-     */
-    void registerNode(long[] oid, int cursor ,SnmpMibNode node)
-        throws IllegalAccessException {
-
-        if (cursor >= oid.length)
-            throw new IllegalAccessException();
-
-        // Check if the node is already defined
-        //
-        long var= oid[cursor];
-
-        //System.out.println("entering registration for val="
-        // + String.valueOf(var) + " position= " + cursor);
-
-        int pos = retrieveIndex(var);
-        if (pos  == nbChildren) {
-            nbChildren++;
-            varList= new int[nbChildren];
-            varList[0]= (int) var;
-            pos =0;
-            if ( (cursor + 1) == oid.length) {
-                // That 's the end of the trip.
-                // Do not forward the registration
-
-                //System.out.println("End of trip for val="
-                //      + String.valueOf(var) + " position= " + cursor);
-                children.insertElementAt(node,pos);
-                return;
-            }
-
-            //System.out.println("Create node for val="
-            //       + String.valueOf(var) + " position= " + cursor);
-            SnmpMibOid child= new SnmpMibOid();
-            children.insertElementAt(child, pos);
-            child.registerNode(oid, cursor + 1, node);
-            return;
-        }
-        if (pos == -1) {
-            // The node is not yet registered
-            //
-            int[] tmp= new int[nbChildren + 1];
-            tmp[nbChildren]= (int) var;
-            System.arraycopy(varList, 0, tmp, 0, nbChildren);
-            varList= tmp;
-            nbChildren++;
-            SnmpMibNode.sort(varList);
-            int newPos = retrieveIndex(var);
-            varList[newPos]= (int) var;
-            if ( (cursor + 1) == oid.length) {
-                // That 's the end of the trip.
-                // Do not forward the registration
-
-                //System.out.println("End of trip for val="
-                //     + String.valueOf(var) + " position= " + cursor);
-                children.insertElementAt(node, newPos);
-                return;
-            }
-            SnmpMibOid child= new SnmpMibOid();
-            // System.out.println("Create node for val=" +
-            //     String.valueOf(var) + " position= " + cursor);
-            children.insertElementAt(child, newPos);
-            child.registerNode(oid, cursor + 1, node);
-        }
-        else {
-            // The node is already registered
-            //
-            SnmpMibNode child= children.elementAt(pos);
-            if ( (cursor + 1) == oid.length ) {
-                //System.out.println("Node already registered val=" +
-                //          String.valueOf(var) + " position= " + cursor);
-                if (child == node) return;
-                if (child != null && node != null) {
-                    // Now we're going to patch the tree the following way:
-                    //   if a subgroup has been registered before its father,
-                    //   we're going to replace the father OID node with
-                    //   the actual group-node and export the children from
-                    //   the temporary OID node to the actual group node.
-                    //
-
-                    if (node instanceof SnmpMibGroup) {
-                        // `node' is a group => replace `child' with `node'
-                        // export the child's subtree to `node'.
-                        //
-                        ((SnmpMibOid)child).exportChildren((SnmpMibOid)node);
-                        children.setElementAt(node,pos);
-                        return;
-
-                    } else if ((node instanceof SnmpMibOid) &&
-                             (child instanceof SnmpMibGroup)) {
-                        // `node' is a temporary node, and `child' is a
-                        //  group => keep child and export the node's
-                        //  subtree to `child'.
-                        //
-                        ((SnmpMibOid)node).exportChildren((SnmpMibOid)child);
-                        return;
-                    } else if (node instanceof SnmpMibOid) {
-                        // `node' and `child' are both temporary OID nodes
-                        // => replace `child' with `node' and export child's
-                        // subtree to `node'.
-                        //
-                        ((SnmpMibOid)child).exportChildren((SnmpMibOid)node);
-                        children.setElementAt(node,pos);
-                        return;
-                    }
-                }
-                children.setElementAt(node,pos);
-            } else {
-                if (child == null)
-                    throw new IllegalAccessException();
-                ((SnmpMibOid)child).registerNode(oid, cursor + 1, node);
-            }
-        }
-    }
-
-    /**
-     * Export this node's children to a brother node that will replace
-     * this node in the OID tree.
-     * This method is a patch that fixes the problem of registering
-     * a subnode before its father node.
-     *
-     **/
-    void exportChildren(SnmpMibOid brother)
-        throws IllegalAccessException {
-
-        if (brother == null) return;
-        final long[] oid = new long[1];
-        for (int i=0; i<nbChildren; i++) {
-            final SnmpMibNode child = children.elementAt(i);
-            if (child == null) continue;
-            oid[0] = varList[i];
-            brother.registerNode(oid,0,child);
-        }
-    }
-
-    // PRIVATE METHODS
-    //----------------
-
-    SnmpMibNode getChild(long id) throws SnmpStatusException {
-
-        // first we need to retrieve the identifier in the list of children
-        //
-        final int pos= getInsertAt(id);
-        if (pos >= nbChildren) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-        }
-
-        if (varList[pos] != (int) id) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-        }
-
-        // Access the node
-        //
-        SnmpMibNode child = null;
-        try {
-            child = children.elementAtNonSync(pos);
-        } catch(ArrayIndexOutOfBoundsException e) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-        }
-        if (child == null) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-        return child;
-    }
-
-    private int retrieveIndex(long val) {
-
-        int low= 0;
-        int cursor= (int) val;
-        if (varList == null || varList.length < 1)
-            return nbChildren;
-
-        int max= varList.length -1 ;
-        int curr= low + (max-low)/2;
-        int elmt;
-        while (low <= max) {
-            elmt= varList[curr];
-            if (cursor == elmt) {
-                // We need to get the next index ...
-                //
-                return curr;
-            }
-            if (elmt < cursor) {
-                low= curr +1;
-            } else {
-                max= curr -1;
-            }
-            curr= low + (max-low)/2;
-        }
-        return -1;
-    }
-
-    private int getInsertAt(long val) {
-
-        int low= 0;
-        final int index= (int) val;
-        if (varList == null)
-            return -1;
-        int max= varList.length -1 ;
-        int elmt;
-        //final int[] v = varList;
-
-        //if (index > a[max])
-        //return max +1;
-
-
-        int curr= low + (max-low)/2;
-        while (low <= max) {
-
-            elmt= varList[curr];
-
-            // never know ...we might find something ...
-            //
-            if (index == elmt)
-                return curr;
-
-            if (elmt < index) {
-                low= curr +1;
-            } else {
-                max= curr -1;
-            }
-            curr= low + (max-low)/2;
-        }
-
-        return curr;
-    }
-
-    // PRIVATE VARIABLES
-    //------------------
-
-    /**
-     * Contains the list of sub nodes.
-     */
-    private NonSyncVector<SnmpMibNode> children = new NonSyncVector<>(1);
-
-    /**
-     * The number of sub nodes.
-     */
-    private int nbChildren= 0;
-
-
-    // All the methods of the Vector class are synchronized.
-    // Synchronization is a very expensive operation. In our case it is
-    // not always required...
-    //
-    @SuppressWarnings("serial")  // We will never serialize this
-    class NonSyncVector<E> extends Vector<E> {
-
-        public NonSyncVector(int size) {
-            super(size);
-        }
-
-        final void addNonSyncElement(E obj) {
-            ensureCapacity(elementCount + 1);
-            elementData[elementCount++] = obj;
-        }
-
-        @SuppressWarnings("unchecked")  // cast to E
-        final E elementAtNonSync(int index) {
-            return (E) elementData[index];
-        }
-
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibRequest.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.agent;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpEngine;
-
-/**
- * This interface models the part of a SNMP request that involves
- * a specific MIB. One object implementing this interface will be created
- * for every MIB involved in a SNMP request, and that object will be passed
- * to the SnmpMibAgent in charge of handling that MIB.
- *
- * Objects implementing this interface will be allocated by the SNMP engine.
- * You will never need to implement this interface. You will only use it.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-public interface SnmpMibRequest {
-    /**
-     * Returns the list of varbind to be handled by the SNMP mib node.
-     *
-     * @return The element of the enumeration are instances of
-     *         {@link com.sun.jmx.snmp.SnmpVarBind}
-     */
-    public Enumeration<SnmpVarBind> getElements();
-
-    /**
-     * Returns the vector of varbind to be handled by the SNMP mib node.
-     * The caller shall not modify this vector.
-     *
-     * @return The element of the vector are instances of
-     *         {@link com.sun.jmx.snmp.SnmpVarBind}
-     */
-    public Vector<SnmpVarBind> getSubList();
-
-    /**
-     * Returns the SNMP protocol version of the original request. If SNMP V1 request are received, the version is upgraded to SNMP V2.
-     *
-     * @return The SNMP protocol version of the original request.
-     */
-    public int getVersion();
-
-    /**
-     * Returns the SNMP protocol version of the original request. No translation is done on the version. The actual received request SNMP version is returned.
-     *
-     * @return The SNMP protocol version of the original request.
-     *
-     * @since 1.5
-     */
-    public int getRequestPduVersion();
-
-    /**
-     * Returns the local engine. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
-     * @return the local engine.
-     *
-     * @since 1.5
-     */
-    public SnmpEngine getEngine();
-    /**
-     * Gets the incoming request principal. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
-     * @return The request principal.
-     *
-     * @since 1.5
-     **/
-    public String getPrincipal();
-    /**
-     * Gets the incoming request security level. This level is defined in {@link com.sun.jmx.snmp.SnmpEngine SnmpEngine}. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise -1 is returned.
-     * @return The security level.
-     *
-     * @since 1.5
-     */
-    public int getSecurityLevel();
-    /**
-     * Gets the incoming request security model. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise -1 is returned.
-     * @return The security model.
-     *
-     * @since 1.5
-     */
-    public int getSecurityModel();
-    /**
-     * Gets the incoming request context name. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
-     * @return The context name.
-     *
-     * @since 1.5
-     */
-    public byte[] getContextName();
-    /**
-     * Gets the incoming request context name used by Access Control Model in order to allow or deny the access to OIDs. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
-     * @return The checked context name.
-     *
-     * @since 1.5
-     */
-    public byte[] getAccessContextName();
-
-    /**
-     * Returns a handle on a user allocated contextual object.
-     * This contextual object is allocated through the SnmpUserDataFactory
-     * on a per SNMP request basis, and is handed back to the user via
-     * SnmpMibRequest (and derivative) objects. It is never accessed by
-     * the system, but might be handed back in multiple threads. It is thus
-     * the user responsibility to make sure he handles this object in a
-     * thread safe manner.
-     */
-    public Object getUserData();
-
-    /**
-     * Returns the varbind index that should be embedded in an
-     * SnmpStatusException for this particular varbind.
-     * This does not necessarily correspond to the "real"
-     * index value that will be returned in the result PDU.
-     *
-     * @param varbind The varbind for which the index value is
-     *        querried. Note that this varbind <b>must</b> have
-     *        been obtained from the enumeration returned by
-     *        <CODE>getElements()</CODE>, or from the vector
-     *        returned by <CODE>getSublist()</CODE>.
-     *
-     * @return The varbind index that should be embedded in an
-     *         SnmpStatusException for this particular varbind.
-     */
-    public int getVarIndex(SnmpVarBind varbind);
-
-    /**
-     * Adds a varbind to this request sublist. This method is used for
-     * internal purposes and you should never need to call it directly.
-     *
-     * @param varbind The varbind to be added in the sublist.
-     *
-     */
-    public void addVarBind(SnmpVarBind varbind);
-
-
-    /**
-     * Returns the number of elements (varbinds) in this request sublist.
-     *
-     * @return The number of elements in the sublist.
-     *
-     **/
-    public int getSize();
-    /**
-     * Returns the SNMP PDU attached to the request.
-     * @return The SNMP PDU.
-     *
-     * @since 1.5
-     **/
-    public SnmpPdu getPdu();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibRequestImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,257 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.agent;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpEngine;
-
-/**
- * This class implements the SnmpMibRequest interface.
- * It represents the part of a SNMP request that involves a specific
- * MIB. One instance of this class will be created for every MIB
- * involved in a SNMP request, and will be passed to the SnmpMibAgent
- * in charge of handling that MIB.
- *
- * Instances of this class are allocated by the SNMP engine. You will
- * never need to use this class directly. You will only access
- * instances of this class through their SnmpMibRequest interface.
- *
- */
-final class SnmpMibRequestImpl implements SnmpMibRequest {
-
-    /**
-     * @param engine The local engine.
-     * @param reqPdu The received pdu.
-     * @param vblist The vector of SnmpVarBind objects in which the
-     *        MIB concerned by this request is involved.
-     * @param protocolVersion  The protocol version of the SNMP request.
-     * @param userData     User allocated contextual data. This object must
-     *        be allocated on a per SNMP request basis through the
-     *        SnmpUserDataFactory registered with the SnmpAdaptorServer,
-     *        and is handed back to the user through SnmpMibRequest objects.
-     */
-    public SnmpMibRequestImpl(SnmpEngine engine,
-                              SnmpPdu reqPdu,
-                              Vector<SnmpVarBind> vblist,
-                              int protocolVersion,
-                              Object userData,
-                              String principal,
-                              int securityLevel,
-                              int securityModel,
-                              byte[] contextName,
-                              byte[] accessContextName) {
-        varbinds   = vblist;
-        version    = protocolVersion;
-        data       = userData;
-        this.reqPdu = reqPdu;
-        this.engine = engine;
-        this.principal = principal;
-        this.securityLevel = securityLevel;
-        this.securityModel = securityModel;
-        this.contextName = contextName;
-        this.accessContextName = accessContextName;
-    }
-    // -------------------------------------------------------------------
-    // PUBLIC METHODS from SnmpMibRequest
-    // -------------------------------------------------------------------
-
-    /**
-     * Returns the local engine. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
-     * @return the local engine.
-     */
-    @Override
-    public SnmpEngine getEngine() {
-        return engine;
-    }
-
-    /**
-     * Gets the incoming request principal. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
-     * @return The request principal.
-     **/
-    @Override
-    public String getPrincipal() {
-        return principal;
-    }
-
-    /**
-     * Gets the incoming request security level. This level is defined in {@link com.sun.jmx.snmp.SnmpEngine SnmpEngine}. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise -1 is returned.
-     * @return The security level.
-     */
-    @Override
-    public int getSecurityLevel() {
-        return securityLevel;
-    }
-    /**
-     * Gets the incoming request security model. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise -1 is returned.
-     * @return The security model.
-     */
-    @Override
-    public int getSecurityModel() {
-        return securityModel;
-    }
-    /**
-     * Gets the incoming request context name. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
-     * @return The context name.
-     */
-    @Override
-    public byte[] getContextName() {
-        return contextName;
-    }
-
-    /**
-     * Gets the incoming request context name used by Access Control Model in order to allow or deny the access to OIDs. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
-     * @return The checked context.
-     */
-    @Override
-    public byte[] getAccessContextName() {
-        return accessContextName;
-    }
-
-    // -------------------------------------------------------------------
-    // Implements the method defined in SnmpMibRequest interface.
-    // See SnmpMibRequest for the java doc.
-    // -------------------------------------------------------------------
-    @Override
-    public final SnmpPdu getPdu() {
-        return reqPdu;
-    }
-
-    // -------------------------------------------------------------------
-    // Implements the method defined in SnmpMibRequest interface.
-    // See SnmpMibRequest for the java doc.
-    // -------------------------------------------------------------------
-    @Override
-    public final Enumeration<SnmpVarBind> getElements()  {return varbinds.elements();}
-
-    // -------------------------------------------------------------------
-    // Implements the method defined in SnmpMibRequest interface.
-    // See SnmpMibRequest for the java doc.
-    // -------------------------------------------------------------------
-    @Override
-    public final Vector<SnmpVarBind> getSubList()  {return varbinds;}
-
-    // -------------------------------------------------------------------
-    // Implements the method defined in SnmpMibRequest interface.
-    // See SnmpMibRequest for the java doc.
-    // -------------------------------------------------------------------
-    @Override
-    public final int getSize()  {
-        if (varbinds == null) return 0;
-        return varbinds.size();
-    }
-
-    // -------------------------------------------------------------------
-    // Implements the method defined in SnmpMibRequest interface.
-    // See SnmpMibRequest for the java doc.
-    // -------------------------------------------------------------------
-    @Override
-    public final int         getVersion()  {return version;}
-
-    // -------------------------------------------------------------------
-    // Implements the method defined in SnmpMibRequest interface.
-    // See SnmpMibRequest for the java doc.
-    // -------------------------------------------------------------------
-    @Override
-    public final int         getRequestPduVersion()  {return reqPdu.version;}
-
-    // -------------------------------------------------------------------
-    // Implements the method defined in SnmpMibRequest interface.
-    // See SnmpMibRequest for the java doc.
-    // -------------------------------------------------------------------
-    @Override
-    public final Object      getUserData() {return data;}
-
-    // -------------------------------------------------------------------
-    // Implements the method defined in SnmpMibRequest interface.
-    // See SnmpMibRequest for the java doc.
-    // -------------------------------------------------------------------
-    @Override
-    public final int getVarIndex(SnmpVarBind varbind) {
-        return varbinds.indexOf(varbind);
-    }
-
-    // -------------------------------------------------------------------
-    // Implements the method defined in SnmpMibRequest interface.
-    // See SnmpMibRequest for the java doc.
-    // -------------------------------------------------------------------
-    @Override
-    public void addVarBind(SnmpVarBind varbind) {
-        varbinds.addElement(varbind);
-    }
-
-    // -------------------------------------------------------------------
-    // PACKAGE METHODS
-    // -------------------------------------------------------------------
-
-    // -------------------------------------------------------------------
-    // Allow to pass the request tree built during the check() phase
-    // to the set() method. Note: the if the tree is `null', then the
-    // set() method will rebuild a new tree identical to the tree built
-    // in the check() method.
-    //
-    // Passing this tree in the SnmpMibRequestImpl object allows to
-    // optimize the SET requests.
-    //
-    // -------------------------------------------------------------------
-    final void setRequestTree(SnmpRequestTree tree) {this.tree = tree;}
-
-    // -------------------------------------------------------------------
-    // Returns the SnmpRequestTree object built in the first operation
-    // phase for two-phase SNMP requests (like SET).
-    // -------------------------------------------------------------------
-    final SnmpRequestTree getRequestTree() {return tree;}
-
-    // -------------------------------------------------------------------
-    // Returns the underlying vector of SNMP varbinds (used for algorithm
-    // optimization).
-    // -------------------------------------------------------------------
-    final Vector<SnmpVarBind> getVarbinds() {return varbinds;}
-
-    // -------------------------------------------------------------------
-    // Private variables
-    // -------------------------------------------------------------------
-
-    // Ideally these variables should be declared final but it makes
-    // the jdk1.1.x compiler complain (seems to be a compiler bug, jdk1.2
-    // is OK).
-    private Vector<SnmpVarBind> varbinds;
-    private int    version;
-    private Object data;
-    private SnmpPdu reqPdu = null;
-    // Non final variable.
-    private SnmpRequestTree tree = null;
-    private SnmpEngine engine = null;
-    private String principal = null;
-    private int securityLevel = -1;
-    private int securityModel = -1;
-    private byte[] contextName = null;
-    private byte[] accessContextName = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibSubRequest.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.agent;
-
-import java.util.Enumeration;
-import java.util.Vector;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpOid;
-// import com.sun.jmx.snmp.SnmpIndex;
-
-/**
- * This interface models an SNMP sub request to be performed on a specific
- * SNMP MIB node. The node involved can be either an SNMP group, an SNMP table,
- * or an SNMP table entry (conceptual row). The conceptual row may or may not
- * already exist. If the row did not exist at the time when the request
- * was received, the <CODE>isNewEntry()</CODE> method will return <CODE>
- * true</CODE>.
- * <p>
- * Objects implementing this interface will be allocated by the SNMP engine.
- * You will never need to implement this interface. You will only use it.
- * </p>
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-public interface SnmpMibSubRequest extends SnmpMibRequest {
-    /**
-     * Return the list of varbind to be handled by the SNMP MIB node.
-     * <p>
-     * <b>Note:</b> <ul>
-     * <i>In case of SET operation, if this node is a table row which
-     * contains a control variable (as identified by the table's
-     * isRowStatus() method) the control variable will not
-     * be included in this list: it will be obtained by calling
-     * getRowStatusVarBind(). This will allow you to handle the control
-     * variable specifically.</i><br>
-     * You will never need to worry about this unless you need to
-     * implement a non standard mechanism for handling row
-     * creation and deletion.
-     * </ul>
-     * <p>
-     * @return The elements of the enumeration are instances of
-     *         {@link com.sun.jmx.snmp.SnmpVarBind}
-     */
-    @Override
-    public Enumeration<SnmpVarBind> getElements();
-
-    /**
-     * Return the list of varbind to be handled by the SNMP MIB node.
-     * <p>
-     * <b>Note:</b> <ul>
-     * <i>In case of SET operation, if this node is a table row which
-     * contains a control variable (as identified by the table's
-     * isRowStatus() method) the control variable will not
-     * be included in this list: it will be obtained by calling
-     * getRowStatusVarBind(). This will allow you to handle the control
-     * variable specifically.</i><br>
-     * You will never need to worry about this unless you need to
-     * implement a non standard mechanism for handling row
-     * creation and deletion.
-     * </ul>
-     * <p>
-     * @return The elements of the vector are instances of
-     *         {@link com.sun.jmx.snmp.SnmpVarBind}
-     */
-    @Override
-    public Vector<SnmpVarBind> getSubList();
-
-    /**
-     * Return the part of the OID identifying the table entry involved.
-     * <p>
-     *
-     * @return {@link com.sun.jmx.snmp.SnmpOid} or <CODE>null</CODE>
-     *         if the request is not directed to an entry.
-     */
-    public SnmpOid     getEntryOid();
-
-    /**
-     * Indicate whether the entry involved is a new entry.
-     * This method will return <CODE>true</CODE> if the entry was not
-     * found when the request was processed. As a consequence, <CODE>
-     * true</CODE> means that either the entry does not exist yet,
-     * or it has been created while processing this request.
-     * The result of this method is only significant when an entry
-     * is involved.
-     *
-     * <p>
-     * @return <CODE>true</CODE> If the entry did not exist,
-     *  or <CODE>false</CODE> if the entry involved was found.
-     */
-    public boolean     isNewEntry();
-
-    /**
-     * Return the varbind that holds the RowStatus variable.
-     * It corresponds to the varbind that was identified by
-     * the <code>isRowStatus()</code> method generated by mibgen
-     * on {@link com.sun.jmx.snmp.agent.SnmpMibTable} derivatives.
-     * <ul><li>In SMIv2, it is the varbind which contains the columnar
-     *         object implementing the RowStatus TEXTUAL-CONVENTION.</li>
-     *      <li>In SMIv1 nothing special is generated</li>
-     *      <ul>You may however subclass the generated table metadata
-     *          class in order to provide your own implementation of
-     *          isRowStatus(), getRowAction(), isRowReady() and
-     *          setRowStatus()
-     *          (see  {@link com.sun.jmx.snmp.agent.SnmpMibTable}).</ul>
-     * </ul>
-     * <p>
-     * @return a varbind that serves to control the table modification.
-     *         <code>null</code> means that no such varbind could be
-     *         identified.<br>
-     *         <b>Note:</b><i>The runtime will only try to identify
-     *         the RowStatus varbind when processing an
-     *         SNMP SET request. In this case, the identified
-     *         varbind will not be included in the set of varbinds
-     *         returned by getSubList() and getElements().
-     *         </i>
-     *
-     **/
-    public SnmpVarBind getRowStatusVarBind();
-
-    /**
-     * This method should be called when a status exception needs to
-     * be raised for a given varbind of an SNMP GET request. This method
-     * performs all the necessary conversions (SNMPv1 <=> SNMPv2) and
-     * propagates the exception if needed:
-     * If the version is SNMP v1, the exception is propagated.
-     * If the version is SNMP v2, the exception is stored in the varbind.
-     * This method also takes care of setting the correct value of the
-     * index field.
-     * <p>
-     *
-     * @param varbind The varbind for which the exception is
-     *        registered. Note that this varbind <b>must</b> have
-     *        been obtained from the enumeration returned by
-     *        <CODE>getElements()</CODE>, or from the vector
-     *        returned by <CODE>getSubList()</CODE>
-     *
-     * @param exception The exception to be registered for the given varbind.
-     *
-     */
-    public void registerGetException(SnmpVarBind varbind,
-                                     SnmpStatusException exception)
-        throws SnmpStatusException;
-
-    /**
-     * This method should be called when a status exception needs to
-     * be raised for a given varbind of an SNMP SET request. This method
-     * performs all the necessary conversions (SNMPv1 <=> SNMPv2) and
-     * propagates the exception if needed.
-     * This method also takes care of setting the correct value of the
-     * index field.
-     * <p>
-     *
-     * @param varbind The varbind for which the exception is
-     *        registered. Note that this varbind <b>must</b> have
-     *        been obtained from the enumeration returned by
-     *        <CODE>getElements()</CODE>, or from the vector
-     *        returned by <CODE>getSubList()</CODE>
-     *
-     * @param exception The exception to be registered for the given varbind.
-     *
-     */
-    public void registerSetException(SnmpVarBind varbind,
-                                     SnmpStatusException exception)
-        throws SnmpStatusException;
-
-    /**
-     * This method should be called when a status exception needs to
-     * be raised when checking a given varbind for an SNMP SET request.
-     * This method performs all the necessary conversions (SNMPv1 <=>
-     * SNMPv2) and propagates the exception if needed.
-     * This method also takes care of setting the correct value of the
-     * index field.
-     * <p>
-     *
-     * @param varbind The varbind for which the exception is
-     *        registered. Note that this varbind <b>must</b> have
-     *        been obtained from the enumeration returned by
-     *        <CODE>getElements()</CODE>, or from the vector
-     *        returned by <CODE>getSubList()</CODE>
-     *
-     * @param exception The exception to be registered for the given varbind.
-     *
-     */
-    public void registerCheckException(SnmpVarBind varbind,
-                                       SnmpStatusException exception)
-        throws SnmpStatusException;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2561 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.agent;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-import java.util.logging.Level;
-
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanNotificationInfo;
-import javax.management.Notification;
-import javax.management.NotificationBroadcaster;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
-
-import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-
-/**
- * This class is the base class for SNMP table metadata.
- * <p>
- * Its responsibility is to manage a sorted array of OID indexes
- * according to the SNMP indexing scheme over the "real" table.
- * Each object of this class can be bound to an
- * {@link com.sun.jmx.snmp.agent.SnmpTableEntryFactory} to which it will
- * forward remote entry creation requests, and invoke callbacks
- * when an entry has been successfully added to / removed from
- * the OID index array.
- * </p>
- *
- * <p>
- * For each table defined in the MIB, mibgen will generate a specific
- * class called Table<i>TableName</i> that will implement the
- * SnmpTableEntryFactory interface, and a corresponding
- * <i>TableName</i>Meta class that will extend this class. <br>
- * The Table<i>TableName</i> class corresponds to the MBean view of the
- * table while the <i>TableName</i>Meta class corresponds to the
- * MIB metadata view of the same table.
- * </p>
- *
- * <p>
- * Objects of this class are instantiated by the generated
- * whole MIB class extending {@link com.sun.jmx.snmp.agent.SnmpMib}
- * You should never need to instantiate this class directly.
- * </p>
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @see com.sun.jmx.snmp.agent.SnmpMib
- * @see com.sun.jmx.snmp.agent.SnmpMibEntry
- * @see com.sun.jmx.snmp.agent.SnmpTableEntryFactory
- * @see com.sun.jmx.snmp.agent.SnmpTableSupport
- *
- */
-@SuppressWarnings("serial") // JDK implementation class
-public abstract class SnmpMibTable extends SnmpMibNode
-    implements NotificationBroadcaster, Serializable {
-
-    /**
-     * Create a new <CODE>SnmpMibTable</CODE> metadata node.
-     *
-     * <p>
-     * @param mib The SNMP MIB to which the metadata will be linked.
-     */
-    public SnmpMibTable(SnmpMib mib) {
-        this.theMib= mib;
-        setCreationEnabled(false);
-    }
-
-    // -------------------------------------------------------------------
-    // PUBLIC METHODS
-    // -------------------------------------------------------------------
-
-    /**
-     * This method is invoked when the creation of a new entry is requested
-     * by a remote SNMP manager.
-     * <br>By default, remote entry creation is disabled - and this method
-     * will not be called. You can dynamically switch the entry creation
-     * policy by calling <code>setCreationEnabled(true)</code> and <code>
-     * setCreationEnabled(false)</code> on this object.
-     * <p><b><i>
-     * This method is called internally by the SNMP runtime and you
-     * should never need to call it directly. </b></i>However you might want
-     * to extend it in order to implement your own specific application
-     * behaviour, should the default behaviour not be at your convenience.
-     * </p>
-     * <p>
-     * @param req   The SNMP  subrequest requesting this creation
-     * @param rowOid  The OID indexing the conceptual row (entry) for which
-     *                the creation was requested.
-     * @param depth The position of the columnar object arc in the OIDs
-     *              from the varbind list.
-     *
-     * @exception SnmpStatusException if the entry cannot be created.
-     */
-    public abstract void createNewEntry(SnmpMibSubRequest req, SnmpOid rowOid,
-                                        int depth)
-        throws SnmpStatusException;
-
-    /**
-     * Tell whether the specific version of this metadata generated
-     * by <code>mibgen</code> requires entries to be registered with
-     * the MBeanServer. In this case an ObjectName will have to be
-     * passed to addEntry() in order for the table to behave correctly
-     * (case of the generic metadata).
-     * <p>
-     * If that version of the metadata does not require entry to be
-     * registered, then passing an ObjectName becomes optional (null
-     * can be passed instead).
-     *
-     * @return <code>true</code> if registration is required by this
-     *         version of the metadata.
-     */
-    public abstract boolean isRegistrationRequired();
-
-    /**
-     * Tell whether a new entry should be created when a SET operation
-     * is received for an entry that does not exist yet.
-     *
-     * @return true if a new entry must be created, false otherwise.<br>
-     *         [default: returns <CODE>false</CODE>]
-     **/
-    public boolean isCreationEnabled() {
-        return creationEnabled;
-    }
-
-    /**
-     * This method lets you dynamically switch the creation policy.
-     *
-     * <p>
-     * @param remoteCreationFlag Tells whether remote entry creation must
-     *        be enabled or disabled.
-     * <ul><li>
-     * <CODE>setCreationEnabled(true)</CODE> will enable remote entry
-     *      creation via SET operations.</li>
-     * <li>
-     * <CODE>setCreationEnabled(false)</CODE> will disable remote entry
-     *      creation via SET operations.</li>
-     * <p> By default remote entry creation via SET operation is disabled.
-     * </p>
-     * </ul>
-     **/
-    public void setCreationEnabled(boolean remoteCreationFlag) {
-        creationEnabled = remoteCreationFlag;
-    }
-
-    /**
-     * Return <code>true</code> if the conceptual row contains a columnar
-     * object used to control creation/deletion of rows in this table.
-     * <p>
-     * This  columnar object can be either a variable with RowStatus
-     * syntax as defined by RFC 2579, or a plain variable whose
-     * semantics is table specific.
-     * <p>
-     * By default, this function returns <code>false</code>, and it is
-     * assumed that the table has no such control variable.<br>
-     * When <code>mibgen</code> is used over SMIv2 MIBs, it will generate
-     * an <code>hasRowStatus()</code> method returning <code>true</code>
-     * for each table containing an object with RowStatus syntax.
-     * <p>
-     * When this method returns <code>false</code> the default mechanism
-     * for remote entry creation is used.
-     * Otherwise, creation/deletion is performed as specified
-     * by the control variable (see getRowAction() for more details).
-     * <p>
-     * This method is called internally when a SET request involving
-     * this table is processed.
-     * <p>
-     * If you need to implement a control variable which do not use
-     * the RowStatus convention as defined by RFC 2579, you should
-     * subclass the generated table metadata class in order to redefine
-     * this method and make it returns <code>true</code>.<br>
-     * You will then have to redefine the isRowStatus(), mapRowStatus(),
-     * isRowReady(), and setRowStatus() methods to suit your specific
-     * implementation.
-     * <p>
-     * @return <li><code>true</code> if this table contains a control
-     *         variable (eg: a variable with RFC 2579 RowStatus syntax),
-     *         </li>
-     *         <li><code>false</code> if this table does not contain
-     *         any control variable.</li>
-     *
-     **/
-    public boolean hasRowStatus() {
-        return false;
-    }
-
-    // ---------------------------------------------------------------------
-    //
-    // Implements the method defined in SnmpMibNode.
-    //
-    // ---------------------------------------------------------------------
-    /**
-     * Generic handling of the <CODE>get</CODE> operation.
-     * <p> The default implementation of this method is to
-     * <ul>
-     * <li> check whether the entry exists, and if not register an
-     *      exception for each varbind in the list.
-     * <li> call the generated
-     *      <CODE>get(req,oid,depth+1)</CODE> method. </li>
-     * </ul>
-     * <p>
-     * <pre>
-     * public void get(SnmpMibSubRequest req, int depth)
-     *    throws SnmpStatusException {
-     *    boolean         isnew  = req.isNewEntry();
-     *
-     *    // if the entry does not exists, then registers an error for
-     *    // each varbind involved (nb: this should not happen, since
-     *    // the error should already have been detected earlier)
-     *    //
-     *    if (isnew) {
-     *        SnmpVarBind     var = null;
-     *        for (Enumeration e= req.getElements(); e.hasMoreElements();) {
-     *            var = (SnmpVarBind) e.nextElement();
-     *            req.registerGetException(var,noSuchNameException);
-     *        }
-     *    }
-     *
-     *    final SnmpOid oid = req.getEntryOid();
-     *    get(req,oid,depth+1);
-     * }
-     * </pre>
-     * <p> You should not need to override this method in any cases, because
-     * it will eventually call
-     * <CODE>get(SnmpMibSubRequest req, int depth)</CODE> on the generated
-     * derivative of <CODE>SnmpMibEntry</CODE>. If you need to implement
-     * specific policies for minimizing the accesses made to some remote
-     * underlying resources, or if you need to implement some consistency
-     * checks between the different values provided in the varbind list,
-     * you should then rather override
-     * <CODE>get(SnmpMibSubRequest req, int depth)</CODE> on the generated
-     * derivative of <CODE>SnmpMibEntry</CODE>.
-     * <p>
-     *
-     */
-    @Override
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-
-        final boolean         isnew  = req.isNewEntry();
-        final SnmpMibSubRequest  r      = req;
-
-        // if the entry does not exists, then registers an error for
-        // each varbind involved (nb: should not happen, the error
-        // should have been registered earlier)
-        if (isnew) {
-            SnmpVarBind var;
-            for (Enumeration<SnmpVarBind> e= r.getElements(); e.hasMoreElements();) {
-                var = e.nextElement();
-                r.registerGetException(var,new SnmpStatusException(SnmpStatusException.noSuchInstance));
-            }
-        }
-
-        final SnmpOid     oid    = r.getEntryOid();
-
-        // SnmpIndex   index  = buildSnmpIndex(oid.longValue(false), 0);
-        // get(req,index,depth+1);
-        //
-        get(req,oid,depth+1);
-    }
-
-    // ---------------------------------------------------------------------
-    //
-    // Implements the method defined in SnmpMibNode.
-    //
-    // ---------------------------------------------------------------------
-    /**
-     * Generic handling of the <CODE>check</CODE> operation.
-     * <p> The default implementation of this method is to
-     * <ul>
-     * <li> check whether a new entry must be created, and if remote
-     *      creation of entries is enabled, create it. </li>
-     * <li> call the generated
-     *      <CODE>check(req,oid,depth+1)</CODE> method. </li>
-     * </ul>
-     * <p>
-     * <pre>
-     * public void check(SnmpMibSubRequest req, int depth)
-     *    throws SnmpStatusException {
-     *    final SnmpOid     oid    = req.getEntryOid();
-     *    final int         action = getRowAction(req,oid,depth+1);
-     *
-     *    beginRowAction(req,oid,depth+1,action);
-     *    check(req,oid,depth+1);
-     * }
-     * </pre>
-     * <p> You should not need to override this method in any cases, because
-     * it will eventually call
-     * <CODE>check(SnmpMibSubRequest req, int depth)</CODE> on the generated
-     * derivative of <CODE>SnmpMibEntry</CODE>. If you need to implement
-     * specific policies for minimizing the accesses made to some remote
-     * underlying resources, or if you need to implement some consistency
-     * checks between the different values provided in the varbind list,
-     * you should then rather override
-     * <CODE>check(SnmpMibSubRequest req, int depth)</CODE> on the generated
-     * derivative of <CODE>SnmpMibEntry</CODE>.
-     * <p>
-     *
-     */
-    @Override
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        final SnmpOid     oid    = req.getEntryOid();
-        final int         action = getRowAction(req,oid,depth+1);
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMibTable.class.getName(),
-                    "check", "Calling beginRowAction");
-        }
-
-        beginRowAction(req,oid,depth+1,action);
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMibTable.class.getName(),
-                    "check",
-                    "Calling check for " + req.getSize() + " varbinds");
-        }
-
-        check(req,oid,depth+1);
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMibTable.class.getName(),
-                    "check", "check finished");
-        }
-    }
-
-    // ---------------------------------------------------------------------
-    //
-    // Implements the method defined in SnmpMibNode.
-    //
-    // ---------------------------------------------------------------------
-    /**
-     * Generic handling of the <CODE>set</CODE> operation.
-     * <p> The default implementation of this method is to
-     * call the generated
-     * <CODE>set(req,oid,depth+1)</CODE> method.
-     * <p>
-     * <pre>
-     * public void set(SnmpMibSubRequest req, int depth)
-     *    throws SnmpStatusException {
-     *    final SnmpOid oid = req.getEntryOid();
-     *    final int  action = getRowAction(req,oid,depth+1);
-     *
-     *    set(req,oid,depth+1);
-     *    endRowAction(req,oid,depth+1,action);
-     * }
-     * </pre>
-     * <p> You should not need to override this method in any cases, because
-     * it will eventually call
-     * <CODE>set(SnmpMibSubRequest req, int depth)</CODE> on the generated
-     * derivative of <CODE>SnmpMibEntry</CODE>. If you need to implement
-     * specific policies for minimizing the accesses made to some remote
-     * underlying resources, or if you need to implement some consistency
-     * checks between the different values provided in the varbind list,
-     * you should then rather override
-     * <CODE>set(SnmpMibSubRequest req, int depth)</CODE> on the generated
-     * derivative of <CODE>SnmpMibEntry</CODE>.
-     * <p>
-     *
-     */
-    @Override
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMibTable.class.getName(),
-                    "set", "Entering set");
-        }
-
-        final SnmpOid     oid    = req.getEntryOid();
-        final int         action = getRowAction(req,oid,depth+1);
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMibTable.class.getName(),
-                    "set", "Calling set for " + req.getSize() + " varbinds");
-        }
-
-        set(req,oid,depth+1);
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMibTable.class.getName(),
-                    "set", "Calling endRowAction");
-        }
-
-        endRowAction(req,oid,depth+1,action);
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMibTable.class.getName(),
-                    "set", "RowAction finished");
-        }
-
-    }
-
-    /**
-     * Add a new entry in this <CODE>SnmpMibTable</CODE>.
-     * Also triggers the addEntryCB() callback of the
-     * {@link com.sun.jmx.snmp.agent.SnmpTableEntryFactory} interface
-     * if this node is bound to a factory.
-     *
-     * This method assumes that the given entry will not be registered.
-     * If the entry is going to be registered, or if ObjectName's are
-     * required, then
-     * {@link com.sun.jmx.snmp.agent.SnmpMibTable#addEntry(SnmpOid,
-     * ObjectName, Object)} should be preferred.
-     * <br> This function is mainly provided for backward compatibility.
-     *
-     * <p>
-     * @param rowOid The <CODE>SnmpOid</CODE> identifying the table
-     *               row to be added.
-     * @param entry The entry to add.
-     *
-     * @exception SnmpStatusException The entry couldn't be added
-     *            at the position identified by the given
-     *            <code>rowOid</code>, or this version of the metadata
-     *            requires ObjectName's.
-     */
-     // public void addEntry(SnmpIndex index, Object entry)
-     public void addEntry(SnmpOid rowOid, Object entry)
-        throws SnmpStatusException {
-
-         addEntry(rowOid, null, entry);
-    }
-
-    /**
-     * Add a new entry in this <CODE>SnmpMibTable</CODE>.
-     * Also triggers the addEntryCB() callback of the
-     * {@link com.sun.jmx.snmp.agent.SnmpTableEntryFactory} interface
-     * if this node is bound to a factory.
-     *
-     * <p>
-     * @param oid    The <CODE>SnmpOid</CODE> identifying the table
-     *               row to be added.
-     *
-     * @param name  The ObjectName with which this entry is registered.
-     *              This parameter can be omitted if isRegistrationRequired()
-     *              return false.
-     *
-     * @param entry The entry to add.
-     *
-     * @exception SnmpStatusException The entry couldn't be added
-     *            at the position identified by the given
-     *            <code>rowOid</code>, or if this version of the metadata
-     *            requires ObjectName's, and the given name is null.
-     */
-    // protected synchronized void addEntry(SnmpIndex index, ObjectName name,
-    //                                      Object entry)
-    public synchronized void addEntry(SnmpOid oid, ObjectName name,
-                                      Object entry)
-        throws SnmpStatusException {
-
-        if (isRegistrationRequired() == true && name == null)
-            throw new SnmpStatusException(SnmpStatusException.badValue);
-
-        if (size == 0) {
-            //            indexes.addElement(index);
-            // XX oids.addElement(oid);
-            insertOid(0,oid);
-            if (entries != null)
-                entries.addElement(entry);
-            if (entrynames != null)
-                entrynames.addElement(name);
-            size++;
-
-            // triggers callbacks on the entry factory
-            //
-            if (factory != null) {
-                try {
-                    factory.addEntryCb(0,oid,name,entry,this);
-                } catch (SnmpStatusException x) {
-                    removeOid(0);
-                    if (entries != null)
-                        entries.removeElementAt(0);
-                    if (entrynames != null)
-                        entrynames.removeElementAt(0);
-                    throw x;
-                }
-            }
-
-            // sends the notifications
-            //
-            sendNotification(SnmpTableEntryNotification.SNMP_ENTRY_ADDED,
-                             (new Date()).getTime(), entry, name);
-            return;
-        }
-
-        // Get the insertion position ...
-        //
-        int pos= 0;
-        // bug jaw.00356.B : use oid rather than index to get the
-        // insertion point.
-        //
-        pos= getInsertionPoint(oid,true);
-        if (pos == size) {
-            // Add a new element in the vectors ...
-            //
-            //            indexes.addElement(index);
-            // XX oids.addElement(oid);
-            insertOid(tablecount,oid);
-            if (entries != null)
-                entries.addElement(entry);
-            if (entrynames != null)
-                entrynames.addElement(name);
-            size++;
-        } else {
-            // Insert new element ...
-            //
-            try {
-                //                indexes.insertElementAt(index, pos);
-                // XX oids.insertElementAt(oid, pos);
-                insertOid(pos,oid);
-                if (entries != null)
-                    entries.insertElementAt(entry, pos);
-                if (entrynames != null)
-                    entrynames.insertElementAt(name,pos);
-                size++;
-            } catch(ArrayIndexOutOfBoundsException e) {
-            }
-        }
-
-        // triggers callbacks on the entry factory
-        //
-        if (factory != null) {
-            try {
-                factory.addEntryCb(pos,oid,name,entry,this);
-            } catch (SnmpStatusException x) {
-                removeOid(pos);
-                if (entries != null)
-                    entries.removeElementAt(pos);
-                if (entrynames != null)
-                    entrynames.removeElementAt(pos);
-                throw x;
-            }
-        }
-
-        // sends the notifications
-        //
-        sendNotification(SnmpTableEntryNotification.SNMP_ENTRY_ADDED,
-                         (new Date()).getTime(), entry, name);
-    }
-
-    /**
-     * Remove the specified entry from the table.
-     * Also triggers the removeEntryCB() callback of the
-     * {@link com.sun.jmx.snmp.agent.SnmpTableEntryFactory} interface
-     * if this node is bound to a factory.
-     *
-     * <p>
-     * @param rowOid The <CODE>SnmpOid</CODE> identifying the table
-     *               row to remove.
-     *
-     * @param entry The entry to be removed. This parameter is not used
-     *              internally, it is simply passed along to the
-     *              removeEntryCB() callback.
-     *
-     * @exception SnmpStatusException if the specified entry couldn't
-     *            be removed (if the given <code>rowOid</code> is not
-     *            valid for instance).
-     */
-    public synchronized void removeEntry(SnmpOid rowOid, Object entry)
-        throws SnmpStatusException {
-        int pos = findObject(rowOid);
-        if (pos == -1)
-            return;
-        removeEntry(pos,entry);
-    }
-
-    /**
-     * Remove the specified entry from the table.
-     * Also triggers the removeEntryCB() callback of the
-     * {@link com.sun.jmx.snmp.agent.SnmpTableEntryFactory} interface
-     * if this node is bound to a factory.
-     *
-     * <p>
-     * @param rowOid The <CODE>SnmpOid</CODE> identifying the table
-     *               row to remove.
-     *
-     * @exception SnmpStatusException if the specified entry couldn't
-     *            be removed (if the given <code>rowOid</code> is not
-     *            valid for instance).
-     */
-    public void removeEntry(SnmpOid rowOid)
-        throws SnmpStatusException {
-        int pos = findObject(rowOid);
-        if (pos == -1)
-            return;
-        removeEntry(pos,null);
-    }
-
-    /**
-     * Remove the specified entry from the table.
-     * Also triggers the removeEntryCB() callback of the
-     * {@link com.sun.jmx.snmp.agent.SnmpTableEntryFactory} interface
-     * if this node is bound to a factory.
-     *
-     * <p>
-     * @param pos The position of the entry in the table.
-     *
-     * @param entry The entry to be removed. This parameter is not used
-     *              internally, it is simply passed along to the
-     *              removeEntryCB() callback.
-     *
-     * @exception SnmpStatusException if the specified entry couldn't
-     *            be removed.
-     */
-    public synchronized void removeEntry(int pos, Object entry)
-        throws SnmpStatusException {
-        if (pos == -1)
-            return;
-        if (pos >= size) return;
-
-        Object obj = entry;
-        if (entries != null && entries.size() > pos) {
-            obj = entries.elementAt(pos);
-            entries.removeElementAt(pos);
-        }
-
-        ObjectName name = null;
-        if (entrynames != null && entrynames.size() > pos) {
-            name = entrynames.elementAt(pos);
-            entrynames.removeElementAt(pos);
-        }
-
-        final SnmpOid rowOid = tableoids[pos];
-        removeOid(pos);
-        size --;
-
-        if (obj == null) obj = entry;
-
-        if (factory != null)
-            factory.removeEntryCb(pos,rowOid,name,obj,this);
-
-        sendNotification(SnmpTableEntryNotification.SNMP_ENTRY_REMOVED,
-                         (new Date()).getTime(), obj, name);
-    }
-
-    /**
-     * Get the entry corresponding to the specified rowOid.
-     *
-     * <p>
-     * @param rowOid The <CODE>SnmpOid</CODE> identifying the
-     *        row to be retrieved.
-     *
-     * @return The entry.
-     *
-     * @exception SnmpStatusException There is no entry with the specified
-     *      <code>rowOid</code> in the table.
-     */
-    public synchronized Object getEntry(SnmpOid rowOid)
-        throws SnmpStatusException {
-        int pos= findObject(rowOid);
-        if (pos == -1)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        return entries.elementAt(pos);
-    }
-
-    /**
-     * Get the ObjectName of the entry corresponding to the
-     * specified rowOid.
-     * The result of this method is only meaningful if
-     * isRegistrationRequired() yields true.
-     *
-     * <p>
-     * @param rowOid The <CODE>SnmpOid</CODE> identifying the table
-     *        row whose ObjectName we want to retrieve.
-     *
-     * @return The object name of the entry.
-     *
-     * @exception SnmpStatusException There is no entry with the specified
-     *      <code>rowOid</code> in the table.
-     */
-    public synchronized ObjectName getEntryName(SnmpOid rowOid)
-        throws SnmpStatusException {
-        int pos = findObject(rowOid);
-        if (entrynames == null) return null;
-        if (pos == -1 || pos >= entrynames.size())
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        return entrynames.elementAt(pos);
-    }
-
-    /**
-     * Return the entries stored in this table <CODE>SnmpMibTable</CODE>.
-     * <p>
-     * If the subclass generated by mibgen uses the generic way to access
-     * the entries (i.e. if it goes through the MBeanServer) then some of
-     * the entries may be <code>null</code>. It all depends whether a non
-     * <code>null</code> entry was passed to addEntry().<br>
-     * Otherwise, if it uses the standard way (access the entry directly
-     * through their standard MBean interface) this array will contain all
-     * the entries.
-     * <p>
-     * @return The entries array.
-     */
-    public Object[] getBasicEntries() {
-        Object[] array= new Object[size];
-        entries.copyInto(array);
-        return array;
-    }
-
-    /**
-     * Get the size of the table.
-     *
-     * @return The number of entries currently registered in this table.
-     */
-    public int getSize() {
-        return size;
-    }
-
-    // EVENT STUFF
-    //------------
-
-    /**
-     * Enable to add an SNMP entry listener to this
-     * <CODE>SnmpMibTable</CODE>.
-     *
-     * <p>
-     * @param listener The listener object which will handle the
-     *    notifications emitted by the registered MBean.
-     *
-     * @param filter The filter object. If filter is null, no filtering
-     *    will be performed before handling notifications.
-     *
-     * @param handback The context to be sent to the listener when a
-     *    notification is emitted.
-     *
-     * @exception IllegalArgumentException Listener parameter is null.
-     */
-    @Override
-    public synchronized void
-        addNotificationListener(NotificationListener listener,
-                                NotificationFilter filter, Object handback)  {
-
-        // Check listener
-        //
-        if (listener == null) {
-            throw new java.lang.IllegalArgumentException
-                ("Listener can't be null") ;
-        }
-
-        // looking for listener in handbackTable
-        //
-        Vector<Object> handbackList = handbackTable.get(listener) ;
-        Vector<NotificationFilter> filterList = filterTable.get(listener) ;
-        if ( handbackList == null ) {
-            handbackList = new Vector<>() ;
-            filterList = new Vector<>() ;
-            handbackTable.put(listener, handbackList) ;
-            filterTable.put(listener, filterList) ;
-        }
-
-        // Add the handback and the filter
-        //
-        handbackList.addElement(handback) ;
-        filterList.addElement(filter) ;
-    }
-
-    /**
-     * Enable to remove an SNMP entry listener from this
-     * <CODE>SnmpMibTable</CODE>.
-     *
-     * @param listener The listener object which will handle the
-     *    notifications emitted by the registered MBean.
-     *    This method will remove all the information related to this
-     *    listener.
-     *
-     * @exception ListenerNotFoundException The listener is not registered
-     *    in the MBean.
-     */
-    @Override
-    public synchronized void
-        removeNotificationListener(NotificationListener listener)
-        throws ListenerNotFoundException {
-
-        // looking for listener in handbackTable
-        //
-        java.util.Vector<?> handbackList = handbackTable.get(listener) ;
-        if ( handbackList == null ) {
-            throw new ListenerNotFoundException("listener");
-        }
-
-        // If handback is null, remove the listener entry
-        //
-        handbackTable.remove(listener) ;
-        filterTable.remove(listener) ;
-    }
-
-    /**
-     * Return a <CODE>NotificationInfo</CODE> object containing the
-     * notification class and the notification type sent by the
-     * <CODE>SnmpMibTable</CODE>.
-     */
-    @Override
-    public MBeanNotificationInfo[] getNotificationInfo() {
-
-        String[] types = {SnmpTableEntryNotification.SNMP_ENTRY_ADDED,
-                          SnmpTableEntryNotification.SNMP_ENTRY_REMOVED};
-
-        MBeanNotificationInfo[] notifsInfo = {
-            new MBeanNotificationInfo
-            (types, "com.sun.jmx.snmp.agent.SnmpTableEntryNotification",
-             "Notifications sent by the SnmpMibTable")
-        };
-
-        return notifsInfo;
-    }
-
-
-    /**
-     * Register the factory through which table entries should
-     * be created when remote entry creation is enabled.
-     *
-     * <p>
-     * @param factory The
-     *        {@link com.sun.jmx.snmp.agent.SnmpTableEntryFactory} through
-     *        which entries will be created when a remote SNMP manager
-     *        request the creation of a new entry via an SNMP SET request.
-     */
-    public void registerEntryFactory(SnmpTableEntryFactory factory) {
-        this.factory = factory;
-    }
-
-    // ----------------------------------------------------------------------
-    // PROTECTED METHODS - RowStatus
-    // ----------------------------------------------------------------------
-
-    /**
-     * Return true if the columnar object identified by <code>var</code>
-     * is used to control the addition/deletion of rows in this table.
-     *
-     * <p>
-     * By default, this method assumes that there is no control variable
-     * and always return <code>false</code>
-     * <p>
-     * If this table was defined using SMIv2, and if it contains a
-     * control variable with RowStatus syntax, <code>mibgen</code>
-     * will generate a non default implementation for this method
-     * that will identify the RowStatus control variable.
-     * <p>
-     * You will have to redefine this method if you need to implement
-     * control variables that do not conform to RFC 2579 RowStatus
-     * TEXTUAL-CONVENTION.
-     * <p>
-     * @param rowOid The <CODE>SnmpOid</CODE> identifying the table
-     *               row involved in the operation.
-     *
-     * @param var The OID arc identifying the involved columnar object.
-     *
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     **/
-    protected boolean isRowStatus(SnmpOid rowOid, long var,
-                                    Object  userData) {
-        return false;
-    }
-
-
-    /**
-     * Return the RowStatus code value specified in this request.
-     * <p>
-     * The RowStatus code value should be one of the values defined
-     * by {@link com.sun.jmx.snmp.EnumRowStatus}. These codes correspond
-     * to RowStatus codes as defined in RFC 2579, plus the <i>unspecified</i>
-     * value which is SNMP Runtime specific.
-     * <p>
-     *
-     * @param req    The sub-request that must be handled by this node.
-     *
-     * @param rowOid The <CODE>SnmpOid</CODE> identifying the table
-     *               row involved in the operation.
-     *
-     * @param depth  The depth reached in the OID tree.
-     *
-     * @return The RowStatus code specified in this request, if any:
-     * <ul>
-     * <li>If the specified row does not exist and this table do
-     *     not use any variable to control creation/deletion of
-     *     rows, then default creation mechanism is assumed and
-     *     <i>createAndGo</i> is returned</li>
-     * <li>Otherwise, if the row exists and this table do not use any
-     *     variable to control creation/deletion of rows,
-     *     <i>unspecified</i> is returned.</li>
-     * <li>Otherwise, if the request does not contain the control variable,
-     *     <i>unspecified</i> is returned.</li>
-     * <li>Otherwise, mapRowStatus() is called to extract the RowStatus
-     *     code from the SnmpVarBind that contains the control variable.</li>
-     * </ul>
-     *
-     * @exception SnmpStatusException if the value of the control variable
-     *            could not be mapped to a RowStatus code.
-     *
-     * @see com.sun.jmx.snmp.EnumRowStatus
-     **/
-    protected int getRowAction(SnmpMibSubRequest req, SnmpOid rowOid,
-                               int depth)
-        throws SnmpStatusException {
-        final boolean     isnew  = req.isNewEntry();
-        final SnmpVarBind vb = req.getRowStatusVarBind();
-        if (vb == null) {
-            if (isnew && ! hasRowStatus())
-                return EnumRowStatus.createAndGo;
-            else return EnumRowStatus.unspecified;
-        }
-
-        try {
-            return mapRowStatus(rowOid, vb, req.getUserData());
-        } catch( SnmpStatusException x) {
-            checkRowStatusFail(req, x.getStatus());
-        }
-        return EnumRowStatus.unspecified;
-    }
-
-    /**
-     * Map the value of the <code>vbstatus</code> varbind to the
-     * corresponding RowStatus code defined in
-     * {@link com.sun.jmx.snmp.EnumRowStatus}.
-     * These codes correspond to RowStatus codes as defined in RFC 2579,
-     * plus the <i>unspecified</i> value which is SNMP Runtime specific.
-     * <p>
-     * By default, this method assumes that the control variable is
-     * an Integer, and it simply returns its value without further
-     * analysis.
-     * <p>
-     * If this table was defined using SMIv2, and if it contains a
-     * control variable with RowStatus syntax, <code>mibgen</code>
-     * will generate a non default implementation for this method.
-     * <p>
-     * You will have to redefine this method if you need to implement
-     * control variables that do not conform to RFC 2579 RowStatus
-     * TEXTUAL-CONVENTION.
-     *
-     * <p>
-     * @param rowOid The <CODE>SnmpOid</CODE> identifying the table
-     *               row involved in the operation.
-     *
-     * @param vbstatus The SnmpVarBind containing the value of the control
-     *           variable, as identified by the isRowStatus() method.
-     *
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @return The RowStatus code mapped from the value contained
-     *     in <code>vbstatus</code>.
-     *
-     * @exception SnmpStatusException if the value of the control variable
-     *            could not be mapped to a RowStatus code.
-     *
-     * @see com.sun.jmx.snmp.EnumRowStatus
-     **/
-    protected int mapRowStatus(SnmpOid rowOid, SnmpVarBind vbstatus,
-                               Object userData)
-        throws SnmpStatusException {
-        final SnmpValue rsvalue = vbstatus.value;
-
-        if (rsvalue instanceof SnmpInt)
-            return ((SnmpInt)rsvalue).intValue();
-        else
-            throw new SnmpStatusException(
-                       SnmpStatusException.snmpRspInconsistentValue);
-    }
-
-    /**
-     * Set the control variable to the specified <code>newStatus</code>
-     * value.
-     *
-     * <p>
-     * This method maps the given <code>newStatus</code> to the appropriate
-     * value for the control variable, then sets the control variable in
-     * the entry identified by <code>rowOid</code>. It returns the new
-     * value of the control variable.
-     * <p>
-     * By default, it is assumed that there is no control variable so this
-     * method does nothing and simply returns <code>null</code>.
-     * <p>
-     * If this table was defined using SMIv2, and if it contains a
-     * control variable with RowStatus syntax, <code>mibgen</code>
-     * will generate a non default implementation for this method.
-     * <p>
-     * You will have to redefine this method if you need to implement
-     * control variables that do not conform to RFC 2579 RowStatus
-     * TEXTUAL-CONVENTION.
-     *
-     * <p>
-     * @param rowOid The <CODE>SnmpOid</CODE> identifying the table
-     *               row involved in the operation.
-     *
-     * @param newStatus The new status for the row: one of the
-     *        RowStatus code defined in
-     *        {@link com.sun.jmx.snmp.EnumRowStatus}. These codes
-     *        correspond to RowStatus codes as defined in RFC 2579,
-     *        plus the <i>unspecified</i> value which is SNMP Runtime specific.
-     *
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @return The new value of the control variable (usually
-     *         <code>new SnmpInt(newStatus)</code>) or <code>null</code>
-     *         if the table do not have any control variable.
-     *
-     * @exception SnmpStatusException If the given <code>newStatus</code>
-     *            could not be set on the specified entry, or if the
-     *            given <code>newStatus</code> is not valid.
-     *
-     * @see com.sun.jmx.snmp.EnumRowStatus
-     **/
-    protected SnmpValue setRowStatus(SnmpOid rowOid, int newStatus,
-                                     Object userData)
-        throws SnmpStatusException {
-        return null;
-    }
-
-    /**
-     * Tell whether the specified row is ready and can be put in the
-     * <i>notInService</i> state.
-     * <p>
-     * This method is called only once, after all the varbind have been
-     * set on a new entry for which <i>createAndWait</i> was specified.
-     * <p>
-     * If the entry is not yet ready, this method should return false.
-     * It will then be the responsibility of the entry to switch its
-     * own state to <i>notInService</i> when it becomes ready.
-     * No further call to <code>isRowReady()</code> will be made.
-     * <p>
-     * By default, this method always return true. <br>
-     * <code>mibgen</code> will not generate any specific implementation
-     * for this method - meaning that by default, a row created using
-     * <i>createAndWait</i> will always be placed in <i>notInService</i>
-     * state at the end of the request.
-     * <p>
-     * If this table was defined using SMIv2, and if it contains a
-     * control variable with RowStatus syntax, <code>mibgen</code>
-     * will generate an implementation for this method that will
-     * delegate the work to the metadata class modelling the conceptual
-     * row, so that you can override the default behaviour by subclassing
-     * that metadata class.
-     * <p>
-     * You will have to redefine this method if this default mechanism
-     * does not suit your needs.
-     *
-     * <p>
-     * @param rowOid The <CODE>SnmpOid</CODE> identifying the table
-     *               row involved in the operation.
-     *
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @return <code>true</code> if the row can be placed in
-     *         <i>notInService</i> state.
-     *
-     * @exception SnmpStatusException An error occurred while trying
-     *            to retrieve the row status, and the operation should
-     *            be aborted.
-     *
-     * @see com.sun.jmx.snmp.EnumRowStatus
-     **/
-    protected boolean isRowReady(SnmpOid rowOid, Object userData)
-        throws SnmpStatusException {
-        return true;
-    }
-
-    /**
-     * Check whether the control variable of the given row can be
-     * switched to the new specified <code>newStatus</code>.
-     * <p>
-     * This method is called during the <i>check</i> phase of a SET
-     * request when the control variable specifies <i>active</i> or
-     * <i>notInService</i>.
-     * <p>
-     * By default it is assumed that nothing prevents putting the
-     * row in the requested state, and this method does nothing.
-     * It is simply provided as a hook so that specific checks can
-     * be implemented.
-     * <p>
-     * Note that if the actual row deletion fails afterward, the
-     * atomicity of the request is no longer guaranteed.
-     *
-     * <p>
-     * @param req    The sub-request that must be handled by this node.
-     *
-     * @param rowOid The <CODE>SnmpOid</CODE> identifying the table
-     *               row involved in the operation.
-     *
-     * @param depth  The depth reached in the OID tree.
-     *
-     * @param newStatus The new status for the row: one of the
-     *        RowStatus code defined in
-     *        {@link com.sun.jmx.snmp.EnumRowStatus}. These codes
-     *        correspond to RowStatus codes as defined in RFC 2579,
-     *        plus the <i>unspecified</i> value which is SNMP Runtime specific.
-     *
-     * @exception SnmpStatusException if switching to this new state
-     *            would fail.
-     *
-     **/
-    protected void checkRowStatusChange(SnmpMibSubRequest req,
-                                        SnmpOid rowOid, int depth,
-                                        int newStatus)
-        throws SnmpStatusException {
-
-    }
-
-    /**
-     * Check whether the specified row can be removed from the table.
-     * <p>
-     * This method is called during the <i>check</i> phase of a SET
-     * request when the control variable specifies <i>destroy</i>
-     * <p>
-     * By default it is assumed that nothing prevents row deletion
-     * and this method does nothing. It is simply provided as a hook
-     * so that specific checks can be implemented.
-     * <p>
-     * Note that if the actual row deletion fails afterward, the
-     * atomicity of the request is no longer guaranteed.
-     *
-     * <p>
-     * @param req    The sub-request that must be handled by this node.
-     *
-     * @param rowOid The <CODE>SnmpOid</CODE> identifying the table
-     *               row involved in the operation.
-     *
-     * @param depth  The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException if the row deletion must be
-     *            rejected.
-     **/
-    protected void checkRemoveTableRow(SnmpMibSubRequest req, SnmpOid rowOid,
-                                       int depth)
-        throws SnmpStatusException {
-
-    }
-
-    /**
-     * Remove a table row upon a remote manager request.
-     *
-     * This method is called internally when <code>getRowAction()</code>
-     * yields <i>destroy</i> - i.e.: it is only called when a remote
-     * manager requests the removal of a table row.<br>
-     * You should never need to call this function directly.
-     * <p>
-     * By default, this method simply calls <code>removeEntry(rowOid)
-     * </code>.
-     * <p>
-     * You can redefine this method if you need to implement some
-     * specific behaviour when a remote row deletion is invoked.
-     * <p>
-     * Note that specific checks should not be implemented in this
-     * method, but rather in <code>checkRemoveTableRow()</code>.
-     * If <code>checkRemoveTableRow()</code> succeeds and this method
-     * fails afterward, the atomicity of the original SET request can no
-     * longer be guaranteed.
-     * <p>
-     *
-     * @param req    The sub-request that must be handled by this node.
-     *
-     * @param rowOid The <CODE>SnmpOid</CODE> identifying the table
-     *               row involved in the operation.
-     *
-     * @param depth  The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException if the actual row deletion fails.
-     *            This should not happen since it would break the
-     *            atomicity of the SET request. Specific checks should
-     *            be implemented in <code>checkRemoveTableRow()</code>
-     *            if needed. If the entry does not exists, no exception
-     *            is generated and the method simply returns.
-     *
-     **/
-    protected void removeTableRow(SnmpMibSubRequest req, SnmpOid rowOid,
-                                  int depth)
-        throws SnmpStatusException {
-
-        removeEntry(rowOid);
-    }
-
-    /**
-     * This method takes care of initial RowStatus handling during the
-     * check() phase of a SET request.
-     *
-     * In particular it will:
-     * <ul><li>check that the given <code>rowAction</code> returned by
-     *         <code>getRowAction()</code> is valid.</li>
-     * <li>Then depending on the <code>rowAction</code> specified it will:
-     *     <ul><li>either call <code>createNewEntry()</code> (<code>
-     *         rowAction = <i>createAndGo</i> or <i>createAndWait</i>
-     *         </code>),</li>
-     *     <li>or call <code>checkRemoveTableRow()</code> (<code>
-     *         rowAction = <i>destroy</i></code>),</li>
-     *     <li>or call <code>checkRowStatusChange()</code> (<code>
-     *         rowAction = <i>active</i> or <i>notInService</i></code>),</li>
-     *     <li>or generate a SnmpStatusException if the passed <code>
-     *         rowAction</code> is not correct.</li>
-     * </ul></li></ul>
-     * <p>
-     * In principle, you should not need to redefine this method.
-     * <p>
-     * <code>beginRowAction()</code> is called during the check phase
-     * of a SET request, before actual checking on the varbind list
-     * is performed.
-     *
-     * <p>
-     * @param req    The sub-request that must be handled by this node.
-     *
-     * @param rowOid The <CODE>SnmpOid</CODE> identifying the table
-     *               row involved in the operation.
-     *
-     * @param depth  The depth reached in the OID tree.
-     *
-     * @param rowAction The requested action as returned by <code>
-     *        getRowAction()</code>: one of the RowStatus codes defined in
-     *        {@link com.sun.jmx.snmp.EnumRowStatus}. These codes
-     *        correspond to RowStatus codes as defined in RFC 2579,
-     *        plus the <i>unspecified</i> value which is SNMP Runtime specific.
-     *
-     * @exception SnmpStatusException if the specified <code>rowAction</code>
-     *            is not valid or cannot be executed.
-     *            This should not happen since it would break the
-     *            atomicity of the SET request. Specific checks should
-     *            be implemented in <code>beginRowAction()</code> if needed.
-     *
-     * @see com.sun.jmx.snmp.EnumRowStatus
-     **/
-    protected synchronized void beginRowAction(SnmpMibSubRequest req,
-                              SnmpOid rowOid, int depth, int rowAction)
-        throws SnmpStatusException {
-        final boolean     isnew  = req.isNewEntry();
-        final SnmpOid     oid    = rowOid;
-        final int         action = rowAction;
-
-        switch (action) {
-        case EnumRowStatus.unspecified:
-            if (isnew) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                            SnmpMibTable.class.getName(),
-                            "beginRowAction", "Failed to create row[" +
-                            rowOid + "] : RowStatus = unspecified");
-                }
-                checkRowStatusFail(req,SnmpStatusException.snmpRspNoAccess);
-            }
-            break;
-        case EnumRowStatus.createAndGo:
-        case EnumRowStatus.createAndWait:
-            if (isnew) {
-                if (isCreationEnabled()) {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                                SnmpMibTable.class.getName(),
-                                "beginRowAction", "Creating row[" + rowOid +
-                                "] : RowStatus = createAndGo | createAndWait");
-                    }
-                    createNewEntry(req,oid,depth);
-                } else {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                                SnmpMibTable.class.getName(),
-                                "beginRowAction", "Can't create row[" + rowOid +
-                                "] : RowStatus = createAndGo | createAndWait " +
-                                "but creation is disabled");
-                    }
-                    checkRowStatusFail(req,
-                       SnmpStatusException.snmpRspNoAccess);
-                }
-            } else {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                            SnmpMibTable.class.getName(),
-                            "beginRowAction", "Can't create row[" + rowOid +
-                            "] : RowStatus = createAndGo | createAndWait " +
-                            "but row already exists");
-                }
-                checkRowStatusFail(req,
-                       SnmpStatusException.snmpRspInconsistentValue);
-            }
-            break;
-        case EnumRowStatus.destroy:
-            if (isnew) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                            SnmpMibTable.class.getName(),
-                            "beginRowAction",
-                            "Warning: can't destroy row[" + rowOid +
-                            "] : RowStatus = destroy but row does not exist");
-                }
-            } else if (!isCreationEnabled()) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                            SnmpMibTable.class.getName(),
-                            "beginRowAction",
-                            "Can't destroy row[" + rowOid + "] : " +
-                            "RowStatus = destroy but creation is disabled");
-                }
-                checkRowStatusFail(req,SnmpStatusException.snmpRspNoAccess);
-            }
-            checkRemoveTableRow(req,rowOid,depth);
-            break;
-        case EnumRowStatus.active:
-        case EnumRowStatus.notInService:
-            if (isnew) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                            SnmpMibTable.class.getName(),
-                            "beginRowAction", "Can't switch state of row[" +
-                            rowOid + "] : specified RowStatus = active | " +
-                            "notInService but row does not exist");
-                }
-                checkRowStatusFail(req,
-                        SnmpStatusException.snmpRspInconsistentValue);
-            }
-            checkRowStatusChange(req,rowOid,depth,action);
-            break;
-        case EnumRowStatus.notReady:
-        default:
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                        SnmpMibTable.class.getName(),
-                        "beginRowAction", "Invalid RowStatus value for row[" +
-                        rowOid + "] : specified RowStatus = " + action);
-            }
-            checkRowStatusFail(req,
-                    SnmpStatusException.snmpRspInconsistentValue);
-        }
-    }
-
-    /**
-     * This method takes care of final RowStatus handling during the
-     * set() phase of a SET request.
-     *
-     * In particular it will:
-     *     <ul><li>either call <code>setRowStatus(<i>active</i>)</code>
-     *         (<code> rowAction = <i>createAndGo</i> or <i>active</i>
-     *         </code>),</li>
-     *     <li>or call <code>setRowStatus(<i>notInService</i> or <i>
-     *         notReady</i>)</code> depending on the result of <code>
-     *         isRowReady()</code> (<code>rowAction = <i>createAndWait</i>
-     *         </code>),</li>
-     *     <li>or call <code>setRowStatus(<i>notInService</i>)</code>
-     *         (<code> rowAction = <i>notInService</i></code>),
-     *     <li>or call <code>removeTableRow()</code> (<code>
-     *         rowAction = <i>destroy</i></code>),</li>
-     *     <li>or generate a SnmpStatusException if the passed <code>
-     *         rowAction</code> is not correct. This should be avoided
-     *         since it would break SET request atomicity</li>
-     *     </ul>
-     * <p>
-     * In principle, you should not need to redefine this method.
-     * <p>
-     * <code>endRowAction()</code> is called during the set() phase
-     * of a SET request, after the actual set() on the varbind list
-     * has been performed. The varbind containing the control variable
-     * is updated with the value returned by setRowStatus() (if it is
-     * not <code>null</code>).
-     *
-     * <p>
-     * @param req    The sub-request that must be handled by this node.
-     *
-     * @param rowOid The <CODE>SnmpOid</CODE> identifying the table
-     *               row involved in the operation.
-     *
-     * @param depth  The depth reached in the OID tree.
-     *
-     * @param rowAction The requested action as returned by <code>
-     *        getRowAction()</code>: one of the RowStatus codes defined in
-     *        {@link com.sun.jmx.snmp.EnumRowStatus}. These codes
-     *        correspond to RowStatus codes as defined in RFC 2579,
-     *        plus the <i>unspecified</i> value which is SNMP Runtime specific.
-     *
-     * @exception SnmpStatusException if the specified <code>rowAction</code>
-     *            is not valid.
-     *
-     * @see com.sun.jmx.snmp.EnumRowStatus
-     **/
-    protected void endRowAction(SnmpMibSubRequest req, SnmpOid rowOid,
-                               int depth, int rowAction)
-        throws SnmpStatusException {
-        final boolean     isnew  = req.isNewEntry();
-        final SnmpOid     oid    = rowOid;
-        final int         action = rowAction;
-        final Object      data   = req.getUserData();
-        SnmpValue         value  = null;
-
-        switch (action) {
-        case EnumRowStatus.unspecified:
-            break;
-        case EnumRowStatus.createAndGo:
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                        SnmpMibTable.class.getName(),
-                        "endRowAction", "Setting RowStatus to 'active' " +
-                        "for row[" + rowOid + "] : requested RowStatus = " +
-                        "createAndGo");
-            }
-            value = setRowStatus(oid,EnumRowStatus.active,data);
-            break;
-        case EnumRowStatus.createAndWait:
-            if (isRowReady(oid,data)) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                            SnmpMibTable.class.getName(),
-                            "endRowAction",
-                            "Setting RowStatus to 'notInService' for row[" +
-                            rowOid + "] : requested RowStatus = createAndWait");
-                }
-                value = setRowStatus(oid,EnumRowStatus.notInService,data);
-            } else {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                            SnmpMibTable.class.getName(),
-                            "endRowAction", "Setting RowStatus to 'notReady' " +
-                            "for row[" + rowOid + "] : requested RowStatus = " +
-                            "createAndWait");
-                }
-                value = setRowStatus(oid,EnumRowStatus.notReady,data);
-            }
-            break;
-        case EnumRowStatus.destroy:
-            if (isnew) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                            SnmpMibTable.class.getName(),
-                            "endRowAction",
-                            "Warning: requested RowStatus = destroy, " +
-                            "but row[" + rowOid + "] does not exist");
-                }
-            } else {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                            SnmpMibTable.class.getName(),
-                            "endRowAction", "Destroying row[" + rowOid +
-                            "] : requested RowStatus = destroy");
-                }
-            }
-            removeTableRow(req,oid,depth);
-            break;
-        case EnumRowStatus.active:
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                        SnmpMibTable.class.getName(),
-                        "endRowAction",
-                        "Setting RowStatus to 'active' for row[" +
-                        rowOid + "] : requested RowStatus = active");
-            }
-            value = setRowStatus(oid,EnumRowStatus.active,data);
-            break;
-        case EnumRowStatus.notInService:
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                        SnmpMibTable.class.getName(),
-                        "endRowAction",
-                        "Setting RowStatus to 'notInService' for row[" +
-                        rowOid + "] : requested RowStatus = notInService");
-            }
-            value = setRowStatus(oid,EnumRowStatus.notInService,data);
-            break;
-        case EnumRowStatus.notReady:
-        default:
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                        SnmpMibTable.class.getName(),
-                        "endRowAction", "Invalid RowStatus value for row[" +
-                        rowOid + "] : specified RowStatus = " + action);
-            }
-            setRowStatusFail(req,
-                          SnmpStatusException.snmpRspInconsistentValue);
-        }
-        if (value != null) {
-            final SnmpVarBind vb = req.getRowStatusVarBind();
-            if (vb != null) vb.value = value;
-        }
-    }
-
-    // -------------------------------------------------------------------
-    // PROTECTED METHODS - get next
-    // -------------------------------------------------------------------
-
-    /**
-     * Return the next OID arc corresponding to a readable columnar
-     * object in the underlying entry OBJECT-TYPE, possibly skipping over
-     * those objects that must not or cannot be returned.
-     * Calls {@link
-     * #getNextVarEntryId(com.sun.jmx.snmp.SnmpOid,long,java.lang.Object)},
-     * until
-     * {@link #skipEntryVariable(com.sun.jmx.snmp.SnmpOid,long,
-     * java.lang.Object,int)} returns false.
-     *
-     *
-     * @param rowOid The OID index of the row involved in the operation.
-     *
-     * @param var Id of the variable we start from, looking for the next.
-     *
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @param pduVersion Protocol version of the original request PDU.
-     *
-     * @return The next columnar object id which can be returned using
-     *         the given PDU's protocol version.
-     *
-     * @exception SnmpStatusException If no id is found after the given id.
-     *
-     **/
-    protected long getNextVarEntryId(SnmpOid rowOid,
-                                     long var,
-                                     Object userData,
-                                     int pduVersion)
-        throws SnmpStatusException {
-
-        long varid=var;
-        do {
-            varid = getNextVarEntryId(rowOid,varid,userData);
-        } while (skipEntryVariable(rowOid,varid,userData,pduVersion));
-
-        return varid;
-    }
-
-    /**
-     * Hook for subclasses.
-     * The default implementation of this method is to always return
-     * false. Subclasses should redefine this method so that it returns
-     * true when:
-     * <ul><li>the variable is a leaf that is not instantiated,</li>
-     * <li>or the variable is a leaf whose type cannot be returned by that
-     *     version of the protocol (e.g. an Counter64 with SNMPv1).</li>
-     * </ul>
-     *
-     * @param rowOid The OID index of the row involved in the operation.
-     *
-     * @param var Id of the variable we start from, looking for the next.
-     *
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @param pduVersion Protocol version of the original request PDU.
-     *
-     * @return true if the variable must be skipped by the get-next
-     *         algorithm.
-     */
-    protected boolean skipEntryVariable(SnmpOid rowOid,
-                                        long var,
-                                        Object userData,
-                                        int pduVersion) {
-        return false;
-    }
-
-    /**
-     * Get the <CODE>SnmpOid</CODE> index of the row that follows
-     * the given <CODE>oid</CODE> in the table. The given <CODE>
-     * oid</CODE> does not need to be a valid row OID index.
-     *
-     * <p>
-     * @param oid The OID from which the search will begin.
-     *
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @return The next <CODE>SnmpOid</CODE> index.
-     *
-     * @exception SnmpStatusException There is no index following the
-     *     specified <CODE>oid</CODE> in the table.
-     */
-    protected SnmpOid getNextOid(SnmpOid oid, Object userData)
-        throws SnmpStatusException {
-
-        if (size == 0) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        final SnmpOid resOid = oid;
-
-        // Just a simple check to speed up retrieval of last element ...
-        //
-        // XX SnmpOid last= (SnmpOid) oids.lastElement();
-        SnmpOid last= tableoids[tablecount-1];
-        if (last.equals(resOid)) {
-            // Last element of the table ...
-            //
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        // First find the oid. This will allow to speed up retrieval process
-        // during smart discovery of table (using the getNext) as the
-        // management station will use the valid index returned during a
-        // previous getNext ...
-        //
-
-        // Returns the position following the position at which resOid
-        // is found, or the position at which resOid should be inserted.
-        //
-        final int newPos = getInsertionPoint(resOid,false);
-
-        // If the position returned is not out of bound, we will find
-        // the next element in the array.
-        //
-        if (newPos > -1 && newPos < size) {
-            try {
-                // XX last = (SnmpOid) oids.elementAt(newPos);
-                last = tableoids[newPos];
-            } catch(ArrayIndexOutOfBoundsException e) {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-            }
-        } else {
-            // We are dealing with the last element of the table ..
-            //
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-
-        return last;
-    }
-
-    /**
-     * Return the first entry OID registered in the table.
-     *
-     * <p>
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @return The <CODE>SnmpOid</CODE> of the first entry in the table.
-     *
-     * @exception SnmpStatusException If the table is empty.
-     */
-    protected SnmpOid getNextOid(Object userData)
-        throws SnmpStatusException {
-        if (size == 0) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-        // XX return (SnmpOid) oids.firstElement();
-        return tableoids[0];
-    }
-
-    // -------------------------------------------------------------------
-    // Abstract Protected Methods
-    // -------------------------------------------------------------------
-
-    /**
-     * This method is used internally and is implemented by the
-     * <CODE>SnmpMibTable</CODE> subclasses generated by <CODE>mibgen</CODE>.
-     *
-     * <p> Return the next OID arc corresponding to a readable columnar
-     *     object in the underlying entry OBJECT-TYPE.</p>
-     *
-     * <p>
-     * @param rowOid The OID index of the row involved in the operation.
-     *
-     * @param var Id of the variable we start from, looking for the next.
-     *
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @return The next columnar object id.
-     *
-     * @exception SnmpStatusException If no id is found after the given id.
-     *
-     **/
-    abstract protected long getNextVarEntryId(SnmpOid rowOid, long var,
-                                              Object userData)
-        throws SnmpStatusException;
-
-    /**
-     * This method is used internally and is implemented by the
-     * <CODE>SnmpMibTable</CODE> subclasses generated by <CODE>mibgen</CODE>.
-     *
-     * <p>
-     * @param rowOid The OID index of the row involved in the operation.
-     *
-     * @param var The var we want to validate.
-     *
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @exception SnmpStatusException If this id is not valid.
-     *
-     */
-    abstract protected void validateVarEntryId(SnmpOid rowOid, long var,
-                                               Object userData)
-        throws SnmpStatusException;
-
-    /**
-     *
-     * This method is used internally and is implemented by the
-     * <CODE>SnmpMibTable</CODE> subclasses generated by <CODE>mibgen</CODE>.
-     *
-     * <p>
-     * @param rowOid The OID index of the row involved in the operation.
-     *
-     * @param var The OID arc.
-     *
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @exception SnmpStatusException If this id is not valid.
-     *
-     */
-    abstract protected boolean isReadableEntryId(SnmpOid rowOid, long var,
-                                                 Object userData)
-        throws SnmpStatusException;
-
-    /**
-     * This method is used internally and is implemented by the
-     * <CODE>SnmpMibTable</CODE> subclasses generated by <CODE>mibgen</CODE>.
-     */
-    abstract protected void get(SnmpMibSubRequest req,
-                                SnmpOid rowOid, int depth)
-        throws SnmpStatusException;
-
-    /**
-     * This method is used internally and is implemented by the
-     * <CODE>SnmpMibTable</CODE> subclasses generated by <CODE>mibgen</CODE>.
-     */
-    abstract protected void check(SnmpMibSubRequest req,
-                                  SnmpOid rowOid, int depth)
-        throws SnmpStatusException;
-
-    /**
-     * This method is used internally and is implemented by the
-     * <CODE>SnmpMibTable</CODE> subclasses generated by <CODE>mibgen</CODE>.
-     */
-    abstract protected void set(SnmpMibSubRequest req,
-                                SnmpOid rowOid, int depth)
-        throws SnmpStatusException;
-
-    // ----------------------------------------------------------------------
-    // PACKAGE METHODS
-    // ----------------------------------------------------------------------
-
-    /**
-     * Get the <CODE>SnmpOid</CODE> index of the row that follows the
-     * index extracted from the specified OID array.
-     * Builds the SnmpOid corresponding to the row OID and calls
-     * <code>getNextOid(oid,userData)</code>;
-     *
-     * <p>
-     * @param oid The OID array.
-     *
-     * @param pos The position in the OID array at which the index starts.
-     *
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @return The next <CODE>SnmpOid</CODE>.
-     *
-     * @exception SnmpStatusException There is no index following the
-     *     specified one in the table.
-     */
-    SnmpOid getNextOid(long[] oid, int pos, Object userData)
-        throws SnmpStatusException {
-
-        // Construct the sub-oid starting at pos.
-        // This sub-oid correspond to the oid part just after the entry
-        // variable oid.
-        //
-        final SnmpOid resOid = new SnmpEntryOid(oid,pos);
-
-        return getNextOid(resOid,userData);
-    }
-
-    // ---------------------------------------------------------------------
-    //
-    // Register an exception when checking the RowStatus variable
-    //
-    // ---------------------------------------------------------------------
-
-    static void checkRowStatusFail(SnmpMibSubRequest req, int errorStatus)
-        throws SnmpStatusException {
-
-        final SnmpVarBind statusvb  = req.getRowStatusVarBind();
-        final SnmpStatusException x = new SnmpStatusException(errorStatus);
-        req.registerCheckException(statusvb,x);
-    }
-
-    // ---------------------------------------------------------------------
-    //
-    // Register an exception when checking the RowStatus variable
-    //
-    // ---------------------------------------------------------------------
-
-    static void setRowStatusFail(SnmpMibSubRequest req, int errorStatus)
-        throws SnmpStatusException {
-
-        final SnmpVarBind statusvb  = req.getRowStatusVarBind();
-        final SnmpStatusException x = new SnmpStatusException(errorStatus);
-        req.registerSetException(statusvb,x);
-    }
-
-    // ---------------------------------------------------------------------
-    //
-    // Implements the method defined in SnmpMibNode.
-    //
-    // ---------------------------------------------------------------------
-    @Override
-    final synchronized void findHandlingNode(SnmpVarBind varbind,
-                                             long[] oid, int depth,
-                                             SnmpRequestTree handlers)
-        throws SnmpStatusException {
-
-        final int  length = oid.length;
-
-        if (handlers == null)
-            throw new SnmpStatusException(SnmpStatusException.snmpRspGenErr);
-
-        if (depth >= length)
-            throw new SnmpStatusException(SnmpStatusException.noAccess);
-
-        if (oid[depth] != nodeId)
-            throw new SnmpStatusException(SnmpStatusException.noAccess);
-
-        if (depth+2 >= length)
-            throw new SnmpStatusException(SnmpStatusException.noAccess);
-
-        // Checks that the oid is valid
-        // validateOid(oid,depth);
-
-        // Gets the part of the OID that identifies the entry
-        final SnmpOid entryoid = new SnmpEntryOid(oid, depth+2);
-
-        // Finds the entry: false means that the entry does not exists
-        final Object data = handlers.getUserData();
-        final boolean hasEntry = contains(entryoid, data);
-
-        // Fails if the entry is not found and the table does not
-        // not support creation.
-        // We know that the entry does not exists if (isentry == false).
-        if (!hasEntry) {
-            if (!handlers.isCreationAllowed()) {
-                // we're not doing a set
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-            } else if (!isCreationEnabled())
-                // we're doing a set but creation is disabled.
-                throw new
-                    SnmpStatusException(SnmpStatusException.snmpRspNoAccess);
-        }
-
-        final long   var  = oid[depth+1];
-
-        // Validate the entry id
-        if (hasEntry) {
-            // The entry already exists - validate the id
-            validateVarEntryId(entryoid,var,data);
-        }
-
-        // Registers this node for the identified entry.
-        //
-        if (handlers.isSetRequest() && isRowStatus(entryoid,var,data))
-
-            // We only try to identify the RowStatus for SET operations
-            //
-            handlers.add(this,depth,entryoid,varbind,(!hasEntry),varbind);
-
-        else
-            handlers.add(this,depth,entryoid,varbind,(!hasEntry));
-    }
-
-
-    // ---------------------------------------------------------------------
-    //
-    // Implements the method defined in SnmpMibNode. The algorithm is very
-    // largely inspired from the original getNext() method.
-    //
-    // ---------------------------------------------------------------------
-    @Override
-    final synchronized long[] findNextHandlingNode(SnmpVarBind varbind,
-                                                   long[] oid,
-                                                   int pos,
-                                                   int depth,
-                                                   SnmpRequestTree handlers,
-                                                   AcmChecker checker)
-        throws SnmpStatusException {
-
-            int length = oid.length;
-
-            if (handlers == null) {
-                // This should be considered as a genErr, but we do not want to
-                // abort the whole request, so we're going to throw
-                // a noSuchObject...
-                //
-                throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-            }
-
-            final Object data = handlers.getUserData();
-            final int pduVersion = handlers.getRequestPduVersion();
-
-            long var= -1;
-
-            // If the querried oid contains less arcs than the OID of the
-            // xxxEntry object, we must return the first leaf under the
-            // first columnar object: the best way to do that is to reset
-            // the queried oid:
-            //   oid[0] = nodeId (arc of the xxxEntry object)
-            //   pos    = 0 (points to the arc of the xxxEntry object)
-            // then we just have to proceed...
-            //
-            if (pos >= length) {
-                // this will have the side effect to set
-                //    oid[pos] = nodeId
-                // and
-                //    (pos+1) = length
-                // so we won't fall into the "else if" cases below -
-                // so using "else if" rather than "if ..." is guaranteed
-                // to be safe.
-                //
-                oid = new long[1];
-                oid[0] = nodeId;
-                pos = 0;
-                length = 1;
-            } else if (oid[pos] > nodeId) {
-                // oid[pos] is expected to be the id of the xxxEntry ...
-                // The id requested is greater than the id of the xxxEntry,
-                // so we won't find the next element in this table... (any
-                // element in this table will have a smaller OID)
-                //
-                throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-            } else if (oid[pos] < nodeId) {
-                // we must return the first leaf under the first columnar
-                // object, so we are back to our first case where pos was
-                // out of bounds... => reset the oid to contain only the
-                // arc of the xxxEntry object.
-                //
-                oid = new long[1];
-                oid[0] = nodeId;
-                pos = 0;
-                length = 0;
-            } else if ((pos + 1) < length) {
-                // The arc at the position "pos+1" is the id of the columnar
-                // object (ie: the id of the variable in the table entry)
-                //
-                var = oid[pos+1];
-            }
-
-            // Now that we've got everything right we can begin.
-            SnmpOid entryoid;
-
-            if (pos == (length - 1)) {
-                // pos points to the last arc in the oid, and this arc is
-                // guaranteed to be the xxxEntry id (we have handled all
-                // the other possibilities before)
-                //
-                // We must therefore return the first leaf below the first
-                // columnar object in the table.
-                //
-                // Get the first index. If an exception is raised,
-                // then it means that the table is empty. We thus do not
-                // have to catch the exception - we let it propagate to
-                // the caller.
-                //
-                entryoid = getNextOid(data);
-                var = getNextVarEntryId(entryoid,var,data,pduVersion);
-            } else if ( pos == (length-2)) {
-                // In that case we have (pos+1) = (length-1), so pos
-                // points to the arc of the querried variable (columnar object).
-                // Since the requested oid stops there, it means we have
-                // to return the first leaf under this columnar object.
-                //
-                // So we first get the first index:
-                // Note: if this raises an exception, this means that the table
-                // is empty, so we can let the exception propagate to the caller.
-                //
-                entryoid = getNextOid(data);
-
-                // XXX revisit: not exactly perfect:
-                //     a specific row could be empty.. But we don't know
-                //     how to make the difference! => tradeoff holes
-                //     in tables can't be properly supported (all rows
-                //     must have the same holes)
-                //
-                if (skipEntryVariable(entryoid,var,data,pduVersion)) {
-                    var = getNextVarEntryId(entryoid,var,data,pduVersion);
-                }
-            } else {
-
-                // So now there remain one last case, namely: some part of the
-                // index is provided by the oid...
-                // We build a possibly incomplete and invalid index from
-                // the OID.
-                // The piece of index provided should begin at pos+2
-                //   oid[pos]   = id of the xxxEntry object,
-                //   oid[pos+1] = id of the columnar object,
-                //   oid[pos+2] ... oid[length-1] = piece of index.
-                //
-
-                // We get the next index following the provided index.
-                // If this raises an exception, then it means that we have
-                // reached the last index in the table, and we must then
-                // try with the next columnar object.
-                //
-                // Bug fix 4269251
-                // The SnmpIndex is defined to contain a valid oid:
-                // this is not an SNMP requirement for the getNext request.
-                // So we no more use the SnmpIndex but directly the SnmpOid.
-                //
-                try {
-                    entryoid = getNextOid(oid, pos + 2, data);
-
-                    // If the variable must ne skipped, fall through...
-                    //
-                    // XXX revisit: not exactly perfect:
-                    //     a specific row could be empty.. But we don't know
-                    //     how to make the difference! => tradeoff holes
-                    //     in tables can't be properly supported (all rows
-                    //     must have the same holes)
-                    //
-                    if (skipEntryVariable(entryoid,var,data,pduVersion)) {
-                        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-                    }
-                } catch(SnmpStatusException se) {
-                    entryoid = getNextOid(data);
-                    var = getNextVarEntryId(entryoid,var,data,pduVersion);
-                }
-            }
-
-            return findNextAccessibleOid(entryoid,
-                                         varbind,
-                                         oid,
-                                         depth,
-                                         handlers,
-                                         checker,
-                                         data,
-                                         var);
-        }
-
-    private long[] findNextAccessibleOid(SnmpOid entryoid,
-                                         SnmpVarBind varbind,long[] oid,
-                                         int depth, SnmpRequestTree handlers,
-                                         AcmChecker checker, Object data,
-                                         long var)
-        throws SnmpStatusException {
-        final int pduVersion = handlers.getRequestPduVersion();
-
-        // Loop on each var (column)
-        while(true) {
-            // This should not happen. If it happens, (bug, or customized
-            // methods returning garbage instead of raising an exception),
-            // it probably means that there is nothing to return anyway.
-            // So we throw the exception.
-            // => will skip to next node in the MIB tree.
-            //
-            if (entryoid == null || var == -1 ) {
-                throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-            }
-
-            // So here we know both the row (entryoid) and the column (var)
-            //
-
-            try {
-                // Raising an exception here will make the catch() clause
-                // switch to the next variable. If `var' is not readable
-                // for this specific entry, it is not readable for any
-                // other entry => skip to next column.
-                //
-                if (!isReadableEntryId(entryoid,var,data)) {
-                    throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-                }
-
-                // Prepare the result and the ACM checker.
-                //
-                final long[] etable  = entryoid.longValue(false);
-                final int    elength = etable.length;
-                final long[] result  = new long[depth + 2 + elength];
-                result[0] = -1 ; // Bug detector!
-
-                // Copy the entryOid at the end of `result'
-                //
-                java.lang.System.arraycopy(etable, 0, result,
-                                           depth+2, elength);
-
-                // Set the node Id and var Id in result.
-                //
-                result[depth] = nodeId;
-                result[depth+1] = var;
-
-                // Append nodeId.varId.<rowOid> to ACM checker.
-                //
-                checker.add(depth,result,depth,elength+2);
-
-                // No we're going to ACM check our OID.
-                try {
-                    checker.checkCurrentOid();
-
-                    // No exception thrown by checker => this is all OK!
-                    // we have it: register the handler and return the
-                    // result.
-                    //
-                    handlers.add(this,depth,entryoid,varbind,false);
-                    return result;
-                } catch(SnmpStatusException e) {
-                    // Skip to the next entry. If an exception is
-                    // thrown, will be catch by enclosing catch
-                    // and a skip is done to the next var.
-                    //
-                    entryoid = getNextOid(entryoid, data);
-                } finally {
-                    // Clean the checker.
-                    //
-                    checker.remove(depth,elength+2);
-                }
-            } catch(SnmpStatusException e) {
-                // Catching an exception here means we have to skip to the
-                // next column.
-                //
-                // Back to the first row.
-                entryoid = getNextOid(data);
-
-                // Find out the next column.
-                //
-                var = getNextVarEntryId(entryoid,var,data,pduVersion);
-
-            }
-
-            // This should not happen. If it happens, (bug, or customized
-            // methods returning garbage instead of raising an exception),
-            // it probably means that there is nothing to return anyway.
-            // No need to continue, we throw an exception.
-            // => will skip to next node in the MIB tree.
-            //
-            if (entryoid == null || var == -1 ) {
-                throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-            }
-        }
-    }
-
-
-    /**
-     * Validate the specified OID.
-     *
-     * <p>
-     * @param oid The OID array.
-     *
-     * @param pos The position in the array.
-     *
-     * @exception SnmpStatusException If the validation fails.
-     */
-    final void validateOid(long[] oid, int pos) throws SnmpStatusException {
-        final int length= oid.length;
-
-        // Control the length of the oid
-        //
-        if (pos +2 >= length) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        // Check that the entry identifier is specified
-        //
-        if (oid[pos] != nodeId) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-        }
-    }
-
-    // ----------------------------------------------------------------------
-    // PRIVATE METHODS
-    // ----------------------------------------------------------------------
-
-    /**
-     * Enable this <CODE>SnmpMibTable</CODE> to send a notification.
-     *
-     * <p>
-     * @param notification The notification to send.
-     */
-    private synchronized void sendNotification(Notification notification) {
-
-        // loop on listener
-        //
-        for(java.util.Enumeration<NotificationListener> k = handbackTable.keys();
-            k.hasMoreElements(); ) {
-
-            NotificationListener listener = k.nextElement();
-
-            // Get the associated handback list and the associated filter list
-            //
-            java.util.Vector<?> handbackList = handbackTable.get(listener) ;
-            java.util.Vector<NotificationFilter> filterList =
-                filterTable.get(listener) ;
-
-            // loop on handback
-            //
-            java.util.Enumeration<NotificationFilter> f = filterList.elements();
-            for(java.util.Enumeration<?> h = handbackList.elements();
-                h.hasMoreElements(); ) {
-
-                Object handback = h.nextElement();
-                NotificationFilter filter = f.nextElement();
-
-                if ((filter == null) ||
-                     (filter.isNotificationEnabled(notification))) {
-
-                    listener.handleNotification(notification,handback) ;
-                }
-            }
-        }
-    }
-
-    /**
-     * This method is used by the SnmpMibTable to create and send a table
-     * entry notification to all the listeners registered for this kind of
-     * notification.
-     *
-     * <p>
-     * @param type The notification type.
-     *
-     * @param timeStamp The notification emission date.
-     *
-     * @param entry The entry object.
-     */
-    private void sendNotification(String type, long timeStamp,
-                                  Object entry, ObjectName name) {
-
-        synchronized(this) {
-            sequenceNumber = sequenceNumber + 1;
-        }
-
-        SnmpTableEntryNotification notif =
-            new SnmpTableEntryNotification(type, this, sequenceNumber,
-                                           timeStamp, entry, name);
-
-        this.sendNotification(notif) ;
-    }
-
-    /**
-     * Return true if the entry identified by the given OID index
-     * is contained in this table.
-     * <p>
-     * <b>Do not call this method directly</b>.
-     * <p>
-     * This method is provided has a hook for subclasses.
-     * It is called when a get/set request is received in order to
-     * determine whether the specified entry is contained in the table.
-     * You may want to override this method if you need to perform e.g.
-     * lazy evaluation of tables (you need to update the table when a
-     * request is received) or if your table is virtual.
-     * <p>
-     * Note that this method is called by the Runtime from within a
-     * synchronized block.
-     *
-     * @param oid The index part of the OID we're looking for.
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @return <code>true</code> if the entry is found, <code>false</code>
-     *         otherwise.
-     *
-     * @since 1.5
-     **/
-    protected boolean contains(SnmpOid oid, Object userData) {
-        return (findObject(oid) > -1);
-    }
-
-    /**
-     * Look for the given oid in the OID table (tableoids) and returns
-     * its position.
-     *
-     * <p>
-     * @param oid The OID we're looking for.
-     *
-     * @return The position of the OID in the table. -1 if the given
-     *         OID was not found.
-     *
-     **/
-    private int findObject(SnmpOid oid) {
-        int low= 0;
-        int max= size - 1;
-        SnmpOid pos;
-        int comp;
-        int curr= low + (max-low)/2;
-        //System.out.println("Try to retrieve: " + oid.toString());
-        while (low <= max) {
-
-            // XX pos = (SnmpOid) oids.elementAt(curr);
-            pos = tableoids[curr];
-
-            //System.out.println("Compare with" + pos.toString());
-            // never know ...we might find something ...
-            //
-            comp = oid.compareTo(pos);
-            if (comp == 0)
-                return curr;
-
-            if (oid.equals(pos) == true) {
-                return curr;
-            }
-            if (comp > 0) {
-                low = curr + 1;
-            } else {
-                max = curr - 1;
-            }
-            curr = low + (max-low)/2;
-        }
-        return -1;
-    }
-
-    /**
-     * Search the position at which the given oid should be inserted
-     * in the OID table (tableoids).
-     *
-     * <p>
-     * @param oid The OID we would like to insert.
-     *
-     * @param fail Tells whether a SnmpStatusException must be generated
-     *             if the given OID is already present in the table.
-     *
-     * @return The position at which the OID should be inserted in
-     *         the table. When the OID is found, it returns the next
-     *         position. Note that it is not valid to insert twice the
-     *         same OID. This feature is only an optimization to improve
-     *         the getNextOid() behaviour.
-     *
-     * @exception SnmpStatusException if the OID is already present in the
-     *            table and <code>fail</code> is <code>true</code>.
-     *
-     **/
-    private int getInsertionPoint(SnmpOid oid, boolean fail)
-        throws SnmpStatusException {
-
-        final int failStatus = SnmpStatusException.snmpRspNotWritable;
-        int low= 0;
-        int max= size - 1;
-        SnmpOid pos;
-        int comp;
-        int curr= low + (max-low)/2;
-        while (low <= max) {
-
-            // XX pos= (SnmpOid) oids.elementAt(curr);
-            pos= tableoids[curr];
-
-            // never know ...we might find something ...
-            //
-            comp= oid.compareTo(pos);
-
-            if (comp == 0) {
-                if (fail)
-                    throw new SnmpStatusException(failStatus,curr);
-                else
-                    return curr+1;
-            }
-
-            if (comp>0) {
-                low= curr +1;
-            } else {
-                max= curr -1;
-            }
-            curr= low + (max-low)/2;
-        }
-        return curr;
-    }
-
-    /**
-     * Remove the OID located at the given position.
-     *
-     * <p>
-     * @param pos The position at which the OID to be removed is located.
-     *
-     **/
-    private void removeOid(int pos) {
-        if (pos >= tablecount) return;
-        if (pos < 0) return;
-        final int l1 = --tablecount-pos;
-        tableoids[pos] = null;
-        if (l1 > 0)
-            java.lang.System.arraycopy(tableoids,pos+1,tableoids,pos,l1);
-        tableoids[tablecount] = null;
-    }
-
-    /**
-     * Insert an OID at the given position.
-     *
-     * <p>
-     * @param oid The OID to be inserted in the table
-     * @param pos The position at which the OID to be added is located.
-     *
-     **/
-    private void insertOid(int pos, SnmpOid oid) {
-        if (pos >= tablesize || tablecount == tablesize) {
-                // Vector must be enlarged
-
-                // Save old vector
-                final SnmpOid[] olde = tableoids;
-
-                // Allocate larger vectors
-                tablesize += Delta;
-                tableoids = new SnmpOid[tablesize];
-
-                // Check pos validity
-                if (pos > tablecount) pos = tablecount;
-                if (pos < 0) pos = 0;
-
-                final int l1 = pos;
-                final int l2 = tablecount - pos;
-
-                // Copy original vector up to `pos'
-                if (l1 > 0)
-                    java.lang.System.arraycopy(olde,0,tableoids,0,l1);
-
-                // Copy original vector from `pos' to end, leaving
-                // an empty room at `pos' in the new vector.
-                if (l2 > 0)
-                    java.lang.System.arraycopy(olde,l1,tableoids,
-                                               l1+1,l2);
-
-            } else if (pos < tablecount) {
-                // Vector is large enough to accommodate one additional
-                // entry.
-                //
-                // Shift vector, making an empty room at `pos'
-
-                java.lang.System.arraycopy(tableoids,pos,tableoids,
-                                           pos+1,tablecount-pos);
-            }
-
-            // Fill the gap at `pos'
-            tableoids[pos]  = oid;
-            tablecount++;
-    }
-
-
-    // ----------------------------------------------------------------------
-    // PROTECTED VARIABLES
-    // ----------------------------------------------------------------------
-
-    /**
-     * The id of the contained entry object.
-     * @serial
-     */
-    protected int nodeId=1;
-
-    /**
-     * The MIB to which the metadata is linked.
-     * @serial
-     */
-    protected SnmpMib theMib;
-
-    /**
-     * <CODE>true</CODE> if remote creation of entries via SET operations
-     * is enabled.
-     * [default value is <CODE>false</CODE>]
-     * @serial
-     */
-    protected boolean creationEnabled = false;
-
-    /**
-     * The entry factory
-     */
-    protected SnmpTableEntryFactory factory = null;
-
-    // ----------------------------------------------------------------------
-    // PRIVATE VARIABLES
-    // ----------------------------------------------------------------------
-
-    /**
-     * The number of elements in the table.
-     * @serial
-     */
-    private int size=0;
-
-    /**
-     * The list of indexes.
-     * @serial
-     */
-    //    private Vector indexes= new Vector();
-
-    /**
-     * The list of OIDs.
-     * @serial
-     */
-    // private Vector oids= new Vector();
-    private final static int Delta = 16;
-    private int     tablecount     = 0;
-    private int     tablesize      = Delta;
-    private SnmpOid tableoids[]    = new SnmpOid[tablesize];
-
-    /**
-     * The list of entries.
-     * @serial
-     */
-    private final Vector<Object> entries= new Vector<>();
-
-    /**
-     * The list of object names.
-     * @serial
-     */
-    private final Vector<ObjectName> entrynames= new Vector<>();
-
-    /**
-     * Callback handlers
-     */
-    // final Vector callbacks = new Vector();
-
-    /**
-     * Listener hashtable containing the hand-back objects.
-     */
-    private Hashtable<NotificationListener, Vector<Object>> handbackTable =
-            new Hashtable<>();
-
-    /**
-     * Listener hashtable containing the filter objects.
-     */
-    private Hashtable<NotificationListener, Vector<NotificationFilter>>
-            filterTable = new Hashtable<>();
-
-    // PACKAGE VARIABLES
-    //------------------
-    /**
-     * SNMP table sequence number.
-     * The default value is set to 0.
-     */
-    transient long sequenceNumber = 0;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1091 +0,0 @@
-/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.agent;
-
-import java.util.Vector;
-import java.util.Hashtable;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Arrays;
-import java.util.logging.Level;
-
-import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpEngine;
-
-//  XXX: things to do: use SnmpOid rather than `instance' for future
-//       evolutions.
-//  XXX: Maybe use hashlists rather than vectors for entries?
-//       => in that case, the key should be SnmpOid.toString()
-//
-/**
- * This class is used to register varbinds from a SNMP varbind list with
- * the SnmpMibNode responsible for handling the requests concerning that
- * varbind.
- * This class holds a hashtable of Handler nodes, whith the involved
- * SnmpMibNode as a key.
- * When the involved SnmpMibNode is a group, the sublist of varbind is
- * directly stored in the Handler node.
- * When the involved SnmpMibNode is a table, the sublist is stored in a
- * sorted array indexed by the OID of the entry involved.
- */
-final class SnmpRequestTree {
-
-    // Constructor:
-    // @param  req The SnmpMibRequest that will be segmented in this
-    //         tree. It holds the original varbind vector passed
-    //         by the SnmpSubRequestHandler to this MIB. This
-    //         varbind vector is used to retrieve the "real"
-    //         position of a varbind in the vector. There is no other easy
-    //         way to do this - since as a result of the segmentation the
-    //         original positions will be lost.
-    // @param  creationflag indicates whether the operation involved
-    //         allows for entry creation (ie: it is a SET request).
-    // @param  pdutype indicates the type of the request PDU as defined
-    //         in SnmpDefinitions
-    //
-    SnmpRequestTree(SnmpMibRequest req, boolean creationflag, int pdutype) {
-        this.request = req;
-        this.version  = req.getVersion();
-        this.creationflag = creationflag;
-        this.hashtable = new Hashtable<>();
-        setPduType(pdutype);
-    }
-
-    public static int mapSetException(int errorStatus, int version)
-        throws SnmpStatusException {
-
-        final int errorCode = errorStatus;
-
-        if (version == SnmpDefinitions.snmpVersionOne)
-            return errorCode;
-
-        int mappedErrorCode = errorCode;
-
-        // Now take care of V2 errorCodes that can be stored
-        // in the varbind itself:
-        if (errorCode == SnmpStatusException.noSuchObject)
-            // noSuchObject => notWritable
-            mappedErrorCode = SnmpStatusException.snmpRspNotWritable;
-
-        else if (errorCode == SnmpStatusException.noSuchInstance)
-            // noSuchInstance => notWritable
-            mappedErrorCode = SnmpStatusException.snmpRspNotWritable;
-
-        return mappedErrorCode;
-    }
-
-    public static int mapGetException(int errorStatus, int version)
-        throws SnmpStatusException {
-
-        final int errorCode = errorStatus;
-        if (version == SnmpDefinitions.snmpVersionOne)
-            return errorCode;
-
-        int mappedErrorCode = errorCode;
-
-        // Now take care of V2 errorCodes that can be stored
-        // in the varbind itself:
-        if (errorCode ==
-            SnmpStatusException.noSuchObject)
-            // noSuchObject => noSuchObject
-            mappedErrorCode = errorCode;
-
-        else if (errorCode ==
-                 SnmpStatusException.noSuchInstance)
-            // noSuchInstance => noSuchInstance
-            mappedErrorCode = errorCode;
-
-        // Now we're going to try to transform every other
-        // global code in either noSuchInstance or noSuchObject,
-        // so that the get can return a partial result.
-        //
-        // Only noSuchInstance or noSuchObject can be stored
-        // in the varbind itself.
-        //
-
-        // According to RFC 1905: noAccess is emitted when the
-        // the access is denied because it is not in the MIB view...
-        //
-        else if (errorCode ==
-                 SnmpStatusException.noAccess)
-            // noAccess => noSuchInstance
-            mappedErrorCode = SnmpStatusException.noSuchInstance;
-
-        // According to RFC 1905: (my interpretation because it is not
-        // really clear) The specified variable name exists - but the
-        // variable does not exists and cannot be created under the
-        // present circumstances (probably because the request specifies
-        // another variable/value which is incompatible, or because the
-        // value of some other variable in the MIB prevents the creation)
-        //
-        // Note that this error should never be raised in a GET context
-        // but who knows?
-        //
-        else if (errorCode == SnmpStatusException.snmpRspInconsistentName)
-            // inconsistentName => noSuchInstance
-            mappedErrorCode = SnmpStatusException.noSuchInstance;
-
-        // All the errors comprised between snmpRspWrongType and
-        // snmpRspInconsistentValue concern values: so we're going
-        // to assume the OID was correct, and reply with noSuchInstance.
-        //
-        // Note that this error should never be raised in a GET context
-        // but who knows?
-        //
-        else if ((errorCode >= SnmpStatusException.snmpRspWrongType) &&
-                 (errorCode <= SnmpStatusException.snmpRspInconsistentValue))
-            mappedErrorCode = SnmpStatusException.noSuchInstance;
-
-        // We're going to assume the OID was correct, and reply
-        // with noSuchInstance.
-        //
-        else if (errorCode == SnmpStatusException.readOnly)
-            mappedErrorCode = SnmpStatusException.noSuchInstance;
-
-        // For all other errors but genErr, we're going to reply with
-        // noSuchObject
-        //
-        else if (errorCode != SnmpStatusException.snmpRspAuthorizationError &&
-                 errorCode != SnmpStatusException.snmpRspGenErr)
-            mappedErrorCode = SnmpStatusException.noSuchObject;
-
-        // Only genErr will abort the GET and be returned as global
-        // error.
-        //
-        return mappedErrorCode;
-
-    }
-
-    //-------------------------------------------------------------------
-    // This class is a package implementation of the enumeration of
-    // SnmSubRequest associated with an Handler node.
-    //-------------------------------------------------------------------
-
-    static final class Enum implements Enumeration<SnmpMibSubRequest> {
-        Enum(SnmpRequestTree hlist,Handler h) {
-            handler = h;
-            this.hlist = hlist;
-            size = h.getSubReqCount();
-        }
-        private final Handler handler;
-        private final SnmpRequestTree hlist;
-        private int   entry = 0;
-        private int   iter  = 0;
-        private int   size  = 0;
-
-        @Override
-        public boolean hasMoreElements() {
-            return iter < size;
-        }
-
-        @Override
-        public SnmpMibSubRequest nextElement() throws NoSuchElementException  {
-            if (iter == 0) {
-                if (handler.sublist != null) {
-                    iter++;
-                    return hlist.getSubRequest(handler);
-                }
-            }
-            iter ++;
-            if (iter > size) throw new NoSuchElementException();
-            SnmpMibSubRequest result = hlist.getSubRequest(handler,entry);
-            entry++;
-            return result;
-        }
-    }
-
-    //-------------------------------------------------------------------
-    // This class is a package implementation of the SnmpMibSubRequest
-    // interface. It can only be instantiated by SnmpRequestTree.
-    //-------------------------------------------------------------------
-
-    static final class SnmpMibSubRequestImpl implements SnmpMibSubRequest {
-        SnmpMibSubRequestImpl(SnmpMibRequest global, Vector<SnmpVarBind> sublist,
-                           SnmpOid entryoid, boolean isnew,
-                           boolean getnextflag, SnmpVarBind rs) {
-            this.global = global;
-            varbinds           = sublist;
-            this.version       = global.getVersion();
-            this.entryoid      = entryoid;
-            this.isnew         = isnew;
-            this.getnextflag   = getnextflag;
-            this.statusvb      = rs;
-        }
-
-        final private Vector<SnmpVarBind> varbinds;
-        final private SnmpMibRequest global;
-        final private int            version;
-        final private boolean        isnew;
-        final private SnmpOid        entryoid;
-        final private boolean        getnextflag;
-        final private SnmpVarBind    statusvb;
-
-        // -------------------------------------------------------------
-        // Implements the method defined in SnmpMibRequest interface.
-        // See SnmpMibRequest for the java doc.
-        // -------------------------------------------------------------
-        @Override
-        public Enumeration<SnmpVarBind> getElements() {
-            return varbinds.elements();
-        }
-
-        // -------------------------------------------------------------
-        // Implements the method defined in SnmpMibRequest interface.
-        // See SnmpMibRequest for the java doc.
-        // -------------------------------------------------------------
-        @Override
-        public Vector<SnmpVarBind> getSubList() {
-            return varbinds;
-        }
-
-        // -------------------------------------------------------------
-        // Implements the method defined in SnmpMibRequest interface.
-        // See SnmpMibRequest for the java doc.
-        // -------------------------------------------------------------
-        @Override
-        public final int getSize()  {
-            if (varbinds == null) return 0;
-            return varbinds.size();
-        }
-
-        // -------------------------------------------------------------
-        // Implements the method defined in SnmpMibRequest interface.
-        // See SnmpMibRequest for the java doc.
-        // -------------------------------------------------------------
-        @Override
-        public void addVarBind(SnmpVarBind varbind) {
-            // XXX not sure we must also add the varbind in the global
-            //     request? or whether we should raise an exception:
-            //     in principle, this method should not be called!
-            varbinds.addElement(varbind);
-            global.addVarBind(varbind);
-        }
-
-        // -------------------------------------------------------------
-        // Implements the method defined in SnmpMibSubRequest interface.
-        // See SnmpMibSubRequest for the java doc.
-        // -------------------------------------------------------------
-        @Override
-        public boolean isNewEntry() {
-            return isnew;
-        }
-
-        // -------------------------------------------------------------
-        // Implements the method defined in SnmpMibSubRequest interface.
-        // See SnmpMibSubRequest for the java doc.
-        // -------------------------------------------------------------
-        @Override
-        public SnmpOid getEntryOid() {
-            return entryoid;
-        }
-
-        // -------------------------------------------------------------
-        // Implements the method defined in SnmpMibRequest interface.
-        // See SnmpMibRequest for the java doc.
-        // -------------------------------------------------------------
-        @Override
-        public int getVarIndex(SnmpVarBind varbind) {
-            if (varbind == null) return 0;
-            return global.getVarIndex(varbind);
-        }
-
-        // -------------------------------------------------------------
-        // Implements the method defined in SnmpMibRequest interface.
-        // See SnmpMibRequest for the java doc.
-        // -------------------------------------------------------------
-        @Override
-        public Object getUserData() { return global.getUserData(); }
-
-
-        // -------------------------------------------------------------
-        // Implements the method defined in SnmpMibSubRequest interface.
-        // See SnmpMibSubRequest for the java doc.
-        // -------------------------------------------------------------
-
-        @Override
-        public void registerGetException(SnmpVarBind var,
-                                         SnmpStatusException exception)
-            throws SnmpStatusException {
-            // The index in the exception must correspond to
-            // the SNMP index ...
-            //
-            if (version == SnmpDefinitions.snmpVersionOne)
-                throw new SnmpStatusException(exception, getVarIndex(var)+1);
-
-            if (var == null)
-                throw exception;
-
-            // If we're doing a getnext ==> endOfMibView
-            if (getnextflag) {
-                var.value = SnmpVarBind.endOfMibView;
-                return;
-            }
-
-            final int errorCode = mapGetException(exception.getStatus(),
-                                                  version);
-
-            // Now take care of V2 errorCodes that can be stored
-            // in the varbind itself:
-            if (errorCode ==
-                SnmpStatusException.noSuchObject)
-                // noSuchObject => noSuchObject
-                var.value= SnmpVarBind.noSuchObject;
-
-            else if (errorCode ==
-                     SnmpStatusException.noSuchInstance)
-                // noSuchInstance => noSuchInstance
-                var.value= SnmpVarBind.noSuchInstance;
-
-            else
-                throw new SnmpStatusException(errorCode, getVarIndex(var)+1);
-
-        }
-
-        // -------------------------------------------------------------
-        // Implements the method defined in SnmpMibSubRequest interface.
-        // See SnmpMibSubRequest for the java doc.
-        // -------------------------------------------------------------
-        @Override
-        public void registerSetException(SnmpVarBind var,
-                                         SnmpStatusException exception)
-            throws SnmpStatusException {
-            // The index in the exception must correspond to
-            // the SNMP index ...
-            //
-            if (version == SnmpDefinitions.snmpVersionOne)
-                throw new SnmpStatusException(exception, getVarIndex(var)+1);
-
-            // Although the first pass of check() did not fail,
-            // the set() phase could not be carried out correctly.
-            // Since we don't know how to make an "undo", and some
-            // assignation may already have been performed, we're going
-            // to throw an snmpRspUndoFailed.
-            //
-            throw new SnmpStatusException(SnmpDefinitions.snmpRspUndoFailed,
-                                          getVarIndex(var)+1);
-        }
-
-        // -------------------------------------------------------------
-        // Implements the method defined in SnmpMibSubRequest interface.
-        // See SnmpMibSubRequest for the java doc.
-        // -------------------------------------------------------------
-        @Override
-        public void registerCheckException(SnmpVarBind var,
-                                           SnmpStatusException exception)
-            throws SnmpStatusException {
-            // The index in the exception must correspond to
-            // the SNMP index ...
-            //
-            // We throw the exception in order to abort the SET operation
-            // in an atomic way.
-            final int errorCode = exception.getStatus();
-            final int mappedErrorCode = mapSetException(errorCode,
-                                                        version);
-
-            if (errorCode != mappedErrorCode)
-                throw new
-                    SnmpStatusException(mappedErrorCode, getVarIndex(var)+1);
-            else
-                throw new SnmpStatusException(exception, getVarIndex(var)+1);
-        }
-
-        // -------------------------------------------------------------
-        // Implements the method defined in SnmpMibRequest interface.
-        // See SnmpMibRequest for the java doc.
-        // -------------------------------------------------------------
-        @Override
-        public int getVersion() {
-            return version;
-        }
-
-        @Override
-        public SnmpVarBind getRowStatusVarBind() {
-            return statusvb;
-        }
-
-        @Override
-        public SnmpPdu getPdu() {
-            return global.getPdu();
-        }
-
-        @Override
-        public int getRequestPduVersion() {
-            return global.getRequestPduVersion();
-        }
-
-        @Override
-        public SnmpEngine getEngine() {
-            return global.getEngine();
-        }
-
-        @Override
-        public String getPrincipal() {
-            return global.getPrincipal();
-        }
-
-        @Override
-        public int getSecurityLevel() {
-            return global.getSecurityLevel();
-        }
-
-        @Override
-        public int getSecurityModel() {
-            return global.getSecurityModel();
-        }
-
-        @Override
-        public byte[] getContextName() {
-            return global.getContextName();
-        }
-
-        @Override
-        public byte[] getAccessContextName() {
-            return global.getAccessContextName();
-        }
-    }
-
-    //-------------------------------------------------------------------
-    // This class implements a node in the SnmpRequestTree.
-    // It stores:
-    //    o The SnmpMibNode involved (key)
-    //    o The sublist of varbind directly handled by this node
-    //    o A vector of sublists concerning the entries (existing or not)
-    //      of the SnmpMIbNode (when it is a table).
-    //-------------------------------------------------------------------
-
-    static final class Handler {
-        SnmpMibNode meta;       // The meta  which handles the sublist.
-        int         depth;      // The depth of the meta node.
-        Vector<SnmpVarBind> sublist; // The sublist of varbinds to be handled.
-        // List        entryoids;  // Sorted array of entry oids
-        // List        entrylists; // Sorted array of entry lists
-        // List        isentrynew; // Sorted array of booleans
-        SnmpOid[]     entryoids  = null; // Sorted array of entry oids
-        Vector<SnmpVarBind>[] entrylists = null; // Sorted array of entry lists
-        boolean[]     isentrynew = null; // Sorted array of booleans
-        SnmpVarBind[] rowstatus  = null; // RowStatus varbind, if any
-        int entrycount = 0;
-        int entrysize  = 0;
-
-        final int type; // request PDU type as defined in SnmpDefinitions
-        final private static int Delta = 10;
-
-        public Handler(int pduType) {
-            this.type = pduType;
-        }
-
-        /**
-         * Adds a varbind in this node sublist.
-         */
-        public void addVarbind(SnmpVarBind varbind) {
-            if (sublist == null) sublist = new Vector<>();
-            sublist.addElement(varbind);
-        }
-
-        /**
-         * register an entry for the given oid at the given position with
-         * the given sublist.
-         */
-        @SuppressWarnings("unchecked")
-        // We need this because of new Vector[n] instead of
-        // new Vector<SnmpVarBind>[n], which is illegal.
-        void add(int pos,SnmpOid oid, Vector<SnmpVarBind> v, boolean isnew,
-                 SnmpVarBind statusvb) {
-
-            if (entryoids == null) {
-                // Vectors are null: Allocate new vectors
-
-                entryoids  = new SnmpOid[Delta];
-                entrylists = (Vector<SnmpVarBind>[])new Vector<?>[Delta];
-                isentrynew = new boolean[Delta];
-                rowstatus  = new SnmpVarBind[Delta];
-                entrysize  = Delta;
-                pos = 0;
-
-            } else if (pos >= entrysize || entrycount == entrysize) {
-                // Vectors must be enlarged
-
-                // Save old vectors
-                SnmpOid[]     olde = entryoids;
-                Vector<SnmpVarBind>[]      oldl = entrylists;
-                boolean[]     oldn = isentrynew;
-                SnmpVarBind[] oldr = rowstatus;
-
-                // Allocate larger vectors
-                entrysize += Delta;
-                entryoids =  new SnmpOid[entrysize];
-                entrylists = (Vector<SnmpVarBind>[])new Vector<?>[entrysize];
-                isentrynew = new boolean[entrysize];
-                rowstatus  = new SnmpVarBind[entrysize];
-
-                // Check pos validity
-                if (pos > entrycount) pos = entrycount;
-                if (pos < 0) pos = 0;
-
-                final int l1 = pos;
-                final int l2 = entrycount - pos;
-
-                // Copy original vectors up to `pos'
-                if (l1 > 0) {
-                    java.lang.System.arraycopy(olde,0,entryoids,
-                                               0,l1);
-                    java.lang.System.arraycopy(oldl,0,entrylists,
-                                               0,l1);
-                    java.lang.System.arraycopy(oldn,0,isentrynew,
-                                               0,l1);
-                    java.lang.System.arraycopy(oldr,0,rowstatus,
-                                               0,l1);
-                }
-
-                // Copy original vectors from `pos' to end, leaving
-                // an empty room at `pos' in the new vectors.
-                if (l2 > 0) {
-                    final int l3 = l1+1;
-                    java.lang.System.arraycopy(olde,l1,entryoids,
-                                               l3,l2);
-                    java.lang.System.arraycopy(oldl,l1,entrylists,
-                                               l3,l2);
-                    java.lang.System.arraycopy(oldn,l1,isentrynew,
-                                               l3,l2);
-                    java.lang.System.arraycopy(oldr,l1,rowstatus,
-                                               l3,l2);
-                }
-
-
-            } else if (pos < entrycount) {
-                // Vectors are large enough to accommodate one additional
-                // entry.
-                //
-                // Shift vectors, making an empty room at `pos'
-                final int l1 = pos+1;
-                final int l2 = entrycount - pos;
-
-                java.lang.System.arraycopy(entryoids,pos,entryoids,
-                                           l1,l2);
-                java.lang.System.arraycopy(entrylists,pos,entrylists,
-                                           l1,l2);
-                java.lang.System.arraycopy(isentrynew,pos,isentrynew,
-                                           l1,l2);
-                java.lang.System.arraycopy(rowstatus,pos,rowstatus,
-                                           l1,l2);
-            }
-
-            // Fill the gap at `pos'
-            entryoids[pos]  = oid;
-            entrylists[pos] = v;
-            isentrynew[pos] = isnew;
-            rowstatus[pos]  = statusvb;
-            entrycount++;
-        }
-
-        public void addVarbind(SnmpVarBind varbind, SnmpOid entryoid,
-                               boolean isnew, SnmpVarBind statusvb)
-            throws SnmpStatusException {
-            Vector<SnmpVarBind> v = null;
-            SnmpVarBind rs = statusvb;
-
-            if (entryoids == null) {
-//              entryoids = new ArrayList();
-//              entrylists = new ArrayList();
-//              isentrynew = new ArrayList();
-                v = new Vector<>();
-//              entryoids.add(entryoid);
-//              entrylists.add(v);
-//              isentrynew.add(new Boolean(isnew));
-                add(0,entryoid,v,isnew,rs);
-            } else {
-                // int pos = findOid(entryoids,entryoid);
-                // int pos = findOid(entryoids,entrycount,entryoid);
-                final int pos =
-                    getInsertionPoint(entryoids,entrycount,entryoid);
-                if (pos > -1 && pos < entrycount &&
-                    entryoid.compareTo(entryoids[pos]) == 0) {
-                    v  = entrylists[pos];
-                    rs = rowstatus[pos];
-                } else {
-                    // if (pos == -1 || pos >= entryoids.size() ) {
-                    // if (pos == -1 || pos >= entrycount ) {
-                    // pos = getInsertionPoint(entryoids,entryoid);
-                    // pos = getInsertionPoint(entryoids,entrycount,entryoid);
-                    v = new Vector<>();
-//                  entryoids.add(pos,entryoid);
-//                  entrylists.add(pos,v);
-//                  isentrynew.add(pos,new Boolean(isnew));
-                    add(pos,entryoid,v,isnew,rs);
-                }
-//              } else v = (Vector) entrylists.get(pos);
-                    // } else v = entrylists[pos];
-                if (statusvb != null) {
-                    if ((rs != null) && (rs != statusvb) &&
-                        ((type == SnmpDefinitions.pduWalkRequest) ||
-                         (type == SnmpDefinitions.pduSetRequestPdu))) {
-                        throw new SnmpStatusException(
-                              SnmpStatusException.snmpRspInconsistentValue);
-                    }
-                    rowstatus[pos] = statusvb;
-                }
-            }
-
-            // We do not include the status variable in the varbind,
-            // because we're going to set it separately...
-            //
-            if (statusvb != varbind)
-                v.addElement(varbind);
-        }
-
-        public int getSubReqCount() {
-            int count = 0;
-            if (sublist != null) count++;
-//          if (entryoids != null) count += entryoids.size();
-            if (entryoids != null) count += entrycount;
-            return count;
-        }
-
-        public Vector<SnmpVarBind> getSubList() {
-            return sublist;
-        }
-
-        public int getEntryPos(SnmpOid entryoid) {
-            // return findOid(entryoids,entryoid);
-            return findOid(entryoids,entrycount,entryoid);
-        }
-
-        public SnmpOid getEntryOid(int pos) {
-            if (entryoids == null) return null;
-            // if (pos == -1 || pos >= entryoids.size() ) return null;
-            if (pos == -1 || pos >= entrycount ) return null;
-            // return (SnmpOid) entryoids.get(pos);
-            return entryoids[pos];
-        }
-
-        public boolean isNewEntry(int pos) {
-            if (entryoids == null) return false;
-            // if (pos == -1 || pos >= entryoids.size() ) return false;
-            if (pos == -1 || pos >= entrycount ) return false;
-            // return ((Boolean)isentrynew.get(pos)).booleanValue();
-            return isentrynew[pos];
-        }
-
-        public SnmpVarBind getRowStatusVarBind(int pos) {
-            if (entryoids == null) return null;
-            // if (pos == -1 || pos >= entryoids.size() ) return false;
-            if (pos == -1 || pos >= entrycount ) return null;
-            // return ((Boolean)isentrynew.get(pos)).booleanValue();
-            return rowstatus[pos];
-        }
-
-        public Vector<SnmpVarBind> getEntrySubList(int pos) {
-            if (entrylists == null) return null;
-            // if (pos == -1 || pos >= entrylists.size() ) return null;
-            if (pos == -1 || pos >= entrycount ) return null;
-            // return (Vector) entrylists.get(pos);
-            return entrylists[pos];
-        }
-
-        public Iterator<SnmpOid> getEntryOids() {
-            if (entryoids == null) return null;
-            // return entryoids.iterator();
-            return Arrays.asList(entryoids).iterator();
-        }
-
-        public int getEntryCount() {
-            if (entryoids == null) return 0;
-            // return entryoids.size();
-            return entrycount;
-        }
-
-    }
-
-
-    //-------------------------------------------------------------------
-    //-------------------------------------------------------------------
-    // Public interface
-    //-------------------------------------------------------------------
-    //-------------------------------------------------------------------
-
-    //-------------------------------------------------------------------
-    // Returns the contextual object containing user-data allocated
-    // through the SnmpUserDataFactory for this request.
-    //-------------------------------------------------------------------
-
-    public Object getUserData() { return request.getUserData(); }
-
-    //-------------------------------------------------------------------
-    // Tells whether creation of new entries is allowed with respect
-    // to the operation involved (GET=>false/SET=>true)
-    //-------------------------------------------------------------------
-
-    public boolean isCreationAllowed() {
-        return creationflag;
-    }
-
-    //-------------------------------------------------------------------
-    // Tells whether we are currently processing a SET request (check/set)
-    //-------------------------------------------------------------------
-
-    public boolean isSetRequest() {
-        return setreqflag;
-    }
-
-    //-------------------------------------------------------------------
-    // Returns the protocol version in which the original request is
-    // evaluated.
-    //-------------------------------------------------------------------
-
-    public int getVersion() {
-        return version;
-    }
-
-    //-------------------------------------------------------------------
-    // Returns the actual protocol version of the request PDU.
-    //-------------------------------------------------------------------
-
-    public int getRequestPduVersion() {
-        return request.getRequestPduVersion();
-    }
-
-    //-------------------------------------------------------------------
-    // Returns the SnmpMibNode associated with the given handler
-    //-------------------------------------------------------------------
-
-    public SnmpMibNode getMetaNode(Handler handler) {
-        return handler.meta;
-    }
-
-    //-------------------------------------------------------------------
-    // Indicates the depth of the arc in the OID that identifies the
-    // SnmpMibNode associated with the given handler
-    //-------------------------------------------------------------------
-
-    public int getOidDepth(Handler handler) {
-        return handler.depth;
-    }
-
-    //-------------------------------------------------------------------
-    // returns an enumeration of the SnmpMibSubRequest's to be invoked on
-    // the SnmpMibNode associated with a given Handler node.
-    // If this node is a group, there will be a single subrequest.
-    // If it is a table, there will be one subrequest per entry involved.
-    //-------------------------------------------------------------------
-
-    public Enumeration<SnmpMibSubRequest> getSubRequests(Handler handler) {
-        return new Enum(this,handler);
-    }
-
-    //-------------------------------------------------------------------
-    // returns an enumeration of the Handlers stored in the Hashtable.
-    //-------------------------------------------------------------------
-
-    public Enumeration<Handler> getHandlers() {
-        return hashtable.elements();
-    }
-
-    //-------------------------------------------------------------------
-    // adds a varbind to a handler node sublist
-    //-------------------------------------------------------------------
-
-    public void add(SnmpMibNode meta, int depth, SnmpVarBind varbind)
-        throws SnmpStatusException {
-        registerNode(meta,depth,null,varbind,false,null);
-    }
-
-    //-------------------------------------------------------------------
-    // adds an entry varbind to a handler node sublist
-    //-------------------------------------------------------------------
-
-    public void add(SnmpMibNode meta, int depth, SnmpOid entryoid,
-                    SnmpVarBind varbind, boolean isnew)
-        throws SnmpStatusException {
-        registerNode(meta,depth,entryoid,varbind,isnew,null);
-    }
-
-    //-------------------------------------------------------------------
-    // adds an entry varbind to a handler node sublist - specifying the
-    // varbind which holds the row status
-    //-------------------------------------------------------------------
-
-    public void add(SnmpMibNode meta, int depth, SnmpOid entryoid,
-                    SnmpVarBind varbind, boolean isnew,
-                    SnmpVarBind statusvb)
-        throws SnmpStatusException {
-        registerNode(meta,depth,entryoid,varbind,isnew,statusvb);
-    }
-
-
-    //-------------------------------------------------------------------
-    //-------------------------------------------------------------------
-    // Protected interface
-    //-------------------------------------------------------------------
-    //-------------------------------------------------------------------
-
-    //-------------------------------------------------------------------
-    // Type of the request (see SnmpDefinitions)
-    //-------------------------------------------------------------------
-
-    void setPduType(int pduType) {
-        type = pduType;
-        setreqflag = ((pduType == SnmpDefinitions.pduWalkRequest) ||
-            (pduType == SnmpDefinitions.pduSetRequestPdu));
-    }
-
-    //-------------------------------------------------------------------
-    // We deal with a GET-NEXT request
-    //-------------------------------------------------------------------
-
-    void setGetNextFlag() {
-        getnextflag = true;
-    }
-
-    //-------------------------------------------------------------------
-    // Tell whether creation is allowed.
-    //-------------------------------------------------------------------
-    void switchCreationFlag(boolean flag) {
-        creationflag = flag;
-    }
-
-
-    //-------------------------------------------------------------------
-    // Returns the subrequest handled by the SnmpMibNode itself
-    // (in principle, only for Groups)
-    //-------------------------------------------------------------------
-
-    SnmpMibSubRequest getSubRequest(Handler handler) {
-        if (handler == null) return null;
-        return new SnmpMibSubRequestImpl(request,handler.getSubList(),
-                                      null,false,getnextflag,null);
-    }
-
-    //-------------------------------------------------------------------
-    // Returns the subrequest associated with the entry identified by
-    // the given entry (only for tables)
-    //-------------------------------------------------------------------
-
-    SnmpMibSubRequest getSubRequest(Handler handler, SnmpOid oid) {
-        if (handler == null) return null;
-        final int pos = handler.getEntryPos(oid);
-        if (pos == -1) return null;
-        return new SnmpMibSubRequestImpl(request,
-                                         handler.getEntrySubList(pos),
-                                         handler.getEntryOid(pos),
-                                         handler.isNewEntry(pos),
-                                         getnextflag,
-                                         handler.getRowStatusVarBind(pos));
-    }
-
-    //-------------------------------------------------------------------
-    // Returns the subrequest associated with the entry identified by
-    // the given entry (only for tables). The `entry' parameter is an
-    // index relative to the position of the entry in the handler sublist.
-    //-------------------------------------------------------------------
-
-    SnmpMibSubRequest getSubRequest(Handler handler, int entry) {
-        if (handler == null) return null;
-        return new
-            SnmpMibSubRequestImpl(request,handler.getEntrySubList(entry),
-                                  handler.getEntryOid(entry),
-                                  handler.isNewEntry(entry),getnextflag,
-                                  handler.getRowStatusVarBind(entry));
-    }
-
-    //-------------------------------------------------------------------
-    //-------------------------------------------------------------------
-    // Private section
-    //-------------------------------------------------------------------
-    //-------------------------------------------------------------------
-
-
-    //-------------------------------------------------------------------
-    // stores a handler node in the Hashtable
-    //-------------------------------------------------------------------
-
-    private void put(Object key, Handler handler) {
-        if (handler == null) return;
-        if (key == null) return;
-        if (hashtable == null) hashtable = new Hashtable<Object, Handler>();
-        hashtable.put(key,handler);
-    }
-
-    //-------------------------------------------------------------------
-    // finds a handler node in the Hashtable
-    //-------------------------------------------------------------------
-
-    private Handler get(Object key) {
-        if (key == null) return null;
-        if (hashtable == null) return null;
-        return hashtable.get(key);
-    }
-
-    //-------------------------------------------------------------------
-    // Search for the given oid in `oids'. If none is found, returns -1
-    // otherwise, returns the index at which the oid is located.
-    //-------------------------------------------------------------------
-
-    private static int findOid(SnmpOid[] oids, int count, SnmpOid oid) {
-        final int size = count;
-        int low= 0;
-        int max= size - 1;
-        int curr= low + (max-low)/2;
-        //System.out.println("Try to retrieve: " + oid.toString());
-        while (low <= max) {
-
-            final SnmpOid pos = oids[curr];
-
-            //System.out.println("Compare with" + pos.toString());
-            // never know ...we might find something ...
-            //
-            final int comp = oid.compareTo(pos);
-            if (comp == 0)
-                return curr;
-
-            if (oid.equals(pos)) {
-                return curr;
-            }
-            if (comp > 0) {
-                low = curr + 1;
-            } else {
-                max = curr - 1;
-            }
-            curr = low + (max-low)/2;
-        }
-        return -1;
-    }
-
-    //-------------------------------------------------------------------
-    // Return the index at which the given oid should be inserted in the
-    // `oids' array.
-    //-------------------------------------------------------------------
-
-    private static int getInsertionPoint(SnmpOid[] oids, int count,
-                                         SnmpOid oid) {
-        final SnmpOid[] localoids = oids;
-        final int size = count;
-        int low= 0;
-        int max= size - 1;
-        int curr= low + (max-low)/2;
-
-
-        while (low <= max) {
-
-            final SnmpOid pos = localoids[curr];
-
-            // never know ...we might find something ...
-            //
-            final int comp= oid.compareTo(pos);
-
-            // In the calling method we will have to check for this case...
-            //    if (comp == 0)
-            //       return -1;
-            // Returning curr instead of -1 avoids having to call
-            // findOid() first and getInsertionPoint() afterwards.
-            // We can simply call getInsertionPoint() and then checks whether
-            // there's an OID at the returned position which equals the
-            // given OID.
-            if (comp == 0)
-                return curr;
-
-            if (comp>0) {
-                low= curr +1;
-            } else {
-                max= curr -1;
-            }
-            curr= low + (max-low)/2;
-        }
-        return curr;
-    }
-
-    //-------------------------------------------------------------------
-    // adds a varbind in a handler node sublist
-    //-------------------------------------------------------------------
-
-    private void registerNode(SnmpMibNode meta, int depth, SnmpOid entryoid,
-                              SnmpVarBind varbind, boolean isnew,
-                              SnmpVarBind statusvb)
-        throws SnmpStatusException {
-        if (meta == null) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                    SnmpRequestTree.class.getName(),
-                    "registerNode", "meta-node is null!");
-            return;
-        }
-        if (varbind == null) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
-                    SnmpRequestTree.class.getName(),
-                    "registerNode", "varbind is null!");
-            return ;
-        }
-
-        final Object key = meta;
-
-        // retrieve the handler node associated with the given meta,
-        // if any
-        Handler handler = get(key);
-
-        // If no handler node was found for that meta, create one.
-        if (handler == null) {
-            // if (isDebugOn())
-            //    debug("registerNode", "adding node for " +
-            //          varbind.oid.toString());
-            handler = new Handler(type);
-            handler.meta  = meta;
-            handler.depth = depth;
-            put(key,handler);
-        }
-        // else {
-        //   if (isDebugOn())
-        //      debug("registerNode","found node for " +
-        //            varbind.oid.toString());
-        // }
-
-        // Adds the varbind in the handler node's sublist.
-        if (entryoid == null)
-            handler.addVarbind(varbind);
-        else
-            handler.addVarbind(varbind,entryoid,isnew,statusvb);
-    }
-
-
-    //-------------------------------------------------------------------
-    // private variables
-    //-------------------------------------------------------------------
-
-    private Hashtable<Object, Handler> hashtable = null;
-                                             // Hashtable of Handler objects
-    private SnmpMibRequest request = null;   // The original list of varbinds
-    private int       version      = 0;      // The protocol version
-    private boolean   creationflag = false;  // Does the operation allow
-                                             // creation of entries
-    private boolean   getnextflag  = false;  // Does the operation allow
-                                             // creation of entries
-    private int       type         = 0;      // Request PDU type as defined
-                                             // in SnmpDefinitions
-    private boolean   setreqflag   = false;  // True if we're processing a
-                                             // SET request (check/set).
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpStandardMetaServer.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.agent;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * <p>
- * This interface defines the methods that must be implemented by an
- * SNMP metadata object that needs to interact with an
- * {@link com.sun.jmx.snmp.agent.SnmpStandardObjectServer} object.
- * </p>
- * <p>
- * All these methods are usually generated by <code>mibgen</code> when
- * run in standard-metadata mode (default).
- * </p>
- * <p><b><i>
- * This interface is used internally between the generated Metadata and
- * the SNMP runtime and you shouldn't need to worry about it, because
- * you will never have to use it directly.
- * </b></i></p>
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- **/
-public interface SnmpStandardMetaServer {
-    /**
-     * Returns the value of the scalar object identified by the given
-     * OID arc.
-     *
-     * @param arc OID arc of the querried scalar object.
-     *
-     * @return The <CODE>SnmpValue</CODE> of the scalar object identified
-     *         by <CODE>arc</CODE>.
-     *
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @exception SnmpStatusException If the arc is not valid, or if
-     *    access is denied.
-     *
-     **/
-    public SnmpValue get(long arc, Object userData)
-        throws SnmpStatusException ;
-
-    /**
-     * Sets the value of the scalar object identified by the given
-     * OID arc.
-     *
-     * @param x New value for the scalar object identified by
-     *    <CODE>arc</CODE>
-     *
-     * @param arc OID arc of the scalar object whose value is set.
-     *
-     * @return The new <CODE>SnmpValue</CODE> of the scalar object
-     *    identified by <CODE>arc</CODE>.
-     *
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @exception SnmpStatusException If the arc is not valid, or if
-     *    access is denied.
-     *
-     **/
-    public SnmpValue set(SnmpValue x, long arc, Object userData)
-        throws SnmpStatusException ;
-
-    /**
-     * Checks that the new desired value of the scalar object identified
-     * by the given OID arc is valid.
-     *
-     * @param x New value for the scalar object identified by
-     *    <CODE>arc</CODE>
-     *
-     * @param arc OID arc of the scalar object whose value is set.
-     *
-     * @param userData A contextual object containing user-data.
-     *        This object is allocated through the <code>
-     *        {@link com.sun.jmx.snmp.agent.SnmpUserDataFactory}</code>
-     *        for each incoming SNMP request.
-     *
-     * @exception SnmpStatusException If the arc is not valid, or if
-     *    access is denied, or if the new desired value is not valid.
-     *
-     **/
-    public void check(SnmpValue x, long arc, Object userData)
-        throws SnmpStatusException ;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpStandardObjectServer.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,256 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.agent;
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Enumeration;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// SNMP Runtime imports
-//
-
-/**
- * <p>
- * This class is a utility class that transform SNMP GET / SET requests
- * into series of get<i>AttributeName</i>() set<i>AttributeName</i>()
- * invoked on the MBean.
- * </p>
- *
- * <p>
- * The transformation relies on the metadata information provided by the
- * {@link com.sun.jmx.snmp.agent.SnmpStandardMetaServer} object which is
- * passed as first parameter to every method. This SnmpStandardMetaServer
- * object is usually a Metadata object generated by <code>mibgen</code>.
- * </p>
- *
- * <p>
- * The MBean is not invoked directly by this class but through the
- * metadata object which holds a reference on it.
- * </p>
- *
- * <p><b><i>
- * This class is used internally by mibgen generated metadata objects and
- * you should never need to use it directly.
- * </b></i></p>
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- **/
-
-public class SnmpStandardObjectServer implements Serializable {
-    private static final long serialVersionUID = -4641068116505308488L;
-
-    /**
-     * Generic handling of the <CODE>get</CODE> operation.
-     * <p> The default implementation of this method is to loop over the
-     * varbind list associated with the sub-request and to call
-     * <CODE>get(var.oid.getOidArc(depth), data);</CODE>
-     * <pre>
-     * public void get(SnmpStandardMetaServer meta, SnmpMibSubRequest req,
-     *                 int depth)
-     *    throws SnmpStatusException {
-     *
-     *    final Object data = req.getUserData();
-     *
-     *    for (Enumeration e= req.getElements(); e.hasMoreElements();) {
-     *
-     *        final SnmpVarBind var= (SnmpVarBind) e.nextElement();
-     *
-     *        try {
-     *            // This method will generate a SnmpStatusException
-     *            // if `depth' is out of bounds.
-     *            //
-     *            final long id = var.oid.getOidArc(depth);
-     *            var.value = meta.get(id, data);
-     *        } catch(SnmpStatusException x) {
-     *            req.registerGetException(var,x);
-     *        }
-     *    }
-     * }
-     * </pre>
-     * <p> You can override this method if you need to implement some
-     * specific policies for minimizing the accesses made to some remote
-     * underlying resources.
-     * <p>
-     *
-     * @param meta  A pointer to the generated meta-data object which
-     *              implements the <code>SnmpStandardMetaServer</code>
-     *              interface.
-     *
-     * @param req   The sub-request that must be handled by this node.
-     *
-     * @param depth The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException An error occurred while accessing
-     *  the MIB node.
-     */
-    public void get(SnmpStandardMetaServer meta, SnmpMibSubRequest req,
-                    int depth)
-        throws SnmpStatusException {
-
-        final Object data = req.getUserData();
-
-        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements();) {
-            final SnmpVarBind var= e.nextElement();
-            try {
-                final long id = var.oid.getOidArc(depth);
-                var.value = meta.get(id, data);
-            } catch(SnmpStatusException x) {
-                req.registerGetException(var,x);
-            }
-        }
-    }
-
-    /**
-     * Generic handling of the <CODE>set</CODE> operation.
-     * <p> The default implementation of this method is to loop over the
-     * varbind list associated with the sub-request and to call
-     * <CODE>set(var.value, var.oid.getOidArc(depth), data);</CODE>
-     * <pre>
-     * public void set(SnmpStandardMetaServer meta, SnmpMibSubRequest req,
-     *                 int depth)
-     *    throws SnmpStatusException {
-     *
-     *    final Object data = req.getUserData();
-     *
-     *    for (Enumeration e= req.getElements(); e.hasMoreElements();) {
-     *
-     *        final SnmpVarBind var= (SnmpVarBind) e.nextElement();
-     *
-     *        try {
-     *            // This method will generate a SnmpStatusException
-     *            // if `depth' is out of bounds.
-     *            //
-     *            final long id = var.oid.getOidArc(depth);
-     *            var.value = meta.set(var.value, id, data);
-     *        } catch(SnmpStatusException x) {
-     *            req.registerSetException(var,x);
-     *        }
-     *    }
-     * }
-     * </pre>
-     * <p> You can override this method if you need to implement some
-     * specific policies for minimizing the accesses made to some remote
-     * underlying resources.
-     * <p>
-     *
-     * @param meta  A pointer to the generated meta-data object which
-     *              implements the <code>SnmpStandardMetaServer</code>
-     *              interface.
-     *
-     * @param req   The sub-request that must be handled by this node.
-     *
-     * @param depth The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException An error occurred while accessing
-     *  the MIB node.
-     */
-    public void set(SnmpStandardMetaServer meta, SnmpMibSubRequest req,
-                    int depth)
-        throws SnmpStatusException {
-
-        final Object data = req.getUserData();
-
-        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements();) {
-            SnmpVarBind var = e.nextElement();
-            try {
-                // This method will generate a SnmpStatusException
-                // if `depth' is out of bounds.
-                //
-                final long id = var.oid.getOidArc(depth);
-                var.value = meta.set(var.value, id, data);
-            } catch(SnmpStatusException x) {
-                req.registerSetException(var,x);
-            }
-        }
-    }
-
-    /**
-     * Generic handling of the <CODE>check</CODE> operation.
-     * <p> The default implementation of this method is to loop over the
-     * varbind list associated with the sub-request and to call
-     * <CODE>check(var.value, var.oid.getOidArc(depth), data);</CODE>
-     * <pre>
-     * public void check(SnmpStandardMetaServer meta, SnmpMibSubRequest req,
-     *                   int depth)
-     *    throws SnmpStatusException {
-     *
-     *    final Object data = req.getUserData();
-     *
-     *    for (Enumeration e= req.getElements(); e.hasMoreElements();) {
-     *
-     *        final SnmpVarBind var= (SnmpVarBind) e.nextElement();
-     *
-     *        try {
-     *            // This method will generate a SnmpStatusException
-     *            // if `depth' is out of bounds.
-     *            //
-     *            final long id = var.oid.getOidArc(depth);
-     *            meta.check(var.value, id, data);
-     *        } catch(SnmpStatusException x) {
-     *            req.registerCheckException(var,x);
-     *        }
-     *    }
-     * }
-     * </pre>
-     * <p> You can override this method if you need to implement some
-     * specific policies for minimizing the accesses made to some remote
-     * underlying resources, or if you need to implement some consistency
-     * checks between the different values provided in the varbind list.
-     * <p>
-     *
-     * @param meta  A pointer to the generated meta-data object which
-     *              implements the <code>SnmpStandardMetaServer</code>
-     *              interface.
-     *
-     * @param req   The sub-request that must be handled by this node.
-     *
-     * @param depth The depth reached in the OID tree.
-     *
-     * @exception SnmpStatusException An error occurred while accessing
-     *  the MIB node.
-     */
-    public void check(SnmpStandardMetaServer meta, SnmpMibSubRequest req,
-                      int depth)
-        throws SnmpStatusException {
-
-        final Object data = req.getUserData();
-
-        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements();) {
-            final SnmpVarBind var = e.nextElement();
-            try {
-                // This method will generate a SnmpStatusException
-                // if `depth' is out of bounds.
-                //
-                final long id = var.oid.getOidArc(depth);
-                meta.check(var.value,id,data);
-            } catch(SnmpStatusException x) {
-                req.registerCheckException(var,x);
-            }
-        }
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpTableCallbackHandler.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.agent;
-
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-
-/**
- * This interface ensures the synchronization between Metadata table objects
- * and bean-like table objects.
- *
- * It is used between mibgen generated table meta and table classes.
- * <p><b><i>
- * You should never need to use this interface directly.
- * </p></b></i>
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- **/
-public interface SnmpTableCallbackHandler {
-    /**
-     * This method is called by the SNMP runtime after a new entry
-     * has been added to the table.
-     *
-     * If an SnmpStatusException is raised, the entry will be removed
-     * and the operation will be aborted. In this case, the removeEntryCb()
-     * callback will not be called.
-     *
-     * <p><b><i>
-     * You should never need to use this method directly.
-     * </p></b></i>
-     *
-     **/
-    public void addEntryCb(int pos, SnmpOid row, ObjectName name,
-                           Object entry, SnmpMibTable meta)
-        throws SnmpStatusException;
-
-    /**
-     * This method is called by the SNMP runtime after a new entry
-     * has been removed from the table.
-     *
-     * If raised, SnmpStatusException will be ignored.
-     *
-     * <p><b><i>
-     * You should never need to use this method directly.
-     * </p></b></i>
-     *
-     **/
-    public void removeEntryCb(int pos, SnmpOid row, ObjectName name,
-                              Object entry, SnmpMibTable meta)
-        throws SnmpStatusException;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpTableEntryFactory.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.agent;
-
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-
-/**
- * This interface is implemented by mibgen generated table objects
- * inheriting from {@link com.sun.jmx.snmp.agent.SnmpTableSupport}.
- * <p>
- * It is used internally by the metadata whenever a remote SNMP manager
- * requests the creation of a new entry through an SNMP SET.
- * </p>
- * <p>
- * At creation, the mibgen generated table object retrieves its
- * corresponding metadata from the MIB and registers with
- * this metadata as a SnmpTableEntryFactory.
- * </p>
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- **/
-
-public interface SnmpTableEntryFactory extends SnmpTableCallbackHandler {
-
-    /**
-     * This method is called by the SNMP runtime whenever a new entry
-     * creation is requested by a remote manager.
-     *
-     * The factory is responsible for instantiating the appropriate MBean
-     * and for registering it with the appropriate metadata object.
-     *
-     * Usually this method will:
-     * <ul>
-     * <li>Check whether the creation can be accepted
-     * <li>Instantiate a new entry
-     * <li>Possibly register this entry with the MBeanServer, if needed.
-     * <li>Call <code>addEntry()</code> on the given <code>meta</code> object.
-     * </ul>
-     * This method is usually generated by <code>mibgen</code> on table
-     * objects (inheriting from
-     * {@link com.sun.jmx.snmp.agent.SnmpTableSupport}). <br>
-     *
-     * <p><b><i>
-     * This method is called internally by the SNMP runtime whenever a
-     * new entry creation is requested by a remote SNMP manager.
-     * You should never need to call this method directlty.
-     * </i></b></p>
-     *
-     * @param request The SNMP subrequest containing the sublist of varbinds
-     *                for the new entry.
-     * @param rowOid  The OID indexing the conceptual row (entry) for which
-     *                the creation was requested.
-     * @param depth   The depth reached in the OID tree (the position at
-     *                which the columnar object ids start in the OIDs
-     *                included in the varbind).
-     * @param meta    The metadata object impacted by the subrequest
-     *
-     * @exception SnmpStatusException The new entry cannot be created.
-     *
-     **/
-    public void createNewEntry(SnmpMibSubRequest request, SnmpOid rowOid,
-                               int depth, SnmpMibTable meta)
-        throws SnmpStatusException;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpTableEntryNotification.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.agent;
-
-
-
-// jmx imports
-//
-import javax.management.Notification;
-import javax.management.ObjectName;
-
-/**
- * Represents a notification emitted when an
- * entry is added or deleted from an SNMP table.
- * <P>
- * The <CODE>SnmpTableEntryNotification</CODE> object contains
- * the reference to the entry added or removed from the table.
- * <P>
- * The list of notifications fired by the <CODE>SnmpMibTable</CODE> is
- * the following:
- * <UL>
- * <LI>A new entry has been added to the SNMP table.
- * <LI>An existing entry has been removed from the SNMP table.
-  </UL>
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpTableEntryNotification extends Notification {
-
-    /**
-     * Creates and initializes a table entry notification object.
-     *
-     * @param type The notification type.
-     * @param source The notification producer.
-     * @param sequenceNumber The notification sequence number within the
-     *                  source object.
-     * @param timeStamp The notification emission date.
-     * @param entry     The entry object (may be null if the entry is
-     *                  registered in the MBeanServer).
-     * @param entryName The ObjectName entry object (may be null if the
-     *                  entry is not registered in the MBeanServer).
-     * @since 1.5
-     */
-    SnmpTableEntryNotification(String type, Object source,
-                               long sequenceNumber, long timeStamp,
-                               Object entry, ObjectName entryName) {
-
-        super(type, source, sequenceNumber, timeStamp);
-        this.entry = entry;
-        this.name  = entryName;
-    }
-
-    /**
-     * Gets the entry object.
-     * May be null if the entry is registered in the MBeanServer, and the
-     * MIB is using the generic MetaData (see mibgen).
-     *
-     * @return The entry.
-     */
-    public Object getEntry() {
-        return entry;
-    }
-
-    /**
-     * Gets the ObjectName of the entry.
-     * May be null if the entry is not registered in the MBeanServer.
-     *
-     * @return The ObjectName of the entry.
-     * @since 1.5
-     */
-    public ObjectName getEntryName() {
-        return name;
-    }
-
-    // PUBLIC VARIABLES
-    //-----------------
-
-    /**
-     * Notification type denoting that a new entry has been added to the
-     * SNMP table.
-     * <BR>The value of this notification type is
-     * <CODE>jmx.snmp.table.entry.added</CODE>.
-     */
-    public static final String SNMP_ENTRY_ADDED =
-        "jmx.snmp.table.entry.added";
-
-    /**
-     * Notification type denoting that an entry has been removed from the
-     * SNMP table.
-     * <BR>The value of this notification type is
-     * <CODE>jmx.snmp.table.entry.removed</CODE>.
-     */
-    public static final String SNMP_ENTRY_REMOVED =
-        "jmx.snmp.table.entry.removed";
-
-    // PRIVATE VARIABLES
-    //------------------
-
-    /**
-     * The entry object.
-     * @serial
-     */
-    private final Object entry;
-
-    /**
-     * The entry name.
-     * @serial
-     * @since 1.5
-     */
-    private final ObjectName name;
-
-    // Ensure compatibility
-    //
-    private static final long serialVersionUID = 5832592016227890252L;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpTableSupport.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,572 +0,0 @@
-/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.agent;
-
-
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.ArrayList;
-
-// jmx imports
-//
-import javax.management.Notification;
-import javax.management.ObjectName;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.NotificationBroadcaster;
-import javax.management.MBeanNotificationInfo;
-import javax.management.ListenerNotFoundException;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This class is an abstraction for an SNMP table.
- * It is the base class for implementing SNMP tables in the
- * MBean world.
- *
- * <p>
- * Its responsibility is to synchronize the MBean view of the table
- * (Table of entries) with the MIB view (array of OID indexes). Each
- * object of this class will be bound to the Metadata object which
- * manages the same SNMP Table within the MIB.
- * </p>
- *
- * <p>
- * For each table defined in a MIB, mibgen will generate a specific
- * class called Table<i>TableName</i> that will subclass this class, and
- * a corresponding <i>TableName</i>Meta class extending SnmpMibTable
- * and corresponding to the MIB view of the same table.
- * </p>
- *
- * <p>
- * Objects of this class are instantiated by MBeans representing
- * the SNMP Group to which the table belong.
- * </p>
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @see com.sun.jmx.snmp.agent.SnmpTableEntryFactory
- * @see com.sun.jmx.snmp.agent.SnmpMibTable
- *
- */
-@SuppressWarnings("serial") // JDK implementation class
-public abstract class SnmpTableSupport implements SnmpTableEntryFactory,
-// NPCTE fix for bugId 4499265, esc 0, MR 04 sept 2001
-//  SnmpTableCallbackHandler {
-    SnmpTableCallbackHandler, Serializable {
-// end of NPCTE fix for bugId 4499265
-
-    //-----------------------------------------------------------------
-    //
-    //  Protected Variables
-    //
-    //-----------------------------------------------------------------
-
-    /**
-     * The list of entries
-     **/
-    protected List<Object> entries;
-
-    /**
-     * The associated metadata object
-     **/
-    protected SnmpMibTable meta;
-
-    /**
-     * The MIB to which this table belongs
-     **/
-    protected SnmpMib      theMib;
-
-    //-----------------------------------------------------------------
-    //
-    //  Private Variables
-    //
-    //-----------------------------------------------------------------
-
-    /**
-     * This variable is initialized while binding this object to its
-     * corresponding meta object.
-     **/
-    private boolean registrationRequired = false;
-
-
-
-    //-----------------------------------------------------------------
-    //
-    //  Constructor
-    //
-    //-----------------------------------------------------------------
-
-    /**
-     * Initializes the table.
-     * The steps are these:
-     * <ul><li> allocate an array for storing entry object,</li>
-     *     <li> retrieve the corresponding metadata object
-     *          from the MIB,
-     *     <li> bind this object to the corresponding metadata object
-     *          from the MIB.</li>
-     * </ul>
-     *
-     * @param mib The MIB to which this table belong.
-     *
-     **/
-    protected SnmpTableSupport(SnmpMib mib) {
-        theMib  = mib;
-        meta    = getRegisteredTableMeta(mib);
-        bindWithTableMeta();
-        entries = allocateTable();
-    }
-
-
-    //-----------------------------------------------------------------
-    //
-    //  Implementation of the SnmpTableEntryFactory interface
-    //
-    //-----------------------------------------------------------------
-
-    /**
-     * Creates a new entry in the table.
-     *
-     * This factory method is generated by mibgen and used internally.
-     * It is part of the
-     * {@link com.sun.jmx.snmp.agent.SnmpTableEntryFactory} interface.
-     * You may subclass this method to implement any specific behaviour
-     * your application requires.
-     *
-     * @exception SnmpStatusException if the entry cannot be created.
-     **/
-    public abstract void createNewEntry(SnmpMibSubRequest request,
-                                        SnmpOid rowOid, int depth,
-                                        SnmpMibTable meta)
-        throws SnmpStatusException;
-
-
-    //-----------------------------------------------------------------
-    //
-    //  Public methods
-    //
-    //-----------------------------------------------------------------
-
-    /**
-     * Returns the entry located at the given position in the table.
-     *
-     * @return The entry located at the given position, <code>null</code>
-     *         if no entry can be found at this position.
-     **/
-    // XXXX xxxx zzz ZZZZ => public? or protected?
-    public Object getEntry(int pos) {
-        if (entries == null) return null;
-        return entries.get(pos);
-    }
-
-    /**
-     * Returns the number of entries registered in the table.
-     *
-     * @return The number of entries registered in the table.
-     **/
-    public int getSize() {
-        return meta.getSize();
-    }
-
-    /**
-     * This method lets you dynamically switch the creation policy.
-     *
-     * <CODE>setCreationEnabled()</CODE> will switch the policy of
-     *      remote entry creation via SET operations, by calling
-     *      <code>setCreationEnabled()</code> on the metadata object
-     *      associated with this table.
-     * <BR> By default remote entry creation via SET operation is disabled.
-     *
-     * @param remoteCreationFlag Tells whether remote entry creation must
-     *        be enabled or disabled.
-     * <li>
-     * <CODE>setCreationEnabled(true)</CODE> will enable remote entry
-     *      creation via SET operations.</li>
-     * <li>
-     * <CODE>setCreationEnabled(false)</CODE> will disable remote entry
-     *      creation via SET operations.</li>
-     * <p> By default remote entry creation via SET operation is disabled.
-     * </p>
-     *
-     * @see com.sun.jmx.snmp.agent.SnmpMibTable
-     *
-     **/
-    public void setCreationEnabled(boolean remoteCreationFlag) {
-        meta.setCreationEnabled(remoteCreationFlag);
-    }
-
-    /**
-     * Tells whether a new entry should be created when a SET operation
-     * is received for an entry that does not exist yet.
-     * This method calls <code>isCreationEnabled()</code> on the metadata
-     * object associated with this table.
-     *
-     * @return true if a new entry must be created, false otherwise.<br>
-     *         [default: returns <CODE>false</CODE>]
-     *
-     * @see com.sun.jmx.snmp.agent.SnmpMibTable
-     **/
-    public boolean isCreationEnabled() {
-        return meta.isCreationEnabled();
-    }
-
-    /**
-     * Tells whether the metadata object to which this table is linked
-     * requires entries to be registered. In this case passing an
-     * ObjectName when registering entries will be mandatory.
-     *
-     * @return <code>true</code> if the associated metadata requires entries
-     *         to be registered (mibgen generated generic metadata).
-     **/
-    public boolean isRegistrationRequired() {
-        return registrationRequired;
-    }
-
-    /**
-     * Builds an entry SnmpIndex from its row OID.
-     *
-     * This method is generated by mibgen and used internally.
-     *
-     * @param rowOid The SnmpOid object identifying a table entry.
-     *
-     * @return The SnmpIndex of the entry identified by <code>rowOid</code>.
-     *
-     * @exception SnmpStatusException if the index cannot be built from the
-     *            given OID.
-     **/
-    public SnmpIndex buildSnmpIndex(SnmpOid rowOid)
-        throws SnmpStatusException {
-        return buildSnmpIndex(rowOid.longValue(false), 0);
-    }
-
-    /**
-     * Builds an SnmpOid from an SnmpIndex object.
-     *
-     * This method is generated by mibgen and used internally.
-     *
-     * @param index An SnmpIndex object identifying a table entry.
-     *
-     * @return The SnmpOid form of the given entry index.
-     *
-     * @exception SnmpStatusException if the given index is not valid.
-     **/
-    public abstract SnmpOid buildOidFromIndex(SnmpIndex index)
-        throws SnmpStatusException;
-
-    /**
-     * Builds the default ObjectName of an entry from the SnmpIndex
-     * identifying this entry. No access is made on the entry itself.
-     *
-     * This method is generated by mibgen and used internally.
-     * You can subclass this method if you want to change the default
-     * ObjectName policy. This is only meaningfull when entries
-     * are registered MBeans.
-     *
-     * @param index The SnmpIndex identifying the entry from which we
-     *              want to build the default ObjectName.
-     *
-     * @return The default ObjectName for the entry identified by
-     *         the given index.
-     *
-     * @exception SnmpStatusException if the given index is not valid.
-     **/
-    public abstract ObjectName buildNameFromIndex(SnmpIndex index)
-        throws SnmpStatusException;
-
-
-    //-----------------------------------------------------------------
-    //
-    //  Implementation of the SnmpTableEntryFactory interface
-    //
-    //-----------------------------------------------------------------
-
-    /**
-     * This callback is called by  the associated metadata object
-     * when a new table entry has been registered in the
-     * table metadata.
-     *
-     * This method will update the <code>entries</code> list.
-     *
-     * @param pos   The position at which the new entry was inserted
-     *              in the table.
-     * @param row   The row OID of the new entry
-     * @param name  The ObjectName of the new entry (as specified by the
-     *              factory)
-     * @param entry The new entry (as returned by the factory)
-     * @param meta  The table metadata object.
-     *
-     **/
-    public void addEntryCb(int pos, SnmpOid row, ObjectName name,
-                           Object entry, SnmpMibTable meta)
-        throws SnmpStatusException {
-        try {
-            if (entries != null) entries.add(pos,entry);
-        } catch (Exception e) {
-            throw new SnmpStatusException(SnmpStatusException.noSuchName);
-        }
-    }
-
-    /**
-     * This callback is called by  the associated metadata object
-     * when a new table entry has been removed from the
-     * table metadata.
-     *
-     * This method will update the <code>entries</code> list.
-     *
-     * @param pos   The position from which the entry was deleted
-     * @param row   The row OID of the deleted entry
-     * @param name  The ObjectName of the deleted entry (may be null if
-     *              ObjectName's were not required)
-     * @param entry The deleted entry (may be null if only ObjectName's
-     *              were required)
-     * @param meta  The table metadata object.
-     *
-     **/
-    public void removeEntryCb(int pos, SnmpOid row, ObjectName name,
-                              Object entry, SnmpMibTable meta)
-        throws SnmpStatusException {
-        try {
-            if (entries != null) entries.remove(pos);
-        } catch (Exception e) {
-        }
-    }
-
-
-
-    /**
-     * Enables to add an SNMP entry listener to this
-     * <CODE>SnmpMibTable</CODE>.
-     *
-     * @param listener The listener object which will handle the
-     *    notifications emitted by the registered MBean.
-     *
-     * @param filter The filter object. If filter is null, no filtering
-     *    will be performed before handling notifications.
-     *
-     * @param handback The context to be sent to the listener when a
-     *    notification is emitted.
-     *
-     * @exception IllegalArgumentException Listener parameter is null.
-     */
-    public void
-        addNotificationListener(NotificationListener listener,
-                                NotificationFilter filter, Object handback) {
-        meta.addNotificationListener(listener,filter,handback);
-    }
-
-    /**
-     * Enables to remove an SNMP entry listener from this
-     * <CODE>SnmpMibTable</CODE>.
-     *
-     * @param listener The listener object which will handle the
-     *    notifications emitted by the registered MBean.
-     *    This method will remove all the information related to this
-     *    listener.
-     *
-     * @exception ListenerNotFoundException The listener is not registered
-     *    in the MBean.
-     */
-    public synchronized void
-        removeNotificationListener(NotificationListener listener)
-        throws ListenerNotFoundException {
-        meta.removeNotificationListener(listener);
-    }
-
-    /**
-     * Returns a <CODE>NotificationInfo</CODE> object containing the
-     * notification class and the notification type sent by the
-     * <CODE>SnmpMibTable</CODE>.
-     */
-    public MBeanNotificationInfo[] getNotificationInfo() {
-        return meta.getNotificationInfo();
-    }
-
-    //-----------------------------------------------------------------
-    //
-    //  Protected Abstract methods
-    //
-    //-----------------------------------------------------------------
-
-    /**
-     * Builds an SnmpIndex object from the index part of an OID.
-     *
-     * This method is generated by mibgen and used internally.
-     *
-     * @param oid The OID from which to build the index, represented
-     *        as an array of long.
-     * @param start The position where to start from in the OID array.
-     *
-     * @return The SnmpOid form of the given entry index.
-     *
-     * @exception SnmpStatusException if the given index is not valid.
-     **/
-    protected abstract SnmpIndex buildSnmpIndex(long oid[], int start )
-        throws SnmpStatusException;
-
-    /**
-     * Returns the metadata object associated with this table.
-     *
-     * This method is generated by mibgen and used internally.
-     *
-     * @param mib The SnmpMib object holding the Metadata corresponding
-     *            to this table.
-     *
-     * @return The metadata object associated with this table.
-     *         Returns <code>null</code> if this implementation of the
-     *         MIB doesn't support this table.
-     **/
-    protected abstract SnmpMibTable getRegisteredTableMeta(SnmpMib mib);
-
-
-    //-----------------------------------------------------------------
-    //
-    //  Protected methods
-    //
-    //-----------------------------------------------------------------
-
-    /**
-     * Allocates an ArrayList for storing table entries.
-     *
-     * This method is called within the constructor at object creation.
-     * Any object implementing the {@link java.util.List} interface can
-     * be used.
-     *
-     * @return A new list in which to store entries. If <code>null</code>
-     *         is returned then no entry will be stored in the list
-     *         and getEntry() will always return null.
-     **/
-    protected List<Object> allocateTable() {
-        return new ArrayList<Object>();
-    }
-
-    /**
-     * Add an entry in this table.
-     *
-     * This method registers an entry in the table and perform
-     * synchronization with the associated table metadata object.
-     *
-     * This method assumes that the given entry will not be registered,
-     * or will be registered with its default ObjectName built from the
-     * associated  SnmpIndex.
-     * <p>
-     * If the entry is going to be registered, then
-     * {@link com.sun.jmx.snmp.agent.SnmpTableSupport#addEntry(SnmpIndex, ObjectName, Object)} should be preferred.
-     * <br> This function is mainly provided for backward compatibility.
-     *
-     * @param index The SnmpIndex built from the given entry.
-     * @param entry The entry that should be added in the table.
-     *
-     * @exception SnmpStatusException if the entry cannot be registered with
-     *            the given index.
-     **/
-    protected void addEntry(SnmpIndex index, Object entry)
-        throws SnmpStatusException {
-        SnmpOid oid = buildOidFromIndex(index);
-        ObjectName name = null;
-        if (isRegistrationRequired()) {
-            name = buildNameFromIndex(index);
-        }
-        meta.addEntry(oid,name,entry);
-    }
-
-    /**
-     * Add an entry in this table.
-     *
-     * This method registers an entry in the table and performs
-     * synchronization with the associated table metadata object.
-     *
-     * @param index The SnmpIndex built from the given entry.
-     * @param name  The ObjectName with which this entry will be registered.
-     * @param entry The entry that should be added in the table.
-     *
-     * @exception SnmpStatusException if the entry cannot be registered with
-     *            the given index.
-     **/
-    protected void addEntry(SnmpIndex index, ObjectName name, Object entry)
-        throws SnmpStatusException {
-        SnmpOid oid = buildOidFromIndex(index);
-        meta.addEntry(oid,name,entry);
-    }
-
-    /**
-     * Remove an entry from this table.
-     *
-     * This method unregisters an entry from the table and performs
-     * synchronization with the associated table metadata object.
-     *
-     * @param index The SnmpIndex identifying the entry.
-     * @param entry The entry that should be removed in the table. This
-     *              parameter is optional and can be omitted if it doesn't
-     *              need to be passed along to the
-     *              <code>removeEntryCb()</code> callback defined in the
-     *              {@link com.sun.jmx.snmp.agent.SnmpTableCallbackHandler}
-     *              interface.
-     *
-     * @exception SnmpStatusException if the entry cannot be unregistered.
-     **/
-    protected void removeEntry(SnmpIndex index, Object entry)
-        throws SnmpStatusException {
-        SnmpOid oid = buildOidFromIndex(index);
-        meta.removeEntry(oid,entry);
-    }
-
-    // protected void removeEntry(ObjectName name, Object entry)
-    //  throws SnmpStatusException {
-    //  meta.removeEntry(name,entry);
-    // }
-
-    /**
-     * Returns the entries in the table.
-     *
-     * @return An Object[] array containing the entries registered in the
-     *         table.
-     **/
-    protected Object[] getBasicEntries() {
-        if (entries == null) return null;
-        Object[] array= new Object[entries.size()];
-        entries.toArray(array);
-        return array;
-    }
-
-    /**
-     * Binds this table with its associated metadata, registering itself
-     * as an SnmpTableEntryFactory.
-     **/
-    protected void bindWithTableMeta() {
-        if (meta == null) return;
-        registrationRequired = meta.isRegistrationRequired();
-        meta.registerEntryFactory(this);
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpUserDataFactory.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.agent;
-
-import com.sun.jmx.snmp.SnmpPduPacket;
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is provided to enable fine customization of the SNMP
- * agent behaviour.
- *
- * <p>You will not need to implement this interface except if your agent
- * needs extra customization requiring some contextual information.</p>
- *
- * <p>If an SnmpUserDataFactory is set on the SnmpAdaptorServer, then a new
- * object containing user-data will be allocated through this factory
- * for each incoming request. This object will be passed along to
- * the SnmpMibAgent within SnmpMibRequest objects. By default, no
- * SnmpUserDataFactory is set on the SnmpAdaptorServer, and the contextual
- * object passed to SnmpMibAgent is null.</p>
- *
- * <p>You can use this feature to obtain on contextual information
- * (such as community string etc...) or to implement a caching
- * mechanism, or for whatever purpose might be required by your specific
- * agent implementation.</p>
- *
- * <p>The sequence <code>allocateUserData() / releaseUserData()</code> can
- * also be used to implement a caching mechanism:
- * <ul>
- * <li><code>allocateUserData()</code> could be used to allocate
- *         some cache space,</li>
- * <li>and <code>releaseUserData()</code> could be used to flush it.</li>
- * </ul></p>
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @see com.sun.jmx.snmp.agent.SnmpMibRequest
- * @see com.sun.jmx.snmp.agent.SnmpMibAgent
- * @see com.sun.jmx.snmp.daemon.SnmpAdaptorServer
- *
- **/
-public interface SnmpUserDataFactory {
-    /**
-     * Called by the <CODE>SnmpAdaptorServer</CODE> adaptor.
-     * Allocate a contextual object containing some user data. This method
-     * is called once for each incoming SNMP request. The scope
-     * of this object will be the whole request. Since the request can be
-     * handled in several threads, the user should make sure that this
-     * object can be accessed in a thread-safe manner. The SNMP framework
-     * will never access this object directly - it will simply pass
-     * it to the <code>SnmpMibAgent</code> within
-     * <code>SnmpMibRequest</code> objects - from where it can be retrieved
-     * through the {@link com.sun.jmx.snmp.agent.SnmpMibRequest#getUserData() getUserData()} accessor.
-     * <code>null</code> is considered to be a valid return value.
-     *
-     * This method is called just after the SnmpPduPacket has been
-     * decoded.
-     *
-     * @param requestPdu The SnmpPduPacket received from the SNMP manager.
-     *        <b>This parameter is owned by the SNMP framework and must be
-     *        considered as transient.</b> If you wish to keep some of its
-     *        content after this method returns (by storing it in the
-     *        returned object for instance) you should clone that
-     *        information.
-     *
-     * @return A newly allocated user-data contextual object, or
-     *         <code>null</code>
-     * @exception SnmpStatusException If an SnmpStatusException is thrown,
-     *            the request will be aborted.
-     *
-     * @since 1.5
-     **/
-    public Object allocateUserData(SnmpPdu requestPdu)
-        throws SnmpStatusException;
-
-    /**
-     * Called by the <CODE>SnmpAdaptorServer</CODE> adaptor.
-     * Release a previously allocated contextual object containing user-data.
-     * This method is called just before the responsePdu is sent back to the
-     * manager. It gives the user a chance to alter the responsePdu packet
-     * before it is encoded, and to free any resources that might have
-     * been allocated when creating the contextual object.
-     *
-     * @param userData The contextual object being released.
-     * @param responsePdu The SnmpPduPacket that will be sent back to the
-     *        SNMP manager.
-     *        <b>This parameter is owned by the SNMP framework and must be
-     *        considered as transient.</b> If you wish to keep some of its
-     *        content after this method returns you should clone that
-     *        information.
-     *
-     * @exception SnmpStatusException If an SnmpStatusException is thrown,
-     *            the responsePdu is dropped and nothing is returned to
-     *            to the manager.
-     *
-     * @since 1.5
-     **/
-    public void releaseUserData(Object userData, SnmpPdu responsePdu)
-        throws SnmpStatusException;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/package.html	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<HTML>
-<HEAD>
-<!--
-
-Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-</HEAD>
-<BODY>
-Provides the classes for creating an <B>SNMP agent</B>.
-<p><b>This API is a Sun Microsystems internal API  and is subject 
-   to change without notice.</b></p>
-</BODY>
-</HTML>
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/ClientHandler.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.daemon;
-
-
-
-// java import
-//
-import java.io.*;
-import java.util.logging.Level;
-
-// jmx import
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-// jmx RI import
-//
-import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
-
-/**
- * The <CODE>ClientHandler</CODE> class is the base class of each
- * adaptor.<p>
- */
-
-abstract class ClientHandler implements Runnable {
-
-    public ClientHandler(CommunicatorServer server, int id, MBeanServer f, ObjectName n) {
-        adaptorServer = server ;
-        requestId = id ;
-        mbs = f ;
-        objectName = n ;
-        interruptCalled = false ;
-        dbgTag = makeDebugTag() ;
-        //if (mbs == null ){
-        //thread = new Thread (this) ;
-        thread =  createThread(this);
-
-        //} else {
-        //thread = mbs.getThreadAllocatorSrvIf().obtainThread(objectName,this) ;
-        //}
-        // Note: the thread will be started by the subclass.
-    }
-
-    // thread service
-    Thread createThread(Runnable r) {
-        return new Thread(this);
-    }
-
-    public void interrupt() {
-        SNMP_ADAPTOR_LOGGER.entering(dbgTag, "interrupt");
-        interruptCalled = true ;
-        if (thread != null) {
-            thread.interrupt() ;
-        }
-        SNMP_ADAPTOR_LOGGER.exiting(dbgTag, "interrupt");
-    }
-
-
-    public void join() {
-        if (thread != null) {
-        try {
-            thread.join() ;
-        }
-        catch(InterruptedException x) {
-        }
-        }
-    }
-
-    public void run() {
-
-        try {
-            //
-            // Notify the server we are now active
-            //
-            adaptorServer.notifyClientHandlerCreated(this) ;
-
-            //
-            // Call protocol specific sequence
-            //
-            doRun() ;
-        }
-        finally {
-            //
-            // Now notify the adaptor server that the handler is terminating.
-            // This is important because the server may be blocked waiting for
-            // a handler to terminate.
-            //
-            adaptorServer.notifyClientHandlerDeleted(this) ;
-        }
-    }
-
-    //
-    // The protocol-dependent part of the request
-    //
-    public abstract void doRun() ;
-
-    protected CommunicatorServer adaptorServer = null ;
-    protected int requestId = -1 ;
-    protected MBeanServer mbs = null ;
-    protected ObjectName objectName = null ;
-    protected Thread thread = null ;
-    protected boolean interruptCalled = false ;
-    protected String dbgTag = null ;
-
-    protected String makeDebugTag() {
-        return "ClientHandler[" + adaptorServer.getProtocol() + ":" + adaptorServer.getPort() + "][" + requestId + "]";
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/CommunicationException.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.daemon;
-
-// java import
-//
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
-/**
- * Represents exceptions raised due to communications problems,
- * for example when a managed object server is out of reach.<p>
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class CommunicationException extends javax.management.JMRuntimeException {
-
-    /* Serial version */
-    private static final long serialVersionUID = -2499186113233316177L;
-
-    /**
-     * Constructs a CommunicationException with a target exception.
-     */
-    public CommunicationException(Throwable target) {
-        super(target.getMessage());
-        initCause(target);
-    }
-
-    /**
-     * Constructs a CommunicationException with a target exception
-     * and a detail message.
-     */
-    public CommunicationException(Throwable target, String msg) {
-        super(msg);
-        initCause(target);
-    }
-
-    /**
-     * Constructs a CommunicationException with a detail message.
-     */
-    public CommunicationException(String msg) {
-        super(msg);
-    }
-
-    /**
-     * Get the thrown target exception.
-     */
-    public Throwable getTargetException() {
-        return getCause();
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServer.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1373 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.daemon;
-
-
-
-// java import
-//
-import java.io.ObjectInputStream;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.util.logging.Level;
-import java.util.Vector;
-import java.util.NoSuchElementException;
-
-// jmx import
-//
-import javax.management.MBeanServer;
-import javax.management.MBeanRegistration;
-import javax.management.ObjectName;
-import javax.management.NotificationListener;
-import javax.management.NotificationFilter;
-import javax.management.NotificationBroadcaster;
-import javax.management.NotificationBroadcasterSupport;
-import javax.management.MBeanNotificationInfo;
-import javax.management.AttributeChangeNotification;
-import javax.management.ListenerNotFoundException;
-
-import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
-
-// JSR 160 import
-//
-// XXX Revisit:
-//   used to import com.sun.jmx.snmp.MBeanServerForwarder
-// Now using JSR 160 instead. => this is an additional
-// dependency to JSR 160.
-//
-import javax.management.remote.MBeanServerForwarder;
-
-/**
- * Defines generic behavior for the server part of a connector or an adaptor.
- * Most connectors or adaptors extend <CODE>CommunicatorServer</CODE>
- * and inherit this behavior. Connectors or adaptors that do not fit into
- * this model do not extend <CODE>CommunicatorServer</CODE>.
- * <p>
- * A <CODE>CommunicatorServer</CODE> is an active object, it listens for
- * client requests  and processes them in its own thread. When necessary, a
- * <CODE>CommunicatorServer</CODE> creates other threads to process multiple
- * requests concurrently.
- * <p>
- * A <CODE>CommunicatorServer</CODE> object can be stopped by calling the
- * <CODE>stop</CODE> method. When it is stopped, the
- * <CODE>CommunicatorServer</CODE> no longer listens to client requests and
- * no longer holds any thread or communication resources.
- * It can be started again by calling the <CODE>start</CODE> method.
- * <p>
- * A <CODE>CommunicatorServer</CODE> has a <CODE>State</CODE> attribute
- * which reflects its  activity.
- * <p>
- * <TABLE>
- * <TR><TH>CommunicatorServer</TH>      <TH>State</TH></TR>
- * <TR><TD><CODE>stopped</CODE></TD>    <TD><CODE>OFFLINE</CODE></TD></TR>
- * <TR><TD><CODE>starting</CODE></TD>    <TD><CODE>STARTING</CODE></TD></TR>
- * <TR><TD><CODE>running</CODE></TD>     <TD><CODE>ONLINE</CODE></TD></TR>
- * <TR><TD><CODE>stopping</CODE></TD>     <TD><CODE>STOPPING</CODE></TD></TR>
- * </TABLE>
- * <p>
- * The <CODE>STARTING</CODE> state marks the transition
- * from <CODE>OFFLINE</CODE> to <CODE>ONLINE</CODE>.
- * <p>
- * The <CODE>STOPPING</CODE> state marks the transition from
- * <CODE>ONLINE</CODE> to <CODE>OFFLINE</CODE>. This occurs when the
- * <CODE>CommunicatorServer</CODE> is finishing or interrupting active
- * requests.
- * <p>
- * When a <CODE>CommunicatorServer</CODE> is unregistered from the MBeanServer,
- * it is stopped automatically.
- * <p>
- * When the value of the <CODE>State</CODE> attribute changes the
- * <CODE>CommunicatorServer</CODE> sends a
- * <tt>{@link javax.management.AttributeChangeNotification}</tt> to the
- * registered listeners, if any.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public abstract class CommunicatorServer
-    implements Runnable, MBeanRegistration, NotificationBroadcaster,
-               CommunicatorServerMBean {
-
-    //
-    // States of a CommunicatorServer
-    //
-
-    /**
-     * Represents an <CODE>ONLINE</CODE> state.
-     */
-    public static final int ONLINE = 0 ;
-
-    /**
-     * Represents an <CODE>OFFLINE</CODE> state.
-     */
-    public static final int OFFLINE = 1 ;
-
-    /**
-     * Represents a <CODE>STOPPING</CODE> state.
-     */
-    public static final int STOPPING = 2 ;
-
-    /**
-     * Represents a <CODE>STARTING</CODE> state.
-     */
-    public static final int STARTING = 3 ;
-
-    //
-    // Types of connectors.
-    //
-
-    /**
-     * Indicates that it is an RMI connector type.
-     */
-    //public static final int RMI_TYPE = 1 ;
-
-    /**
-     * Indicates that it is an HTTP connector type.
-     */
-    //public static final int HTTP_TYPE = 2 ;
-
-    /**
-     * Indicates that it is an HTML connector type.
-     */
-    //public static final int HTML_TYPE = 3 ;
-
-    /**
-     * Indicates that it is an SNMP connector type.
-     */
-    public static final int SNMP_TYPE = 4 ;
-
-    /**
-     * Indicates that it is an HTTPS connector type.
-     */
-    //public static final int HTTPS_TYPE = 5 ;
-
-    //
-    // Package variables
-    //
-
-    /**
-     * The state of the connector server.
-     */
-     transient volatile int state = OFFLINE ;
-
-    /**
-     * The object name of the connector server.
-     * @serial
-     */
-    ObjectName objectName ;
-
-    MBeanServer topMBS;
-    MBeanServer bottomMBS;
-
-    /**
-     */
-    transient String dbgTag = null ;
-
-    /**
-     * The maximum number of clients that the CommunicatorServer can
-     * process concurrently.
-     * @serial
-     */
-    int maxActiveClientCount = 1 ;
-
-    /**
-     */
-    transient int servedClientCount = 0 ;
-
-    /**
-     * The host name used by this CommunicatorServer.
-     * @serial
-     */
-    String host = null ;
-
-    /**
-     * The port number used by this CommunicatorServer.
-     * @serial
-     */
-    int port = -1 ;
-
-
-    //
-    // Private fields
-    //
-
-    /* This object controls access to the "state" and "interrupted" variables.
-       If held at the same time as the lock on "this", the "this" lock must
-       be taken first.  */
-    private transient Object stateLock = new Object();
-
-    private transient Vector<ClientHandler>
-            clientHandlerVector = new Vector<>() ;
-
-    private transient Thread mainThread = null ;
-
-    private volatile boolean stopRequested = false ;
-    private boolean interrupted = false;
-    private transient Exception startException = null;
-
-    // Notifs count, broadcaster and info
-    private transient long notifCount = 0;
-    private transient NotificationBroadcasterSupport notifBroadcaster =
-        new NotificationBroadcasterSupport();
-    private transient MBeanNotificationInfo[] notifInfos = null;
-
-
-    /**
-     * Instantiates a <CODE>CommunicatorServer</CODE>.
-     *
-     * @param connectorType Indicates the connector type. Possible values are:
-     * SNMP_TYPE.
-     *
-     * @exception <CODE>java.lang.IllegalArgumentException</CODE>
-     *            This connector type is not correct.
-     */
-    public CommunicatorServer(int connectorType)
-        throws IllegalArgumentException {
-        switch (connectorType) {
-        case SNMP_TYPE :
-            //No op. int Type deciding debugging removed.
-            break;
-        default:
-            throw new IllegalArgumentException("Invalid connector Type") ;
-        }
-        dbgTag = makeDebugTag() ;
-    }
-
-    protected Thread createMainThread() {
-        return new Thread (this, makeThreadName());
-    }
-
-    /**
-     * Starts this <CODE>CommunicatorServer</CODE>.
-     * <p>
-     * Has no effect if this <CODE>CommunicatorServer</CODE> is
-     * <CODE>ONLINE</CODE> or <CODE>STOPPING</CODE>.
-     * @param timeout Time in ms to wait for the connector to start.
-     *        If <code>timeout</code> is positive, wait for at most
-     *        the specified time. An infinite timeout can be specified
-     *        by passing a <code>timeout</code> value equals
-     *        <code>Long.MAX_VALUE</code>. In that case the method
-     *        will wait until the connector starts or fails to start.
-     *        If timeout is negative or zero, returns as soon as possible
-     *        without waiting.
-     * @exception CommunicationException if the connectors fails to start.
-     * @exception InterruptedException if the thread is interrupted or the
-     *            timeout expires.
-     */
-    public void start(long timeout)
-        throws CommunicationException, InterruptedException {
-        boolean start;
-
-        synchronized (stateLock) {
-            if (state == STOPPING) {
-                // Fix for bug 4352451:
-                //     "java.net.BindException: Address in use".
-                waitState(OFFLINE, 60000);
-            }
-            start = (state == OFFLINE);
-            if (start) {
-                changeState(STARTING);
-                stopRequested = false;
-                interrupted = false;
-                startException = null;
-            }
-        }
-
-        if (!start) {
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                    "start","Connector is not OFFLINE");
-            }
-            return;
-        }
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "start","--> Start connector ");
-        }
-
-        mainThread = createMainThread();
-
-        mainThread.start() ;
-
-        if (timeout > 0) waitForStart(timeout);
-    }
-
-    /**
-     * Starts this <CODE>CommunicatorServer</CODE>.
-     * <p>
-     * Has no effect if this <CODE>CommunicatorServer</CODE> is
-     * <CODE>ONLINE</CODE> or <CODE>STOPPING</CODE>.
-     */
-    @Override
-    public void start() {
-        try {
-            start(0);
-        } catch (InterruptedException x) {
-            // cannot happen because of `0'
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                    "start","interrupted", x);
-            }
-        }
-    }
-
-    /**
-     * Stops this <CODE>CommunicatorServer</CODE>.
-     * <p>
-     * Has no effect if this <CODE>CommunicatorServer</CODE> is
-     * <CODE>OFFLINE</CODE> or  <CODE>STOPPING</CODE>.
-     */
-    @Override
-    public void stop() {
-        synchronized (stateLock) {
-            if (state == OFFLINE || state == STOPPING) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                        "stop","Connector is not ONLINE");
-                }
-                return;
-            }
-            changeState(STOPPING);
-            //
-            // Stop the connector thread
-            //
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                    "stop","Interrupt main thread");
-            }
-            stopRequested = true ;
-            if (!interrupted) {
-                interrupted = true;
-                mainThread.interrupt();
-            }
-        }
-
-        //
-        // Call terminate on each active client handler
-        //
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "stop","terminateAllClient");
-        }
-        terminateAllClient() ;
-
-        // ----------------------
-        // changeState
-        // ----------------------
-        synchronized (stateLock) {
-            if (state == STARTING)
-                changeState(OFFLINE);
-        }
-    }
-
-    /**
-     * Tests whether the <CODE>CommunicatorServer</CODE> is active.
-     *
-     * @return True if connector is <CODE>ONLINE</CODE>; false otherwise.
-     */
-    @Override
-    public boolean isActive() {
-        synchronized (stateLock) {
-            return (state == ONLINE);
-        }
-    }
-
-    /**
-     * <p>Waits until either the State attribute of this MBean equals the
-     * specified <VAR>wantedState</VAR> parameter,
-     * or the specified  <VAR>timeOut</VAR> has elapsed.
-     * The method <CODE>waitState</CODE> returns with a boolean value
-     * indicating whether the specified <VAR>wantedState</VAR> parameter
-     * equals the value of this MBean's State attribute at the time the method
-     * terminates.</p>
-     *
-     * <p>Two special cases for the <VAR>timeOut</VAR> parameter value are:</p>
-     * <UL><LI> if <VAR>timeOut</VAR> is negative then <CODE>waitState</CODE>
-     *     returns immediately (i.e. does not wait at all),</LI>
-     * <LI> if <VAR>timeOut</VAR> equals zero then <CODE>waitState</CODE>
-     *     waits untill the value of this MBean's State attribute
-     *     is the same as the <VAR>wantedState</VAR> parameter (i.e. will wait
-     *     indefinitely if this condition is never met).</LI></UL>
-     *
-     * @param wantedState The value of this MBean's State attribute to wait
-     *        for. <VAR>wantedState</VAR> can be one of:
-     * <ul>
-     * <li><CODE>CommunicatorServer.OFFLINE</CODE>,</li>
-     * <li><CODE>CommunicatorServer.ONLINE</CODE>,</li>
-     * <li><CODE>CommunicatorServer.STARTING</CODE>,</li>
-     * <li><CODE>CommunicatorServer.STOPPING</CODE>.</li>
-     * </ul>
-     * @param timeOut The maximum time to wait for, in milliseconds,
-     *        if positive.
-     * Infinite time out if 0, or no waiting at all if negative.
-     *
-     * @return true if the value of this MBean's State attribute is the
-     *      same as the <VAR>wantedState</VAR> parameter; false otherwise.
-     */
-    @Override
-    public boolean waitState(int wantedState, long timeOut) {
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "waitState", wantedState + "(0on,1off,2st) TO=" + timeOut +
-                  " ; current state = " + getStateString());
-        }
-
-        long endTime = 0;
-        if (timeOut > 0)
-            endTime = System.currentTimeMillis() + timeOut;
-
-        synchronized (stateLock) {
-            while (state != wantedState) {
-                if (timeOut < 0) {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                            "waitState", "timeOut < 0, return without wait");
-                    }
-                    return false;
-                } else {
-                    try {
-                        if (timeOut > 0) {
-                            long toWait = endTime - System.currentTimeMillis();
-                            if (toWait <= 0) {
-                                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                                    SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                                        "waitState", "timed out");
-                                }
-                                return false;
-                            }
-                            stateLock.wait(toWait);
-                        } else {  // timeOut == 0
-                            stateLock.wait();
-                        }
-                    } catch (InterruptedException e) {
-                        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                                "waitState", "wait interrupted");
-                        }
-                        return (state == wantedState);
-                    }
-                }
-            }
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                    "waitState","returning in desired state");
-            }
-            return true;
-        }
-    }
-
-    /**
-     * <p>Waits until the communicator is started or timeout expires.
-     *
-     * @param timeout Time in ms to wait for the connector to start.
-     *        If <code>timeout</code> is positive, wait for at most
-     *        the specified time. An infinite timeout can be specified
-     *        by passing a <code>timeout</code> value equals
-     *        <code>Long.MAX_VALUE</code>. In that case the method
-     *        will wait until the connector starts or fails to start.
-     *        If timeout is negative or zero, returns as soon as possible
-     *        without waiting.
-     *
-     * @exception CommunicationException if the connectors fails to start.
-     * @exception InterruptedException if the thread is interrupted or the
-     *            timeout expires.
-     *
-     */
-    private void waitForStart(long timeout)
-        throws CommunicationException, InterruptedException {
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "waitForStart", "Timeout=" + timeout +
-                 " ; current state = " + getStateString());
-        }
-
-        final long startTime = System.currentTimeMillis();
-
-        synchronized (stateLock) {
-            while (state == STARTING) {
-                // Time elapsed since startTime...
-                //
-                final long elapsed = System.currentTimeMillis() - startTime;
-
-                // wait for timeout - elapsed.
-                // A timeout of Long.MAX_VALUE is equivalent to something
-                // like 292271023 years - which is pretty close to
-                // forever as far as we are concerned ;-)
-                //
-                final long remainingTime = timeout-elapsed;
-
-                // If remainingTime is negative, the timeout has elapsed.
-                //
-                if (remainingTime < 0) {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                            "waitForStart", "timeout < 0, return without wait");
-                    }
-                    throw new InterruptedException("Timeout expired");
-                }
-
-                // We're going to wait until someone notifies on the
-                // the stateLock object, or until the timeout expires,
-                // or until the thread is interrupted.
-                //
-                try {
-                    stateLock.wait(remainingTime);
-                } catch (InterruptedException e) {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                            "waitForStart", "wait interrupted");
-                    }
-
-                    // If we are now ONLINE, then no need to rethrow the
-                    // exception... we're simply going to exit the while
-                    // loop. Otherwise, throw the InterruptedException.
-                    //
-                    if (state != ONLINE) throw e;
-                }
-            }
-
-            // We're no longer in STARTING state
-            //
-            if (state == ONLINE) {
-                // OK, we're started, everything went fine, just return
-                //
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                        "waitForStart", "started");
-                }
-                return;
-            } else if (startException instanceof CommunicationException) {
-                // There was some exception during the starting phase.
-                // Cast and throw...
-                //
-                throw (CommunicationException)startException;
-            } else if (startException instanceof InterruptedException) {
-                // There was some exception during the starting phase.
-                // Cast and throw...
-                //
-                throw (InterruptedException)startException;
-            } else if (startException != null) {
-                // There was some exception during the starting phase.
-                // Wrap and throw...
-                //
-                throw new CommunicationException(startException,
-                                                 "Failed to start: "+
-                                                 startException);
-            } else {
-                // We're not ONLINE, and there's no exception...
-                // Something went wrong but we don't know what...
-                //
-                throw new CommunicationException("Failed to start: state is "+
-                                                 getStringForState(state));
-            }
-        }
-    }
-
-    /**
-     * Gets the state of this <CODE>CommunicatorServer</CODE> as an integer.
-     *
-     * @return <CODE>ONLINE</CODE>, <CODE>OFFLINE</CODE>,
-     *         <CODE>STARTING</CODE> or <CODE>STOPPING</CODE>.
-     */
-    @Override
-    public int getState() {
-        synchronized (stateLock) {
-            return state ;
-        }
-    }
-
-    /**
-     * Gets the state of this <CODE>CommunicatorServer</CODE> as a string.
-     *
-     * @return One of the strings "ONLINE", "OFFLINE", "STARTING" or
-     *         "STOPPING".
-     */
-    @Override
-    public String getStateString() {
-        return getStringForState(state) ;
-    }
-
-    /**
-     * Gets the host name used by this <CODE>CommunicatorServer</CODE>.
-     *
-     * @return The host name used by this <CODE>CommunicatorServer</CODE>.
-     */
-    @Override
-    public String getHost() {
-        try {
-            host = InetAddress.getLocalHost().getHostName();
-        } catch (Exception e) {
-            host = "Unknown host";
-        }
-        return host ;
-    }
-
-    /**
-     * Gets the port number used by this <CODE>CommunicatorServer</CODE>.
-     *
-     * @return The port number used by this <CODE>CommunicatorServer</CODE>.
-     */
-    @Override
-    public int getPort() {
-        synchronized (stateLock) {
-            return port ;
-        }
-    }
-
-    /**
-     * Sets the port number used by this <CODE>CommunicatorServer</CODE>.
-     *
-     * @param port The port number used by this
-     *             <CODE>CommunicatorServer</CODE>.
-     *
-     * @exception java.lang.IllegalStateException This method has been invoked
-     * while the communicator was ONLINE or STARTING.
-     */
-    @Override
-    public void setPort(int port) throws java.lang.IllegalStateException {
-        synchronized (stateLock) {
-            if ((state == ONLINE) || (state == STARTING))
-                throw new IllegalStateException("Stop server before " +
-                                                "carrying out this operation");
-            this.port = port;
-            dbgTag = makeDebugTag();
-        }
-    }
-
-    /**
-     * Gets the protocol being used by this <CODE>CommunicatorServer</CODE>.
-     * @return The protocol as a string.
-     */
-    @Override
-    public abstract String getProtocol();
-
-    /**
-     * Gets the number of clients that have been processed by this
-     * <CODE>CommunicatorServer</CODE>  since its creation.
-     *
-     * @return The number of clients handled by this
-     *         <CODE>CommunicatorServer</CODE>
-     *         since its creation. This counter is not reset by the
-     *         <CODE>stop</CODE> method.
-     */
-    int getServedClientCount() {
-        return servedClientCount ;
-    }
-
-    /**
-     * Gets the number of clients currently being processed by this
-     * <CODE>CommunicatorServer</CODE>.
-     *
-     * @return The number of clients currently being processed by this
-     *         <CODE>CommunicatorServer</CODE>.
-     */
-    int getActiveClientCount() {
-        int result = clientHandlerVector.size() ;
-        return result ;
-    }
-
-    /**
-     * Gets the maximum number of clients that this
-     * <CODE>CommunicatorServer</CODE> can  process concurrently.
-     *
-     * @return The maximum number of clients that this
-     *         <CODE>CommunicatorServer</CODE> can
-     *         process concurrently.
-     */
-    int getMaxActiveClientCount() {
-        return maxActiveClientCount ;
-    }
-
-    /**
-     * Sets the maximum number of clients this
-     * <CODE>CommunicatorServer</CODE> can process concurrently.
-     *
-     * @param c The number of clients.
-     *
-     * @exception java.lang.IllegalStateException This method has been invoked
-     * while the communicator was ONLINE or STARTING.
-     */
-    void setMaxActiveClientCount(int c)
-        throws java.lang.IllegalStateException {
-        synchronized (stateLock) {
-            if ((state == ONLINE) || (state == STARTING)) {
-                throw new IllegalStateException(
-                          "Stop server before carrying out this operation");
-            }
-            maxActiveClientCount = c ;
-        }
-    }
-
-    /**
-     * For SNMP Runtime internal use only.
-     */
-    void notifyClientHandlerCreated(ClientHandler h) {
-        clientHandlerVector.addElement(h) ;
-    }
-
-    /**
-     * For SNMP Runtime internal use only.
-     */
-    synchronized void notifyClientHandlerDeleted(ClientHandler h) {
-        clientHandlerVector.removeElement(h);
-        notifyAll();
-    }
-
-    /**
-     * The number of times the communicator server will attempt
-     * to bind before giving up.
-     **/
-    protected int getBindTries() {
-        return 50;
-    }
-
-    /**
-     * The delay, in ms, during which the communicator server will sleep before
-     * attempting to bind again.
-     **/
-    protected long getBindSleepTime() {
-        return 100;
-    }
-
-    /**
-     * For SNMP Runtime internal use only.
-     * <p>
-     * The <CODE>run</CODE> method executed by this connector's main thread.
-     */
-    @Override
-    public void run() {
-
-        // Fix jaw.00667.B
-        // It seems that the init of "i" and "success"
-        // need to be done outside the "try" clause...
-        // A bug in Java 2 production release ?
-        //
-        int i = 0;
-        boolean success = false;
-
-        // ----------------------
-        // Bind
-        // ----------------------
-        try {
-            // Fix for bug 4352451: "java.net.BindException: Address in use".
-            //
-            final int  bindRetries = getBindTries();
-            final long sleepTime   = getBindSleepTime();
-            while (i < bindRetries && !success) {
-                try {
-                    // Try socket connection.
-                    //
-                    doBind();
-                    success = true;
-                } catch (CommunicationException ce) {
-                    i++;
-                    try {
-                        Thread.sleep(sleepTime);
-                    } catch (InterruptedException ie) {
-                        throw ie;
-                    }
-                }
-            }
-            // Retry last time to get correct exception.
-            //
-            if (!success) {
-                // Try socket connection.
-                //
-                doBind();
-            }
-
-        } catch(Exception x) {
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                    "run", "Got unexpected exception", x);
-            }
-            synchronized(stateLock) {
-                startException = x;
-                changeState(OFFLINE);
-            }
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                    "run","State is OFFLINE");
-            }
-            doError(x);
-            return;
-        }
-
-        try {
-            // ----------------------
-            // State change
-            // ----------------------
-            changeState(ONLINE) ;
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                    "run","State is ONLINE");
-            }
-
-            // ----------------------
-            // Main loop
-            // ----------------------
-            while (!stopRequested) {
-                servedClientCount++;
-                doReceive() ;
-                waitIfTooManyClients() ;
-                doProcess() ;
-            }
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                    "run","Stop has been requested");
-            }
-
-        } catch(InterruptedException x) {
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                    "run","Interrupt caught");
-            }
-            changeState(STOPPING);
-        } catch(Exception x) {
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                    "run","Got unexpected exception", x);
-            }
-            changeState(STOPPING);
-        } finally {
-            synchronized (stateLock) {
-                interrupted = true;
-                Thread.interrupted();
-            }
-
-            // ----------------------
-            // unBind
-            // ----------------------
-            try {
-                doUnbind() ;
-                waitClientTermination() ;
-                changeState(OFFLINE);
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                        "run","State is OFFLINE");
-                }
-            } catch(Exception x) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                        "run","Got unexpected exception", x);
-                }
-                changeState(OFFLINE);
-            }
-
-        }
-    }
-
-    /**
-     */
-    protected abstract void doError(Exception e) throws CommunicationException;
-
-    //
-    // To be defined by the subclass.
-    //
-    // Each method below is called by run() and must be subclassed.
-    // If the method sends an exception (Communication or Interrupt), this
-    // will end up the run() method and switch the connector offline.
-    //
-    // If it is a CommunicationException, run() will call
-    //       Debug.printException().
-    //
-    // All these methods should propagate the InterruptedException to inform
-    // run() that the connector must be switch OFFLINE.
-    //
-    //
-    //
-    // doBind() should do all what is needed before calling doReceive().
-    // If doBind() throws an exception, doUnbind() is not to be called
-    // and run() ends up.
-    //
-
-    /**
-     */
-    protected abstract void doBind()
-        throws CommunicationException, InterruptedException ;
-
-    /**
-     * <CODE>doReceive()</CODE> should block until a client is available.
-     * If this method throws an exception, <CODE>doProcess()</CODE> is not
-     * called but <CODE>doUnbind()</CODE> is called then <CODE>run()</CODE>
-     * stops.
-     */
-    protected abstract void doReceive()
-        throws CommunicationException, InterruptedException ;
-
-    /**
-     * <CODE>doProcess()</CODE> is called after <CODE>doReceive()</CODE>:
-     * it should process the requests of the incoming client.
-     * If it throws an exception, <CODE>doUnbind()</CODE> is called and
-     * <CODE>run()</CODE> stops.
-     */
-    protected abstract void doProcess()
-        throws CommunicationException, InterruptedException ;
-
-    /**
-     * <CODE>doUnbind()</CODE> is called whenever the connector goes
-     * <CODE>OFFLINE</CODE>, except if <CODE>doBind()</CODE> has thrown an
-     * exception.
-     */
-    protected abstract void doUnbind()
-        throws CommunicationException, InterruptedException ;
-
-    /**
-     * Get the <code>MBeanServer</code> object to which incoming requests are
-     * sent.  This is either the MBean server in which this connector is
-     * registered, or an <code>MBeanServerForwarder</code> leading to that
-     * server.
-     */
-    public synchronized MBeanServer getMBeanServer() {
-        return topMBS;
-    }
-
-    /**
-     * Set the <code>MBeanServer</code> object to which incoming
-     * requests are sent.  This must be either the MBean server in
-     * which this connector is registered, or an
-     * <code>MBeanServerForwarder</code> leading to that server.  An
-     * <code>MBeanServerForwarder</code> <code>mbsf</code> leads to an
-     * MBean server <code>mbs</code> if
-     * <code>mbsf.getMBeanServer()</code> is either <code>mbs</code>
-     * or an <code>MBeanServerForwarder</code> leading to
-     * <code>mbs</code>.
-     *
-     * @exception IllegalArgumentException if <code>newMBS</code> is neither
-     * the MBean server in which this connector is registered nor an
-     * <code>MBeanServerForwarder</code> leading to that server.
-     *
-     * @exception IllegalStateException This method has been invoked
-     * while the communicator was ONLINE or STARTING.
-     */
-    public synchronized void setMBeanServer(MBeanServer newMBS)
-            throws IllegalArgumentException, IllegalStateException {
-        synchronized (stateLock) {
-            if (state == ONLINE || state == STARTING)
-                throw new IllegalStateException("Stop server before " +
-                                                "carrying out this operation");
-        }
-        final String error =
-            "MBeanServer argument must be MBean server where this " +
-            "server is registered, or an MBeanServerForwarder " +
-            "leading to that server";
-        Vector<MBeanServer> seenMBS = new Vector<>();
-        for (MBeanServer mbs = newMBS;
-             mbs != bottomMBS;
-             mbs = ((MBeanServerForwarder) mbs).getMBeanServer()) {
-            if (!(mbs instanceof MBeanServerForwarder))
-                throw new IllegalArgumentException(error);
-            if (seenMBS.contains(mbs))
-                throw new IllegalArgumentException("MBeanServerForwarder " +
-                                                   "loop");
-            seenMBS.addElement(mbs);
-        }
-        topMBS = newMBS;
-    }
-
-    //
-    // To be called by the subclass if needed
-    //
-    /**
-     * For internal use only.
-     */
-    ObjectName getObjectName() {
-        return objectName ;
-    }
-
-    /**
-     * For internal use only.
-     */
-    void changeState(int newState) {
-        int oldState;
-        synchronized (stateLock) {
-            if (state == newState)
-                return;
-            oldState = state;
-            state = newState;
-            stateLock.notifyAll();
-        }
-        sendStateChangeNotification(oldState, newState);
-    }
-
-    /**
-     * Returns the string used in debug traces.
-     */
-    String makeDebugTag() {
-        return "CommunicatorServer["+ getProtocol() + ":" + getPort() + "]" ;
-    }
-
-    /**
-     * Returns the string used to name the connector thread.
-     */
-    String makeThreadName() {
-        String result ;
-
-        if (objectName == null)
-            result = "CommunicatorServer" ;
-        else
-            result = objectName.toString() ;
-
-        return result ;
-    }
-
-    /**
-     * This method blocks if there are too many active clients.
-     * Call to <CODE>wait()</CODE> is terminated when a client handler
-     * thread calls <CODE>notifyClientHandlerDeleted(this)</CODE> ;
-     */
-    private synchronized void waitIfTooManyClients()
-        throws InterruptedException {
-        while (getActiveClientCount() >= maxActiveClientCount) {
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                    "waitIfTooManyClients","Waiting for a client to terminate");
-            }
-            wait();
-        }
-    }
-
-    /**
-     * This method blocks until there is no more active client.
-     */
-    private void waitClientTermination() {
-        int s = clientHandlerVector.size() ;
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            if (s >= 1) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "waitClientTermination","waiting for " +
-                      s + " clients to terminate");
-            }
-        }
-
-        // The ClientHandler will remove themselves from the
-        // clientHandlerVector at the end of their run() method, by
-        // calling notifyClientHandlerDeleted().
-        // Since the clientHandlerVector is modified by the ClientHandler
-        // threads we must avoid using Enumeration or Iterator to loop
-        // over this array. We must also take care of NoSuchElementException
-        // which could be thrown if the last ClientHandler removes itself
-        // between the call to clientHandlerVector.isEmpty() and the call
-        // to clientHandlerVector.firstElement().
-        // What we *MUST NOT DO* is locking the clientHandlerVector, because
-        // this would most probably cause a deadlock.
-        //
-        while (! clientHandlerVector.isEmpty()) {
-            try {
-                clientHandlerVector.firstElement().join();
-            } catch (NoSuchElementException x) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                        "waitClientTermination","No elements left",  x);
-                }
-            }
-        }
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            if (s >= 1) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                    "waitClientTermination","Ok, let's go...");
-            }
-        }
-    }
-
-    /**
-     * Call <CODE>interrupt()</CODE> on each pending client.
-     */
-    private void terminateAllClient() {
-        final int s = clientHandlerVector.size() ;
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            if (s >= 1) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                    "terminateAllClient","Interrupting " + s + " clients");
-            }
-        }
-
-        // The ClientHandler will remove themselves from the
-        // clientHandlerVector at the end of their run() method, by
-        // calling notifyClientHandlerDeleted().
-        // Since the clientHandlerVector is modified by the ClientHandler
-        // threads we must avoid using Enumeration or Iterator to loop
-        // over this array.
-        // We cannot use the same logic here than in waitClientTermination()
-        // because there is no guarantee that calling interrupt() on the
-        // ClientHandler will actually terminate the ClientHandler.
-        // Since we do not want to wait for the actual ClientHandler
-        // termination, we cannot simply loop over the array until it is
-        // empty (this might result in calling interrupt() endlessly on
-        // the same client handler. So what we do is simply take a snapshot
-        // copy of the vector and loop over the copy.
-        // What we *MUST NOT DO* is locking the clientHandlerVector, because
-        // this would most probably cause a deadlock.
-        //
-        final  ClientHandler[] handlers =
-                clientHandlerVector.toArray(new ClientHandler[0]);
-         for (ClientHandler h : handlers) {
-             try {
-                 h.interrupt() ;
-             } catch (Exception x) {
-                 if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                     SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                             "terminateAllClient",
-                             "Failed to interrupt pending request. " +
-                             "Ignore the exception.", x);
-                 }
-            }
-        }
-    }
-
-    /**
-     * Controls the way the CommunicatorServer service is deserialized.
-     */
-    private void readObject(ObjectInputStream stream)
-        throws IOException, ClassNotFoundException {
-
-        // Call the default deserialization of the object.
-        //
-        stream.defaultReadObject();
-
-        // Call the specific initialization for the CommunicatorServer service.
-        // This is for transient structures to be initialized to specific
-        // default values.
-        //
-        stateLock = new Object();
-        state = OFFLINE;
-        stopRequested = false;
-        servedClientCount = 0;
-        clientHandlerVector = new Vector<>();
-        mainThread = null;
-        notifCount = 0;
-        notifInfos = null;
-        notifBroadcaster = new NotificationBroadcasterSupport();
-        dbgTag = makeDebugTag();
-    }
-
-
-    //
-    // NotificationBroadcaster
-    //
-
-    /**
-     * Adds a listener for the notifications emitted by this
-     * CommunicatorServer.
-     * There is only one type of notifications sent by the CommunicatorServer:
-     * they are <tt>{@link javax.management.AttributeChangeNotification}</tt>,
-     * sent when the <tt>State</tt> attribute of this CommunicatorServer
-     * changes.
-     *
-     * @param listener The listener object which will handle the emitted
-     *        notifications.
-     * @param filter The filter object. If filter is null, no filtering
-     *        will be performed before handling notifications.
-     * @param handback An object which will be sent back unchanged to the
-     *        listener when a notification is emitted.
-     *
-     * @exception IllegalArgumentException Listener parameter is null.
-     */
-    @Override
-    public void addNotificationListener(NotificationListener listener,
-                                        NotificationFilter filter,
-                                        Object handback)
-        throws java.lang.IllegalArgumentException {
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                "addNotificationListener","Adding listener "+ listener +
-                  " with filter "+ filter + " and handback "+ handback);
-        }
-        notifBroadcaster.addNotificationListener(listener, filter, handback);
-    }
-
-    /**
-     * Removes the specified listener from this CommunicatorServer.
-     * Note that if the listener has been registered with different
-     * handback objects or notification filters, all entries corresponding
-     * to the listener will be removed.
-     *
-     * @param listener The listener object to be removed.
-     *
-     * @exception ListenerNotFoundException The listener is not registered.
-     */
-    @Override
-    public void removeNotificationListener(NotificationListener listener)
-        throws ListenerNotFoundException {
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                "removeNotificationListener","Removing listener "+ listener);
-        }
-        notifBroadcaster.removeNotificationListener(listener);
-    }
-
-    /**
-     * Returns an array of MBeanNotificationInfo objects describing
-     * the notification types sent by this CommunicatorServer.
-     * There is only one type of notifications sent by the CommunicatorServer:
-     * it is <tt>{@link javax.management.AttributeChangeNotification}</tt>,
-     * sent when the <tt>State</tt> attribute of this CommunicatorServer
-     * changes.
-     */
-    @Override
-    public MBeanNotificationInfo[] getNotificationInfo() {
-
-        // Initialize notifInfos on first call to getNotificationInfo()
-        //
-        if (notifInfos == null) {
-            notifInfos = new MBeanNotificationInfo[1];
-            String[] notifTypes = {
-                AttributeChangeNotification.ATTRIBUTE_CHANGE};
-            notifInfos[0] = new MBeanNotificationInfo( notifTypes,
-                     AttributeChangeNotification.class.getName(),
-                     "Sent to notify that the value of the State attribute "+
-                     "of this CommunicatorServer instance has changed.");
-        }
-
-        return notifInfos.clone();
-    }
-
-    /**
-     *
-     */
-    private void sendStateChangeNotification(int oldState, int newState) {
-
-        String oldStateString = getStringForState(oldState);
-        String newStateString = getStringForState(newState);
-        String message = new StringBuffer().append(dbgTag)
-            .append(" The value of attribute State has changed from ")
-            .append(oldState).append(" (").append(oldStateString)
-            .append(") to ").append(newState).append(" (")
-            .append(newStateString).append(").").toString();
-
-        notifCount++;
-        AttributeChangeNotification notif =
-            new AttributeChangeNotification(this,    // source
-                         notifCount,                 // sequence number
-                         System.currentTimeMillis(), // time stamp
-                         message,                    // message
-                         "State",                    // attribute name
-                         "int",                      // attribute type
-                         oldState,                   // old value
-                         newState );                 // new value
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                "sendStateChangeNotification","Sending AttributeChangeNotification #"
-                    + notifCount + " with message: "+ message);
-        }
-        notifBroadcaster.sendNotification(notif);
-    }
-
-    /**
-     *
-     */
-    private static String getStringForState(int s) {
-        switch (s) {
-        case ONLINE:   return "ONLINE";
-        case STARTING: return "STARTING";
-        case OFFLINE:  return "OFFLINE";
-        case STOPPING: return "STOPPING";
-        default:       return "UNDEFINED";
-        }
-    }
-
-
-    //
-    // MBeanRegistration
-    //
-
-    /**
-     * Preregister method of connector.
-     *
-     *@param server The <CODE>MBeanServer</CODE> in which the MBean will
-     *       be registered.
-     *@param name The object name of the MBean.
-     *
-     *@return  The name of the MBean registered.
-     *
-     *@exception java.langException This exception should be caught by
-     *           the <CODE>MBeanServer</CODE> and re-thrown
-     *           as an <CODE>MBeanRegistrationException</CODE>.
-     */
-    @Override
-    public ObjectName preRegister(MBeanServer server, ObjectName name)
-            throws java.lang.Exception {
-        objectName = name;
-        synchronized (this) {
-            if (bottomMBS != null) {
-                throw new IllegalArgumentException("connector already " +
-                                                   "registered in an MBean " +
-                                                   "server");
-            }
-            topMBS = bottomMBS = server;
-        }
-        dbgTag = makeDebugTag();
-        return name;
-    }
-
-    /**
-     *
-     *@param registrationDone Indicates whether or not the MBean has been
-     *       successfully registered in the <CODE>MBeanServer</CODE>.
-     *       The value false means that the registration phase has failed.
-     */
-    @Override
-    public void postRegister(Boolean registrationDone) {
-        if (!registrationDone.booleanValue()) {
-            synchronized (this) {
-                topMBS = bottomMBS = null;
-            }
-        }
-    }
-
-    /**
-     * Stop the connector.
-     *
-     * @exception java.langException This exception should be caught by
-     *            the <CODE>MBeanServer</CODE> and re-thrown
-     *            as an <CODE>MBeanRegistrationException</CODE>.
-     */
-    @Override
-    public void preDeregister() throws java.lang.Exception {
-        synchronized (this) {
-            topMBS = bottomMBS = null;
-        }
-        objectName = null ;
-        final int cstate = getState();
-        if ((cstate == ONLINE) || ( cstate == STARTING)) {
-            stop() ;
-        }
-    }
-
-    /**
-     * Do nothing.
-     */
-    @Override
-    public void postDeregister(){
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServerMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.daemon;
-
-
-
-/**
- * Defines generic behaviour for the server
- * part of a connector or an adaptor. Most connectors or adaptors extend <CODE>CommunicatorServer</CODE>
- * and inherit this behaviour. Connectors or adaptors that do not fit into this model do not extend
- * <CODE>CommunicatorServer</CODE>.
- * <p>
- * An <CODE>CommunicatorServer</CODE> is an active object, it listens for client requests
- * and processes them in its own thread. When necessary, a <CODE>CommunicatorServer</CODE>
- * creates other threads to process multiple requests concurrently.
- * <p>
- * A <CODE>CommunicatorServer</CODE> object can be stopped by calling the <CODE>stop</CODE>
- * method. When it is stopped, the <CODE>CommunicatorServer</CODE> no longer listens to client
- * requests and no longer holds any thread or communication resources.
- * It can be started again by calling the <CODE>start</CODE> method.
- * <p>
- * A <CODE>CommunicatorServer</CODE> has a <CODE>state</CODE> property which reflects its
- * activity.
- * <p>
- * <TABLE>
- * <TR><TH>CommunicatorServer</TH>            <TH>State</TH></TR>
- * <TR><TD><CODE>stopped</CODE></TD>          <TD><CODE>OFFLINE</CODE></TD></TR>
- * <TR><TD><CODE>starting</CODE></TD>         <TD><CODE>STARTING</CODE></TD></TR>
- * <TR><TD><CODE>running</CODE></TD>          <TD><CODE>ONLINE</CODE></TD></TR>
- * <TR><TD><CODE>stopping</CODE></TD>         <TD><CODE>STOPPING</CODE></TD></TR>
- * </TABLE>
- * <p>
- * The <CODE>STARTING</CODE> state marks the transition from <CODE>OFFLINE</CODE> to
- * <CODE>ONLINE</CODE>.
- * <p>
- * The <CODE>STOPPING</CODE> state marks the transition from <CODE>ONLINE</CODE> to
- * <CODE>OFFLINE</CODE>. This occurs when the <CODE>CommunicatorServer</CODE> is
- * finishing or interrupting active requests.
- * <p>
- * A <CODE>CommunicatorServer</CODE> may serve several clients concurrently. The
- * number of concurrent clients can be limited using the property
- * <CODE>maxActiveClientCount</CODE>. The default value of this property is
- * defined by the subclasses.
- * <p>
- * When a <CODE>CommunicatorServer</CODE> is unregistered from the MBeanServer,
- * it is stopped automatically.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public interface CommunicatorServerMBean {
-
-    /**
-     * Starts this <CODE>CommunicatorServer</CODE>.
-     * <p>
-     * Has no effect if this <CODE>CommunicatorServer</CODE> is <CODE>ONLINE</CODE> or
-     * <CODE>STOPPING</CODE>.
-     */
-    public void start() ;
-
-    /**
-     * Stops this <CODE>CommunicatorServer</CODE>.
-     * <p>
-     * Has no effect if this <CODE>CommunicatorServer</CODE> is <CODE>OFFLINE</CODE> or
-     * <CODE>STOPPING</CODE>.
-     */
-    public void stop() ;
-
-    /**
-     * Tests if the <CODE>CommunicatorServer</CODE> is active.
-     *
-     * @return True if connector is <CODE>ONLINE</CODE>; false otherwise.
-     */
-    public boolean isActive() ;
-
-    /**
-     * Waits untill either the State attribute of this MBean equals the specified <VAR>state</VAR> parameter,
-     * or the specified  <VAR>timeOut</VAR> has elapsed. The method <CODE>waitState</CODE> returns with a boolean value indicating whether
-     * the specified <VAR>state</VAR> parameter equals the value of this MBean's State attribute at the time the method terminates.
-     *
-     * Two special cases for the <VAR>timeOut</VAR> parameter value are:
-     * <UL><LI> if <VAR>timeOut</VAR> is negative then <CODE>waitState</CODE> returns immediately (i.e. does not wait at all),</LI>
-     * <LI> if <VAR>timeOut</VAR> equals zero then <CODE>waitState</CODE> waits untill the value of this MBean's State attribute
-     * is the same as the <VAR>state</VAR> parameter (i.e. will wait indefinitely if this condition is never met).</LI></UL>
-     *
-     * @param state The value of this MBean's State attribute
-     *        to wait for. <VAR>state</VAR> can be one of:
-     * <ul>
-     * <li><CODE>CommunicatorServer.OFFLINE</CODE>,</li>
-     * <li><CODE>CommunicatorServer.ONLINE</CODE>,</li>
-     * <li><CODE>CommunicatorServer.STARTING</CODE>,</li>
-     * <li><CODE>CommunicatorServer.STOPPING</CODE>.</li>
-     * </ul>
-     * @param timeOut The maximum time to wait for, in
-     *        milliseconds, if positive.
-     * Infinite time out if 0, or no waiting at all if negative.
-     *
-     * @return true if the value of this MBean's State attribute is the
-     *  same as the <VAR>state</VAR> parameter; false otherwise.
-     */
-    public boolean waitState(int state , long timeOut) ;
-
-    /**
-     * Gets the state of this <CODE>CommunicatorServer</CODE> as an integer.
-     *
-     * @return <CODE>ONLINE</CODE>, <CODE>OFFLINE</CODE>, <CODE>STARTING</CODE> or <CODE>STOPPING</CODE>.
-     */
-    public int getState() ;
-
-    /**
-     * Gets the state of this <CODE>CommunicatorServer</CODE> as a string.
-     *
-     * @return One of the strings "ONLINE", "OFFLINE", "STARTING" or "STOPPING".
-     */
-    public String getStateString() ;
-
-    /**
-     * Gets the host name used by this <CODE>CommunicatorServer</CODE>.
-     *
-     * @return The host name used by this <CODE>CommunicatorServer</CODE>.
-     */
-    public String getHost() ;
-
-    /**
-     * Gets the port number used by this <CODE>CommunicatorServer</CODE>.
-     *
-     * @return The port number used by this <CODE>CommunicatorServer</CODE>.
-     */
-    public int getPort() ;
-
-    /**
-     * Sets the port number used by this <CODE>CommunicatorServer</CODE>.
-     *
-     * @param port The port number used by this <CODE>CommunicatorServer</CODE>.
-     *
-     * @exception java.lang.IllegalStateException This method has been invoked
-     * while the communicator was ONLINE or STARTING.
-     */
-    public void setPort(int port) throws java.lang.IllegalStateException ;
-
-    /**
-     * Gets the protocol being used by this <CODE>CommunicatorServer</CODE>.
-     * @return The protocol as a string.
-     */
-    public abstract String getProtocol() ;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServer.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2746 +0,0 @@
-/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.daemon;
-
-
-// java imports
-//
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.logging.Level;
-import java.net.DatagramSocket;
-import java.net.DatagramPacket;
-import java.net.InetAddress;
-import java.net.SocketException;
-import java.net.UnknownHostException;
-import java.io.ObjectInputStream;
-import java.io.IOException;
-import java.io.InterruptedIOException;
-
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.MBeanRegistration;
-import javax.management.ObjectName;
-import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpMessage;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpPduFactory;
-import com.sun.jmx.snmp.SnmpPduPacket;
-import com.sun.jmx.snmp.SnmpPduRequest;
-import com.sun.jmx.snmp.SnmpPduTrap;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpVarBindList;
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpTooBigException;
-import com.sun.jmx.snmp.InetAddressAcl;
-import com.sun.jmx.snmp.SnmpPeer;
-import com.sun.jmx.snmp.SnmpParameters;
-// SNMP Runtime imports
-//
-import com.sun.jmx.snmp.SnmpPduFactoryBER;
-import com.sun.jmx.snmp.agent.SnmpMibAgent;
-import com.sun.jmx.snmp.agent.SnmpMibHandler;
-import com.sun.jmx.snmp.agent.SnmpUserDataFactory;
-import com.sun.jmx.snmp.agent.SnmpErrorHandlerAgent;
-
-import com.sun.jmx.snmp.IPAcl.SnmpAcl;
-
-import com.sun.jmx.snmp.tasks.ThreadService;
-
-/**
- * Implements an adaptor on top of the SNMP protocol.
- * <P>
- * When this SNMP protocol adaptor is started it creates a datagram socket
- * and is able to receive requests and send traps or inform requests.
- * When it is stopped, the socket is closed and neither requests
- * and nor traps/inform request are processed.
- * <P>
- * The default port number of the socket is 161. This default value can be
- * changed by specifying a port number:
- * <UL>
- * <LI>in the object constructor</LI>
- * <LI>using the {@link com.sun.jmx.snmp.daemon.CommunicatorServer#setPort
- *     setPort} method before starting the adaptor</LI>
- * </UL>
- * The default object name is defined by {@link
- * com.sun.jmx.snmp.ServiceName#DOMAIN com.sun.jmx.snmp.ServiceName.DOMAIN}
- * and {@link com.sun.jmx.snmp.ServiceName#SNMP_ADAPTOR_SERVER
- * com.sun.jmx.snmp.ServiceName.SNMP_ADAPTOR_SERVER}.
- * <P>
- * The SNMP protocol adaptor supports versions 1 and 2 of the SNMP protocol
- * in a stateless way: when it receives a v1 request, it replies with a v1
- * response, when it receives a v2 request it replies with a v2 response.
- * <BR>The method {@link #snmpV1Trap snmpV1Trap} sends traps using SNMP v1
- * format.
- * The method {@link #snmpV2Trap snmpV2Trap} sends traps using SNMP v2 format.
- * The method {@link #snmpInformRequest snmpInformRequest} sends inform
- * requests using SNMP v2 format.
- * <P>
- * To receive data packets, the SNMP protocol adaptor uses a buffer
- * which size can be configured using the property <CODE>bufferSize</CODE>
- * (default value is 1024).
- * Packets which do not fit into the buffer are rejected.
- * Increasing <CODE>bufferSize</CODE> allows the exchange of bigger packets.
- * However, the underlying networking system may impose a limit on the size
- * of UDP packets.
- * Packets which size exceed this limit will be rejected, no matter what
- * the value of <CODE>bufferSize</CODE> actually is.
- * <P>
- * An SNMP protocol adaptor may serve several managers concurrently. The
- * number of concurrent managers can be limited using the property
- * <CODE>maxActiveClientCount</CODE>.
- * <p>
- * The SNMP protocol adaptor specifies a default value (10) for the
- * <CODE>maxActiveClientCount</CODE> property. When the adaptor is stopped,
- * the active requests are interrupted and an error result is sent to
- * the managers.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public class SnmpAdaptorServer extends CommunicatorServer
-    implements SnmpAdaptorServerMBean, MBeanRegistration, SnmpDefinitions,
-               SnmpMibHandler {
-
-    // PRIVATE VARIABLES
-    //------------------
-
-    /**
-     * Port number for sending SNMP traps.
-     * <BR>The default value is 162.
-     */
-    private int                 trapPort = 162;
-
-    /**
-     * Port number for sending SNMP inform requests.
-     * <BR>The default value is 162.
-     */
-    private int                 informPort = 162;
-
-    /**
-     * The <CODE>InetAddress</CODE> used when creating the datagram socket.
-     * <BR>It is specified when creating the SNMP protocol adaptor.
-     * If not specified, the local host machine is used.
-     */
-    InetAddress address = null;
-
-    /**
-     * The IP address based ACL used by this SNMP protocol adaptor.
-     */
-    private InetAddressAcl ipacl = null;
-
-    /**
-     * The factory object.
-     */
-    private SnmpPduFactory pduFactory = null;
-
-    /**
-     * The user-data factory object.
-     */
-    private SnmpUserDataFactory userDataFactory = null;
-
-    /**
-     * Indicates if the SNMP protocol adaptor sends a response in case
-     * of authentication failure
-     */
-    private boolean authRespEnabled = true;
-
-    /**
-     * Indicates if authentication traps are enabled.
-     */
-    private boolean authTrapEnabled = true;
-
-    /**
-     * The enterprise OID.
-     * <BR>The default value is "1.3.6.1.4.1.42".
-     */
-    private SnmpOid enterpriseOid = new SnmpOid("1.3.6.1.4.1.42");
-
-    /**
-     * The buffer size of the SNMP protocol adaptor.
-     * This buffer size is used for both incoming request and outgoing
-     * inform requests.
-     * <BR>The default value is 1024.
-     */
-    int bufferSize = 1024;
-
-    private transient long            startUpTime     = 0;
-    private transient DatagramSocket  socket          = null;
-    transient DatagramSocket          trapSocket      = null;
-    private transient SnmpSession     informSession   = null;
-    private transient DatagramPacket  packet          = null;
-    transient Vector<SnmpMibAgent>    mibs            = new Vector<>();
-    private transient SnmpMibTree     root;
-
-    /**
-     * Whether ACL must be used.
-     */
-    private transient boolean         useAcl = true;
-
-
-    // SENDING SNMP INFORMS STUFF
-    //---------------------------
-
-    /**
-     * Number of times to try an inform request before giving up.
-     * The default number is 3.
-     */
-    private int maxTries = 3 ;
-
-    /**
-     * The amount of time to wait for an inform response from the manager.
-     * The default amount of time is 3000 millisec.
-     */
-    private int timeout = 3 * 1000 ;
-
-    // VARIABLES REQUIRED FOR IMPLEMENTING SNMP GROUP (MIBII)
-    //-------------------------------------------------------
-
-    /**
-     * The <CODE>snmpOutTraps</CODE> value defined in MIB-II.
-     */
-    int snmpOutTraps=0;
-
-    /**
-     * The <CODE>snmpOutGetResponses</CODE> value defined in MIB-II.
-     */
-    private int snmpOutGetResponses=0;
-
-    /**
-     * The <CODE>snmpOutGenErrs</CODE> value defined in MIB-II.
-     */
-    private int snmpOutGenErrs=0;
-
-    /**
-     * The <CODE>snmpOutBadValues</CODE> value defined in MIB-II.
-     */
-    private int snmpOutBadValues=0;
-
-    /**
-     * The <CODE>snmpOutNoSuchNames</CODE> value defined in MIB-II.
-     */
-    private int snmpOutNoSuchNames=0;
-
-    /**
-     * The <CODE>snmpOutTooBigs</CODE> value defined in MIB-II.
-     */
-    private int snmpOutTooBigs=0;
-
-    /**
-     * The <CODE>snmpOutPkts</CODE> value defined in MIB-II.
-     */
-    int snmpOutPkts=0;
-
-    /**
-     * The <CODE>snmpInASNParseErrs</CODE> value defined in MIB-II.
-     */
-    private int snmpInASNParseErrs=0;
-
-    /**
-     * The <CODE>snmpInBadCommunityUses</CODE> value defined in MIB-II.
-     */
-    private int snmpInBadCommunityUses=0;
-
-    /**
-     * The <CODE>snmpInBadCommunityNames</CODE> value defined in MIB-II.
-     */
-    private int snmpInBadCommunityNames=0;
-
-    /**
-     * The <CODE>snmpInBadVersions</CODE> value defined in MIB-II.
-     */
-    private int snmpInBadVersions=0;
-
-    /**
-     * The <CODE>snmpInGetRequests</CODE> value defined in MIB-II.
-     */
-    private int snmpInGetRequests=0;
-
-    /**
-     * The <CODE>snmpInGetNexts</CODE> value defined in MIB-II.
-     */
-    private int snmpInGetNexts=0;
-
-    /**
-     * The <CODE>snmpInSetRequests</CODE> value defined in MIB-II.
-     */
-    private int snmpInSetRequests=0;
-
-    /**
-     * The <CODE>snmpInPkts</CODE> value defined in MIB-II.
-     */
-    private int snmpInPkts=0;
-
-    /**
-     * The <CODE>snmpInTotalReqVars</CODE> value defined in MIB-II.
-     */
-    private int snmpInTotalReqVars=0;
-
-    /**
-     * The <CODE>snmpInTotalSetVars</CODE> value defined in MIB-II.
-     */
-    private int snmpInTotalSetVars=0;
-
-    /**
-     * The <CODE>snmpInTotalSetVars</CODE> value defined in rfc 1907 MIB-II.
-     */
-    private int snmpSilentDrops=0;
-
-    private static final String InterruptSysCallMsg =
-        "Interrupted system call";
-    static final SnmpOid sysUpTimeOid = new SnmpOid("1.3.6.1.2.1.1.3.0") ;
-    static final SnmpOid snmpTrapOidOid = new SnmpOid("1.3.6.1.6.3.1.1.4.1.0");
-
-    private ThreadService threadService;
-
-    private static int threadNumber = 6;
-
-    static {
-        String s = System.getProperty("com.sun.jmx.snmp.threadnumber");
-
-        if (s != null) {
-            try {
-                threadNumber = Integer.parseInt(System.getProperty(s));
-            } catch (Exception e) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER,
-                        SnmpAdaptorServer.class.getName(),
-                        "<static init>",
-                        "Got wrong value for com.sun.jmx.snmp.threadnumber: " +
-                        s + ". Use the default value: " + threadNumber);
-            }
-        }
-    }
-
-    // PUBLIC CONSTRUCTORS
-    //--------------------
-
-    /**
-     * Initializes this SNMP protocol adaptor using the default port (161).
-     * Use the {@link com.sun.jmx.snmp.IPAcl.SnmpAcl} default
-     * implementation of the <CODE>InetAddressAcl</CODE> interface.
-     */
-    public SnmpAdaptorServer() {
-        this(true, null, com.sun.jmx.snmp.ServiceName.SNMP_ADAPTOR_PORT,
-             null) ;
-    }
-
-    /**
-     * Initializes this SNMP protocol adaptor using the specified port.
-     * Use the {@link com.sun.jmx.snmp.IPAcl.SnmpAcl} default
-     * implementation of the <CODE>InetAddressAcl</CODE> interface.
-     *
-     * @param port The port number for sending SNMP responses.
-     */
-    public SnmpAdaptorServer(int port) {
-        this(true, null, port, null) ;
-    }
-
-    /**
-     * Initializes this SNMP protocol adaptor using the default port (161)
-     * and the specified IP address based ACL implementation.
-     *
-     * @param acl The <CODE>InetAddressAcl</CODE> implementation.
-     *        <code>null</code> means no ACL - everybody is authorized.
-     *
-     * @since 1.5
-     */
-    public SnmpAdaptorServer(InetAddressAcl acl) {
-        this(false, acl, com.sun.jmx.snmp.ServiceName.SNMP_ADAPTOR_PORT,
-             null) ;
-    }
-
-    /**
-     * Initializes this SNMP protocol adaptor using the default port (161)
-     * and the
-     * specified <CODE>InetAddress</CODE>.
-     * Use the {@link com.sun.jmx.snmp.IPAcl.SnmpAcl} default
-     * implementation of the <CODE>InetAddressAcl</CODE> interface.
-     *
-     * @param addr The IP address to bind.
-     */
-    public SnmpAdaptorServer(InetAddress addr) {
-        this(true, null, com.sun.jmx.snmp.ServiceName.SNMP_ADAPTOR_PORT,
-             addr) ;
-    }
-
-    /**
-     * Initializes this SNMP protocol adaptor using the specified port and the
-     * specified IP address based ACL implementation.
-     *
-     * @param acl The <CODE>InetAddressAcl</CODE> implementation.
-     *        <code>null</code> means no ACL - everybody is authorized.
-     * @param port The port number for sending SNMP responses.
-     *
-     * @since 1.5
-     */
-    public SnmpAdaptorServer(InetAddressAcl acl, int port) {
-        this(false, acl, port, null) ;
-    }
-
-    /**
-     * Initializes this SNMP protocol adaptor using the specified port and the
-     * specified <CODE>InetAddress</CODE>.
-     * Use the {@link com.sun.jmx.snmp.IPAcl.SnmpAcl} default
-     * implementation of the <CODE>InetAddressAcl</CODE> interface.
-     *
-     * @param port The port number for sending SNMP responses.
-     * @param addr The IP address to bind.
-     */
-    public SnmpAdaptorServer(int port, InetAddress addr) {
-        this(true, null, port, addr) ;
-    }
-
-    /**
-     * Initializes this SNMP protocol adaptor using the specified IP
-     * address based ACL implementation and the specified
-     * <CODE>InetAddress</CODE>.
-     *
-     * @param acl The <CODE>InetAddressAcl</CODE> implementation.
-     * @param addr The IP address to bind.
-     *
-     * @since 1.5
-     */
-    public SnmpAdaptorServer(InetAddressAcl acl, InetAddress addr) {
-        this(false, acl, com.sun.jmx.snmp.ServiceName.SNMP_ADAPTOR_PORT,
-             addr) ;
-    }
-
-    /**
-     * Initializes this SNMP protocol adaptor using the specified port, the
-     * specified  address based ACL implementation and the specified
-     * <CODE>InetAddress</CODE>.
-     *
-     * @param acl The <CODE>InetAddressAcl</CODE> implementation.
-     * @param port The port number for sending SNMP responses.
-     * @param addr The IP address to bind.
-     *
-     * @since 1.5
-     */
-    public SnmpAdaptorServer(InetAddressAcl acl, int port, InetAddress addr) {
-        this(false, acl, port, addr);
-    }
-
-    /**
-     * Initializes this SNMP protocol adaptor using the specified port and the
-     * specified <CODE>InetAddress</CODE>.
-     * This constructor allows to initialize an SNMP adaptor without using
-     * the ACL mechanism (by setting the <CODE>useAcl</CODE> parameter to
-     * false).
-     * <br>This constructor must be used in particular with a platform that
-     * does not support the <CODE>java.security.acl</CODE> package like pJava.
-     *
-     * @param useAcl Specifies if this new SNMP adaptor uses the ACL mechanism.
-     * If the specified parameter is set to <CODE>true</CODE>, this
-     * constructor is equivalent to
-     * <CODE>SnmpAdaptorServer((int)port,(InetAddress)addr)</CODE>.
-     * @param port The port number for sending SNMP responses.
-     * @param addr The IP address to bind.
-     */
-    public SnmpAdaptorServer(boolean useAcl, int port, InetAddress addr) {
-        this(useAcl,null,port,addr);
-    }
-
-    // If forceAcl is `true' and InetAddressAcl is null, then a default
-    // SnmpAcl object is created.
-    //
-    private SnmpAdaptorServer(boolean forceAcl, InetAddressAcl acl,
-                              int port, InetAddress addr) {
-        super(CommunicatorServer.SNMP_TYPE) ;
-
-
-        // Initialize the ACL implementation.
-        //
-        if (acl == null && forceAcl) {
-            try {
-                acl = new SnmpAcl("SNMP protocol adaptor IP ACL");
-            } catch (UnknownHostException e) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                        "constructor", "UnknowHostException when creating ACL",e);
-                }
-            }
-        } else {
-            this.useAcl = (acl!=null) || forceAcl;
-        }
-
-        init(acl, port, addr) ;
-    }
-
-    // GETTERS AND SETTERS
-    //--------------------
-
-    /**
-     * Gets the number of managers that have been processed by this
-     * SNMP protocol adaptor  since its creation.
-     *
-     * @return The number of managers handled by this SNMP protocol adaptor
-     * since its creation. This counter is not reset by the <CODE>stop</CODE>
-     * method.
-     */
-    @Override
-    public int getServedClientCount() {
-        return super.getServedClientCount();
-    }
-
-    /**
-     * Gets the number of managers currently being processed by this
-     * SNMP protocol adaptor.
-     *
-     * @return The number of managers currently being processed by this
-     * SNMP protocol adaptor.
-     */
-    @Override
-    public int getActiveClientCount() {
-        return super.getActiveClientCount();
-    }
-
-    /**
-     * Gets the maximum number of managers that this SNMP protocol adaptor can
-     * process concurrently.
-     *
-     * @return The maximum number of managers that this SNMP protocol adaptor
-     *         can process concurrently.
-     */
-    @Override
-    public int getMaxActiveClientCount() {
-        return super.getMaxActiveClientCount();
-    }
-
-    /**
-     * Sets the maximum number of managers this SNMP protocol adaptor can
-     * process concurrently.
-     *
-     * @param c The number of managers.
-     *
-     * @exception java.lang.IllegalStateException This method has been invoked
-     * while the communicator was <CODE>ONLINE</CODE> or <CODE>STARTING</CODE>.
-     */
-    @Override
-    public void setMaxActiveClientCount(int c)
-        throws java.lang.IllegalStateException {
-        super.setMaxActiveClientCount(c);
-    }
-
-    /**
-     * Returns the Ip address based ACL used by this SNMP protocol adaptor.
-     * @return The <CODE>InetAddressAcl</CODE> implementation.
-     *
-     * @since 1.5
-     */
-    @Override
-    public InetAddressAcl getInetAddressAcl() {
-        return ipacl;
-    }
-
-    /**
-     * Returns the port used by this SNMP protocol adaptor for sending traps.
-     * By default, port 162 is used.
-     *
-     * @return The port number for sending SNMP traps.
-     */
-    @Override
-    public Integer getTrapPort() {
-        return trapPort;
-    }
-
-    /**
-     * Sets the port used by this SNMP protocol adaptor for sending traps.
-     *
-     * @param port The port number for sending SNMP traps.
-     */
-    @Override
-    public void setTrapPort(Integer port) {
-        setTrapPort(port.intValue());
-    }
-
-    /**
-     * Sets the port used by this SNMP protocol adaptor for sending traps.
-     *
-     * @param port The port number for sending SNMP traps.
-     */
-    public void setTrapPort(int port) {
-        int val= port ;
-        if (val < 0) throw new
-            IllegalArgumentException("Trap port cannot be a negative value");
-        trapPort= val ;
-    }
-
-    /**
-     * Returns the port used by this SNMP protocol adaptor for sending
-     * inform requests. By default, port 162 is used.
-     *
-     * @return The port number for sending SNMP inform requests.
-     */
-    @Override
-    public int getInformPort() {
-        return informPort;
-    }
-
-    /**
-     * Sets the port used by this SNMP protocol adaptor for sending
-     * inform requests.
-     *
-     * @param port The port number for sending SNMP inform requests.
-     */
-    @Override
-    public void setInformPort(int port) {
-        if (port < 0)
-            throw new IllegalArgumentException("Inform request port "+
-                                               "cannot be a negative value");
-        informPort= port ;
-    }
-
-    /**
-     * Returns the protocol of this SNMP protocol adaptor.
-     *
-     * @return The string "snmp".
-     */
-    @Override
-    public String getProtocol() {
-        return "snmp";
-    }
-
-    /**
-     * Returns the buffer size of this SNMP protocol adaptor.
-     * This buffer size is used for both incoming request and outgoing
-     * inform requests.
-     * By default, buffer size 1024 is used.
-     *
-     * @return The buffer size.
-     */
-    @Override
-    public Integer getBufferSize() {
-        return bufferSize;
-    }
-
-    /**
-     * Sets the buffer size of this SNMP protocol adaptor.
-     * This buffer size is used for both incoming request and outgoing
-     * inform requests.
-     *
-     * @param s The buffer size.
-     *
-     * @exception java.lang.IllegalStateException This method has been invoked
-     * while the communicator was <CODE>ONLINE</CODE> or <CODE>STARTING</CODE>.
-     */
-    @Override
-    public void setBufferSize(Integer s)
-        throws java.lang.IllegalStateException {
-        if ((state == ONLINE) || (state == STARTING)) {
-            throw new IllegalStateException("Stop server before carrying out"+
-                                            " this operation");
-        }
-        bufferSize = s.intValue() ;
-    }
-
-    /**
-     * Gets the number of times to try sending an inform request before
-     * giving up.
-     * By default, a maximum of 3 tries is used.
-     * @return The maximun number of tries.
-     */
-    @Override
-    final public int getMaxTries() {
-        return maxTries;
-    }
-
-    /**
-     * Changes the maximun number of times to try sending an inform
-     * request before giving up.
-     * @param newMaxTries The maximun number of tries.
-     */
-    @Override
-    final public synchronized void setMaxTries(int newMaxTries) {
-        if (newMaxTries < 0)
-            throw new IllegalArgumentException();
-        maxTries = newMaxTries;
-    }
-
-    /**
-     * Gets the timeout to wait for an inform response from the manager.
-     * By default, a timeout of 3 seconds is used.
-     * @return The value of the timeout property.
-     */
-    @Override
-    final public int getTimeout() {
-        return timeout;
-    }
-
-    /**
-     * Changes the timeout to wait for an inform response from the manager.
-     * @param newTimeout The timeout (in milliseconds).
-     */
-    @Override
-    final public synchronized void setTimeout(int newTimeout) {
-        if (newTimeout < 0)
-            throw new IllegalArgumentException();
-        timeout= newTimeout;
-    }
-
-    /**
-     * Returns the message factory of this SNMP protocol adaptor.
-     *
-     * @return The factory object.
-     */
-    @Override
-    public SnmpPduFactory getPduFactory() {
-        return pduFactory ;
-    }
-
-    /**
-     * Sets the message factory of this SNMP protocol adaptor.
-     *
-     * @param factory The factory object (null means the default factory).
-     */
-    @Override
-    public void setPduFactory(SnmpPduFactory factory) {
-        if (factory == null)
-            pduFactory = new SnmpPduFactoryBER() ;
-        else
-            pduFactory = factory ;
-    }
-
-    /**
-     * Set the user-data factory of this SNMP protocol adaptor.
-     *
-     * @param factory The factory object (null means no factory).
-     * @see com.sun.jmx.snmp.agent.SnmpUserDataFactory
-     */
-    @Override
-    public void setUserDataFactory(SnmpUserDataFactory factory) {
-        userDataFactory = factory ;
-    }
-
-    /**
-     * Get the user-data factory associated with this SNMP protocol adaptor.
-     *
-     * @return The factory object (null means no factory).
-     * @see com.sun.jmx.snmp.agent.SnmpUserDataFactory
-     */
-    @Override
-    public SnmpUserDataFactory getUserDataFactory() {
-        return userDataFactory;
-    }
-
-    /**
-     * Returns <CODE>true</CODE> if authentication traps are enabled.
-     * <P>
-     * When this feature is enabled, the SNMP protocol adaptor sends
-     * an <CODE>authenticationFailure</CODE> trap each time an
-     * authentication fails.
-     * <P>
-     * The default behaviour is to send authentication traps.
-     *
-     * @return <CODE>true</CODE> if authentication traps are enabled,
-     *         <CODE>false</CODE> otherwise.
-     */
-    @Override
-    public boolean getAuthTrapEnabled() {
-        return authTrapEnabled ;
-    }
-
-    /**
-     * Sets the flag indicating if traps need to be sent in case of
-     * authentication failure.
-     *
-     * @param enabled Flag indicating if traps need to be sent.
-     */
-    @Override
-    public void setAuthTrapEnabled(boolean enabled) {
-        authTrapEnabled = enabled ;
-    }
-
-    /**
-     * Returns <code>true</code> if this SNMP protocol adaptor sends a
-     * response in case of authentication failure.
-     * <P>
-     * When this feature is enabled, the SNMP protocol adaptor sends a
-     * response with <CODE>noSuchName</CODE> or <CODE>readOnly</CODE> when
-     * the authentication failed. If the flag is disabled, the
-     * SNMP protocol adaptor trashes the PDU silently.
-     * <P>
-     * The default behavior is to send responses.
-     *
-     * @return <CODE>true</CODE> if responses are sent.
-     */
-    @Override
-    public boolean getAuthRespEnabled() {
-        return authRespEnabled ;
-    }
-
-    /**
-     * Sets the flag indicating if responses need to be sent in case of
-     * authentication failure.
-     *
-     * @param enabled Flag indicating if responses need to be sent.
-     */
-    @Override
-    public void setAuthRespEnabled(boolean enabled) {
-        authRespEnabled = enabled ;
-    }
-
-    /**
-     * Returns the enterprise OID. It is used by
-     * {@link #snmpV1Trap snmpV1Trap} to fill the 'enterprise' field of the
-     * trap request.
-     *
-     * @return The OID in string format "x.x.x.x".
-     */
-    @Override
-    public String getEnterpriseOid() {
-        return enterpriseOid.toString() ;
-    }
-
-    /**
-     * Sets the enterprise OID.
-     *
-     * @param oid The OID in string format "x.x.x.x".
-     *
-     * @exception IllegalArgumentException The string format is incorrect
-     */
-    @Override
-    public void setEnterpriseOid(String oid) throws IllegalArgumentException {
-        enterpriseOid = new SnmpOid(oid) ;
-    }
-
-    /**
-     * Returns the names of the MIBs available in this SNMP protocol adaptor.
-     *
-     * @return An array of MIB names.
-     */
-    @Override
-    public String[] getMibs() {
-        String[] result = new String[mibs.size()] ;
-        int i = 0 ;
-        for (Enumeration<SnmpMibAgent> e = mibs.elements() ; e.hasMoreElements() ;) {
-            SnmpMibAgent mib = e.nextElement() ;
-            result[i++] = mib.getMibName();
-        }
-        return result ;
-    }
-
-    // GETTERS FOR SNMP GROUP (MIBII)
-    //-------------------------------
-
-    /**
-     * Returns the <CODE>snmpOutTraps</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpOutTraps</CODE> value.
-     */
-    @Override
-    public Long getSnmpOutTraps() {
-        return (long)snmpOutTraps;
-    }
-
-    /**
-     * Returns the <CODE>snmpOutGetResponses</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpOutGetResponses</CODE> value.
-     */
-    @Override
-    public Long getSnmpOutGetResponses() {
-        return (long)snmpOutGetResponses;
-    }
-
-    /**
-     * Returns the <CODE>snmpOutGenErrs</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpOutGenErrs</CODE> value.
-     */
-    @Override
-    public Long getSnmpOutGenErrs() {
-        return (long)snmpOutGenErrs;
-    }
-
-    /**
-     * Returns the <CODE>snmpOutBadValues</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpOutBadValues</CODE> value.
-     */
-    @Override
-    public Long getSnmpOutBadValues() {
-        return (long)snmpOutBadValues;
-    }
-
-    /**
-     * Returns the <CODE>snmpOutNoSuchNames</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpOutNoSuchNames</CODE> value.
-     */
-    @Override
-    public Long getSnmpOutNoSuchNames() {
-        return (long)snmpOutNoSuchNames;
-    }
-
-    /**
-     * Returns the <CODE>snmpOutTooBigs</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpOutTooBigs</CODE> value.
-     */
-    @Override
-    public Long getSnmpOutTooBigs() {
-        return (long)snmpOutTooBigs;
-    }
-
-    /**
-     * Returns the <CODE>snmpInASNParseErrs</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInASNParseErrs</CODE> value.
-     */
-    @Override
-    public Long getSnmpInASNParseErrs() {
-        return (long)snmpInASNParseErrs;
-    }
-
-    /**
-     * Returns the <CODE>snmpInBadCommunityUses</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInBadCommunityUses</CODE> value.
-     */
-    @Override
-    public Long getSnmpInBadCommunityUses() {
-        return (long)snmpInBadCommunityUses;
-    }
-
-    /**
-     * Returns the <CODE>snmpInBadCommunityNames</CODE> value defined in
-     * MIB-II.
-     *
-     * @return The <CODE>snmpInBadCommunityNames</CODE> value.
-     */
-    @Override
-    public Long getSnmpInBadCommunityNames() {
-        return (long)snmpInBadCommunityNames;
-    }
-
-    /**
-     * Returns the <CODE>snmpInBadVersions</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInBadVersions</CODE> value.
-     */
-    @Override
-    public Long getSnmpInBadVersions() {
-        return (long)snmpInBadVersions;
-    }
-
-    /**
-     * Returns the <CODE>snmpOutPkts</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpOutPkts</CODE> value.
-     */
-    @Override
-    public Long getSnmpOutPkts() {
-        return (long)snmpOutPkts;
-    }
-
-    /**
-     * Returns the <CODE>snmpInPkts</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInPkts</CODE> value.
-     */
-    @Override
-    public Long getSnmpInPkts() {
-        return (long)snmpInPkts;
-    }
-
-    /**
-     * Returns the <CODE>snmpInGetRequests</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInGetRequests</CODE> value.
-     */
-    @Override
-    public Long getSnmpInGetRequests() {
-        return (long)snmpInGetRequests;
-    }
-
-    /**
-     * Returns the <CODE>snmpInGetNexts</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInGetNexts</CODE> value.
-     */
-    @Override
-    public Long getSnmpInGetNexts() {
-        return (long)snmpInGetNexts;
-    }
-
-    /**
-     * Returns the <CODE>snmpInSetRequests</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInSetRequests</CODE> value.
-     */
-    @Override
-    public Long getSnmpInSetRequests() {
-        return (long)snmpInSetRequests;
-    }
-
-    /**
-     * Returns the <CODE>snmpInTotalSetVars</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInTotalSetVars</CODE> value.
-     */
-    @Override
-    public Long getSnmpInTotalSetVars() {
-        return (long)snmpInTotalSetVars;
-    }
-
-    /**
-     * Returns the <CODE>snmpInTotalReqVars</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInTotalReqVars</CODE> value.
-     */
-    @Override
-    public Long getSnmpInTotalReqVars() {
-        return (long)snmpInTotalReqVars;
-    }
-
-    /**
-     * Returns the <CODE>snmpSilentDrops</CODE> value defined in RFC
-     * 1907 NMPv2-MIB .
-     *
-     * @return The <CODE>snmpSilentDrops</CODE> value.
-     *
-     * @since 1.5
-     */
-    @Override
-    public Long getSnmpSilentDrops() {
-        return (long)snmpSilentDrops;
-    }
-
-    /**
-     * Returns the <CODE>snmpProxyDrops</CODE> value defined in RFC
-     * 1907 NMPv2-MIB .
-     *
-     * @return The <CODE>snmpProxyDrops</CODE> value.
-     *
-     * @since 1.5
-     */
-    @Override
-    public Long getSnmpProxyDrops() {
-        return 0L;
-    }
-
-
-    // PUBLIC METHODS
-    //---------------
-
-    /**
-     * Allows the MBean to perform any operations it needs before being
-     * registered in the MBean server.
-     * If the name of the SNMP protocol adaptor MBean is not specified,
-     * it is initialized with the default value:
-     * {@link com.sun.jmx.snmp.ServiceName#DOMAIN
-     *   com.sun.jmx.snmp.ServiceName.DOMAIN}:{@link
-     * com.sun.jmx.snmp.ServiceName#SNMP_ADAPTOR_SERVER
-     * com.sun.jmx.snmp.ServiceName.SNMP_ADAPTOR_SERVER}.
-     * If any exception is raised, the SNMP protocol adaptor MBean will
-     * not be registered in the MBean server.
-     *
-     * @param server The MBean server to register the service with.
-     * @param name The object name.
-     *
-     * @return The name of the SNMP protocol adaptor registered.
-     *
-     * @exception java.lang.Exception
-     */
-    @Override
-    public ObjectName preRegister(MBeanServer server, ObjectName name)
-        throws java.lang.Exception {
-
-        if (name == null) {
-            name = new ObjectName(server.getDefaultDomain() + ":" +
-                             com.sun.jmx.snmp.ServiceName.SNMP_ADAPTOR_SERVER);
-        }
-        return (super.preRegister(server, name));
-    }
-
-    /**
-     * Not used in this context.
-     */
-    @Override
-    public void postRegister (Boolean registrationDone) {
-        super.postRegister(registrationDone);
-    }
-
-    /**
-     * Not used in this context.
-     */
-    @Override
-    public void preDeregister() throws java.lang.Exception {
-        super.preDeregister();
-    }
-
-    /**
-     * Not used in this context.
-     */
-    @Override
-    public void postDeregister() {
-        super.postDeregister();
-    }
-
-    /**
-     * Adds a new MIB in the SNMP MIB handler.
-     *
-     * @param mib The MIB to add.
-     *
-     * @return A reference to the SNMP MIB handler.
-     *
-     * @exception IllegalArgumentException If the parameter is null.
-     */
-    @Override
-    public SnmpMibHandler addMib(SnmpMibAgent mib)
-        throws IllegalArgumentException {
-        if (mib == null) {
-            throw new IllegalArgumentException() ;
-        }
-
-        if(!mibs.contains(mib))
-            mibs.addElement(mib);
-
-        root.register(mib);
-
-        return this;
-    }
-
-    /**
-     * Adds a new MIB in the SNMP MIB handler.
-     * This method is to be called to set a specific agent to a specific OID.
-     * This can be useful when dealing with MIB overlapping.
-     * Some OID can be implemented in more than one MIB. In this case,
-     * the OID nearer agent will be used on SNMP operations.
-     *
-     * @param mib The MIB to add.
-     * @param oids The set of OIDs this agent implements.
-     *
-     * @return A reference to the SNMP MIB handler.
-     *
-     * @exception IllegalArgumentException If the parameter is null.
-     *
-     * @since 1.5
-     */
-    @Override
-    public SnmpMibHandler addMib(SnmpMibAgent mib, SnmpOid[] oids)
-        throws IllegalArgumentException {
-        if (mib == null) {
-            throw new IllegalArgumentException() ;
-        }
-
-        //If null oid array, just add it to the mib.
-        if(oids == null)
-            return addMib(mib);
-
-        if(!mibs.contains(mib))
-            mibs.addElement(mib);
-
-        for (int i = 0; i < oids.length; i++) {
-            root.register(mib, oids[i].longValue());
-        }
-        return this;
-    }
-
-    /**
-     * Adds a new MIB in the SNMP MIB handler. In SNMP V1 and V2 the
-     * <CODE>contextName</CODE> is useless and this method
-     * is equivalent to <CODE>addMib(SnmpMibAgent mib)</CODE>.
-     *
-     * @param mib The MIB to add.
-     * @param contextName The MIB context name.
-     * @return A reference on the SNMP MIB handler.
-     *
-     * @exception IllegalArgumentException If the parameter is null.
-     *
-     * @since 1.5
-     */
-    @Override
-    public SnmpMibHandler addMib(SnmpMibAgent mib, String contextName)
-        throws IllegalArgumentException {
-        return addMib(mib);
-    }
-
-    /**
-     * Adds a new MIB in the SNMP MIB handler. In SNMP V1 and V2 the
-     * <CODE>contextName</CODE> is useless and this method
-     * is equivalent to <CODE>addMib(SnmpMibAgent mib, SnmpOid[] oids)</CODE>.
-     *
-     * @param mib The MIB to add.
-     * @param contextName The MIB context. If null is passed, will be
-     *        registered in the default context.
-     * @param oids The set of OIDs this agent implements.
-     *
-     * @return A reference to the SNMP MIB handler.
-     *
-     * @exception IllegalArgumentException If the parameter is null.
-     *
-     * @since 1.5
-     */
-    @Override
-    public SnmpMibHandler addMib(SnmpMibAgent mib,
-                                 String contextName,
-                                 SnmpOid[] oids)
-        throws IllegalArgumentException {
-
-        return addMib(mib, oids);
-    }
-
-    /**
-     * Removes the specified MIB from the SNMP protocol adaptor.
-     * In SNMP V1 and V2 the <CODE>contextName</CODE> is useless and this
-     * method is equivalent to <CODE>removeMib(SnmpMibAgent mib)</CODE>.
-     *
-     * @param mib The MIB to be removed.
-     * @param contextName The context name used at registration time.
-     *
-     * @return <CODE>true</CODE> if the specified <CODE>mib</CODE> was
-     * a MIB included in the SNMP MIB handler, <CODE>false</CODE>
-     * otherwise.
-     *
-     * @since 1.5
-     */
-    @Override
-    public boolean removeMib(SnmpMibAgent mib, String contextName) {
-        return removeMib(mib);
-    }
-
-    /**
-     * Removes the specified MIB from the SNMP protocol adaptor.
-     *
-     * @param mib The MIB to be removed.
-     *
-     * @return <CODE>true</CODE> if the specified <CODE>mib</CODE> was a MIB
-     *         included in the SNMP MIB handler, <CODE>false</CODE> otherwise.
-     */
-    @Override
-    public boolean removeMib(SnmpMibAgent mib) {
-        root.unregister(mib);
-        return (mibs.removeElement(mib)) ;
-    }
-
-    /**
-     * Removes the specified MIB from the SNMP protocol adaptor.
-     *
-     * @param mib The MIB to be removed.
-     * @param oids The oid the MIB was previously registered for.
-     * @return <CODE>true</CODE> if the specified <CODE>mib</CODE> was
-     * a MIB included in the SNMP MIB handler, <CODE>false</CODE>
-     * otherwise.
-     *
-     * @since 1.5
-     */
-    @Override
-    public boolean removeMib(SnmpMibAgent mib, SnmpOid[] oids) {
-        root.unregister(mib, oids);
-        return (mibs.removeElement(mib)) ;
-    }
-
-     /**
-     * Removes the specified MIB from the SNMP protocol adaptor.
-     *
-     * @param mib The MIB to be removed.
-     * @param contextName The context name used at registration time.
-     * @param oids The oid the MIB was previously registered for.
-     * @return <CODE>true</CODE> if the specified <CODE>mib</CODE> was
-     * a MIB included in the SNMP MIB handler, <CODE>false</CODE>
-     * otherwise.
-     *
-     * @since 1.5
-     */
-    @Override
-    public boolean removeMib(SnmpMibAgent mib,
-                             String contextName,
-                             SnmpOid[] oids) {
-        return removeMib(mib, oids);
-    }
-
-    // SUBCLASSING OF COMMUNICATOR SERVER
-    //-----------------------------------
-
-    /**
-     * Creates the datagram socket.
-     */
-    @Override
-    protected void doBind()
-        throws CommunicationException, InterruptedException {
-
-        try {
-            synchronized (this) {
-                socket = new DatagramSocket(port, address) ;
-            }
-            dbgTag = makeDebugTag();
-        } catch (SocketException e) {
-            if (e.getMessage().equals(InterruptSysCallMsg))
-                throw new InterruptedException(e.toString()) ;
-            else {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                        "doBind", "cannot bind on port " + port);
-                }
-                throw new CommunicationException(e) ;
-            }
-        }
-    }
-
-    /**
-     * Return the actual port to which the adaptor is bound.
-     * Can be different from the port given at construction time if
-     * that port number was 0.
-     * @return the actual port to which the adaptor is bound.
-     **/
-    @Override
-    public int getPort() {
-        synchronized (this) {
-            if (socket != null) return socket.getLocalPort();
-        }
-        return super.getPort();
-    }
-
-    /**
-     * Closes the datagram socket.
-     */
-    @Override
-    protected void doUnbind()
-        throws CommunicationException, InterruptedException {
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "doUnbind","Finally close the socket");
-        }
-        synchronized (this) {
-            if (socket != null) {
-                socket.close() ;
-                socket = null ;
-                // Important to inform finalize() that the socket is closed...
-            }
-        }
-        closeTrapSocketIfNeeded() ;
-        closeInformSocketIfNeeded() ;
-    }
-
-    private void createSnmpRequestHandler(SnmpAdaptorServer server,
-                                          int id,
-                                          DatagramSocket s,
-                                          DatagramPacket p,
-                                          SnmpMibTree tree,
-                                          Vector<SnmpMibAgent> m,
-                                          InetAddressAcl a,
-                                          SnmpPduFactory factory,
-                                          SnmpUserDataFactory dataFactory,
-                                          MBeanServer f,
-                                          ObjectName n) {
-        final SnmpRequestHandler handler =
-            new SnmpRequestHandler(this, id, s, p, tree, m, a, factory,
-                                   dataFactory, f, n);
-        threadService.submitTask(handler);
-    }
-
-    /**
-     * Reads a packet from the datagram socket and creates a request
-     * handler which decodes and processes the request.
-     */
-    @Override
-    protected void doReceive()
-        throws CommunicationException, InterruptedException {
-
-        // Let's wait for something to be received.
-        //
-        try {
-            packet = new DatagramPacket(new byte[bufferSize], bufferSize) ;
-            socket.receive(packet);
-            int state = getState();
-
-            if(state != ONLINE) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                        "doReceive","received a message but state not online, returning.");
-                }
-                return;
-            }
-
-            createSnmpRequestHandler(this, servedClientCount, socket,
-                                     packet, root, mibs, ipacl, pduFactory,
-                                     userDataFactory, topMBS, objectName);
-        } catch (SocketException e) {
-            // Let's check if we have been interrupted by stop().
-            //
-            if (e.getMessage().equals(InterruptSysCallMsg))
-                throw new InterruptedException(e.toString()) ;
-            else
-                throw new CommunicationException(e) ;
-        } catch (InterruptedIOException e) {
-            throw new InterruptedException(e.toString()) ;
-        } catch (CommunicationException e) {
-            throw e ;
-        } catch (Exception e) {
-            throw new CommunicationException(e) ;
-        }
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "doReceive", "received a message");
-        }
-    }
-
-    @Override
-    protected void doError(Exception e) throws CommunicationException {
-    }
-
-    /**
-     * Not used in this context.
-     */
-    @Override
-    protected void doProcess()
-        throws CommunicationException, InterruptedException {
-    }
-
-
-    /**
-     * The number of times the communicator server will attempt
-     * to bind before giving up.
-     * We attempt only once...
-     * @return 1
-     **/
-    @Override
-    protected int getBindTries() {
-        return 1;
-    }
-
-    /**
-     * Stops this SNMP protocol adaptor.
-     * Closes the datagram socket.
-     * <p>
-     * Has no effect if this SNMP protocol adaptor is <CODE>OFFLINE</CODE> or
-     * <CODE>STOPPING</CODE>.
-     */
-    @Override
-    public void stop(){
-
-        final int port = getPort();
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "stop", "Stopping: using port " + port);
-        }
-        if ((state == ONLINE) || (state == STARTING)){
-            super.stop();
-            try {
-                DatagramSocket sn = new DatagramSocket(0);
-                try {
-                    byte[] ob = new byte[1];
-
-                    DatagramPacket pk;
-                    if (address != null)
-                        pk = new DatagramPacket(ob , 1, address, port);
-                    else
-                        pk = new DatagramPacket(ob , 1,
-                                 java.net.InetAddress.getLocalHost(), port);
-
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                            "stop", "Sending: using port " + port);
-                    }
-                    sn.send(pk);
-                } finally {
-                    sn.close();
-                }
-            } catch (Throwable e){
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                        "stop", "Got unexpected Throwable", e);
-                }
-            }
-        }
-    }
-
-    // SENDING SNMP TRAPS STUFF
-    //-------------------------
-
-    /**
-     * Sends a trap using SNMP V1 trap format.
-     * <BR>The trap is sent to each destination defined in the ACL file
-     * (if available).
-     * If no ACL file or no destinations are available, the trap is sent
-     * to the local host.
-     *
-     * @param generic The generic number of the trap.
-     * @param specific The specific number of the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     *
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit defined
-     *            by <CODE>bufferSize</CODE>.
-     */
-    @Override
-    public void snmpV1Trap(int generic, int specific,
-                           SnmpVarBindList varBindList)
-        throws IOException, SnmpStatusException {
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "snmpV1Trap", "generic=" + generic +
-                  ", specific=" + specific);
-        }
-
-        // First, make an SNMP V1 trap pdu
-        //
-        SnmpPduTrap pdu = new SnmpPduTrap() ;
-        pdu.address = null ;
-        pdu.port = trapPort ;
-        pdu.type = pduV1TrapPdu ;
-        pdu.version = snmpVersionOne ;
-        pdu.community = null ;
-        pdu.enterprise = enterpriseOid ;
-        pdu.genericTrap = generic ;
-        pdu.specificTrap = specific ;
-        pdu.timeStamp = getSysUpTime();
-
-        if (varBindList != null) {
-            pdu.varBindList = new SnmpVarBind[varBindList.size()] ;
-            varBindList.copyInto(pdu.varBindList);
-        }
-        else
-            pdu.varBindList = null ;
-
-        // If the local host cannot be determined, we put 0.0.0.0 in agentAddr
-        try {
-            if (address != null)
-                pdu.agentAddr = handleMultipleIpVersion(address.getAddress());
-            else pdu.agentAddr =
-              handleMultipleIpVersion(InetAddress.getLocalHost().getAddress());
-        } catch (UnknownHostException e) {
-            byte[] zeroedAddr = new byte[4];
-            pdu.agentAddr = handleMultipleIpVersion(zeroedAddr) ;
-        }
-
-        // Next, send the pdu to all destinations defined in ACL
-        //
-        sendTrapPdu(pdu) ;
-    }
-
-    private SnmpIpAddress handleMultipleIpVersion(byte[] address) {
-        if(address.length == 4)
-          return new SnmpIpAddress(address);
-        else {
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                    "handleMultipleIPVersion",
-                      "Not an IPv4 address, return null");
-            }
-            return null;
-        }
-    }
-
-    /**
-     * Sends a trap using SNMP V1 trap format.
-     * <BR>The trap is sent to the specified <CODE>InetAddress</CODE>
-     * destination using the specified community string (and the ACL file
-     * is not used).
-     *
-     * @param addr The <CODE>InetAddress</CODE> destination of the trap.
-     * @param cs The community string to be used for the trap.
-     * @param generic The generic number of the trap.
-     * @param specific The specific number of the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     *
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit defined
-     *            by <CODE>bufferSize</CODE>.
-     */
-    @Override
-    public void snmpV1Trap(InetAddress addr, String cs, int generic,
-                           int specific, SnmpVarBindList varBindList)
-        throws IOException, SnmpStatusException {
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "snmpV1Trap", "generic=" + generic + ", specific=" +
-                  specific);
-        }
-
-        // First, make an SNMP V1 trap pdu
-        //
-        SnmpPduTrap pdu = new SnmpPduTrap() ;
-        pdu.address = null ;
-        pdu.port = trapPort ;
-        pdu.type = pduV1TrapPdu ;
-        pdu.version = snmpVersionOne ;
-
-        if(cs != null)
-            pdu.community = cs.getBytes();
-        else
-            pdu.community = null ;
-
-        pdu.enterprise = enterpriseOid ;
-        pdu.genericTrap = generic ;
-        pdu.specificTrap = specific ;
-        pdu.timeStamp = getSysUpTime();
-
-        if (varBindList != null) {
-            pdu.varBindList = new SnmpVarBind[varBindList.size()] ;
-            varBindList.copyInto(pdu.varBindList);
-        }
-        else
-            pdu.varBindList = null ;
-
-        // If the local host cannot be determined, we put 0.0.0.0 in agentAddr
-        try {
-            if (address != null)
-                pdu.agentAddr = handleMultipleIpVersion(address.getAddress());
-            else pdu.agentAddr =
-              handleMultipleIpVersion(InetAddress.getLocalHost().getAddress());
-        } catch (UnknownHostException e) {
-            byte[] zeroedAddr = new byte[4];
-            pdu.agentAddr = handleMultipleIpVersion(zeroedAddr) ;
-        }
-
-        // Next, send the pdu to the specified destination
-        //
-        if(addr != null)
-            sendTrapPdu(addr, pdu) ;
-        else
-            sendTrapPdu(pdu);
-    }
-
-    /**
-     * Sends a trap using SNMP V1 trap format.
-     * <BR>The trap is sent to the specified <CODE>InetAddress</CODE>
-     * destination using the specified parameters (and the ACL file is not
-     * used).
-     * Note that if the specified <CODE>InetAddress</CODE> destination is null,
-     * then the ACL file mechanism is used.
-     *
-     * @param addr The <CODE>InetAddress</CODE> destination of the trap.
-     * @param agentAddr The agent address to be used for the trap.
-     * @param cs The community string to be used for the trap.
-     * @param enterpOid The enterprise OID to be used for the trap.
-     * @param generic The generic number of the trap.
-     * @param specific The specific number of the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     * @param time The time stamp (overwrite the current time).
-     *
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit defined
-     *            by <CODE>bufferSize</CODE>.
-     *
-     * @since 1.5
-     */
-    public void snmpV1Trap(InetAddress addr,
-                           SnmpIpAddress agentAddr,
-                           String cs,
-                           SnmpOid enterpOid,
-                           int generic,
-                           int specific,
-                           SnmpVarBindList varBindList,
-                           SnmpTimeticks time)
-        throws IOException, SnmpStatusException {
-        snmpV1Trap(addr,
-                   trapPort,
-                   agentAddr,
-                   cs,
-                   enterpOid,
-                   generic,
-                   specific,
-                   varBindList,
-                   time);
-    }
-
-    /**
-     * Sends a trap using SNMP V1 trap format.
-     * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
-     * The community string used is the one located in the
-     * <CODE>SnmpPeer</CODE> parameters
-     * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
-     *
-     * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
-     * @param agentAddr The agent address to be used for the trap.
-     * @param enterpOid The enterprise OID to be used for the trap.
-     * @param generic The generic number of the trap.
-     * @param specific The specific number of the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     * @param time The time stamp (overwrite the current time).
-     *
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit
-     * defined by <CODE>bufferSize</CODE>.
-     *
-     * @since 1.5
-     */
-    @Override
-    public void snmpV1Trap(SnmpPeer peer,
-                           SnmpIpAddress agentAddr,
-                           SnmpOid enterpOid,
-                           int generic,
-                           int specific,
-                           SnmpVarBindList varBindList,
-                           SnmpTimeticks time)
-        throws IOException, SnmpStatusException {
-
-        SnmpParameters p = (SnmpParameters) peer.getParams();
-        snmpV1Trap(peer.getDestAddr(),
-                   peer.getDestPort(),
-                   agentAddr,
-                   p.getRdCommunity(),
-                   enterpOid,
-                   generic,
-                   specific,
-                   varBindList,
-                   time);
-    }
-
-    private void snmpV1Trap(InetAddress addr,
-                            int port,
-                            SnmpIpAddress agentAddr,
-                            String cs,
-                            SnmpOid enterpOid,
-                            int generic,
-                            int specific,
-                            SnmpVarBindList varBindList,
-                            SnmpTimeticks time)
-        throws IOException, SnmpStatusException {
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "snmpV1Trap", "generic=" + generic + ", specific=" +
-                  specific);
-        }
-
-        // First, make an SNMP V1 trap pdu
-        //
-        SnmpPduTrap pdu = new SnmpPduTrap() ;
-        pdu.address = null ;
-        pdu.port = port ;
-        pdu.type = pduV1TrapPdu ;
-        pdu.version = snmpVersionOne ;
-
-        //Diff start
-        if(cs != null)
-            pdu.community = cs.getBytes();
-        else
-            pdu.community = null ;
-        //Diff end
-
-        // Diff start
-        if(enterpOid != null)
-            pdu.enterprise = enterpOid;
-        else
-            pdu.enterprise = enterpriseOid ;
-        //Diff end
-        pdu.genericTrap = generic ;
-        pdu.specificTrap = specific ;
-        //Diff start
-        if(time != null)
-            pdu.timeStamp = time.longValue();
-        else
-            pdu.timeStamp = getSysUpTime();
-        //Diff end
-
-        if (varBindList != null) {
-            pdu.varBindList = new SnmpVarBind[varBindList.size()] ;
-            varBindList.copyInto(pdu.varBindList);
-        }
-        else
-            pdu.varBindList = null ;
-
-        if (agentAddr == null) {
-            // If the local host cannot be determined,
-            // we put 0.0.0.0 in agentAddr
-            try {
-                final InetAddress inetAddr =
-                    (address!=null)?address:InetAddress.getLocalHost();
-                agentAddr = handleMultipleIpVersion(inetAddr.getAddress());
-            }  catch (UnknownHostException e) {
-                byte[] zeroedAddr = new byte[4];
-                agentAddr = handleMultipleIpVersion(zeroedAddr);
-            }
-        }
-
-        pdu.agentAddr = agentAddr;
-
-        // Next, send the pdu to the specified destination
-        //
-        // Diff start
-        if(addr != null)
-            sendTrapPdu(addr, pdu) ;
-        else
-            sendTrapPdu(pdu);
-
-        //End diff
-    }
-
-    /**
-     * Sends a trap using SNMP V2 trap format.
-     * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
-     * <BR>The community string used is the one located in the
-     * <CODE>SnmpPeer</CODE> parameters
-     * (<CODE>SnmpParameters.getRdCommunity() </CODE>).
-     * <BR>The variable list included in the outgoing trap is composed of
-     * the following items:
-     * <UL>
-     * <LI><CODE>sysUpTime.0</CODE> with the value specified by
-     *     <CODE>time</CODE></LI>
-     * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
-     *     <CODE>trapOid</CODE></LI>
-     * <LI><CODE>all the (oid,values)</CODE> from the specified
-     *     <CODE>varBindList</CODE></LI>
-     * </UL>
-     *
-     * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
-     * @param trapOid The OID identifying the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     * @param time The time stamp (overwrite the current time).
-     *
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit
-     * defined by <CODE>bufferSize</CODE>.
-     *
-     * @since 1.5
-     */
-    @Override
-    public void snmpV2Trap(SnmpPeer peer,
-                           SnmpOid trapOid,
-                           SnmpVarBindList varBindList,
-                           SnmpTimeticks time)
-        throws IOException, SnmpStatusException {
-
-        SnmpParameters p = (SnmpParameters) peer.getParams();
-        snmpV2Trap(peer.getDestAddr(),
-                   peer.getDestPort(),
-                   p.getRdCommunity(),
-                   trapOid,
-                   varBindList,
-                   time);
-    }
-
-    /**
-     * Sends a trap using SNMP V2 trap format.
-     * <BR>The trap is sent to each destination defined in the ACL file
-     * (if available). If no ACL file or no destinations are available,
-     * the trap is sent to the local host.
-     * <BR>The variable list included in the outgoing trap is composed of
-     * the following items:
-     * <UL>
-     * <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
-     * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
-     *     <CODE>trapOid</CODE></LI>
-     * <LI><CODE>all the (oid,values)</CODE> from the specified
-     *     <CODE>varBindList</CODE></LI>
-     * </UL>
-     *
-     * @param trapOid The OID identifying the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     *
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit defined
-     *            by <CODE>bufferSize</CODE>.
-     */
-    @Override
-    public void snmpV2Trap(SnmpOid trapOid, SnmpVarBindList varBindList)
-        throws IOException, SnmpStatusException {
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "snmpV2Trap", "trapOid=" + trapOid);
-        }
-
-        // First, make an SNMP V2 trap pdu
-        // We clone varBindList and insert sysUpTime and snmpTrapOid
-        //
-        SnmpPduRequest pdu = new SnmpPduRequest() ;
-        pdu.address = null ;
-        pdu.port = trapPort ;
-        pdu.type = pduV2TrapPdu ;
-        pdu.version = snmpVersionTwo ;
-        pdu.community = null ;
-
-        SnmpVarBindList fullVbl ;
-        if (varBindList != null)
-            fullVbl = varBindList.clone() ;
-        else
-            fullVbl = new SnmpVarBindList(2) ;
-        SnmpTimeticks sysUpTimeValue = new SnmpTimeticks(getSysUpTime()) ;
-        fullVbl.insertElementAt(new SnmpVarBind(snmpTrapOidOid, trapOid), 0) ;
-        fullVbl.insertElementAt(new SnmpVarBind(sysUpTimeOid, sysUpTimeValue),
-                                0);
-        pdu.varBindList = new SnmpVarBind[fullVbl.size()] ;
-        fullVbl.copyInto(pdu.varBindList) ;
-
-        // Next, send the pdu to all destinations defined in ACL
-        //
-        sendTrapPdu(pdu) ;
-    }
-
-    /**
-     * Sends a trap using SNMP V2 trap format.
-     * <BR>The trap is sent to the specified <CODE>InetAddress</CODE>
-     * destination using the specified community string (and the ACL file
-     * is not used).
-     * <BR>The variable list included in the outgoing trap is composed of
-     * the following items:
-     * <UL>
-     * <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
-     * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
-     *     <CODE>trapOid</CODE></LI>
-     * <LI><CODE>all the (oid,values)</CODE> from the specified
-     *     <CODE>varBindList</CODE></LI>
-     * </UL>
-     *
-     * @param addr The <CODE>InetAddress</CODE> destination of the trap.
-     * @param cs The community string to be used for the trap.
-     * @param trapOid The OID identifying the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     *
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit
-     *            defined by <CODE>bufferSize</CODE>.
-     */
-    @Override
-    public void snmpV2Trap(InetAddress addr, String cs, SnmpOid trapOid,
-                           SnmpVarBindList varBindList)
-        throws IOException, SnmpStatusException {
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "snmpV2Trap", "trapOid=" + trapOid);
-        }
-
-        // First, make an SNMP V2 trap pdu
-        // We clone varBindList and insert sysUpTime and snmpTrapOid
-        //
-        SnmpPduRequest pdu = new SnmpPduRequest() ;
-        pdu.address = null ;
-        pdu.port = trapPort ;
-        pdu.type = pduV2TrapPdu ;
-        pdu.version = snmpVersionTwo ;
-
-        if(cs != null)
-            pdu.community = cs.getBytes();
-        else
-            pdu.community = null;
-
-        SnmpVarBindList fullVbl ;
-        if (varBindList != null)
-            fullVbl = varBindList.clone() ;
-        else
-            fullVbl = new SnmpVarBindList(2) ;
-        SnmpTimeticks sysUpTimeValue = new SnmpTimeticks(getSysUpTime()) ;
-        fullVbl.insertElementAt(new SnmpVarBind(snmpTrapOidOid, trapOid), 0) ;
-        fullVbl.insertElementAt(new SnmpVarBind(sysUpTimeOid, sysUpTimeValue),
-                                0);
-        pdu.varBindList = new SnmpVarBind[fullVbl.size()] ;
-        fullVbl.copyInto(pdu.varBindList) ;
-
-        // Next, send the pdu to the specified destination
-        //
-        if(addr != null)
-            sendTrapPdu(addr, pdu);
-        else
-            sendTrapPdu(pdu);
-    }
-
-    /**
-     * Sends a trap using SNMP V2 trap format.
-     * <BR>The trap is sent to the specified <CODE>InetAddress</CODE>
-     * destination using the specified parameters (and the ACL file is not
-     * used).
-     * Note that if the specified <CODE>InetAddress</CODE> destination is null,
-     * then the ACL file mechanism is used.
-     * <BR>The variable list included in the outgoing trap is composed of the
-     * following items:
-     * <UL>
-     * <LI><CODE>sysUpTime.0</CODE> with the value specified by
-     *     <CODE>time</CODE></LI>
-     * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
-     *     <CODE>trapOid</CODE></LI>
-     * <LI><CODE>all the (oid,values)</CODE> from the specified
-     *     <CODE>varBindList</CODE></LI>
-     * </UL>
-     *
-     * @param addr The <CODE>InetAddress</CODE> destination of the trap.
-     * @param cs The community string to be used for the trap.
-     * @param trapOid The OID identifying the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     * @param time The time stamp (overwrite the current time).
-     *
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit
-     * defined by <CODE>bufferSize</CODE>.
-     *
-     * @since 1.5
-     */
-    public void snmpV2Trap(InetAddress addr,
-                           String cs,
-                           SnmpOid trapOid,
-                           SnmpVarBindList varBindList,
-                           SnmpTimeticks time)
-        throws IOException, SnmpStatusException {
-
-        snmpV2Trap(addr,
-                   trapPort,
-                   cs,
-                   trapOid,
-                   varBindList,
-                   time);
-    }
-
-    private void snmpV2Trap(InetAddress addr,
-                            int port,
-                            String cs,
-                            SnmpOid trapOid,
-                            SnmpVarBindList varBindList,
-                            SnmpTimeticks time)
-        throws IOException, SnmpStatusException {
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            final StringBuilder strb = new StringBuilder()
-                .append("trapOid=").append(trapOid)
-                .append("\ncommunity=").append(cs)
-                .append("\naddr=").append(addr)
-                .append("\nvarBindList=").append(varBindList)
-                .append("\ntime=").append(time)
-                .append("\ntrapPort=").append(port);
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "snmpV2Trap", strb.toString());
-        }
-
-        // First, make an SNMP V2 trap pdu
-        // We clone varBindList and insert sysUpTime and snmpTrapOid
-        //
-        SnmpPduRequest pdu = new SnmpPduRequest() ;
-        pdu.address = null ;
-        pdu.port = port ;
-        pdu.type = pduV2TrapPdu ;
-        pdu.version = snmpVersionTwo ;
-
-        if(cs != null)
-            pdu.community = cs.getBytes();
-        else
-            pdu.community = null;
-
-        SnmpVarBindList fullVbl ;
-        if (varBindList != null)
-            fullVbl = varBindList.clone() ;
-        else
-            fullVbl = new SnmpVarBindList(2) ;
-
-        // Only difference with other
-        SnmpTimeticks sysUpTimeValue;
-        if(time != null)
-            sysUpTimeValue = time;
-        else
-            sysUpTimeValue = new SnmpTimeticks(getSysUpTime()) ;
-        //End of diff
-
-        fullVbl.insertElementAt(new SnmpVarBind(snmpTrapOidOid, trapOid), 0) ;
-        fullVbl.insertElementAt(new SnmpVarBind(sysUpTimeOid, sysUpTimeValue),
-                                0);
-        pdu.varBindList = new SnmpVarBind[fullVbl.size()] ;
-        fullVbl.copyInto(pdu.varBindList) ;
-
-        // Next, send the pdu to the specified destination
-        //
-        // Diff start
-        if(addr != null)
-            sendTrapPdu(addr, pdu) ;
-        else
-            sendTrapPdu(pdu);
-        //End diff
-    }
-
-    /**
-     * Send the specified trap PDU to the passed <CODE>InetAddress</CODE>.
-     * @param address The destination address.
-     * @param pdu The pdu to send.
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit
-     * defined by <CODE>bufferSize</CODE>.
-     *
-     * @since 1.5
-     */
-    @Override
-    public void snmpPduTrap(InetAddress address, SnmpPduPacket pdu)
-            throws IOException, SnmpStatusException {
-
-        if(address != null)
-            sendTrapPdu(address, pdu);
-        else
-            sendTrapPdu(pdu);
-    }
-
-    /**
-     * Send the specified trap PDU to the passed <CODE>SnmpPeer</CODE>.
-     * @param peer The destination peer. The Read community string is used of
-     * <CODE>SnmpParameters</CODE> is used as the trap community string.
-     * @param pdu The pdu to send.
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit defined
-     * by <CODE>bufferSize</CODE>.
-     * @since 1.5
-     */
-    @Override
-    public void snmpPduTrap(SnmpPeer peer,
-                            SnmpPduPacket pdu)
-        throws IOException, SnmpStatusException {
-        if(peer != null) {
-            pdu.port = peer.getDestPort();
-            sendTrapPdu(peer.getDestAddr(), pdu);
-        }
-        else {
-            pdu.port = getTrapPort().intValue();
-            sendTrapPdu(pdu);
-        }
-    }
-
-    /**
-     * Send the specified trap PDU to every destinations from the ACL file.
-     */
-    private void sendTrapPdu(SnmpPduPacket pdu)
-     throws SnmpStatusException, IOException {
-
-        // Make an SNMP message from the pdu
-        //
-        SnmpMessage msg = null ;
-        try {
-            msg = (SnmpMessage)pduFactory.encodeSnmpPdu(pdu, bufferSize) ;
-            if (msg == null) {
-                throw new SnmpStatusException(
-                          SnmpDefinitions.snmpRspAuthorizationError) ;
-            }
-        }
-        catch (SnmpTooBigException x) {
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                    "sendTrapPdu", "Trap pdu is too big. " +
-                     "Trap hasn't been sent to anyone" );
-            }
-            throw new SnmpStatusException(SnmpDefinitions.snmpRspTooBig) ;
-            // FIXME: is the right exception to throw ?
-            // We could simply forward SnmpTooBigException ?
-        }
-
-        // Now send the SNMP message to each destination
-        //
-        int sendingCount = 0 ;
-        openTrapSocketIfNeeded() ;
-        if (ipacl != null) {
-            Enumeration<InetAddress> ed = ipacl.getTrapDestinations() ;
-            while (ed.hasMoreElements()) {
-                msg.address = ed.nextElement() ;
-                Enumeration<String> ec = ipacl.getTrapCommunities(msg.address) ;
-                while (ec.hasMoreElements()) {
-                    msg.community = ec.nextElement().getBytes() ;
-                    try {
-                        sendTrapMessage(msg) ;
-                        sendingCount++ ;
-                    }
-                    catch (SnmpTooBigException x) {
-                        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                                "sendTrapPdu", "Trap pdu is too big. " +
-                                 "Trap hasn't been sent to "+msg.address);
-                        }
-                    }
-                }
-            }
-        }
-
-        // If there is no destination defined or if everything has failed
-        // we tried to send the trap to the local host (as suggested by
-        // mister Olivier Reisacher).
-        //
-        if (sendingCount == 0) {
-            try {
-                msg.address = InetAddress.getLocalHost() ;
-                sendTrapMessage(msg) ;
-            } catch (SnmpTooBigException x) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                        "sendTrapPdu", "Trap pdu is too big. " +
-                         "Trap hasn't been sent.");
-                }
-            } catch (UnknownHostException e) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                        "sendTrapPdu", "Trap pdu is too big. " +
-                         "Trap hasn't been sent.");
-                }
-            }
-        }
-
-        closeTrapSocketIfNeeded() ;
-    }
-
-    /**
-     * Send the specified trap PDU to the specified destination.
-     */
-    private void sendTrapPdu(InetAddress addr, SnmpPduPacket pdu)
-        throws SnmpStatusException, IOException {
-
-        // Make an SNMP message from the pdu
-        //
-        SnmpMessage msg = null ;
-        try {
-            msg = (SnmpMessage)pduFactory.encodeSnmpPdu(pdu, bufferSize) ;
-            if (msg == null) {
-                throw new SnmpStatusException(
-                          SnmpDefinitions.snmpRspAuthorizationError) ;
-            }
-        } catch (SnmpTooBigException x) {
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                    "sendTrapPdu", "Trap pdu is too big. " +
-                     "Trap hasn't been sent to the specified host.");
-            }
-            throw new SnmpStatusException(SnmpDefinitions.snmpRspTooBig) ;
-            // FIXME: is the right exception to throw ?
-            // We could simply forward SnmpTooBigException ?
-        }
-
-        // Now send the SNMP message to specified destination
-        //
-        openTrapSocketIfNeeded() ;
-        if (addr != null) {
-            msg.address = addr;
-            try {
-                sendTrapMessage(msg) ;
-            } catch (SnmpTooBigException x) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                        "sendTrapPdu", "Trap pdu is too big. " +
-                         "Trap hasn't been sent to " +  msg.address);
-                }
-            }
-        }
-
-        closeTrapSocketIfNeeded() ;
-    }
-
-    /**
-     * Send the specified message on trapSocket.
-     */
-    private void sendTrapMessage(SnmpMessage msg)
-        throws IOException, SnmpTooBigException {
-
-        byte[] buffer = new byte[bufferSize] ;
-        DatagramPacket packet = new DatagramPacket(buffer, buffer.length) ;
-        int encodingLength = msg.encodeMessage(buffer) ;
-        packet.setLength(encodingLength) ;
-        packet.setAddress(msg.address) ;
-        packet.setPort(msg.port) ;
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "sendTrapMessage", "sending trap to " + msg.address + ":" +
-                  msg.port);
-        }
-        trapSocket.send(packet) ;
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "sendTrapMessage", "sent to " + msg.address + ":" +
-                  msg.port);
-        }
-        snmpOutTraps++;
-        snmpOutPkts++;
-    }
-
-    /**
-     * Open trapSocket if it's not already done.
-     */
-    synchronized void openTrapSocketIfNeeded() throws SocketException {
-        if (trapSocket == null) {
-            trapSocket = new DatagramSocket(0, address) ;
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                    "openTrapSocketIfNeeded", "using port " +
-                      trapSocket.getLocalPort() + " to send traps");
-            }
-        }
-    }
-
-    /**
-     * Close trapSocket if the SNMP protocol adaptor is not ONLINE.
-     */
-    synchronized void closeTrapSocketIfNeeded() {
-        if ((trapSocket != null) && (state != ONLINE)) {
-            trapSocket.close() ;
-            trapSocket = null ;
-        }
-    }
-
-    // SENDING SNMP INFORMS STUFF
-    //---------------------------
-
-    /**
-     * Sends an inform using SNMP V2 inform request format.
-     * <BR>The inform request is sent to each destination defined in the ACL
-     * file (if available).
-     * If no ACL file or no destinations are available, the inform request is
-     * sent to the local host.
-     * <BR>The variable list included in the outgoing inform is composed of
-     * the following items:
-     * <UL>
-     * <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
-     * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
-     *     <CODE>trapOid</CODE></LI>
-     * <LI><CODE>all the (oid,values)</CODE> from the specified
-     *     <CODE>varBindList</CODE></LI>
-     * </UL>
-     * To send an inform request, the SNMP adaptor server must be active.
-     *
-     * @param cb The callback that is invoked when a request is complete.
-     * @param trapOid The OID identifying the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     *
-     * @return A vector of {@link com.sun.jmx.snmp.daemon.SnmpInformRequest}
-     *         objects.
-     *         <P>If there is no destination host for this inform request,
-     *         the returned vector will be empty.
-     *
-     * @exception IllegalStateException  This method has been invoked while
-     *            the SNMP adaptor server was not active.
-     * @exception IOException An I/O error occurred while sending the
-     *            inform request.
-     * @exception SnmpStatusException If the inform request exceeds the
-     *            limit defined by <CODE>bufferSize</CODE>.
-     */
-    @Override
-    public Vector<SnmpInformRequest> snmpInformRequest(SnmpInformHandler cb,
-                                                       SnmpOid trapOid,
-                                                       SnmpVarBindList varBindList)
-        throws IllegalStateException, IOException, SnmpStatusException {
-
-        if (!isActive()) {
-            throw new IllegalStateException(
-               "Start SNMP adaptor server before carrying out this operation");
-        }
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "snmpInformRequest", "trapOid=" + trapOid);
-        }
-
-        // First, make an SNMP inform pdu:
-        // We clone varBindList and insert sysUpTime and snmpTrapOid variables.
-        //
-        SnmpVarBindList fullVbl ;
-        if (varBindList != null)
-            fullVbl = varBindList.clone() ;
-        else
-            fullVbl = new SnmpVarBindList(2) ;
-        SnmpTimeticks sysUpTimeValue = new SnmpTimeticks(getSysUpTime()) ;
-        fullVbl.insertElementAt(new SnmpVarBind(snmpTrapOidOid, trapOid), 0) ;
-        fullVbl.insertElementAt(new SnmpVarBind(sysUpTimeOid, sysUpTimeValue),
-                                0);
-
-        // Next, send the pdu to the specified destination
-        //
-        openInformSocketIfNeeded() ;
-
-        // Now send the SNMP message to each destination
-        //
-        Vector<SnmpInformRequest> informReqList = new Vector<>();
-        InetAddress addr;
-        String cs;
-        if (ipacl != null) {
-            Enumeration<InetAddress> ed = ipacl.getInformDestinations() ;
-            while (ed.hasMoreElements()) {
-                addr = ed.nextElement() ;
-                Enumeration<String> ec = ipacl.getInformCommunities(addr) ;
-                while (ec.hasMoreElements()) {
-                    cs = ec.nextElement() ;
-                    informReqList.addElement(
-                       informSession.makeAsyncRequest(addr, cs, cb,
-                                              fullVbl,getInformPort())) ;
-                }
-            }
-        }
-
-        return informReqList ;
-    }
-
-    /**
-     * Sends an inform using SNMP V2 inform request format.
-     * <BR>The inform is sent to the specified <CODE>InetAddress</CODE>
-     * destination
-     * using the specified community string.
-     * <BR>The variable list included in the outgoing inform is composed
-     *     of the following items:
-     * <UL>
-     * <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
-     * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
-     *      <CODE>trapOid</CODE></LI>
-     * <LI><CODE>all the (oid,values)</CODE> from the specified
-     *     <CODE>varBindList</CODE></LI>
-     * </UL>
-     * To send an inform request, the SNMP adaptor server must be active.
-     *
-     * @param addr The <CODE>InetAddress</CODE> destination for this inform
-     *             request.
-     * @param cs The community string to be used for the inform request.
-     * @param cb The callback that is invoked when a request is complete.
-     * @param trapOid The OID identifying the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     *
-     * @return The inform request object.
-     *
-     * @exception IllegalStateException  This method has been invoked
-     *            while the SNMP adaptor server was not active.
-     * @exception IOException An I/O error occurred while sending the
-     *            inform request.
-     * @exception SnmpStatusException If the inform request exceeds the
-     *            limit defined by <CODE>bufferSize</CODE>.
-     */
-    @Override
-    public SnmpInformRequest snmpInformRequest(InetAddress addr,
-                                               String cs,
-                                               SnmpInformHandler cb,
-                                               SnmpOid trapOid,
-                                               SnmpVarBindList varBindList)
-        throws IllegalStateException, IOException, SnmpStatusException {
-
-        return snmpInformRequest(addr,
-                                 getInformPort(),
-                                 cs,
-                                 cb,
-                                 trapOid,
-                                 varBindList);
-    }
-
-    /**
-     * Sends an inform using SNMP V2 inform request format.
-     * <BR>The inform is sent to the specified <CODE>SnmpPeer</CODE>
-     *     destination.
-     * <BR>The community string used is the one located in the
-     *     <CODE>SnmpPeer</CODE> parameters
-     *     (<CODE>SnmpParameters.getInformCommunity() </CODE>).
-     * <BR>The variable list included in the outgoing inform is composed
-     *     of the following items:
-     * <UL>
-     * <LI><CODE>sysUpTime.0</CODE> with its current value</LI>
-     * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by
-     *     <CODE>trapOid</CODE></LI>
-     * <LI><CODE>all the (oid,values)</CODE> from the specified
-     *     <CODE>varBindList</CODE></LI>
-     * </UL>
-     * To send an inform request, the SNMP adaptor server must be active.
-     *
-     * @param peer The <CODE>SnmpPeer</CODE> destination for this inform
-     *             request.
-     * @param cb The callback that is invoked when a request is complete.
-     * @param trapOid The OID identifying the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     *
-     * @return The inform request object.
-     *
-     * @exception IllegalStateException  This method has been invoked while
-     *            the SNMP adaptor server was not active.
-     * @exception IOException An I/O error occurred while sending the
-     *            inform request.
-     * @exception SnmpStatusException If the inform request exceeds the
-     *            limit defined by <CODE>bufferSize</CODE>.
-     *
-     * @since 1.5
-     */
-    @Override
-    public SnmpInformRequest snmpInformRequest(SnmpPeer peer,
-                                               SnmpInformHandler cb,
-                                               SnmpOid trapOid,
-                                               SnmpVarBindList varBindList)
-        throws IllegalStateException, IOException, SnmpStatusException {
-
-        SnmpParameters p = (SnmpParameters) peer.getParams();
-        return snmpInformRequest(peer.getDestAddr(),
-                                 peer.getDestPort(),
-                                 p.getInformCommunity(),
-                                 cb,
-                                 trapOid,
-                                 varBindList);
-    }
-
-    /**
-     * Method that maps an SNMP error status in the passed protocolVersion
-     * according to the provided pdu type.
-     * @param errorStatus The error status to convert.
-     * @param protocolVersion The protocol version.
-     * @param reqPduType The pdu type.
-     */
-    public static int mapErrorStatus(int errorStatus,
-                                     int protocolVersion,
-                                     int reqPduType) {
-        return SnmpSubRequestHandler.mapErrorStatus(errorStatus,
-                                                    protocolVersion,
-                                                    reqPduType);
-    }
-
-    private SnmpInformRequest snmpInformRequest(InetAddress addr,
-                                                int port,
-                                                String cs,
-                                                SnmpInformHandler cb,
-                                                SnmpOid trapOid,
-                                                SnmpVarBindList varBindList)
-        throws IllegalStateException, IOException, SnmpStatusException {
-
-        if (!isActive()) {
-            throw new IllegalStateException(
-              "Start SNMP adaptor server before carrying out this operation");
-        }
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                "snmpInformRequest", "trapOid=" + trapOid);
-        }
-
-        // First, make an SNMP inform pdu:
-        // We clone varBindList and insert sysUpTime and snmpTrapOid variables.
-        //
-        SnmpVarBindList fullVbl ;
-        if (varBindList != null)
-            fullVbl = varBindList.clone() ;
-        else
-            fullVbl = new SnmpVarBindList(2) ;
-        SnmpTimeticks sysUpTimeValue = new SnmpTimeticks(getSysUpTime()) ;
-        fullVbl.insertElementAt(new SnmpVarBind(snmpTrapOidOid, trapOid), 0) ;
-        fullVbl.insertElementAt(new SnmpVarBind(sysUpTimeOid, sysUpTimeValue),
-                                0);
-
-        // Next, send the pdu to the specified destination
-        //
-        openInformSocketIfNeeded() ;
-        return informSession.makeAsyncRequest(addr, cs, cb, fullVbl, port) ;
-    }
-
-
-    /**
-     * Open informSocket if it's not already done.
-     */
-    synchronized void openInformSocketIfNeeded() throws SocketException {
-        if (informSession == null) {
-            informSession = new SnmpSession(this) ;
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                   "openInformSocketIfNeeded",
-                      "to send inform requests and receive inform responses");
-            }
-        }
-    }
-
-    /**
-     * Close informSocket if the SNMP protocol adaptor is not ONLINE.
-     */
-    synchronized void closeInformSocketIfNeeded() {
-        if ((informSession != null) && (state != ONLINE)) {
-            informSession.destroySession() ;
-            informSession = null ;
-        }
-    }
-
-    /**
-     * Gets the IP address to bind.
-     * This getter is used to initialize the DatagramSocket in the
-     * SnmpSocket object created for the inform request stuff.
-     */
-    InetAddress getAddress() {
-        return address;
-    }
-
-
-    // PROTECTED METHODS
-    //------------------
-
-    /**
-     * Finalizer of the SNMP protocol adaptor objects.
-     * This method is called by the garbage collector on an object
-     * when garbage collection determines that there are no more
-     * references to the object.
-     * <P>Closes the datagram socket associated to this SNMP protocol adaptor.
-     */
-    @Override
-    protected void finalize() {
-        try {
-            if (socket != null) {
-                socket.close() ;
-                socket = null ;
-            }
-
-            threadService.terminate();
-        } catch (Exception e) {
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                   "finalize", "Exception in finalizer", e);
-            }
-        }
-    }
-
-    // PACKAGE METHODS
-    //----------------
-
-    /**
-     * Returns the string used in debug traces.
-     */
-    @Override
-    String makeDebugTag() {
-        return "SnmpAdaptorServer["+ getProtocol() + ":" + getPort() + "]";
-    }
-
-    void updateRequestCounters(int pduType) {
-        switch(pduType)  {
-
-        case pduGetRequestPdu:
-            snmpInGetRequests++;
-            break;
-        case pduGetNextRequestPdu:
-            snmpInGetNexts++;
-            break;
-        case pduSetRequestPdu:
-            snmpInSetRequests++;
-            break;
-        default:
-            break;
-        }
-        snmpInPkts++ ;
-    }
-
-    void updateErrorCounters(int errorStatus) {
-        switch(errorStatus) {
-
-        case snmpRspNoError:
-            snmpOutGetResponses++;
-            break;
-        case snmpRspGenErr:
-            snmpOutGenErrs++;
-            break;
-        case snmpRspBadValue:
-            snmpOutBadValues++;
-            break;
-        case snmpRspNoSuchName:
-            snmpOutNoSuchNames++;
-            break;
-        case snmpRspTooBig:
-            snmpOutTooBigs++;
-            break;
-        default:
-            break;
-        }
-        snmpOutPkts++ ;
-    }
-
-    void updateVarCounters(int pduType, int n) {
-        switch(pduType) {
-
-        case pduGetRequestPdu:
-        case pduGetNextRequestPdu:
-        case pduGetBulkRequestPdu:
-            snmpInTotalReqVars += n ;
-            break ;
-        case pduSetRequestPdu:
-            snmpInTotalSetVars += n ;
-            break ;
-        }
-    }
-
-    void incSnmpInASNParseErrs(int n) {
-        snmpInASNParseErrs += n ;
-    }
-
-    void incSnmpInBadVersions(int n) {
-        snmpInBadVersions += n ;
-    }
-
-    void incSnmpInBadCommunityUses(int n) {
-        snmpInBadCommunityUses += n ;
-    }
-
-    void incSnmpInBadCommunityNames(int n) {
-        snmpInBadCommunityNames += n ;
-    }
-
-    void incSnmpSilentDrops(int n) {
-        snmpSilentDrops += n ;
-    }
-    // PRIVATE METHODS
-    //----------------
-
-    /**
-     * Returns the time (in hundreths of second) elapsed since the SNMP
-     * protocol adaptor startup.
-     */
-    long getSysUpTime() {
-        return (System.currentTimeMillis() - startUpTime) / 10 ;
-    }
-
-    /**
-     * Control the way the SnmpAdaptorServer service is deserialized.
-     */
-    private void readObject(ObjectInputStream stream)
-        throws IOException, ClassNotFoundException {
-
-        // Call the default deserialization of the object.
-        //
-        stream.defaultReadObject();
-
-        // Call the specific initialization for the SnmpAdaptorServer service.
-        // This is for transient structures to be initialized to specific
-        // default values.
-        //
-        mibs      = new Vector<>() ;
-    }
-
-    /**
-     * Common initializations.
-     */
-    private void init(InetAddressAcl acl, int p, InetAddress a) {
-
-        root= new SnmpMibTree();
-
-        // The default Agent is initialized with a SnmpErrorHandlerAgent agent.
-        root.setDefaultAgent(new SnmpErrorHandlerAgent());
-
-        // For the trap time, use the time the agent started ...
-        //
-        startUpTime= java.lang.System.currentTimeMillis();
-        maxActiveClientCount = 10;
-
-        // Create the default message factory
-        pduFactory = new SnmpPduFactoryBER() ;
-
-        port = p ;
-        ipacl = acl ;
-        address = a ;
-
-        if ((ipacl == null) && (useAcl == true))
-            throw new IllegalArgumentException("ACL object cannot be null") ;
-
-        threadService = new ThreadService(threadNumber);
-    }
-
-    SnmpMibAgent getAgentMib(SnmpOid oid) {
-        return root.getAgentMib(oid);
-    }
-
-    @Override
-    protected Thread createMainThread() {
-        final Thread t = super.createMainThread();
-        t.setDaemon(true);
-        return t;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,702 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.daemon;
-
-// java import
-import java.util.Vector;
-import java.io.IOException;
-import java.net.InetAddress;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpPduFactory;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpVarBindList;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpPduPacket;
-import com.sun.jmx.snmp.InetAddressAcl;
-import com.sun.jmx.snmp.SnmpPeer;
-
-// SNMP Runtime imports
-//
-import com.sun.jmx.snmp.agent.SnmpMibAgent;
-import com.sun.jmx.snmp.agent.SnmpMibHandler;
-import com.sun.jmx.snmp.agent.SnmpUserDataFactory;
-
-/**
- * Exposes the remote management interface of the {@link SnmpAdaptorServer} MBean.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public interface SnmpAdaptorServerMBean extends CommunicatorServerMBean {
-
-    // GETTERS AND SETTERS
-    //--------------------
-
-    /**
-     * Returns the Ip address based ACL used by this SNMP protocol adaptor.
-     * @return The <CODE>InetAddressAcl</CODE> implementation.
-     *
-     * @since 1.5
-     */
-    public InetAddressAcl getInetAddressAcl();
-    /**
-     * Returns the port used by this SNMP protocol adaptor for sending traps.
-     * By default, port 162 is used.
-     *
-     * @return The port number for sending SNMP traps.
-     */
-    public Integer getTrapPort();
-
-    /**
-     * Sets the port used by this SNMP protocol adaptor for sending traps.
-     *
-     * @param port The port number for sending SNMP traps.
-     */
-    public void setTrapPort(Integer port);
-
-    /**
-     * Returns the port used by this SNMP protocol adaptor for sending inform requests.
-     * By default, port 162 is used.
-     *
-     * @return The port number for sending SNMP inform requests.
-     */
-    public int getInformPort();
-
-    /**
-     * Sets the port used by this SNMP protocol adaptor for sending inform requests.
-     *
-     * @param port The port number for sending SNMP inform requests.
-     */
-    public void setInformPort(int port);
-
-    /**
-     * Gets the number of managers that have been processed by this SNMP protocol adaptor
-     * since its creation.
-     *
-     * @return The number of managers handled by this SNMP protocol adaptor
-     * since its creation. This counter is not reset by the <CODE>stop</CODE> method.
-     */
-    public int getServedClientCount();
-
-    /**
-     * Gets the number of managers currently being processed by this
-     * SNMP protocol adaptor.
-     *
-     * @return The number of managers currently being processed by this
-     * SNMP protocol adaptor.
-     */
-    public int getActiveClientCount();
-
-    /**
-     * Gets the maximum number of managers that this SNMP protocol adaptor can
-     * process concurrently.
-     *
-     * @return The maximum number of managers that this SNMP protocol adaptor can
-     * process concurrently.
-     */
-    public int getMaxActiveClientCount();
-
-    /**
-     * Sets the maximum number of managers this SNMP protocol adaptor can
-     * process concurrently.
-     *
-     * @param c The number of managers.
-     *
-     * @exception java.lang.IllegalStateException This method has been invoked
-     * while the communicator was <CODE>ONLINE</CODE> or <CODE>STARTING</CODE>.
-     */
-    public void setMaxActiveClientCount(int c) throws java.lang.IllegalStateException;
-
-    /**
-     * Returns the protocol of this SNMP protocol adaptor.
-     *
-     * @return The string "snmp".
-     */
-    @Override
-    public String getProtocol();
-
-    /**
-     * Returns the buffer size of this SNMP protocol adaptor.
-     * By default, buffer size 1024 is used.
-     *
-     * @return The buffer size.
-     */
-    public Integer getBufferSize();
-
-    /**
-     * Sets the buffer size of this SNMP protocol adaptor.
-     *
-     * @param s The buffer size.
-     *
-     * @exception java.lang.IllegalStateException This method has been invoked
-     * while the communicator was <CODE>ONLINE</CODE> or <CODE>STARTING</CODE>.
-     */
-    public void setBufferSize(Integer s) throws java.lang.IllegalStateException;
-
-    /**
-     * Gets the number of times to try sending an inform request before giving up.
-     * @return The maximun number of tries.
-     */
-    public int getMaxTries();
-
-    /**
-     * Changes the maximun number of times to try sending an inform request before giving up.
-     * @param newMaxTries The maximun number of tries.
-     */
-    public void setMaxTries(int newMaxTries);
-
-    /**
-     * Gets the timeout to wait for an inform response from the manager.
-     * @return The value of the timeout property.
-     */
-    public int getTimeout();
-
-    /**
-     * Changes the timeout to wait for an inform response from the manager.
-     * @param newTimeout The timeout (in milliseconds).
-     */
-    public void setTimeout(int newTimeout);
-
-    /**
-     * Returns the message factory of this SNMP protocol adaptor.
-     *
-     * @return The factory object.
-     */
-    public SnmpPduFactory getPduFactory();
-
-    /**
-     * Sets the message factory of this SNMP protocol adaptor.
-     *
-     * @param factory The factory object (null means the default factory).
-     */
-    public void setPduFactory(SnmpPduFactory factory);
-
-
-    /**
-     * Set the user-data factory of this SNMP protocol adaptor.
-     *
-     * @param factory The factory object (null means no factory).
-     * @see com.sun.jmx.snmp.agent.SnmpUserDataFactory
-     */
-    public void setUserDataFactory(SnmpUserDataFactory factory);
-
-    /**
-     * Get the user-data factory associated with this SNMP protocol adaptor.
-     *
-     * @return The factory object (null means no factory).
-     * @see com.sun.jmx.snmp.agent.SnmpUserDataFactory
-     */
-    public SnmpUserDataFactory getUserDataFactory();
-
-    /**
-     * Returns <CODE>true</CODE> if authentication traps are enabled.
-     * <P>
-     * When this feature is enabled, the SNMP protocol adaptor sends
-     * an <CODE>authenticationFailure</CODE> trap each time an authentication fails.
-     * <P>
-     * The default behaviour is to send authentication traps.
-     *
-     * @return <CODE>true</CODE> if authentication traps are enabled, <CODE>false</CODE> otherwise.
-     */
-    public boolean getAuthTrapEnabled();
-
-    /**
-     * Sets the flag indicating if traps need to be sent in case of authentication failure.
-     *
-     * @param enabled Flag indicating if traps need to be sent.
-     */
-    public void setAuthTrapEnabled(boolean enabled);
-
-    /**
-     * Returns <code>true</code> if this SNMP protocol adaptor sends a response in case
-     * of authentication failure.
-     * <P>
-     * When this feature is enabled, the SNMP protocol adaptor sends a response with <CODE>noSuchName</CODE>
-     * or <CODE>readOnly</CODE> when the authentication failed. If the flag is disabled, the
-     * SNMP protocol adaptor trashes the PDU silently.
-     * <P>
-     * The default behavior is to send responses.
-     *
-     * @return <code>true</code> if responses are sent.
-     */
-    public boolean getAuthRespEnabled();
-
-    /**
-     * Sets the flag indicating if responses need to be sent in case of authentication failure.
-     *
-     * @param enabled Flag indicating if responses need to be sent.
-     */
-    public void setAuthRespEnabled(boolean enabled);
-
-    /**
-     * Returns the enterprise OID. It is used by {@link #snmpV1Trap snmpV1Trap} to fill
-     * the 'enterprise' field of the trap request.
-     *
-     * @return The OID in string format "x.x.x.x".
-     */
-    public String getEnterpriseOid();
-
-    /**
-     * Sets the enterprise OID.
-     *
-     * @param oid The OID in string format "x.x.x.x".
-     *
-     * @exception IllegalArgumentException The string format is incorrect
-     */
-    public void setEnterpriseOid(String oid) throws IllegalArgumentException;
-
-    /**
-     * Returns the names of the MIBs available in this SNMP protocol adaptor.
-     *
-     * @return An array of MIB names.
-     */
-    public String[] getMibs();
-
-    // GETTERS FOR SNMP GROUP (MIBII)
-    //-------------------------------
-
-    /**
-     * Returns the <CODE>snmpOutTraps</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpOutTraps</CODE> value.
-     */
-    public Long getSnmpOutTraps();
-
-    /**
-     * Returns the <CODE>snmpOutGetResponses</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpOutGetResponses</CODE> value.
-     */
-    public Long getSnmpOutGetResponses();
-
-    /**
-     * Returns the <CODE>snmpOutGenErrs</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpOutGenErrs</CODE> value.
-     */
-    public Long getSnmpOutGenErrs();
-
-    /**
-     * Returns the <CODE>snmpOutBadValues</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpOutBadValues</CODE> value.
-     */
-    public Long getSnmpOutBadValues();
-
-    /**
-     * Returns the <CODE>snmpOutNoSuchNames</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpOutNoSuchNames</CODE> value.
-     */
-    public Long getSnmpOutNoSuchNames();
-
-    /**
-     * Returns the <CODE>snmpOutTooBigs</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpOutTooBigs</CODE> value.
-     */
-    public Long getSnmpOutTooBigs();
-
-    /**
-     * Returns the <CODE>snmpInASNParseErrs</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInASNParseErrs</CODE> value.
-     */
-    public Long getSnmpInASNParseErrs();
-
-    /**
-     * Returns the <CODE>snmpInBadCommunityUses</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInBadCommunityUses</CODE> value.
-     */
-    public Long getSnmpInBadCommunityUses();
-
-    /**
-     * Returns the <CODE>snmpInBadCommunityNames</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInBadCommunityNames</CODE> value.
-     */
-    public Long getSnmpInBadCommunityNames();
-
-    /**
-     * Returns the <CODE>snmpInBadVersions</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInBadVersions</CODE> value.
-     */
-    public Long getSnmpInBadVersions();
-
-    /**
-     * Returns the <CODE>snmpOutPkts</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpOutPkts</CODE> value.
-     */
-    public Long getSnmpOutPkts();
-
-    /**
-     * Returns the <CODE>snmpInPkts</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInPkts</CODE> value.
-     */
-    public Long getSnmpInPkts();
-
-    /**
-     * Returns the <CODE>snmpInGetRequests</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInGetRequests</CODE> value.
-     */
-    public Long getSnmpInGetRequests();
-
-    /**
-     * Returns the <CODE>snmpInGetNexts</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInGetNexts</CODE> value.
-     */
-    public Long getSnmpInGetNexts();
-
-    /**
-     * Returns the <CODE>snmpInSetRequests</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInSetRequests</CODE> value.
-     */
-    public Long getSnmpInSetRequests();
-
-    /**
-     * Returns the <CODE>snmpInTotalSetVars</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInTotalSetVars</CODE> value.
-     */
-    public Long getSnmpInTotalSetVars();
-
-    /**
-     * Returns the <CODE>snmpInTotalReqVars</CODE> value defined in MIB-II.
-     *
-     * @return The <CODE>snmpInTotalReqVars</CODE> value.
-     */
-    public Long getSnmpInTotalReqVars();
-
-    /**
-     * Returns the <CODE>snmpSilentDrops</CODE> value defined in rfc 1907 NMPv2-MIB .
-     *
-     * @return The <CODE>snmpSilentDrops</CODE> value.
-     *
-     * @since 1.5
-     */
-    public Long getSnmpSilentDrops();
-
-    /**
-     * Returns the <CODE>snmpProxyDrops</CODE> value defined in rfc 1907 NMPv2-MIB .
-     *
-     * @return The <CODE>snmpProxyDrops</CODE> value.
-     *
-     * @since 1.5
-     */
-    public Long getSnmpProxyDrops();
-
-    // PUBLIC METHODS
-    //---------------
-
-    /**
-     * Adds a new MIB in the SNMP MIB handler.
-     * This method is called automatically by {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptor(SnmpMibHandler)}
-     * and {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptorName(ObjectName)}
-     * and should not be called directly.
-     *
-     * @param mib The MIB to add.
-     *
-     * @return A reference to the SNMP MIB handler.
-     *
-     * @exception IllegalArgumentException If the parameter is null.
-     */
-    public SnmpMibHandler addMib(SnmpMibAgent mib) throws IllegalArgumentException;
-
-    /**
-     * Adds a new MIB in the SNMP MIB handler.
-     *
-     * @param mib The MIB to add.
-     * @param oids The set of OIDs this agent implements.
-     *
-     * @return A reference to the SNMP MIB handler.
-     *
-     * @exception IllegalArgumentException If the parameter is null.
-     *
-     * @since 1.5
-     */
-    public SnmpMibHandler addMib(SnmpMibAgent mib, SnmpOid[] oids) throws IllegalArgumentException;
-
-    /**
-     * Removes the specified MIB from the SNMP protocol adaptor.
-     * This method is called automatically by {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptor(SnmpMibHandler)}
-     * and {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptorName(ObjectName)}
-     * and should not be called directly.
-     *
-     * @param mib The MIB to be removed.
-     *
-     * @return <code>true</code> if the specified <CODE>mib</CODE> was a MIB included in the SNMP MIB handler,
-     * <code>false</code> otherwise.
-     */
-    public boolean removeMib(SnmpMibAgent mib);
-
-    /**
-     * Sends a trap using SNMP V1 trap format.
-     * <BR>The trap is sent to each destination defined in the ACL file (if available).
-     * If no ACL file or no destinations are available, the trap is sent to the local host.
-     *
-     * @param generic The generic number of the trap.
-     * @param specific The specific number of the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     *
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
-     */
-    public void snmpV1Trap(int generic, int specific, SnmpVarBindList varBindList) throws IOException, SnmpStatusException;
-
-
-    /**
-     * Sends a trap using SNMP V1 trap format.
-     * <BR>The trap is sent to the specified <CODE>InetAddress</CODE> destination
-     * using the specified community string (and the ACL file is not used).
-     *
-     * @param address The <CODE>InetAddress</CODE> destination of the trap.
-     * @param cs The community string to be used for the trap.
-     * @param generic The generic number of the trap.
-     * @param specific The specific number of the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     *
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
-     */
-    public void snmpV1Trap(InetAddress address, String cs, int generic, int specific, SnmpVarBindList varBindList)
-        throws IOException, SnmpStatusException;
-
-
-    /**
-     * Sends a trap using SNMP V1 trap format.
-     * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
-     * The community string used is the one located in the <CODE>SnmpPeer</CODE> parameters (<CODE>SnmpParameters.getRdCommunity() </CODE>).
-     *
-     * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
-     * @param agentAddr The agent address to be used for the trap.
-     * @param enterpOid The enterprise OID to be used for the trap.
-     * @param generic The generic number of the trap.
-     * @param specific The specific number of the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     * @param time The time stamp (overwrite the current time).
-     *
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
-     *
-     * @since 1.5
-     */
-    public void snmpV1Trap(SnmpPeer peer,
-                           SnmpIpAddress agentAddr,
-                           SnmpOid enterpOid,
-                           int generic,
-                           int specific,
-                           SnmpVarBindList varBindList,
-                           SnmpTimeticks time) throws IOException, SnmpStatusException;
-
-    /**
-     * Sends a trap using SNMP V2 trap format.
-     * <BR>The trap is sent to the specified <CODE>SnmpPeer</CODE> destination.
-     * <BR>The community string used is the one located in the <CODE>SnmpPeer</CODE> parameters (<CODE>SnmpParameters.getRdCommunity() </CODE>).
-     * <BR>The variable list included in the outgoing trap is composed of the following items:
-     * <UL>
-     * <LI><CODE>sysUpTime.0</CODE> with the value specified by <CODE>time</CODE>
-     * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by <CODE>trapOid</CODE>
-     * <LI><CODE>all the (oid,values)</CODE> from the specified <CODE>varBindList</CODE>
-     * </UL>
-     *
-     * @param peer The <CODE>SnmpPeer</CODE> destination of the trap.
-     * @param trapOid The OID identifying the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     * @param time The time stamp (overwrite the current time).
-     *
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
-     *
-     * @since 1.5
-     */
-    public void snmpV2Trap(SnmpPeer peer,
-                           SnmpOid trapOid,
-                           SnmpVarBindList varBindList,
-                           SnmpTimeticks time) throws IOException, SnmpStatusException;
-
-    /**
-     * Sends a trap using SNMP V2 trap format.
-     * <BR>The trap is sent to each destination defined in the ACL file (if available).
-     * If no ACL file or no destinations are available, the trap is sent to the local host.
-     * <BR>The variable list included in the outgoing trap is composed of the following items:
-     * <UL>
-     * <LI><CODE>sysUpTime.0</CODE> with its current value
-     * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by <CODE>trapOid</CODE>
-     * <LI><CODE>all the (oid,values)</CODE> from the specified <CODE>varBindList</CODE>
-     * </UL>
-     *
-     * @param trapOid The OID identifying the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     *
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
-     */
-    public void snmpV2Trap(SnmpOid trapOid, SnmpVarBindList varBindList) throws IOException, SnmpStatusException;
-
-
-    /**
-     * Sends a trap using SNMP V2 trap format.
-     * <BR>The trap is sent to the specified <CODE>InetAddress</CODE> destination
-     * using the specified community string (and the ACL file is not used).
-     * <BR>The variable list included in the outgoing trap is composed of the following items:
-     * <UL>
-     * <LI><CODE>sysUpTime.0</CODE> with its current value
-     * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by <CODE>trapOid</CODE>
-     * <LI><CODE>all the (oid,values)</CODE> from the specified <CODE>varBindList</CODE>
-     * </UL>
-     *
-     * @param address The <CODE>InetAddress</CODE> destination of the trap.
-     * @param cs The community string to be used for the trap.
-     * @param trapOid The OID identifying the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     *
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
-     */
-    public void snmpV2Trap(InetAddress address, String cs, SnmpOid trapOid, SnmpVarBindList varBindList)
-        throws IOException, SnmpStatusException;
-
-    /**
-     * Send the specified trap PDU to the passed <CODE>InetAddress</CODE>.
-     * @param address The destination address.
-     * @param pdu The pdu to send.
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
-     *
-     * @since 1.5
-     */
-    public void snmpPduTrap(InetAddress address, SnmpPduPacket pdu)
-        throws IOException, SnmpStatusException;
-    /**
-     * Send the specified trap PDU to the passed <CODE>SnmpPeer</CODE>.
-     * @param peer The destination peer. The Read community string is used of <CODE>SnmpParameters</CODE> is used as the trap community string.
-     * @param pdu The pdu to send.
-     * @exception IOException An I/O error occurred while sending the trap.
-     * @exception SnmpStatusException If the trap exceeds the limit defined by <CODE>bufferSize</CODE>.
-     * @since 1.5
-     */
-    public void snmpPduTrap(SnmpPeer peer,
-                            SnmpPduPacket pdu)
-        throws IOException, SnmpStatusException;
-
-    /**
-     * Sends an inform using SNMP V2 inform request format.
-     * <BR>The inform request is sent to each destination defined in the ACL file (if available).
-     * If no ACL file or no destinations are available, the inform request is sent to the local host.
-     * <BR>The variable list included in the outgoing inform request is composed of the following items:
-     * <UL>
-     * <LI><CODE>sysUpTime.0</CODE> with its current value
-     * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by <CODE>trapOid</CODE>
-     * <LI><CODE>all the (oid,values)</CODE> from the specified <CODE>varBindList</CODE>
-     * </UL>
-     * To send an inform request, the SNMP adaptor server must be active.
-     *
-     * @param cb The callback that is invoked when a request is complete.
-     * @param trapOid The OID identifying the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     *
-     * @return A vector of {@link com.sun.jmx.snmp.daemon.SnmpInformRequest} objects.
-     * <P>If there is no destination host for this inform request, the returned vector will be empty.
-     *
-     * @exception IllegalStateException  This method has been invoked while the SNMP adaptor server was not active.
-     * @exception IOException An I/O error occurred while sending the inform request.
-     * @exception SnmpStatusException If the inform request exceeds the limit defined by <CODE>bufferSize</CODE>.
-     */
-    public Vector<?> snmpInformRequest(SnmpInformHandler cb, SnmpOid trapOid,
-            SnmpVarBindList varBindList)
-        throws IllegalStateException, IOException, SnmpStatusException;
-
-    /**
-     * Sends an inform using SNMP V2 inform request format.
-     * <BR>The inform is sent to the specified <CODE>InetAddress</CODE> destination
-     * using the specified community string.
-     * <BR>The variable list included in the outgoing inform request is composed of the following items:
-     * <UL>
-     * <LI><CODE>sysUpTime.0</CODE> with its current value
-     * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by <CODE>trapOid</CODE>
-     * <LI><CODE>all the (oid,values)</CODE> from the specified <CODE>varBindList</CODE>
-     * </UL>
-     * To send an inform request, the SNMP adaptor server must be active.
-     *
-     * @param address The <CODE>InetAddress</CODE> destination for this inform request.
-     * @param cs The community string to be used for the inform request.
-     * @param cb The callback that is invoked when a request is complete.
-     * @param trapOid The OID identifying the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     *
-     * @return The inform request object.
-     *
-     * @exception IllegalStateException  This method has been invoked while the SNMP adaptor server was not active.
-     * @exception IOException An I/O error occurred while sending the inform request.
-     * @exception SnmpStatusException If the inform request exceeds the limit defined by <CODE>bufferSize</CODE>.
-     */
-    public SnmpInformRequest snmpInformRequest(InetAddress address, String cs, SnmpInformHandler cb,
-                                               SnmpOid trapOid, SnmpVarBindList varBindList)
-        throws IllegalStateException, IOException, SnmpStatusException;
-
-
-    /**
-     * Sends an inform using SNMP V2 inform request format.
-     * <BR>The inform is sent to the specified <CODE>SnmpPeer</CODE> destination.
-     * <BR> The community string used is the one located in the <CODE>SnmpPeer</CODE> parameters (<CODE>SnmpParameters.getInformCommunity() </CODE>).
-     * <BR>The variable list included in the outgoing inform is composed of the following items:
-     * <UL>
-     * <LI><CODE>sysUpTime.0</CODE> with its current value
-     * <LI><CODE>snmpTrapOid.0</CODE> with the value specified by <CODE>trapOid</CODE>
-     * <LI><CODE>all the (oid,values)</CODE> from the specified <CODE>varBindList</CODE>
-     * </UL>
-     * To send an inform request, the SNMP adaptor server must be active.
-     *
-     * @param peer The <CODE>SnmpPeer</CODE> destination for this inform request.
-     * @param cb The callback that is invoked when a request is complete.
-     * @param trapOid The OID identifying the trap.
-     * @param varBindList A list of <CODE>SnmpVarBind</CODE> instances or null.
-     *
-     * @return The inform request object.
-     *
-     * @exception IllegalStateException  This method has been invoked while the SNMP adaptor server was not active.
-     * @exception IOException An I/O error occurred while sending the inform request.
-     * @exception SnmpStatusException If the inform request exceeds the limit defined by <CODE>bufferSize</CODE>.
-     *
-     * @since 1.5
-     */
-    public SnmpInformRequest snmpInformRequest(SnmpPeer peer,
-                                               SnmpInformHandler cb,
-                                               SnmpOid trapOid,
-                                               SnmpVarBindList varBindList) throws IllegalStateException, IOException, SnmpStatusException;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpInformHandler.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.daemon ;
-
-// JMX imports
-//
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpVarBindList;
-
-/**
- * Provides the callback methods that are required to be implemented by the application
- * when an inform response is received by the agent.
- * <P>
- * Each inform request can be provided with an object that implements this callback
- * interface. An application then uses the SNMP adaptor to start an SNMP inform request,
- * which marks the request as active. The methods in this callback interface
- * get invoked when any of the following happens:
- * <P>
- * <UL>
- * <LI> The agent receives the SNMP inform response.
- * <LI> The agent does not receive any response within a specified time and the number of tries
- * have exceeded the limit (timeout condition).
- * <LI> An internal error occurs while processing or parsing the inform request.
- * </UL>
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-
-public interface SnmpInformHandler extends SnmpDefinitions {
-
-    /**
-     * This callback is invoked when a manager responds to an SNMP inform request.
-     * The callback should check the error status of the inform request to determine
-     * the kind of response.
-     *
-     * @param request The <CODE>SnmpInformRequest</CODE> associated with this callback.
-     * @param errStatus The status of the request.
-     * @param errIndex The index in the list that caused the error.
-     * @param vblist The <CODE>Response varBind</CODE> list for the successful request.
-     */
-    public abstract void processSnmpPollData(SnmpInformRequest request, int errStatus, int errIndex, SnmpVarBindList vblist);
-
-    /**
-     * This callback is invoked when a manager does not respond within the
-     * specified timeout value to the SNMP inform request. The number of tries have also
-     * been exhausted.
-     * @param request The <CODE>SnmpInformRequest</CODE> associated with this callback.
-     */
-    public abstract void processSnmpPollTimeout(SnmpInformRequest request);
-
-    /**
-     * This callback is invoked when any form of internal error occurs.
-     * @param request The <CODE>SnmpInformRequest</CODE> associated with this callback.
-     * @param errmsg The <CODE>String</CODE> describing the internal error.
-     */
-    public abstract void processSnmpInternalError(SnmpInformRequest request, String errmsg);
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpMibTree.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,269 +0,0 @@
-/*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.daemon;
-
-
-
-// java imports
-//
-import java.util.Vector;
-import java.util.Enumeration;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpOid;
-
-// SNMP Runtime imports
-//
-import com.sun.jmx.snmp.agent.SnmpMibAgent;
-
-/**
- * The class is used for building a tree representation of the different
- * root oids of the supported MIBs. Each node is associated to a specific MIB.
- */
-final class SnmpMibTree {
-
-    public SnmpMibTree() {
-      defaultAgent= null;
-      root= new TreeNode(-1, null, null);
-    }
-
-    public void setDefaultAgent(SnmpMibAgent def) {
-        defaultAgent= def;
-        root.agent= def;
-    }
-
-    public SnmpMibAgent getDefaultAgent() {
-        return defaultAgent;
-    }
-
-    public void register(SnmpMibAgent agent) {
-        root.registerNode(agent);
-    }
-
-    public void register(SnmpMibAgent agent, long[] oid) {
-      root.registerNode(oid, 0, agent);
-    }
-
-    public SnmpMibAgent getAgentMib(SnmpOid oid) {
-        TreeNode node= root.retrieveMatchingBranch(oid.longValue(), 0);
-        if (node == null)
-            return defaultAgent;
-        else
-            if(node.getAgentMib() == null)
-                return defaultAgent;
-            else
-                return node.getAgentMib();
-    }
-
-    public void unregister(SnmpMibAgent agent, SnmpOid[] oids) {
-        for(int i = 0; i < oids.length; i++) {
-            long[] oid = oids[i].longValue();
-            TreeNode node = root.retrieveMatchingBranch(oid, 0);
-            if (node == null)
-                continue;
-            node.removeAgent(agent);
-        }
-    }
-
-
-    public void unregister(SnmpMibAgent agent) {
-
-        root.removeAgentFully(agent);
-    }
-
-    /*
-    public void unregister(SnmpMibAgent agent) {
-        long[] oid= agent.getRootOid();
-        TreeNode node= root.retrieveMatchingBranch(oid, 0);
-        if (node == null)
-            return;
-        node.removeAgent(agent);
-    }
-    */
-    public void printTree() {
-        root.printTree(">");
-    }
-
-    private SnmpMibAgent defaultAgent;
-    private TreeNode root;
-
-    // A SnmpMibTree object is a tree of TreeNode
-    //
-    final class TreeNode {
-
-        void registerNode(SnmpMibAgent agent) {
-            long[] oid= agent.getRootOid();
-            registerNode(oid, 0, agent);
-        }
-
-        TreeNode retrieveMatchingBranch(long[] oid, int cursor) {
-            TreeNode node= retrieveChild(oid, cursor);
-            if (node == null)
-                return this;
-            if (children.isEmpty()) {
-                // In this case, the node does not have any children. So no point to
-                // continue the search ...
-                return node;
-            }
-            if( cursor + 1 == oid.length) {
-                // In this case, the oid does not have any more element. So the search
-                // is over.
-                return node;
-            }
-
-            TreeNode n = node.retrieveMatchingBranch(oid, cursor + 1);
-            //If the returned node got a null agent, we have to replace it by
-            //the current one (in case it is not null)
-            //
-            return n.agent == null ? this : n;
-        }
-
-        SnmpMibAgent getAgentMib() {
-            return agent;
-        }
-
-        public void printTree(String ident) {
-
-            StringBuilder buff= new StringBuilder();
-            if (agents == null) {
-                return;
-            }
-
-            for(Enumeration<SnmpMibAgent> e= agents.elements(); e.hasMoreElements(); ) {
-                SnmpMibAgent mib= e.nextElement();
-                if (mib == null)
-                    buff.append("empty ");
-                else
-                    buff.append(mib.getMibName()).append(" ");
-            }
-            ident+= " ";
-            if (children == null) {
-                return;
-            }
-            for(Enumeration<TreeNode> e= children.elements(); e.hasMoreElements(); ) {
-                TreeNode node= e.nextElement();
-                node.printTree(ident);
-            }
-        }
-
-        // PRIVATE STUFF
-        //--------------
-
-        /**
-         * Only the treeNode class can create an instance of treeNode.
-         * The creation occurs when registering a new oid.
-         */
-        private TreeNode(long nodeValue, SnmpMibAgent agent, TreeNode sup) {
-            this.nodeValue= nodeValue;
-            this.parent= sup;
-            agents.addElement(agent);
-        }
-
-        private void removeAgentFully(SnmpMibAgent agent) {
-            Vector<TreeNode> v = new Vector<>();
-            for(Enumeration<TreeNode> e= children.elements();
-                e.hasMoreElements(); ) {
-
-                TreeNode node= e.nextElement();
-                node.removeAgentFully(agent);
-                if(node.agents.isEmpty())
-                    v.add(node);
-
-            }
-            for(Enumeration<TreeNode> e= v.elements(); e.hasMoreElements(); ) {
-                children.removeElement(e.nextElement());
-            }
-            removeAgent(agent);
-
-        }
-
-        private void removeAgent(SnmpMibAgent mib) {
-            if (!agents.contains(mib))
-                return;
-            agents.removeElement(mib);
-
-            if (!agents.isEmpty())
-                agent= agents.firstElement();
-
-        }
-
-        private void setAgent(SnmpMibAgent agent) {
-            this.agent = agent;
-        }
-
-        private void registerNode(long[] oid, int cursor, SnmpMibAgent agent) {
-
-            if (cursor >= oid.length)
-                //That's it !
-                //
-                return;
-            TreeNode child = retrieveChild(oid, cursor);
-            if (child == null) {
-                // Create a child and register it !
-                //
-                long theValue= oid[cursor];
-                child= new TreeNode(theValue, agent, this);
-                children.addElement(child);
-            }
-            else
-                if (agents.contains(agent) == false) {
-                    agents.addElement(agent);
-                }
-
-            // We have to set the agent attribute
-            //
-            if(cursor == (oid.length - 1)) {
-              child.setAgent(agent);
-            }
-            else
-              child.registerNode(oid, cursor+1, agent);
-        }
-
-        private TreeNode retrieveChild(long[] oid, int current) {
-            long theValue= oid[current];
-
-            for(Enumeration<TreeNode> e= children.elements(); e.hasMoreElements(); ) {
-                TreeNode node= e.nextElement();
-                if (node.match(theValue))
-                    return node;
-            }
-            return null;
-        }
-
-        private boolean match(long value) {
-            return (nodeValue == value) ? true : false;
-        }
-
-        private Vector<TreeNode> children= new Vector<>();
-        private Vector<SnmpMibAgent> agents= new Vector<>();
-        private long nodeValue;
-        private SnmpMibAgent agent;
-        private TreeNode parent;
-
-    }; // end of class TreeNode
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1149 +0,0 @@
-/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.daemon;
-
-
-
-// java import
-//
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.logging.Level;
-import java.io.InterruptedIOException;
-import java.net.DatagramSocket;
-import java.net.DatagramPacket;
-import java.net.SocketException;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpMessage;
-import com.sun.jmx.snmp.SnmpPduFactory;
-import com.sun.jmx.snmp.SnmpPduBulk;
-import com.sun.jmx.snmp.SnmpPduPacket;
-import com.sun.jmx.snmp.SnmpPduRequest;
-import com.sun.jmx.snmp.SnmpPduTrap;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpVarBindList;
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpTooBigException;
-import com.sun.jmx.snmp.SnmpDataTypeEnums;
-
-// RI imports
-//
-import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
-
-// SNMP runtime import
-//
-import com.sun.jmx.snmp.agent.SnmpMibAgent;
-import com.sun.jmx.snmp.agent.SnmpUserDataFactory;
-//import com.sun.jmx.snmp.IPAcl.IPAcl;
-import com.sun.jmx.snmp.InetAddressAcl;
-
-
-class SnmpRequestHandler extends ClientHandler implements SnmpDefinitions {
-
-    private transient DatagramSocket       socket = null ;
-    private transient DatagramPacket       packet = null ;
-    private transient Vector<SnmpMibAgent> mibs = null ;
-
-    /**
-     * Contains the list of sub-requests associated to the current request.
-     */
-    private transient Hashtable<SnmpMibAgent, SnmpSubRequestHandler> subs = null;
-
-    /**
-     * Reference on the MIBS
-     */
-    private transient SnmpMibTree root;
-
-    private transient InetAddressAcl      ipacl = null ;
-    private transient SnmpPduFactory      pduFactory = null ;
-    private transient SnmpUserDataFactory userDataFactory = null ;
-    private transient SnmpAdaptorServer adaptor = null;
-    /**
-     * Full constructor
-     */
-    public SnmpRequestHandler(SnmpAdaptorServer server, int id,
-                              DatagramSocket s, DatagramPacket p,
-                              SnmpMibTree tree, Vector<SnmpMibAgent> m,
-                              InetAddressAcl a,
-                              SnmpPduFactory factory,
-                              SnmpUserDataFactory dataFactory,
-                              MBeanServer f, ObjectName n)
-    {
-        super(server, id, f, n);
-
-        // Need a reference on SnmpAdaptorServer for getNext & getBulk,
-        // in case of oid equality (mib overlapping).
-        //
-        adaptor = server;
-        socket = s;
-        packet = p;
-        root= tree;
-        mibs = new Vector<>(m);
-        subs= new Hashtable<>(mibs.size());
-        ipacl = a;
-        pduFactory = factory ;
-        userDataFactory = dataFactory ;
-        //thread.start();
-    }
-
-    /**
-     * Treat the request available in 'packet' and send the result
-     * back to the client.
-     * Note: we overwrite 'packet' with the response bytes.
-     */
-    @Override
-    public void doRun() {
-
-        // Trace the input packet
-        //
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                    "doRun","Packet received:\n" +
-                    SnmpMessage.dumpHexBuffer(packet.getData(), 0, packet.getLength()));
-        }
-
-        // Let's build the response packet
-        //
-        DatagramPacket respPacket = makeResponsePacket(packet) ;
-
-        // Trace the output packet
-        //
-        if ((SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) && (respPacket != null)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                    "doRun","Packet to be sent:\n" +
-                    SnmpMessage.dumpHexBuffer(respPacket.getData(), 0, respPacket.getLength()));
-        }
-
-        // Send the response packet if any
-        //
-        if (respPacket != null) {
-            try {
-                socket.send(respPacket) ;
-            } catch (SocketException e) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    if (e.getMessage().equals(InterruptSysCallMsg)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                            "doRun", "interrupted");
-                    } else {
-                      SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                            "doRun", "I/O exception", e);
-                    }
-                }
-            } catch(InterruptedIOException e) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                        "doRun", "interrupted");
-                }
-            } catch(Exception e) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                        "doRun", "failure when sending response", e);
-                }
-            }
-        }
-    }
-
-    /**
-     * Here we make a response packet from a request packet.
-     * We return null if there no response packet to sent.
-     */
-    private DatagramPacket makeResponsePacket(DatagramPacket reqPacket) {
-        DatagramPacket respPacket = null ;
-
-        // Transform the request packet into a request SnmpMessage
-        //
-        SnmpMessage reqMsg = new SnmpMessage() ;
-        try {
-            reqMsg.decodeMessage(reqPacket.getData(), reqPacket.getLength()) ;
-            reqMsg.address = reqPacket.getAddress() ;
-            reqMsg.port = reqPacket.getPort() ;
-        }
-        catch(SnmpStatusException x) {
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                    "makeResponsePacket", "packet decoding failed", x);
-            }
-            reqMsg = null ;
-            ((SnmpAdaptorServer)adaptorServer).incSnmpInASNParseErrs(1) ;
-        }
-
-        // Make the response SnmpMessage if any
-        //
-        SnmpMessage respMsg = null ;
-        if (reqMsg != null) {
-            respMsg = makeResponseMessage(reqMsg) ;
-        }
-
-        // Try to transform the response SnmpMessage into response packet.
-        // NOTE: we overwrite the request packet.
-        //
-        if (respMsg != null) {
-            try {
-                reqPacket.setLength(respMsg.encodeMessage(reqPacket.getData())) ;
-                respPacket = reqPacket ;
-            }
-            catch(SnmpTooBigException x) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                        "makeResponsePacket", "response message is too big");
-                }
-                try {
-                    respMsg = newTooBigMessage(reqMsg) ;
-                    reqPacket.setLength(respMsg.encodeMessage(reqPacket.getData())) ;
-                    respPacket = reqPacket ;
-                }
-                catch(SnmpTooBigException xx) {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                            "makeResponsePacket", "'too big' is 'too big' !!!");
-                    }
-                    adaptor.incSnmpSilentDrops(1);
-                }
-            }
-        }
-
-        return respPacket ;
-    }
-
-    /**
-     * Here we make a response message from a request message.
-     * We return null if there is no message to reply.
-     */
-    private SnmpMessage makeResponseMessage(SnmpMessage reqMsg) {
-        SnmpMessage respMsg = null ;
-
-        // Transform the request message into a request pdu
-        //
-        SnmpPduPacket reqPdu;
-        Object userData = null;
-        try {
-            reqPdu = (SnmpPduPacket)pduFactory.decodeSnmpPdu(reqMsg) ;
-            if (reqPdu != null && userDataFactory != null)
-                userData = userDataFactory.allocateUserData(reqPdu);
-        }
-        catch(SnmpStatusException x) {
-            reqPdu = null ;
-            SnmpAdaptorServer snmpServer = (SnmpAdaptorServer)adaptorServer ;
-            snmpServer.incSnmpInASNParseErrs(1) ;
-            if (x.getStatus()== SnmpDefinitions.snmpWrongSnmpVersion)
-                snmpServer.incSnmpInBadVersions(1) ;
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                    "makeResponseMessage", "message decoding failed", x);
-            }
-        }
-
-        // Make the response pdu if any
-        //
-        SnmpPduPacket respPdu = null ;
-        if (reqPdu != null) {
-            respPdu = makeResponsePdu(reqPdu,userData) ;
-            try {
-                if (userDataFactory != null)
-                    userDataFactory.releaseUserData(userData,respPdu);
-            } catch (SnmpStatusException x) {
-                respPdu = null;
-            }
-        }
-
-        // Try to transform the response pdu into a response message if any
-        //
-        if (respPdu != null) {
-            try {
-                respMsg = (SnmpMessage)pduFactory.
-                    encodeSnmpPdu(respPdu, packet.getData().length) ;
-            }
-            catch(SnmpStatusException x) {
-                respMsg = null ;
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                        "makeResponseMessage", "failure when encoding the response message", x);
-                }
-            }
-            catch(SnmpTooBigException x) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                        "makeResponseMessage", "response message is too big");
-                }
-
-                try {
-                    // if the PDU is too small, why should we try to do
-                    // recovery ?
-                    //
-                    if (packet.getData().length <=32)
-                        throw x;
-                    int pos= x.getVarBindCount();
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                            "makeResponseMessage", "fail on element" + pos);
-                    }
-                    int old;
-                    while (true) {
-                        try {
-                            respPdu = reduceResponsePdu(reqPdu, respPdu, pos) ;
-                            respMsg = (SnmpMessage)pduFactory.
-                                encodeSnmpPdu(respPdu,
-                                              packet.getData().length -32) ;
-                            break;
-                        } catch (SnmpTooBigException xx) {
-                            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                                    "makeResponseMessage", "response message is still too big");
-                            }
-                            old= pos;
-                            pos= xx.getVarBindCount();
-                            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                                    "makeResponseMessage","fail on element" + pos);
-                            }
-                            if (pos == old) {
-                                // we can not go any further in trying to
-                                // reduce the message !
-                                //
-                                throw xx;
-                            }
-                        }
-                    }// end of loop
-                } catch(SnmpStatusException xx) {
-                    respMsg = null ;
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                           "makeResponseMessage", "failure when encoding the response message", xx);
-                    }
-                }
-                catch(SnmpTooBigException xx) {
-                    try {
-                        respPdu = newTooBigPdu(reqPdu) ;
-                        respMsg = (SnmpMessage)pduFactory.
-                            encodeSnmpPdu(respPdu, packet.getData().length) ;
-                    }
-                    catch(SnmpTooBigException xxx) {
-                        respMsg = null ;
-                        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                               "makeResponseMessage", "'too big' is 'too big' !!!");
-                        }
-                        adaptor.incSnmpSilentDrops(1);
-                    }
-                    catch(Exception xxx) {
-                        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                               "makeResponseMessage", "Got unexpected exception", xxx);
-                        }
-                        respMsg = null ;
-                    }
-                }
-                catch(Exception xx) {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                           "makeResponseMessage", "Got unexpected exception", xx);
-                    }
-                    respMsg = null ;
-                }
-            }
-        }
-        return respMsg ;
-    }
-
-    /**
-     * Here we make a response pdu from a request pdu.
-     * We return null if there is no pdu to reply.
-     */
-    private SnmpPduPacket makeResponsePdu(SnmpPduPacket reqPdu,
-                                          Object userData) {
-
-        SnmpAdaptorServer snmpServer = (SnmpAdaptorServer)adaptorServer ;
-        SnmpPduPacket respPdu = null ;
-
-        snmpServer.updateRequestCounters(reqPdu.type) ;
-        if (reqPdu.varBindList != null)
-            snmpServer.updateVarCounters(reqPdu.type,
-                                         reqPdu.varBindList.length) ;
-
-        if (checkPduType(reqPdu)) {
-            respPdu = checkAcl(reqPdu) ;
-            if (respPdu == null) { // reqPdu is accepted by ACLs
-                if (mibs.size() < 1) {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                           "makeResponsePdu", "Request " + reqPdu.requestId +
-                           " received but no MIB registered.");
-                    }
-                    return makeNoMibErrorPdu((SnmpPduRequest)reqPdu, userData);
-                }
-                switch(reqPdu.type) {
-                case SnmpPduPacket.pduGetRequestPdu:
-                case SnmpPduPacket.pduGetNextRequestPdu:
-                case SnmpPduPacket.pduSetRequestPdu:
-                    respPdu = makeGetSetResponsePdu((SnmpPduRequest)reqPdu,
-                                                    userData) ;
-                    break ;
-
-                case SnmpPduPacket.pduGetBulkRequestPdu:
-                    respPdu = makeGetBulkResponsePdu((SnmpPduBulk)reqPdu,
-                                                     userData) ;
-                    break ;
-                }
-            }
-            else { // reqPdu is rejected by ACLs
-                // respPdu contains the error response to be sent.
-                // We send this response only if authResEnabled is true.
-                if (!snmpServer.getAuthRespEnabled()) { // No response should be sent
-                    respPdu = null ;
-                }
-                if (snmpServer.getAuthTrapEnabled()) { // A trap must be sent
-                    try {
-                        snmpServer.snmpV1Trap(SnmpPduTrap.
-                                              trapAuthenticationFailure, 0,
-                                              new SnmpVarBindList()) ;
-                    }
-                    catch(Exception x) {
-                        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                               "makeResponsePdu", "Failure when sending authentication trap", x);
-                        }
-                    }
-                }
-            }
-        }
-        return respPdu ;
-    }
-
-    //
-    // Generates a response packet, filling the values in the
-    // varbindlist with one of endOfMibView, noSuchObject, noSuchInstance
-    // according to the value of <code>status</code>
-    //
-    // @param statusTag should be one of:
-    //        <li>SnmpDataTypeEnums.errEndOfMibViewTag</li>
-    //        <li>SnmpDataTypeEnums.errNoSuchObjectTag</li>
-    //        <li>SnmpDataTypeEnums.errNoSuchInstanceTag</li>
-    //
-    SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {
-
-        final SnmpVarBind[] vblist = req.varBindList;
-        final int length = vblist.length;
-
-        switch (statusTag) {
-        case SnmpDataTypeEnums.errEndOfMibViewTag:
-            for (int i=0 ; i<length ; i++)
-                vblist[i].value = SnmpVarBind.endOfMibView;
-            break;
-        case SnmpDataTypeEnums.errNoSuchObjectTag:
-            for (int i=0 ; i<length ; i++)
-                vblist[i].value = SnmpVarBind.noSuchObject;
-            break;
-        case SnmpDataTypeEnums.errNoSuchInstanceTag:
-            for (int i=0 ; i<length ; i++)
-                vblist[i].value = SnmpVarBind.noSuchInstance;
-            break;
-        default:
-            return newErrorResponsePdu(req,snmpRspGenErr,1);
-        }
-        return newValidResponsePdu(req,vblist);
-    }
-
-    // Generates an appropriate response when no mib is registered in
-    // the adaptor.
-    //
-    // <li>If the version is V1:</li>
-    // <ul><li>Generates a NoSuchName error V1 response PDU</li></ul>
-    // <li>If the version is V2:</li>
-    // <ul><li>If the request is a GET, fills the varbind list with
-    //         NoSuchObject's</li>
-    //     <li>If the request is a GET-NEXT/GET-BULK, fills the varbind
-    //         list with EndOfMibView's</li>
-    //     <li>If the request is a SET, generates a NoAccess error V2
-    //          response PDU</li>
-    // </ul>
-    //
-    //
-    SnmpPduPacket makeNoMibErrorPdu(SnmpPduRequest req, Object userData) {
-        // There is no agent registered
-        //
-        if (req.version == SnmpDefinitions.snmpVersionOne) {
-            // Version 1: => NoSuchName
-            return
-                newErrorResponsePdu(req,snmpRspNoSuchName,1);
-        } else if (req.version == SnmpDefinitions.snmpVersionTwo) {
-            // Version 2: => depends on PDU type
-            switch (req.type) {
-            case pduSetRequestPdu :
-            case pduWalkRequest :
-                // SET request => NoAccess
-                return
-                    newErrorResponsePdu(req,snmpRspNoAccess,1);
-            case pduGetRequestPdu :
-                // GET request => NoSuchObject
-                return
-                    makeErrorVarbindPdu(req,SnmpDataTypeEnums.
-                                        errNoSuchObjectTag);
-            case pduGetNextRequestPdu :
-            case pduGetBulkRequestPdu :
-                // GET-NEXT or GET-BULK => EndOfMibView
-                return
-                    makeErrorVarbindPdu(req,SnmpDataTypeEnums.
-                                        errEndOfMibViewTag);
-            default:
-            }
-        }
-        // Something wrong here: => snmpRspGenErr
-        return newErrorResponsePdu(req,snmpRspGenErr,1);
-    }
-
-    /**
-     * Here we make the response pdu from a get/set request pdu.
-     * At this level, the result is never null.
-     */
-    private SnmpPduPacket makeGetSetResponsePdu(SnmpPduRequest req,
-                                                Object userData) {
-
-        // Create the trhead group specific for handling sub-requests
-        // associated to the current request. Use the invoke id
-        //
-        // Nice idea to use a thread group on a request basis.
-        // However the impact on performance is terrible !
-        // theGroup= new ThreadGroup(thread.getThreadGroup(),
-        //                "request " + String.valueOf(req.requestId));
-
-        // Let's build the varBindList for the response pdu
-        //
-
-        if (req.varBindList == null) {
-            // Good ! Let's make a full response pdu.
-            //
-            return newValidResponsePdu(req, null) ;
-        }
-
-        // First we need to split the request into subrequests
-        //
-        splitRequest(req);
-        int nbSubRequest= subs.size();
-        if (nbSubRequest == 1)
-            return turboProcessingGetSet(req,userData);
-
-
-        // Execute all the subrequests resulting from the split of the
-        // varbind list.
-        //
-        SnmpPduPacket result= executeSubRequest(req,userData);
-        if (result != null)
-            // It means that an error occurred. The error is already
-            // formatted by the executeSubRequest
-            // method.
-            return result;
-
-        // So far so good. So we need to concatenate all the answers.
-        //
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-               "makeGetSetResponsePdu",
-               "Build the unified response for request " + req.requestId);
-        }
-        return mergeResponses(req);
-    }
-
-    /**
-     * The method runs all the sub-requests associated to the current
-     * instance of SnmpRequestHandler.
-     */
-    private SnmpPduPacket executeSubRequest(SnmpPduPacket req,
-                                            Object userData) {
-
-        int errorStatus = SnmpDefinitions.snmpRspNoError ;
-
-        int i;
-        // If it's a set request, we must first check any varBind
-        //
-        if (req.type == pduSetRequestPdu) {
-
-            i=0;
-            for(Enumeration<SnmpSubRequestHandler> e= subs.elements(); e.hasMoreElements() ; i++) {
-                // Indicate to the sub request that a check must be invoked ...
-                // OK we should have defined out own tag for that !
-                //
-                SnmpSubRequestHandler sub= e.nextElement();
-                sub.setUserData(userData);
-                sub.type= pduWalkRequest;
-
-                sub.run();
-
-                sub.type= pduSetRequestPdu;
-
-                if (sub.getErrorStatus() != SnmpDefinitions.snmpRspNoError) {
-                    // No point to go any further.
-                    //
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                           "executeSubRequest", "an error occurs");
-                    }
-
-                    return newErrorResponsePdu(req, errorStatus,
-                                               sub.getErrorIndex() + 1) ;
-                }
-            }
-        }// end processing check operation for a set PDU.
-
-        // Let's start the sub-requests.
-        //
-        i=0;
-        for(Enumeration<SnmpSubRequestHandler> e= subs.elements(); e.hasMoreElements() ;i++) {
-            SnmpSubRequestHandler sub= e.nextElement();
-        /* NPCTE fix for bugId 4492741, esc 0, 16-August 2001 */
-            sub.setUserData(userData);
-        /* end of NPCTE fix for bugId 4492741 */
-
-            sub.run();
-
-            if (sub.getErrorStatus() != SnmpDefinitions.snmpRspNoError) {
-                // No point to go any further.
-                //
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                       "executeSubRequest", "an error occurs");
-                }
-
-                return newErrorResponsePdu(req, errorStatus,
-                                           sub.getErrorIndex() + 1) ;
-            }
-        }
-
-        // everything is ok
-        //
-        return null;
-    }
-
-    /**
-     * Optimize when there is only one sub request
-     */
-    private SnmpPduPacket turboProcessingGetSet(SnmpPduRequest req,
-                                                Object userData) {
-
-        int errorStatus;
-        SnmpSubRequestHandler sub = subs.elements().nextElement();
-        sub.setUserData(userData);
-
-        // Indicate to the sub request that a check must be invoked ...
-        // OK we should have defined out own tag for that !
-        //
-        if (req.type == SnmpDefinitions.pduSetRequestPdu) {
-            sub.type= pduWalkRequest;
-            sub.run();
-            sub.type= pduSetRequestPdu;
-
-            // Check the error status.
-            //
-            errorStatus= sub.getErrorStatus();
-            if (errorStatus != SnmpDefinitions.snmpRspNoError) {
-                // No point to go any further.
-                //
-                return newErrorResponsePdu(req, errorStatus,
-                                           sub.getErrorIndex() + 1) ;
-            }
-        }
-
-        // process the operation
-        //
-
-        sub.run();
-        errorStatus= sub.getErrorStatus();
-        if (errorStatus != SnmpDefinitions.snmpRspNoError) {
-            // No point to go any further.
-            //
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                   "turboProcessingGetSet", "an error occurs");
-            }
-            int realIndex= sub.getErrorIndex() + 1;
-            return newErrorResponsePdu(req, errorStatus, realIndex) ;
-        }
-
-        // So far so good. So we need to concatenate all the answers.
-        //
-
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-               "turboProcessingGetSet",  "build the unified response for request "
-                + req.requestId);
-        }
-        return mergeResponses(req);
-    }
-
-    /**
-     * Here we make the response pdu for a bulk request.
-     * At this level, the result is never null.
-     */
-    private SnmpPduPacket makeGetBulkResponsePdu(SnmpPduBulk req,
-                                                 Object userData) {
-
-        SnmpVarBind[] respVarBindList;
-
-        // RFC 1905, Section 4.2.3, p14
-        int L = req.varBindList.length ;
-        int N = Math.max(Math.min(req.nonRepeaters, L), 0) ;
-        int M = Math.max(req.maxRepetitions, 0) ;
-        int R = L - N ;
-
-        if (req.varBindList == null) {
-            // Good ! Let's make a full response pdu.
-            //
-            return newValidResponsePdu(req, null) ;
-        }
-
-        // Split the request into subrequests.
-        //
-        splitBulkRequest(req, N, M, R);
-        SnmpPduPacket result= executeSubRequest(req,userData);
-        if (result != null)
-            return result;
-
-        respVarBindList= mergeBulkResponses(N + (M * R));
-
-        // Now we remove useless trailing endOfMibView.
-        //
-        int m2 ; // respVarBindList[m2] item and next are going to be removed
-        int t = respVarBindList.length ;
-        while ((t > N) && (respVarBindList[t-1].
-                           value.equals(SnmpVarBind.endOfMibView))) {
-            t-- ;
-        }
-        if (t == N)
-            m2 = N + R ;
-        else
-            m2 = N + ((t -1 -N) / R + 2) * R ; // Trivial, of course...
-        if (m2 < respVarBindList.length) {
-            SnmpVarBind[] truncatedList = new SnmpVarBind[m2] ;
-            for (int i = 0 ; i < m2 ; i++) {
-                truncatedList[i] = respVarBindList[i] ;
-            }
-            respVarBindList = truncatedList ;
-        }
-
-        // Good ! Let's make a full response pdu.
-        //
-        return newValidResponsePdu(req, respVarBindList) ;
-    }
-
-    /**
-     * Check the type of the pdu: only the get/set/bulk request
-     * are accepted.
-     */
-    private boolean checkPduType(SnmpPduPacket pdu) {
-
-        boolean result;
-
-        switch(pdu.type) {
-
-        case SnmpDefinitions.pduGetRequestPdu:
-        case SnmpDefinitions.pduGetNextRequestPdu:
-        case SnmpDefinitions.pduSetRequestPdu:
-        case SnmpDefinitions.pduGetBulkRequestPdu:
-            result = true ;
-            break;
-
-        default:
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                   "checkPduType", "cannot respond to this kind of PDU");
-            }
-            result = false ;
-            break;
-        }
-
-        return result ;
-    }
-
-    /**
-     * Check if the specified pdu is conform to the ACL.
-     * This method returns null if the pdu is ok. If not, it returns
-     * the response pdu to be replied.
-     */
-    private SnmpPduPacket checkAcl(SnmpPduPacket pdu) {
-        SnmpPduPacket response = null ;
-        String community = new String(pdu.community) ;
-
-        // We check the pdu type and create an error response if
-        // the check failed.
-        //
-        if (ipacl != null) {
-            if (pdu.type == SnmpDefinitions.pduSetRequestPdu) {
-                if (!ipacl.checkWritePermission(pdu.address, community)) {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                           "checkAcl", "sender is " + pdu.address +
-                              " with " + community +". Sender has no write permission");
-                    }
-                    int err = SnmpSubRequestHandler.
-                        mapErrorStatus(SnmpDefinitions.
-                                       snmpRspAuthorizationError,
-                                       pdu.version, pdu.type);
-                    response = newErrorResponsePdu(pdu, err, 0) ;
-                }
-                else {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                           "checkAcl", "sender is " + pdu.address +
-                              " with " + community +". Sender has write permission");
-                    }
-                }
-            }
-            else {
-                if (!ipacl.checkReadPermission(pdu.address, community)) {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                           "checkAcl", "sender is " + pdu.address +
-                              " with " + community +". Sender has no read permission");
-                    }
-                    int err = SnmpSubRequestHandler.
-                        mapErrorStatus(SnmpDefinitions.
-                                       snmpRspAuthorizationError,
-                                       pdu.version, pdu.type);
-                    response = newErrorResponsePdu(pdu,
-                                                   err,
-                                                   0);
-                    SnmpAdaptorServer snmpServer =
-                        (SnmpAdaptorServer)adaptorServer;
-                    snmpServer.updateErrorCounters(SnmpDefinitions.
-                                                   snmpRspNoSuchName);
-                }
-                else {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                           "checkAcl", "sender is " + pdu.address +
-                              " with " + community +". Sender has read permission");
-                    }
-                }
-            }
-        }
-
-        // If the response is not null, this means the pdu is rejected.
-        // So let's update the statistics.
-        //
-        if (response != null) {
-            SnmpAdaptorServer snmpServer = (SnmpAdaptorServer)adaptorServer ;
-            snmpServer.incSnmpInBadCommunityUses(1) ;
-            if (ipacl.checkCommunity(community) == false)
-                snmpServer.incSnmpInBadCommunityNames(1) ;
-        }
-
-        return response ;
-    }
-
-    /**
-     * Make a response pdu with the specified error status and index.
-     * NOTE: the response pdu share its varBindList with the request pdu.
-     */
-    private SnmpPduRequest newValidResponsePdu(SnmpPduPacket reqPdu,
-                                               SnmpVarBind[] varBindList) {
-        SnmpPduRequest result = new SnmpPduRequest() ;
-
-        result.address = reqPdu.address ;
-        result.port = reqPdu.port ;
-        result.version = reqPdu.version ;
-        result.community = reqPdu.community ;
-        result.type = SnmpPduRequest.pduGetResponsePdu ;
-        result.requestId = reqPdu.requestId ;
-        result.errorStatus = SnmpDefinitions.snmpRspNoError ;
-        result.errorIndex = 0 ;
-        result.varBindList = varBindList ;
-
-        ((SnmpAdaptorServer)adaptorServer).
-            updateErrorCounters(result.errorStatus) ;
-
-        return result ;
-    }
-
-    /**
-     * Make a response pdu with the specified error status and index.
-     * NOTE: the response pdu share its varBindList with the request pdu.
-     */
-    private SnmpPduRequest newErrorResponsePdu(SnmpPduPacket req,int s,int i) {
-        SnmpPduRequest result = newValidResponsePdu(req, null) ;
-        result.errorStatus = s ;
-        result.errorIndex = i ;
-        result.varBindList = req.varBindList ;
-
-        ((SnmpAdaptorServer)adaptorServer).
-            updateErrorCounters(result.errorStatus) ;
-
-        return result ;
-    }
-
-    private SnmpMessage newTooBigMessage(SnmpMessage reqMsg)
-        throws SnmpTooBigException {
-        SnmpMessage result = null ;
-        SnmpPduPacket reqPdu;
-
-        try {
-            reqPdu = (SnmpPduPacket)pduFactory.decodeSnmpPdu(reqMsg) ;
-            if (reqPdu != null) {
-                SnmpPduPacket respPdu = newTooBigPdu(reqPdu) ;
-                result = (SnmpMessage)pduFactory.
-                    encodeSnmpPdu(respPdu, packet.getData().length) ;
-            }
-        }
-        catch(SnmpStatusException x) {
-            // This should not occur because decodeIncomingRequest has normally
-            // been successfully called before.
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                   "newTooBigMessage", "Internal error", x);
-            }
-            throw new InternalError(x) ;
-        }
-
-        return result ;
-    }
-
-    private SnmpPduPacket newTooBigPdu(SnmpPduPacket req) {
-        SnmpPduRequest result =
-            newErrorResponsePdu(req, SnmpDefinitions.snmpRspTooBig, 0) ;
-        result.varBindList = null ;
-        return result ;
-    }
-
-    private SnmpPduPacket reduceResponsePdu(SnmpPduPacket req,
-                                            SnmpPduPacket resp,
-                                            int acceptedVbCount)
-        throws SnmpTooBigException {
-
-        // Reduction can be attempted only on bulk response
-        //
-        if (req.type != SnmpPduPacket.pduGetBulkRequestPdu) {
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                   "reduceResponsePdu", "cannot remove anything");
-            }
-            throw new SnmpTooBigException(acceptedVbCount) ;
-        }
-
-        // We're going to reduce the varbind list.
-        // First determine which items should be removed.
-        // Next duplicate and replace the existing list by the reduced one.
-        //
-        // acceptedVbCount is the number of varbind which have been
-        // successfully encoded before reaching bufferSize:
-        //   * when it is >= 2, we split the varbindlist at this
-        //     position (-1 to be safe),
-        //   * when it is 1, we only put one (big?) item in the varbindlist
-        //   * when it is 0 (in fact, acceptedVbCount is not available),
-        //     we split the varbindlist by 2.
-        //
-        int vbCount;
-        if (acceptedVbCount >= 3)
-            vbCount = Math.min(acceptedVbCount - 1, resp.varBindList.length) ;
-        else if (acceptedVbCount == 1)
-            vbCount = 1 ;
-        else // acceptedCount == 0 ie it is unknown
-            vbCount = resp.varBindList.length / 2 ;
-
-        if (vbCount < 1) {
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                   "reduceResponsePdu", "cannot remove anything");
-            }
-            throw new SnmpTooBigException(acceptedVbCount) ;
-        }
-        else {
-            SnmpVarBind[] newVbList = new SnmpVarBind[vbCount] ;
-            for (int i = 0 ; i < vbCount ; i++) {
-                newVbList[i] = resp.varBindList[i] ;
-            }
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
-                   "reduceResponsePdu", (resp.varBindList.length - newVbList.length) +
-                    " items have been removed");
-            }
-            resp.varBindList = newVbList ;
-        }
-
-        return resp ;
-    }
-
-    /**
-     * The method takes the incoming requests and split it into subrequests.
-     */
-    private void splitRequest(SnmpPduRequest req) {
-
-        int nbAgents= mibs.size();
-        SnmpMibAgent agent = mibs.firstElement();
-        if (nbAgents == 1) {
-            // Take all the oids contained in the request and
-            //
-            subs.put(agent, new SnmpSubRequestHandler(agent, req, true));
-            return;
-        }
-
-        // For the get next operation we are going to send the varbind list
-        // to all agents
-        //
-        if (req.type == pduGetNextRequestPdu) {
-            for(Enumeration<SnmpMibAgent> e= mibs.elements(); e.hasMoreElements(); ) {
-                final SnmpMibAgent ag= e.nextElement();
-                subs.put(ag, new SnmpSubNextRequestHandler(adaptor, ag, req));
-            }
-            return;
-        }
-
-        int nbReqs= req.varBindList.length;
-        SnmpVarBind[] vars= req.varBindList;
-        SnmpSubRequestHandler sub;
-        for(int i=0; i < nbReqs; i++) {
-            agent= root.getAgentMib(vars[i].oid);
-            sub= subs.get(agent);
-            if (sub == null) {
-                // We need to create the sub request handler and update
-                // the hashtable
-                //
-                sub= new SnmpSubRequestHandler(agent, req);
-                subs.put(agent, sub);
-            }
-
-            // Update the translation table within the subrequest
-            //
-            sub.updateRequest(vars[i], i);
-        }
-    }
-
-    /**
-     * The method takes the incoming get bulk requests and split it into
-     * subrequests.
-     */
-    private void splitBulkRequest(SnmpPduBulk req,
-                                  int nonRepeaters,
-                                  int maxRepetitions,
-                                  int R) {
-        // Send the getBulk to all agents
-        //
-        for(Enumeration<SnmpMibAgent> e= mibs.elements(); e.hasMoreElements(); ) {
-            final SnmpMibAgent agent = e.nextElement();
-
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
-                   "splitBulkRequest", "Create a sub with : " + agent + " " + nonRepeaters
-                   + " " + maxRepetitions + " " + R);
-            }
-
-            subs.put(agent,
-                     new SnmpSubBulkRequestHandler(adaptor,
-                                                   agent,
-                                                   req,
-                                                   nonRepeaters,
-                                                   maxRepetitions,
-                                                   R));
-        }
-    }
-
-    private SnmpPduPacket mergeResponses(SnmpPduRequest req) {
-
-        if (req.type == pduGetNextRequestPdu) {
-            return mergeNextResponses(req);
-        }
-
-        SnmpVarBind[] result= req.varBindList;
-
-        // Go through the list of subrequests and concatenate.
-        // Hopefully, by now all the sub-requests should be finished
-        //
-        for(Enumeration<SnmpSubRequestHandler> e= subs.elements(); e.hasMoreElements();) {
-            SnmpSubRequestHandler sub= e.nextElement();
-            sub.updateResult(result);
-        }
-        return newValidResponsePdu(req,result);
-    }
-
-    private SnmpPduPacket mergeNextResponses(SnmpPduRequest req) {
-        int max= req.varBindList.length;
-        SnmpVarBind[] result= new SnmpVarBind[max];
-
-        // Go through the list of subrequests and concatenate.
-        // Hopefully, by now all the sub-requests should be finished
-        //
-        for(Enumeration<SnmpSubRequestHandler> e= subs.elements(); e.hasMoreElements();) {
-            SnmpSubRequestHandler sub= e.nextElement();
-            sub.updateResult(result);
-        }
-
-        if (req.version == snmpVersionTwo) {
-            return newValidResponsePdu(req,result);
-        }
-
-        // In v1 make sure there is no endOfMibView ...
-        //
-        for(int i=0; i < max; i++) {
-            SnmpValue val= result[i].value;
-            if (val == SnmpVarBind.endOfMibView)
-                return newErrorResponsePdu(req,
-                                   SnmpDefinitions.snmpRspNoSuchName, i+1);
-        }
-
-        // So far so good ...
-        //
-        return newValidResponsePdu(req,result);
-    }
-
-    private SnmpVarBind[] mergeBulkResponses(int size) {
-        // Let's allocate the array for storing the result
-        //
-        SnmpVarBind[] result= new SnmpVarBind[size];
-        for(int i= size-1; i >=0; --i) {
-            result[i]= new SnmpVarBind();
-            result[i].value= SnmpVarBind.endOfMibView;
-        }
-
-        // Go through the list of subrequests and concatenate.
-        // Hopefully, by now all the sub-requests should be finished
-        //
-        for(Enumeration<SnmpSubRequestHandler> e= subs.elements(); e.hasMoreElements();) {
-            SnmpSubRequestHandler sub= e.nextElement();
-            sub.updateResult(result);
-        }
-
-        return result;
-    }
-
-    @Override
-    protected String makeDebugTag() {
-        return "SnmpRequestHandler[" + adaptorServer.getProtocol() + ":" +
-            adaptorServer.getPort() + "]";
-    }
-
-    @Override
-    Thread createThread(Runnable r) {
-        return null;
-    }
-
-    static final private String InterruptSysCallMsg =
-        "Interrupted system call";
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,343 +0,0 @@
-/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.daemon;
-
-
-
-// java import
-//
-import java.util.Enumeration;
-import java.util.logging.Level;
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpEngine;
-// SNMP Runtime import
-//
-import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
-import com.sun.jmx.snmp.agent.SnmpMibAgent;
-import com.sun.jmx.snmp.internal.SnmpIncomingRequest;
-import com.sun.jmx.snmp.ThreadContext;
-
-class SnmpSubBulkRequestHandler extends SnmpSubRequestHandler {
-    private SnmpAdaptorServer server = null;
-
-    /**
-     * The constructor initialize the subrequest with the whole varbind list contained
-     * in the original request.
-     */
-    protected SnmpSubBulkRequestHandler(SnmpEngine engine,
-                                        SnmpAdaptorServer server,
-                                        SnmpIncomingRequest incRequest,
-                                        SnmpMibAgent agent,
-                                        SnmpPdu req,
-                                        int nonRepeat,
-                                        int maxRepeat,
-                                        int R) {
-        super(engine, incRequest, agent, req);
-        init(server, req, nonRepeat, maxRepeat, R);
-    }
-
-    /**
-     * The constructor initialize the subrequest with the whole varbind list contained
-     * in the original request.
-     */
-    protected SnmpSubBulkRequestHandler(SnmpAdaptorServer server,
-                                        SnmpMibAgent agent,
-                                        SnmpPdu req,
-                                        int nonRepeat,
-                                        int maxRepeat,
-                                        int R) {
-        super(agent, req);
-        init(server, req, nonRepeat, maxRepeat, R);
-    }
-
-    @Override
-    public void run() {
-
-        size= varBind.size();
-
-        try {
-            // Invoke a getBulk operation
-            //
-            /* NPCTE fix for bugId 4492741, esc 0, 16-August-2001 */
-            final ThreadContext oldContext =
-                ThreadContext.push("SnmpUserData",data);
-            try {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                        "run", "[" + Thread.currentThread() +
-                        "]:getBulk operation on " + agent.getMibName());
-                }
-                agent.getBulk(createMibRequest(varBind,version,data),
-                              nonRepeat, maxRepeat);
-            } finally {
-                ThreadContext.restore(oldContext);
-            }
-            /* end of NPCTE fix for bugId 4492741 */
-
-        } catch(SnmpStatusException x) {
-            errorStatus = x.getStatus() ;
-            errorIndex=  x.getErrorIndex();
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubRequestHandler.class.getName(),
-                    "run", "[" + Thread.currentThread() +
-                    "]:an Snmp error occurred during the operation", x);
-            }
-        }
-        catch(Exception x) {
-            errorStatus = SnmpDefinitions.snmpRspGenErr ;
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubRequestHandler.class.getName(),
-                    "run", "[" + Thread.currentThread() +
-                    "]:a generic error occurred during the operation", x);
-            }
-        }
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                "run", "[" + Thread.currentThread() +
-                  "]:operation completed");
-        }
-    }
-
-    private void init(SnmpAdaptorServer server,
-                      SnmpPdu req,
-                      int nonRepeat,
-                      int maxRepeat,
-                      int R) {
-        this.server = server;
-        this.nonRepeat= nonRepeat;
-        this.maxRepeat= maxRepeat;
-        this.globalR= R;
-
-        final int max= translation.length;
-        final SnmpVarBind[] list= req.varBindList;
-        final NonSyncVector<SnmpVarBind> nonSyncVarBind =
-                ((NonSyncVector<SnmpVarBind>)varBind);
-        for(int i=0; i < max; i++) {
-            translation[i]= i;
-            // we need to allocate a new SnmpVarBind. Otherwise the first
-            // sub request will modify the list...
-            //
-            final SnmpVarBind newVarBind =
-                new SnmpVarBind(list[i].oid, list[i].value);
-            nonSyncVarBind.addNonSyncElement(newVarBind);
-        }
-    }
-
-    /**
-     * The method updates find out which element to use at update time. Handle oid overlapping as well
-     */
-    private SnmpVarBind findVarBind(SnmpVarBind element,
-                                    SnmpVarBind result) {
-
-        if (element == null) return null;
-
-        if (result.oid == null) {
-             return element;
-        }
-
-        if (element.value == SnmpVarBind.endOfMibView) return result;
-
-        if (result.value == SnmpVarBind.endOfMibView) return element;
-
-        final SnmpValue val = result.value;
-
-        int comp = element.oid.compareTo(result.oid);
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                "findVarBind","Comparing OID element : " + element.oid +
-                  " with result : " + result.oid);
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                "findVarBind","Values element : " + element.value +
-                  " result : " + result.value);
-        }
-        if (comp < 0) {
-            // Take the smallest (lexicographically)
-            //
-            return element;
-        }
-        else {
-            if(comp == 0) {
-                // Must compare agent used for reply
-                // Take the deeper within the reply
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                        "findVarBind"," oid overlapping. Oid : " +
-                          element.oid + "value :" + element.value);
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                         "findVarBind","Already present varBind : " +
-                          result);
-                }
-                SnmpOid oid = result.oid;
-                SnmpMibAgent deeperAgent = server.getAgentMib(oid);
-
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                        "findVarBind","Deeper agent : " + deeperAgent);
-                }
-                if(deeperAgent == agent) {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                            "findVarBind","The current agent is the deeper one. Update the value with the current one");
-                    }
-                    return element;
-                } else {
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                            "findVarBind","The current agent is not the deeper one. return the previous one.");
-                    }
-                    return result;
-                }
-
-                /*
-                   Vector v = new Vector();
-                   SnmpMibRequest getReq = createMibRequest(v,
-                   version,
-                   null);
-                   SnmpVarBind realValue = new SnmpVarBind(oid);
-                   getReq.addVarBind(realValue);
-                   try {
-                   deeperAgent.get(getReq);
-                   } catch(SnmpStatusException e) {
-                   e.printStackTrace();
-                   }
-
-                   if(isDebugOn())
-                   trace("findVarBind", "Biggest priority value is : " +
-                   realValue.value);
-
-                   return realValue;
-                */
-
-            }
-            else {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                        "findVarBind","The right varBind is the already present one");
-                }
-                return result;
-            }
-        }
-    }
-    /**
-     * The method updates a given var bind list with the result of a
-     * previsouly invoked operation.
-     * Prior to calling the method, one must make sure that the operation was
-     * successful. As such the method getErrorIndex or getErrorStatus should be
-     * called.
-     */
-    @Override
-    protected void updateResult(SnmpVarBind[] result) {
-        // we can assume that the run method is over ...
-        //
-
-        final Enumeration<SnmpVarBind> e= varBind.elements();
-        final int max= result.length;
-
-        // First go through all the values once ...
-        for(int i=0; i < size; i++) {
-            // May be we should control the position ...
-            //
-            if (e.hasMoreElements() == false)
-                return;
-
-            // bugId 4641694: must check position in order to avoid
-            //       ArrayIndexOutOfBoundException
-            final int pos=translation[i];
-            if (pos >= max) {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubRequestHandler.class.getName(),
-                        "updateResult","Position '"+pos+"' is out of bound...");
-                }
-                continue;
-            }
-
-            final SnmpVarBind element= e.nextElement();
-
-            if (element == null) continue;
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                    "updateResult","Non repeaters Current element : " +
-                      element + " from agent : " + agent);
-            }
-            final SnmpVarBind res = findVarBind(element,result[pos]);
-
-            if(res == null) continue;
-
-            result[pos] = res;
-        }
-
-        // Now update the values which have been repeated
-        // more than once.
-        int localR= size - nonRepeat;
-        for (int i = 2 ; i <= maxRepeat ; i++) {
-            for (int r = 0 ; r < localR ; r++) {
-                final int pos = (i-1)* globalR + translation[nonRepeat + r] ;
-                if (pos >= max)
-                    return;
-                if (e.hasMoreElements() ==false)
-                    return;
-                final SnmpVarBind element= e.nextElement();
-
-                if (element == null) continue;
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                        "updateResult","Repeaters Current element : " +
-                          element + " from agent : " + agent);
-                }
-                final SnmpVarBind res = findVarBind(element, result[pos]);
-
-                if(res == null) continue;
-
-                result[pos] = res;
-            }
-        }
-    }
-
-    // PROTECTED VARIABLES
-    //------------------
-
-    /**
-     * Specific to the sub request
-     */
-    protected int nonRepeat=0;
-
-    protected int maxRepeat=0;
-
-    /**
-     * R as defined in RCF 1902 for the global request the sub-request is associated to.
-     */
-    protected int globalR=0;
-
-    protected int size=0;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpSubNextRequestHandler.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,272 +0,0 @@
-/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.daemon;
-
-// java imports
-//
-import java.util.logging.Level;
-import java.util.Vector;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpEngine;
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpVarBindList;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpStatusException;
-// SNMP Runtime import
-//
-import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
-import com.sun.jmx.snmp.agent.SnmpMibAgent;
-import com.sun.jmx.snmp.agent.SnmpMibRequest;
-import com.sun.jmx.snmp.daemon.SnmpAdaptorServer;
-import com.sun.jmx.snmp.internal.SnmpIncomingRequest;
-
-/* NPCTE fix for bugId 4492741, esc 0 */
-import com.sun.jmx.snmp.ThreadContext;
-/* end of NPCTE fix for bugId 4492741 */
-
-class SnmpSubNextRequestHandler extends SnmpSubRequestHandler {
-    private SnmpAdaptorServer server = null;
-    /**
-     * The constructor initialize the subrequest with the whole varbind
-     * list contained in the original request.
-     */
-    protected SnmpSubNextRequestHandler(SnmpAdaptorServer server,
-                                        SnmpMibAgent agent,
-                                        SnmpPdu req) {
-        super(agent,req);
-        init(req, server);
-    }
-
-    protected SnmpSubNextRequestHandler(SnmpEngine engine,
-                                        SnmpAdaptorServer server,
-                                        SnmpIncomingRequest incRequest,
-                                        SnmpMibAgent agent,
-                                        SnmpPdu req) {
-        super(engine, incRequest, agent, req);
-        init(req, server);
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubNextRequestHandler.class.getName(),
-                "SnmpSubNextRequestHandler", "Constructor : " + this);
-        }
-    }
-
-    private void init(SnmpPdu req, SnmpAdaptorServer server) {
-        this.server = server;
-
-        // The translation table is easy in this case ...
-        //
-        final int max= translation.length;
-        final SnmpVarBind[] list= req.varBindList;
-        final NonSyncVector<SnmpVarBind> nonSyncVarBind =
-                ((NonSyncVector<SnmpVarBind>)varBind);
-        for(int i=0; i < max; i++) {
-            translation[i]= i;
-            // we need to allocate a new SnmpVarBind. Otherwise the first
-            // sub request will modify the list...
-            //
-            final SnmpVarBind newVarBind =
-                new SnmpVarBind(list[i].oid, list[i].value);
-            nonSyncVarBind.addNonSyncElement(newVarBind);
-        }
-    }
-
-    public void run() {
-
-        try {
-            /* NPCTE fix for bugId 4492741, esc 0, 16-August-2001 */
-            final ThreadContext oldContext =
-                ThreadContext.push("SnmpUserData",data);
-            try {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                        "run", "[" + Thread.currentThread() +
-                          "]:getNext operation on " + agent.getMibName());
-                }
-
-                // Always call with V2. So the merge of the responses will
-                // be easier.
-                //
-                agent.getNext(createMibRequest(varBind, snmpVersionTwo, data));
-            } finally {
-                ThreadContext.restore(oldContext);
-            }
-            /* end of NPCTE fix for bugId 4492741 */
-
-
-        } catch(SnmpStatusException x) {
-            errorStatus = x.getStatus() ;
-            errorIndex=  x.getErrorIndex();
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubRequestHandler.class.getName(),
-                    "run", "[" + Thread.currentThread() +
-                      "]:an Snmp error occurred during the operation", x);
-            }
-        }
-        catch(Exception x) {
-            errorStatus = SnmpDefinitions.snmpRspGenErr ;
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubRequestHandler.class.getName(),
-                    "run", "[" + Thread.currentThread() +
-                      "]:a generic error occurred during the operation", x);
-            }
-        }
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                "run", "[" + Thread.currentThread() +  "]:operation completed");
-        }
-    }
-
-    /**
-     * The method updates the varbind list of the subrequest.
-     */
-    protected  void updateRequest(SnmpVarBind var, int pos) {
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubRequestHandler.class.getName(),
-                "updateRequest", "Copy :" + var);
-        }
-        int size= varBind.size();
-        translation[size]= pos;
-        final SnmpVarBind newVarBind =
-            new SnmpVarBind(var.oid, var.value);
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubRequestHandler.class.getName(),
-                "updateRequest", "Copied :" + newVarBind);
-        }
-
-        varBind.addElement(newVarBind);
-    }
-    /**
-     * The method updates a given var bind list with the result of a
-     * previsouly invoked operation.
-     * Prior to calling the method, one must make sure that the operation was
-     * successful. As such the method getErrorIndex or getErrorStatus should be
-     * called.
-     */
-    protected void updateResult(SnmpVarBind[] result) {
-
-        final int max=varBind.size();
-        for(int i= 0; i< max ; i++) {
-            // May be we should control the position ...
-            //
-            final int index= translation[i];
-            final SnmpVarBind elmt=
-                (SnmpVarBind)((NonSyncVector)varBind).elementAtNonSync(i);
-
-            final SnmpVarBind vb= result[index];
-            if (vb == null) {
-                result[index]= elmt;
-                /* NPCTE fix for bugid 4381195 esc 0. <J.C.> < 17-Oct-2000> */
-                // if ((elmt != null) &&  (elmt.value == null) &&
-                //    (version == snmpVersionTwo))
-                //    elmt.value = SnmpVarBind.endOfMibView;
-                /* end of NPCTE fix for bugid 4381195 */
-                continue;
-            }
-
-            final SnmpValue val= vb.value;
-            if ((val == null)|| (val == SnmpVarBind.endOfMibView)){
-                /* NPCTE fix for bugid 4381195 esc 0. <J.C.> < 17-Oct-2000> */
-                if ((elmt != null) &&
-                    (elmt.value != SnmpVarBind.endOfMibView))
-                    result[index]= elmt;
-                // else if ((val == null) && (version == snmpVersionTwo))
-                //    vb.value = SnmpVarBind.endOfMibView;
-                continue;
-                /* end of NPCTE fix for bugid 4381195 */
-            }
-
-            /* NPCTE fix for bugid 4381195 esc 0. <J.C.> < 17-Oct-2000> */
-            if (elmt == null) continue;
-            /* end of NPCTE fix for bugid 4381195 */
-
-            if (elmt.value == SnmpVarBind.endOfMibView) continue;
-
-
-            // Now we need to take the smallest oid ...
-            //
-            int comp = elmt.oid.compareTo(vb.oid);
-            if (comp < 0) {
-              // Take the smallest (lexicographically)
-                //
-                result[index]= elmt;
-            }
-            else {
-                if(comp == 0) {
-                    // Must compare agent used for reply
-                    // Take the deeper within the reply
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                            "updateResult"," oid overlapping. Oid : " +
-                              elmt.oid + "value :" + elmt.value);
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                            "updateResult","Already present varBind : " +
-                              vb);
-                    }
-
-                    SnmpOid oid = vb.oid;
-                    SnmpMibAgent deeperAgent = server.getAgentMib(oid);
-
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                            "updateResult","Deeper agent : " + deeperAgent);
-                    }
-                    if(deeperAgent == agent) {
-                        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                                "updateResult","The current agent is the deeper one. Update the value with the current one");
-                        }
-                        result[index].value = elmt.value;
-                    }
-
-                    /*
-                      Vector v = new Vector();
-                      SnmpMibRequest getReq = createMibRequest(v,
-                      version,
-                      null);
-                      SnmpVarBind realValue = new SnmpVarBind(oid);
-                      getReq.addVarBind(realValue);
-                      try {
-                      deeperAgent.get(getReq);
-                      } catch(SnmpStatusException e) {
-                      e.printStackTrace();
-                      }
-
-                      if(isDebugOn())
-                      trace("updateResult", "Biggest priority value is : " +
-                      realValue.value);
-
-                      result[index].value = realValue.value;
-                    */
-                }
-            }
-        }
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpSubRequestHandler.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,630 +0,0 @@
-/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.daemon;
-
-
-
-// java import
-//
-import java.util.logging.Level;
-import java.util.Vector;
-
-// jmx imports
-//
-import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpEngine;
-
-// SNMP Runtime import
-//
-import com.sun.jmx.snmp.agent.SnmpMibAgent;
-import com.sun.jmx.snmp.agent.SnmpMibRequest;
-import com.sun.jmx.snmp.ThreadContext;
-import com.sun.jmx.snmp.internal.SnmpIncomingRequest;
-
-class SnmpSubRequestHandler implements SnmpDefinitions, Runnable {
-
-    protected SnmpIncomingRequest incRequest = null;
-    protected SnmpEngine engine = null;
-    /**
-     * V3 enabled Adaptor. Each Oid is added using updateRequest method.
-     */
-    protected SnmpSubRequestHandler(SnmpEngine engine,
-                                    SnmpIncomingRequest incRequest,
-                                    SnmpMibAgent agent,
-                                    SnmpPdu req) {
-        this(agent, req);
-        init(engine, incRequest);
-    }
-
-    /**
-     * V3 enabled Adaptor.
-     */
-    protected SnmpSubRequestHandler(SnmpEngine engine,
-                                    SnmpIncomingRequest incRequest,
-                                    SnmpMibAgent agent,
-                                    SnmpPdu req,
-                                    boolean nouse) {
-        this(agent, req, nouse);
-        init(engine, incRequest);
-    }
-    /**
-     * SNMP V1/V2 . To be called with updateRequest.
-     */
-    protected SnmpSubRequestHandler(SnmpMibAgent agent, SnmpPdu req) {
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                "constructor", "creating instance for request " + String.valueOf(req.requestId));
-        }
-
-        version= req.version;
-        type= req.type;
-        this.agent= agent;
-
-        // We get a ref on the pdu in order to pass it to SnmpMibRequest.
-        reqPdu = req;
-
-        //Pre-allocate room for storing varbindlist and translation table.
-        //
-        int length= req.varBindList.length;
-        translation= new int[length];
-        varBind= new NonSyncVector<SnmpVarBind>(length);
-    }
-
-    /**
-     * SNMP V1/V2 The constructor initialize the subrequest with the whole varbind list contained
-     * in the original request.
-     */
-    @SuppressWarnings("unchecked")  // cast to NonSyncVector<SnmpVarBind>
-    protected SnmpSubRequestHandler(SnmpMibAgent agent,
-                                    SnmpPdu req,
-                                    boolean nouse) {
-        this(agent,req);
-
-        // The translation table is easy in this case ...
-        //
-        int max= translation.length;
-        SnmpVarBind[] list= req.varBindList;
-        for(int i=0; i < max; i++) {
-            translation[i]= i;
-            ((NonSyncVector<SnmpVarBind>)varBind).addNonSyncElement(list[i]);
-        }
-    }
-
-    SnmpMibRequest createMibRequest(Vector<SnmpVarBind> vblist,
-                                    int protocolVersion,
-                                    Object userData) {
-
-        // This is an optimization:
-        //    The SnmpMibRequest created in the check() phase is
-        //    reused in the set() phase.
-        //
-        if (type == pduSetRequestPdu && mibRequest != null)
-            return mibRequest;
-
-        //This is a request comming from an SnmpV3AdaptorServer.
-        //Full power.
-        SnmpMibRequest result = null;
-        if(incRequest != null) {
-            result = SnmpMibAgent.newMibRequest(engine,
-                                                reqPdu,
-                                                vblist,
-                                                protocolVersion,
-                                                userData,
-                                                incRequest.getPrincipal(),
-                                                incRequest.getSecurityLevel(),
-                                                incRequest.getSecurityModel(),
-                                                incRequest.getContextName(),
-                                                incRequest.getAccessContext());
-        } else {
-            result = SnmpMibAgent.newMibRequest(reqPdu,
-                                                vblist,
-                                                protocolVersion,
-                                                userData);
-        }
-        // If we're doing the check() phase, we store the SnmpMibRequest
-        // so that we can reuse it in the set() phase.
-        //
-        if (type == pduWalkRequest)
-            mibRequest = result;
-
-        return result;
-    }
-
-    void setUserData(Object userData) {
-        data = userData;
-    }
-
-    public void run() {
-
-        try {
-            final ThreadContext oldContext =
-                ThreadContext.push("SnmpUserData",data);
-            try {
-                switch(type) {
-                case pduGetRequestPdu:
-                    // Invoke a get operation
-                    //
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                            "run", "[" + Thread.currentThread() +
-                              "]:get operation on " + agent.getMibName());
-                    }
-
-                    agent.get(createMibRequest(varBind,version,data));
-                    break;
-
-                case pduGetNextRequestPdu:
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                            "run", "[" + Thread.currentThread() +
-                              "]:getNext operation on " + agent.getMibName());
-                    }
-                    //#ifdef DEBUG
-                    agent.getNext(createMibRequest(varBind,version,data));
-                    break;
-
-                case pduSetRequestPdu:
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                            "run", "[" + Thread.currentThread() +
-                            "]:set operation on " + agent.getMibName());
-                    }
-                    agent.set(createMibRequest(varBind,version,data));
-                    break;
-
-                case pduWalkRequest:
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                            "run", "[" + Thread.currentThread() +
-                            "]:check operation on " + agent.getMibName());
-                    }
-                    agent.check(createMibRequest(varBind,version,data));
-                    break;
-
-                default:
-                    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubRequestHandler.class.getName(),
-                            "run", "[" + Thread.currentThread() +
-                              "]:unknown operation (" +  type + ") on " +
-                              agent.getMibName());
-                    }
-                    errorStatus= snmpRspGenErr;
-                    errorIndex= 1;
-                    break;
-
-                }// end of switch
-
-            } finally {
-                ThreadContext.restore(oldContext);
-            }
-        } catch(SnmpStatusException x) {
-            errorStatus = x.getStatus() ;
-            errorIndex=  x.getErrorIndex();
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubRequestHandler.class.getName(),
-                    "run", "[" + Thread.currentThread() +
-                      "]:an Snmp error occurred during the operation", x);
-            }
-        }
-        catch(Exception x) {
-            errorStatus = SnmpDefinitions.snmpRspGenErr ;
-            if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubRequestHandler.class.getName(),
-                    "run", "[" + Thread.currentThread() +
-                      "]:a generic error occurred during the operation", x);
-            }
-        }
-        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_ADAPTOR_LOGGER.logp(Level.FINER, SnmpSubRequestHandler.class.getName(),
-                "run", "[" + Thread.currentThread() + "]:operation completed");
-        }
-    }
-
-    // -------------------------------------------------------------
-    //
-    // This function does a best-effort to map global error status
-    // to SNMP v1 valid global error status.
-    //
-    // An SnmpStatusException can contain either:
-    // <li> v2 local error codes (that should be stored in the varbind)</li>
-    // <li> v2 global error codes </li>
-    // <li> v1 global error codes </li>
-    //
-    // v2 local error codes (noSuchInstance, noSuchObject) are
-    // transformed in a global v1 snmpRspNoSuchName error.
-    //
-    // v2 global error codes are transformed in the following way:
-    //
-    //    If the request was a GET/GETNEXT then either
-    //         snmpRspNoSuchName or snmpRspGenErr is returned.
-    //
-    //    Otherwise:
-    //      snmpRspNoAccess, snmpRspInconsistentName
-    //               => snmpRspNoSuchName
-    //      snmpRspAuthorizationError, snmpRspNotWritable, snmpRspNoCreation
-    //               => snmpRspReadOnly  (snmpRspNoSuchName for GET/GETNEXT)
-    //      snmpRspWrong*
-    //               => snmpRspBadValue  (snmpRspNoSuchName for GET/GETNEXT)
-    //      snmpRspResourceUnavailable, snmpRspRspCommitFailed,
-    //      snmpRspUndoFailed
-    //                  => snmpRspGenErr
-    //
-    // -------------------------------------------------------------
-    //
-    static final int mapErrorStatusToV1(int errorStatus, int reqPduType) {
-        // Map v2 codes onto v1 codes
-        //
-        if (errorStatus == SnmpDefinitions.snmpRspNoError)
-            return SnmpDefinitions.snmpRspNoError;
-
-        if (errorStatus == SnmpDefinitions.snmpRspGenErr)
-            return SnmpDefinitions.snmpRspGenErr;
-
-        if (errorStatus == SnmpDefinitions.snmpRspNoSuchName)
-            return SnmpDefinitions.snmpRspNoSuchName;
-
-        if ((errorStatus == SnmpStatusException.noSuchInstance) ||
-            (errorStatus == SnmpStatusException.noSuchObject)   ||
-            (errorStatus == SnmpDefinitions.snmpRspNoAccess)    ||
-            (errorStatus == SnmpDefinitions.snmpRspInconsistentName) ||
-            (errorStatus == SnmpDefinitions.snmpRspAuthorizationError)){
-
-            return SnmpDefinitions.snmpRspNoSuchName;
-
-        } else if ((errorStatus ==
-                    SnmpDefinitions.snmpRspAuthorizationError)         ||
-                   (errorStatus == SnmpDefinitions.snmpRspNotWritable)) {
-
-            if (reqPduType == SnmpDefinitions.pduWalkRequest)
-                return SnmpDefinitions.snmpRspReadOnly;
-            else
-                return SnmpDefinitions.snmpRspNoSuchName;
-
-        } else if ((errorStatus == SnmpDefinitions.snmpRspNoCreation)) {
-
-                return SnmpDefinitions.snmpRspNoSuchName;
-
-        } else if ((errorStatus == SnmpDefinitions.snmpRspWrongType)      ||
-                   (errorStatus == SnmpDefinitions.snmpRspWrongLength)    ||
-                   (errorStatus == SnmpDefinitions.snmpRspWrongEncoding)  ||
-                   (errorStatus == SnmpDefinitions.snmpRspWrongValue)     ||
-                   (errorStatus == SnmpDefinitions.snmpRspWrongLength)    ||
-                   (errorStatus ==
-                    SnmpDefinitions.snmpRspInconsistentValue)) {
-
-            if ((reqPduType == SnmpDefinitions.pduSetRequestPdu) ||
-                (reqPduType == SnmpDefinitions.pduWalkRequest))
-                return SnmpDefinitions.snmpRspBadValue;
-            else
-                return SnmpDefinitions.snmpRspNoSuchName;
-
-        } else if ((errorStatus ==
-                    SnmpDefinitions.snmpRspResourceUnavailable) ||
-                   (errorStatus ==
-                    SnmpDefinitions.snmpRspCommitFailed)        ||
-                   (errorStatus == SnmpDefinitions.snmpRspUndoFailed)) {
-
-            return SnmpDefinitions.snmpRspGenErr;
-
-        }
-
-        // At this point we should have a V1 error code
-        //
-        if (errorStatus == SnmpDefinitions.snmpRspTooBig)
-            return SnmpDefinitions.snmpRspTooBig;
-
-        if( (errorStatus == SnmpDefinitions.snmpRspBadValue) ||
-            (errorStatus == SnmpDefinitions.snmpRspReadOnly)) {
-            if ((reqPduType == SnmpDefinitions.pduSetRequestPdu) ||
-                (reqPduType == SnmpDefinitions.pduWalkRequest))
-                return errorStatus;
-            else
-                return SnmpDefinitions.snmpRspNoSuchName;
-        }
-
-        // We have a snmpRspGenErr, or something which is not defined
-        // in RFC1905 => return a snmpRspGenErr
-        //
-        return SnmpDefinitions.snmpRspGenErr;
-
-    }
-
-    // -------------------------------------------------------------
-    //
-    // This function does a best-effort to map global error status
-    // to SNMP v2 valid global error status.
-    //
-    // An SnmpStatusException can contain either:
-    // <li> v2 local error codes (that should be stored in the varbind)</li>
-    // <li> v2 global error codes </li>
-    // <li> v1 global error codes </li>
-    //
-    // v2 local error codes (noSuchInstance, noSuchObject)
-    // should not raise this level: they should have been stored in the
-    // varbind earlier. If they, do there is nothing much we can do except
-    // to transform them into:
-    // <li> a global snmpRspGenErr (if the request is a GET/GETNEXT) </li>
-    // <li> a global snmpRspNoSuchName otherwise. </li>
-    //
-    // v2 global error codes are transformed in the following way:
-    //
-    //    If the request was a GET/GETNEXT then snmpRspGenErr is returned.
-    //    (snmpRspGenErr is the only global error that is expected to be
-    //     raised by a GET/GETNEXT request).
-    //
-    //    Otherwise the v2 code itself is returned
-    //
-    // v1 global error codes are transformed in the following way:
-    //
-    //      snmpRspNoSuchName
-    //               => snmpRspNoAccess  (snmpRspGenErr for GET/GETNEXT)
-    //      snmpRspReadOnly
-    //               => snmpRspNotWritable (snmpRspGenErr for GET/GETNEXT)
-    //      snmpRspBadValue
-    //               => snmpRspWrongValue  (snmpRspGenErr for GET/GETNEXT)
-    //
-    // -------------------------------------------------------------
-    //
-    static final int mapErrorStatusToV2(int errorStatus, int reqPduType) {
-        // Map v1 codes onto v2 codes
-        //
-        if (errorStatus == SnmpDefinitions.snmpRspNoError)
-            return SnmpDefinitions.snmpRspNoError;
-
-        if (errorStatus == SnmpDefinitions.snmpRspGenErr)
-            return SnmpDefinitions.snmpRspGenErr;
-
-        if (errorStatus == SnmpDefinitions.snmpRspTooBig)
-            return SnmpDefinitions.snmpRspTooBig;
-
-        // For get / getNext / getBulk the only global error
-        // (PDU-level) possible is genErr.
-        //
-        if ((reqPduType != SnmpDefinitions.pduSetRequestPdu) &&
-            (reqPduType != SnmpDefinitions.pduWalkRequest)) {
-            if(errorStatus == SnmpDefinitions.snmpRspAuthorizationError)
-                return errorStatus;
-            else
-                return SnmpDefinitions.snmpRspGenErr;
-        }
-
-        // Map to noSuchName
-        //      if ((errorStatus == SnmpDefinitions.snmpRspNoSuchName) ||
-        //   (errorStatus == SnmpStatusException.noSuchInstance) ||
-        //  (errorStatus == SnmpStatusException.noSuchObject))
-        //  return SnmpDefinitions.snmpRspNoSuchName;
-
-        // SnmpStatusException.noSuchInstance and
-        // SnmpStatusException.noSuchObject can't happen...
-
-        if (errorStatus == SnmpDefinitions.snmpRspNoSuchName)
-            return SnmpDefinitions.snmpRspNoAccess;
-
-        // Map to notWritable
-        if (errorStatus == SnmpDefinitions.snmpRspReadOnly)
-                return SnmpDefinitions.snmpRspNotWritable;
-
-        // Map to wrongValue
-        if (errorStatus == SnmpDefinitions.snmpRspBadValue)
-            return SnmpDefinitions.snmpRspWrongValue;
-
-        // Other valid V2 codes
-        if ((errorStatus == SnmpDefinitions.snmpRspNoAccess) ||
-            (errorStatus == SnmpDefinitions.snmpRspInconsistentName) ||
-            (errorStatus == SnmpDefinitions.snmpRspAuthorizationError) ||
-            (errorStatus == SnmpDefinitions.snmpRspNotWritable) ||
-            (errorStatus == SnmpDefinitions.snmpRspNoCreation) ||
-            (errorStatus == SnmpDefinitions.snmpRspWrongType) ||
-            (errorStatus == SnmpDefinitions.snmpRspWrongLength) ||
-            (errorStatus == SnmpDefinitions.snmpRspWrongEncoding) ||
-            (errorStatus == SnmpDefinitions.snmpRspWrongValue) ||
-            (errorStatus == SnmpDefinitions.snmpRspWrongLength) ||
-            (errorStatus == SnmpDefinitions.snmpRspInconsistentValue) ||
-            (errorStatus == SnmpDefinitions.snmpRspResourceUnavailable) ||
-            (errorStatus == SnmpDefinitions.snmpRspCommitFailed) ||
-            (errorStatus == SnmpDefinitions.snmpRspUndoFailed))
-            return errorStatus;
-
-        // Ivalid V2 code => genErr
-        return SnmpDefinitions.snmpRspGenErr;
-    }
-
-    static final int mapErrorStatus(int errorStatus,
-                                    int protocolVersion,
-                                    int reqPduType) {
-        if (errorStatus == SnmpDefinitions.snmpRspNoError)
-            return SnmpDefinitions.snmpRspNoError;
-
-        // Too bad, an error occurs ... we need to translate it ...
-        //
-        if (protocolVersion == SnmpDefinitions.snmpVersionOne)
-            return mapErrorStatusToV1(errorStatus,reqPduType);
-        if (protocolVersion == SnmpDefinitions.snmpVersionTwo ||
-            protocolVersion == SnmpDefinitions.snmpVersionThree)
-            return mapErrorStatusToV2(errorStatus,reqPduType);
-
-        return SnmpDefinitions.snmpRspGenErr;
-    }
-
-    /**
-     * The method returns the error status of the operation.
-     * The method takes into account the protocol version.
-     */
-    protected int getErrorStatus() {
-        if (errorStatus == snmpRspNoError)
-            return snmpRspNoError;
-
-        return mapErrorStatus(errorStatus,version,type);
-    }
-
-    /**
-     * The method returns the error index as a position in the var bind list.
-     * The value returned by the method corresponds to the index in the original
-     * var bind list as received by the SNMP protocol adaptor.
-     */
-    protected int getErrorIndex() {
-        if  (errorStatus == snmpRspNoError)
-            return -1;
-
-        // An error occurs. We need to be carefull because the index
-        // we are getting is a valid SNMP index (so range starts at 1).
-        // FIX ME: Shall we double-check the range here ?
-        // The response is : YES :
-        if ((errorIndex == 0) || (errorIndex == -1))
-            errorIndex = 1;
-
-        return translation[errorIndex -1];
-    }
-
-    /**
-     * The method updates the varbind list of the subrequest.
-     */
-    protected  void updateRequest(SnmpVarBind var, int pos) {
-        int size= varBind.size();
-        translation[size]= pos;
-        varBind.addElement(var);
-    }
-
-    /**
-     * The method updates a given var bind list with the result of a
-     * previsouly invoked operation.
-     * Prior to calling the method, one must make sure that the operation was
-     * successful. As such the method getErrorIndex or getErrorStatus should be
-     * called.
-     */
-    protected void updateResult(SnmpVarBind[] result) {
-
-        if (result == null) return;
-        final int max=varBind.size();
-        final int len=result.length;
-        for(int i= 0; i< max ; i++) {
-            // bugId 4641694: must check position in order to avoid
-            //       ArrayIndexOutOfBoundException
-            final int pos=translation[i];
-            if (pos < len) {
-                result[pos] =
-                    (SnmpVarBind)((NonSyncVector)varBind).elementAtNonSync(i);
-            } else {
-                if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
-                    SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubRequestHandler.class.getName(),
-                        "updateResult","Position `"+pos+"' is out of bound...");
-                }
-            }
-        }
-    }
-
-    private void init(SnmpEngine engine,
-                      SnmpIncomingRequest incRequest) {
-        this.incRequest = incRequest;
-        this.engine = engine;
-    }
-
-    // PRIVATE VARIABLES
-    //------------------
-
-    /**
-     * Store the protocol version to handle
-     */
-    protected int version= snmpVersionOne;
-
-    /**
-     * Store the operation type. Remember if the type is Walk, it means
-     * that we have to invoke the check method ...
-     */
-    protected int type= 0;
-
-    /**
-     * Agent directly handled by the sub-request handler.
-     */
-    protected SnmpMibAgent agent;
-
-    /**
-     * Error status.
-     */
-    protected int errorStatus= snmpRspNoError;
-
-    /**
-     * Index of error.
-     * A value of -1 means no error.
-     */
-    protected int errorIndex= -1;
-
-    /**
-     * The varbind list specific to the current sub request.
-     * The vector must contain object of type SnmpVarBind.
-     */
-    protected Vector<SnmpVarBind> varBind;
-
-    /**
-     * The array giving the index translation between the content of
-     * <VAR>varBind</VAR> and the varbind list as specified in the request.
-     */
-    protected int[] translation;
-
-    /**
-     * Contextual object allocated by the SnmpUserDataFactory.
-     **/
-    protected Object data;
-
-    /**
-     * The SnmpMibRequest that will be passed to the agent.
-     *
-     **/
-    private   SnmpMibRequest mibRequest = null;
-
-    /**
-     * The SnmpPdu that will be passed to the request.
-     *
-     **/
-    private   SnmpPdu reqPdu = null;
-
-    // All the methods of the Vector class are synchronized.
-    // Synchronization is a very expensive operation. In our case it is not always
-    // required...
-    //
-    @SuppressWarnings("serial")  // we never serialize this
-    class NonSyncVector<E> extends Vector<E> {
-
-        public NonSyncVector(int size) {
-            super(size);
-        }
-
-        final void addNonSyncElement(E obj) {
-            ensureCapacity(elementCount + 1);
-            elementData[elementCount++] = obj;
-        }
-
-        @SuppressWarnings("unchecked")  // cast to E
-        final E elementAtNonSync(int index) {
-            return (E) elementData[index];
-        }
-    };
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/package.html	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<HTML>
-<HEAD>
-<!--
-
-Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-</HEAD>
-<BODY>
-Provides the classes implementing the <B>communication</B>.
-<p><b>This API is a Sun Microsystems internal API  and is subject 
-   to change without notice.</b></p>
-</BODY>
-</HTML>
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/defaults/DefaultPaths.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,245 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.defaults;
-
-
-// java import
-//
-import java.io.File;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.StringTokenizer;
-
-/**
- * This class represents a set of default directories used by Java DMK.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public class DefaultPaths {
-    private static final String INSTALL_PATH_RESOURCE_NAME = "com/sun/jdmk/defaults/install.path";
-    // private constructor defined to "hide" the default public constructor
-    private DefaultPaths() {
-
-    }
-
-    // PUBLIC STATIC METHODS
-    //----------------------
-
-    /**
-     * Returns the installation directory for Java DMK.
-     *
-     * The default value of the installation directory is:
-     * <CODE>&lt;base_dir&gt; + File.separator + SUNWjdmk + File.separator + jdmk5.0 </CODE>
-     *
-     * @return Java DMK installation directory.
-     */
-    public static String getInstallDir() {
-        if (installDir == null)
-            return useRessourceFile();
-        else
-            return installDir;
-    }
-
-    /**
-     * Returns the installation directory for Java DMK concatenated with dirname.
-     *
-     * The default value of the installation directory is:
-     * <CODE>&lt;base_dir&gt; + File.separator + SUNWjdmk + File.separator + jdmk5.0 </CODE>
-     *
-     * @param dirname The directory to be appended.
-     *
-     * @return Java DMK installation directory + <CODE>File.separator</CODE> + <CODE>dirname</CODE>.
-     */
-    public static String getInstallDir(String dirname) {
-        if (installDir == null) {
-            if (dirname == null) {
-                return getInstallDir();
-            } else {
-                return getInstallDir() + File.separator + dirname;
-            }
-        } else {
-            if (dirname == null) {
-                return installDir;
-            } else {
-                return installDir + File.separator + dirname;
-            }
-        }
-    }
-
-    /**
-     * Sets the installation directory for Java DMK.
-     *
-     * @param dirname The directory where Java DMK resides.
-     */
-    public static void setInstallDir(String dirname) {
-        installDir = dirname;
-    }
-
-    /**
-     * Returns the <CODE>etc</CODE> directory for Java DMK.
-     * <P>
-     * The default value of the <CODE>etc</CODE> directory is:
-     * <UL>
-     * <LI><CODE>DefaultPaths.getInstallDir("etc")</CODE>.
-     * </UL>
-     *
-     * @return Java DMK <CODE>etc</CODE> directory.
-     */
-    public static String getEtcDir() {
-        if (etcDir == null)
-            return getInstallDir("etc");
-        else
-            return etcDir;
-    }
-
-    /**
-     * Returns the <CODE>etc</CODE> directory for Java DMK concatenated with dirname.
-     * <P>
-     * The default value of the <CODE>etc</CODE> directory is:
-     * <UL>
-     * <LI><CODE>DefaultPaths.getInstallDir("etc")</CODE>.
-     * </UL>
-     *
-     * @param dirname The directory to be appended.
-     *
-     * @return Java DMK <CODE>etc</CODE> directory + <CODE>File.separator</CODE> + <CODE>dirname</CODE>.
-     */
-    public static String getEtcDir(String dirname) {
-        if (etcDir == null) {
-            if (dirname == null) {
-                return getEtcDir();
-            } else {
-                return getEtcDir() + File.separator + dirname;
-            }
-        } else {
-            if (dirname == null) {
-                return etcDir;
-            } else {
-                return etcDir + File.separator + dirname;
-            }
-        }
-    }
-
-    /**
-     * Sets the <CODE>etc</CODE> directory for Java DMK.
-     *
-     * @param dirname The <CODE>etc</CODE> directory for Java DMK.
-     */
-    public static void setEtcDir(String dirname) {
-        etcDir = dirname;
-    }
-
-    /**
-     * Returns the <CODE>tmp</CODE> directory for the product.
-     * <P>
-     * The default value of the <CODE>tmp</CODE> directory is:
-     * <UL>
-     * <LI><CODE>DefaultPaths.getInstallDir("tmp")</CODE>.
-     * </UL>
-     *
-     * @return Java DMK <CODE>tmp</CODE> directory.
-     */
-    public static String getTmpDir() {
-         if (tmpDir == null)
-            return getInstallDir("tmp");
-        else
-            return tmpDir;
-    }
-
-    /**
-     * Returns the <CODE>tmp</CODE> directory for Java DMK concatenated with dirname.
-     * <P>
-     * The default value of the <CODE>tmp</CODE> directory is:
-     * <UL>
-     * <LI><CODE>DefaultPaths.getInstallDir("tmp")</CODE>.
-     * </UL>
-     *
-     * @param dirname The directory to be appended.
-     *
-     * @return Java DMK <CODE>tmp</CODE> directory + <CODE>File.separator</CODE> + <CODE>dirname</CODE>.
-     */
-    public static String getTmpDir(String dirname) {
-        if (tmpDir == null) {
-            if (dirname == null) {
-                return getTmpDir();
-            } else {
-                return getTmpDir() + File.separator + dirname;
-            }
-        } else {
-            if (dirname == null) {
-                return tmpDir;
-            } else {
-                return tmpDir + File.separator + dirname;
-            }
-        }
-    }
-
-    /**
-     * Sets the <CODE>tmp</CODE> directory for the product
-     *
-     * @param dirname The <CODE>tmp</CODE> directory for Java DMK.
-     */
-    public static void setTmpDir(String dirname) {
-        tmpDir = dirname;
-    }
-
-
-    // PRIVATE STATIC METHODS
-    //-----------------------
-
-    private static String useRessourceFile() {
-        InputStream in = null;
-        BufferedReader r = null;
-        try {
-            in =
-                DefaultPaths.class.getClassLoader().getResourceAsStream(INSTALL_PATH_RESOURCE_NAME);
-            if(in == null) return null;
-            r = new BufferedReader(new InputStreamReader(in));
-            installDir = r.readLine();
-        }catch(Exception e) {
-        }
-        finally {
-            try {
-                if(in != null) in.close();
-                if(r != null) r.close();
-            }catch(Exception e) {}
-        }
-        return installDir;
-    }
-
-    // PRIVATE VARIABLES
-    //------------------
-
-    /**
-     * Directories used by Java DMK.
-     */
-    private static String etcDir;
-    private static String tmpDir;
-    private static String installDir;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/defaults/SnmpProperties.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-/*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.defaults;
-
-// java import
-//
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.IOException;
-import java.util.Properties;
-import java.util.Enumeration;
-
-/**
- * This class reads a file containing the property list defined for Java DMK
- * and adds all the read properties to the list of system properties.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- *
- * @since 1.5
- */
-public class SnmpProperties {
-
-    // private constructor defined to "hide" the default public constructor
-    private SnmpProperties() {
-    }
-
-    // PUBLIC STATIC METHODS
-    //----------------------
-
-    /**
-     * Reads the Java DMK property list from a file and
-     * adds the read properties as system properties.
-     */
-    public static void load(String file) throws IOException {
-        Properties props = new Properties();
-        InputStream is = new FileInputStream(file);
-        props.load(is);
-        is.close();
-        for (final Enumeration<?> e = props.keys(); e.hasMoreElements() ; ) {
-            final String key = (String) e.nextElement();
-            System.setProperty(key,props.getProperty(key));
-        }
-    }
-
-    // PUBLIC STATIC VARIABLES
-    //------------------------
-
-    /**
-     * References the property that specifies the directory where
-     * the native libraries will be stored before the MLet Service
-     * loads them into memory.
-     * <p>
-     * Property Name: <B>jmx.mlet.library.dir</B>
-     */
-    public static final String MLET_LIB_DIR = "jmx.mlet.library.dir";
-
-    /**
-     * References the property that specifies the ACL file
-     * used by the SNMP protocol adaptor.
-     * <p>
-     * Property Name: <B>jdmk.acl.file</B>
-     */
-    public static final String ACL_FILE = "jdmk.acl.file";
-
-    /**
-     * References the property that specifies the Security file
-     * used by the SNMP protocol adaptor.
-     * <p>
-     * Property Name: <B>jdmk.security.file</B>
-     */
-    public static final String SECURITY_FILE = "jdmk.security.file";
-
-    /**
-     * References the property that specifies the User ACL file
-     * used by the SNMP protocol adaptor.
-     * <p>
-     * Property Name: <B>jdmk.uacl.file</B>
-     */
-    public static final String UACL_FILE = "jdmk.uacl.file";
-
-    /**
-     * References the property that specifies the default mib_core file
-     * used by the mibgen compiler.
-     * <p>
-     * Property Name: <B>mibcore.file</B>
-     */
-    public static final String MIB_CORE_FILE = "mibcore.file";
-
-    /**
-     * References the property that specifies the full name of the JMX
-     * specification implemented by this product.
-     * <p>
-     * Property Name: <B>jmx.specification.name</B>
-     */
-     public static final String JMX_SPEC_NAME = "jmx.specification.name";
-
-    /**
-     * References the property that specifies the version of the JMX
-     * specification implemented by this product.
-     * <p>
-     * Property Name: <B>jmx.specification.version</B>
-     */
-     public static final String JMX_SPEC_VERSION = "jmx.specification.version";
-
-    /**
-     * References the property that specifies the vendor of the JMX
-     * specification implemented by this product.
-     * <p>
-     * Property Name: <B>jmx.specification.vendor</B>
-     */
-     public static final String JMX_SPEC_VENDOR = "jmx.specification.vendor";
-
-    /**
-     * References the property that specifies the full name of this product
-     * implementing the  JMX specification.
-     * <p>
-     * Property Name: <B>jmx.implementation.name</B>
-     */
-    public static final String JMX_IMPL_NAME = "jmx.implementation.name";
-
-    /**
-     * References the property that specifies the name of the vendor of this product
-     * implementing the  JMX specification.
-     * <p>
-     * Property Name: <B>jmx.implementation.vendor</B>
-     */
-    public static final String JMX_IMPL_VENDOR = "jmx.implementation.vendor";
-
-    /**
-     * References the property that specifies the version of this product
-     * implementing the  JMX specification.
-     * <p>
-     * Property Name: <B>jmx.implementation.version</B>
-     */
-    public static final String JMX_IMPL_VERSION = "jmx.implementation.version";
-
-    /**
-     * References the property that specifies the SSL cipher suites to
-     * be enabled by the HTTP/SSL connector.
-     * <p>
-     * Property Name: <B>jdmk.ssl.cipher.suite.</B>
-     * <p>
-     * The list of SSL cipher suites is specified in the format:
-     * <p>
-     * <DD><B>jdmk.ssl.cipher.suite.</B>&lt;n&gt;<B>=</B>&lt;cipher suite name&gt;</DD>
-     * <p>
-     * For example:
-     * <p>
-     * <DD>jdmk.ssl.cipher.suite.1=SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA</DD>
-     * <DD>jdmk.ssl.cipher.suite.2=SSL_RSA_EXPORT_WITH_RC4_40_MD5</DD>
-     * <DD>. . .</DD>
-     */
-    public static final String SSL_CIPHER_SUITE = "jdmk.ssl.cipher.suite.";
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/defaults/package.html	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<HTML>
-<HEAD>
-<!--
- 
-Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-</HEAD>
-<BODY>
-    Provides specific classes to <B>Sun JMX Tools Contribution</B>: Utility classes.
-<p><b>This API is a Sun Microsystems internal API  and is subject 
-   to change without notice.</b></p>
-</BODY>
-</HTML>
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpAccessControlModel.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.internal;
-
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpPdu;
-/**
- * Access Control Model interface. Every access control model must implement this interface in order to be integrated in the engine based framework.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpAccessControlModel extends SnmpModel {
-    /**
-     * Method called by the dispatcher in order to control the access at an <CODE>SnmpOid</CODE> Level. If access is not allowed, an <CODE>SnmpStatusException</CODE> is thrown.
-     * This method is called after the <CODE>checkPduAccess</CODE> pdu based method.
-     * @param version The SNMP protocol version number.
-     * @param principal The request principal.
-     * @param securityLevel The request security level as defined in <CODE>SnmpEngine</CODE>.
-     * @param pduType The pdu type (get, set, ...).
-     * @param securityModel The security model ID.
-     * @param contextName The access control context name.
-     * @param oid The OID to check.
-     */
-    public void checkAccess(int version,
-                            String principal,
-                            int securityLevel,
-                            int pduType,
-                            int securityModel,
-                            byte[] contextName,
-                            SnmpOid oid)
-        throws SnmpStatusException;
-    /**
-     * Method called by the dispatcher in order to control the access at an SNMP pdu Level. If access is not allowed, an <CODE>SnmpStatusException</CODE> is thrown. In case of exception, the access control is aborted. OIDs are not checked.
-     * This method should be called prior to the <CODE>checkAccess</CODE> OID based method.
-     * @param version The SNMP protocol version number.
-     * @param principal The request principal.
-     * @param securityLevel The request security level as defined in <CODE>SnmpEngine</CODE>.
-     * @param pduType The pdu type (get, set, ...).
-     * @param securityModel The security model ID.
-     * @param contextName The access control context name.
-     * @param pdu The pdu to check.
-     */
-    public void checkPduAccess(int version,
-                               String principal,
-                               int securityLevel,
-                               int pduType,
-                               int securityModel,
-                               byte[] contextName,
-                               SnmpPdu pdu)
-        throws SnmpStatusException;
-
-    /**
-     * Enable SNMP V1 and V2 set requests. Be aware that can lead to a security hole in a context of SNMP V3 management. By default SNMP V1 and V2 set requests are not authorized.
-     * @return boolean True the activation suceeded.
-     */
-    public boolean enableSnmpV1V2SetRequest();
-    /**
-     * Disable SNMP V1 and V2 set requests. By default SNMP V1 and V2 set requests are not authorized.
-     * @return boolean True the deactivation suceeded.
-     */
-    public boolean disableSnmpV1V2SetRequest();
-
-    /**
-     * The SNMP V1 and V2 set requests authorization status. By default SNMP V1 and V2 set requests are not authorized.
-     * @return boolean True SNMP V1 and V2 requests are authorized.
-     */
-    public boolean isSnmpV1V2SetRequestAuthorized();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpAccessControlSubSystem.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.internal;
-
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpUnknownAccContrModelException;
-/**
- * Access Control sub system interface. To allow engine integration, an Access Control sub system must implement this interface.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpAccessControlSubSystem extends SnmpSubSystem {
-
-    /**
-     * Method called by the dispatcher in order to control the access at an SNMP pdu Level.
-     * <P> This call is routed by the sub system to the target model according to the SNMP protocol version number.</P>
-     * @param version The SNMP protocol version number.
-     * @param principal The request principal.
-     * @param securityLevel The request security level as defined in <CODE>SnmpEngine</CODE>.
-     * @param pduType The pdu type (get, set, ...).
-     * @param securityModel The security model ID.
-     * @param contextName The access control context name.
-     * @param pdu The pdu to check.
-     */
-    public void checkPduAccess(int version,
-                               String principal,
-                               int securityLevel,
-                               int pduType,
-                               int securityModel,
-                               byte[] contextName,
-                               SnmpPdu pdu) throws SnmpStatusException, SnmpUnknownAccContrModelException;
-    /**
-     * Method called by the dispatcher in order to control the access at an <CODE>SnmpOid</CODE> Level.
-     * This method is called after the <CODE>checkPduAccess</CODE> pdu based method.
-     * <P> This call is routed by the sub system to the target model according to the SNMP protocol version number.</P>
-     * @param version The SNMP protocol version number.
-     * @param principal The request principal.
-     * @param securityLevel The request security level as defined in <CODE>SnmpEngine</CODE>.
-     * @param pduType The pdu type (get, set, ...).
-     * @param securityModel The security model ID.
-     * @param contextName The access control context name.
-     * @param oid The OID to check.
-     */
-    public void checkAccess(int version,
-                            String principal,
-                            int securityLevel,
-                            int pduType,
-                            int securityModel,
-                            byte[] contextName,
-                            SnmpOid oid) throws SnmpStatusException, SnmpUnknownAccContrModelException;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpDecryptedPdu.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.internal;
-/**
- * Class returned by <CODE>SnmpSecuritySubSystem</CODE> and <CODE>SnmpSecurityModel</CODE>. If privacy is applied, the received pdu must be decrypted. This class contains the field of of a decrypted scoped pdu.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-
-public class SnmpDecryptedPdu {
-    /**
-     * Decrypted pdu data.
-     */
-    public byte[] data = null;
-    /**
-     * Decrypted pdu data length.
-     */
-    public int dataLength = 0;
-    /**
-     * Decrypted context name.
-     */
-    public byte[] contextName = null;
-    /**
-     * Decrypted context engine Id.
-     */
-    public byte[] contextEngineId = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpEngineImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,424 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.internal;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Hashtable;
-import java.util.logging.Level;
-import java.io.Serializable;
-
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpEngineId;
-import com.sun.jmx.snmp.SnmpEngine;
-import com.sun.jmx.snmp.SnmpUsmKeyHandler;
-import com.sun.jmx.snmp.SnmpEngineFactory;
-import com.sun.jmx.snmp.SnmpUnknownModelException;
-
-import com.sun.jmx.snmp.internal.SnmpTools;
-import com.sun.jmx.snmp.SnmpBadSecurityLevelException;
-import static com.sun.jmx.defaults.JmxProperties.SNMP_LOGGER;
-
-/**
- * This engine is conformant with the RFC 2571. It is the main object within
- * an SNMP entity (agent, manager...).
- * To an engine is associated an {@link com.sun.jmx.snmp.SnmpEngineId}.
- * The way the engineId is retrieved is linked to the way the engine is
- * instantiated. See each <CODE>SnmpEngine</CODE> constructor for more details.
- * An engine is composed of a set of sub systems
- * {@link com.sun.jmx.snmp.internal.SnmpSubSystem}. An <CODE>SNMP</CODE>
- * engine can contain a:
- *<ul>
- *<li> Message Processing Sub System :
- * {@link com.sun.jmx.snmp.internal.SnmpMsgProcessingSubSystem}</li>
- *<li> Security Sub System :
- * {@link com.sun.jmx.snmp.internal.SnmpSecuritySubSystem} </li>
- *<li> Access Control Sub System :
- * {@link com.sun.jmx.snmp.internal.SnmpAccessControlSubSystem}</li>
- *</ul>
- *<P> Each sub system contains a set of models. A model is an implementation
- * of a particular treatement (eg: the User based Security Model defined in
- * RFC 2574 is a functional element dealing with authentication and privacy).
- *</P>
- * Engine instantiation is based on a factory. This factory, implementing
- * mandatorily {@link com.sun.jmx.snmp.SnmpEngineFactory  SnmpEngineFactory}
- * is set in the method <CODE>setFactory</CODE>.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public class SnmpEngineImpl implements SnmpEngine, Serializable {
-    private static final long serialVersionUID = -2564301391365614725L;
-
-    /**
-     * Security level. No authentication, no privacy. Value is 0,
-     * as defined in RFC 2572
-     */
-    public static final int noAuthNoPriv = 0;
-    /**
-     * Security level. Authentication, no privacy. Value is 1, as
-     * defined in RFC 2572
-     */
-    public static final int authNoPriv = 1;
-    /**
-     * Security level. Authentication, privacy. Value is 3,
-     * as defined in RFC 2572
-     */
-    public static final int authPriv = 3;
-    /**
-     * Flag that indicates that a report is to be sent. Value is 4, as defined in RFC 2572
-     */
-    public static final int reportableFlag = 4;
-
-    /**
-     * Mask used to isolate authentication information within a message flag.
-     */
-    public static final int authMask = 1;
-    /**
-     * Mask used to isolate privacy information within a message flag.
-     */
-    public static final int privMask = 2;
-    /**
-     * Mask used to isolate authentication and privacy information within a message flag.
-     */
-    public static final int authPrivMask = 3;
-
-    private SnmpEngineId engineid = null;
-    private SnmpEngineFactory factory = null;
-    private long startTime = 0;
-
-    private int boot = 0;
-    private boolean checkOid = false;
-
-    transient private SnmpUsmKeyHandler usmKeyHandler = null;
-    transient private SnmpLcd lcd = null;
-
-    transient private SnmpSecuritySubSystem securitySub = null;
-
-    transient private SnmpMsgProcessingSubSystem messageSub = null;
-
-    transient private SnmpAccessControlSubSystem accessSub = null;
-
-    /**
-     * Gets the engine time in seconds. This is the time from the last reboot.
-     * @return The time from the last reboot.
-     */
-    public synchronized int getEngineTime() {
-        //We do the counter wrap in a lazt way. Each time Engine is asked for his time it checks. So if nobody use the Engine, the time can wrap and wrap again without incrementing nb boot. We can imagine that it is irrelevant due to the amount of time needed to wrap.
-        long delta = (System.currentTimeMillis() / 1000) - startTime;
-        if(delta >  0x7FFFFFFF) {
-            //67 years of running. That is a great thing!
-            //Reinitialize startTime.
-            startTime = System.currentTimeMillis() / 1000;
-
-            //Can't do anything with this counter.
-            if(boot != 0x7FFFFFFF)
-                boot += 1;
-            //Store for future use.
-            storeNBBoots(boot);
-        }
-
-        return (int) ((System.currentTimeMillis() / 1000) - startTime);
-    }
-
-    /**
-     * Gets the engine Id. This is unique for each engine.
-     * @return The engine Id object.
-     */
-    public SnmpEngineId getEngineId() {
-        return engineid;
-    }
-
-    /**
-     * Gets the Usm key handler.
-     * @return The key handler.
-     */
-    public SnmpUsmKeyHandler getUsmKeyHandler() {
-        return usmKeyHandler;
-    }
-
-    /**
-     * Gets the engine Lcd.
-     * @return The engine Lcd.
-     */
-    public SnmpLcd getLcd() {
-        return lcd;
-    }
-    /**
-     * Gets the engine boot number. This is the number of time this engine has rebooted. Each time an <CODE>SnmpEngine</CODE> is instantiated, it will read this value in its Lcd, and store back the value incremented by one.
-     * @return The engine's number of reboot.
-     */
-    public int getEngineBoots() {
-        return boot;
-    }
-
-     /**
-     * Constructor. A Local Configuration Datastore is passed to the engine. It will be used to store and retrieve data (engine Id, engine boots).
-     * <P> WARNING : The SnmpEngineId is computed as follow:
-     * <ul>
-     * <li> If an lcd file is provided containing the property "localEngineID", this property value is used.</li>.
-     * <li> If not, if the passed engineID is not null, this engine ID is used.</li>
-     * <li> If not, a time based engineID is computed.</li>
-     * </ul>
-     * This constructor should be called by an <CODE>SnmpEngineFactory</CODE>. Don't call it directly.
-     * @param fact The factory used to instantiate this engine.
-     * @param lcd The local configuration datastore.
-     * @param engineid The engine ID to use. If null is provided, an SnmpEngineId is computed using the current time.
-     * @throws UnknownHostException Exception thrown, if the host name located in the property "localEngineID" is invalid.
-     */
-    public SnmpEngineImpl(SnmpEngineFactory fact,
-                          SnmpLcd lcd,
-                          SnmpEngineId engineid) throws UnknownHostException {
-
-        init(lcd, fact);
-        initEngineID();
-        if(this.engineid == null) {
-            if(engineid != null)
-                this.engineid = engineid;
-            else
-                this.engineid = SnmpEngineId.createEngineId();
-        }
-        lcd.storeEngineId(this.engineid);
-        if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_LOGGER.logp(Level.FINER, SnmpEngineImpl.class.getName(),
-                    "SnmpEngineImpl(SnmpEngineFactory,SnmpLcd,SnmpEngineId)",
-                    "LOCAL ENGINE ID: " + this.engineid);
-        }
-    }
-    /**
-     * Constructor. A Local Configuration Datastore is passed to the engine. It will be used to store and retrieve data (engine ID, engine boots).
-     * <P> WARNING : The SnmpEngineId is computed as follow:
-     * <ul>
-     * <li> If an lcd file is provided containing the property "localEngineID", this property value is used.</li>.
-     * <li> If not, the passed address and port are used to compute one.</li>
-     * </ul>
-     * This constructor should be called by an <CODE>SnmpEngineFactory</CODE>. Don't call it directly.
-     * @param fact The factory used to instantiate this engine.
-     * @param lcd The local configuration datastore.
-     * @param port UDP port to use in order to calculate the engine ID.
-     * @param address An IP address used to calculate the engine ID.
-     * @throws UnknownHostException Exception thrown, if the host name located in the property "localEngineID" is invalid.
-     */
-    public SnmpEngineImpl(SnmpEngineFactory fact,
-                          SnmpLcd lcd,
-                          InetAddress address,
-                          int port) throws UnknownHostException {
-        init(lcd, fact);
-        initEngineID();
-        if(engineid == null)
-            engineid = SnmpEngineId.createEngineId(address, port);
-
-        lcd.storeEngineId(engineid);
-
-        if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_LOGGER.logp(Level.FINER, SnmpEngineImpl.class.getName(),
-                    "SnmpEngineImpl(SnmpEngineFactory,SnmpLcd,InetAddress,int)",
-                    "LOCAL ENGINE ID: " + engineid + " / " +
-                    "LOCAL ENGINE NB BOOTS: " + boot + " / " +
-                    "LOCAL ENGINE START TIME: " + getEngineTime());
-        }
-    }
-
-    /**
-     * Constructor. A Local Configuration Datastore is passed to the engine. It will be used to store and retrieve data (engine ID, engine boots).
-     * <P> WARNING : The SnmpEngineId is computed as follow:
-     * <ul>
-     * <li> If an lcd file is provided containing the property "localEngineID", this property value is used.</li>.
-     * <li> If not, The passed port is used to compute one.</li>
-     * </ul>
-     * This constructor should be called by an <CODE>SnmpEngineFactory</CODE>. Don't call it directly.
-     * @param fact The factory used to instantiate this engine.
-     * @param lcd The local configuration datastore
-     * @param port UDP port to use in order to calculate the engine ID.
-     * @throws UnknownHostException Exception thrown, if the host name located in the property "localEngineID" is invalid.
-     */
-    public SnmpEngineImpl(SnmpEngineFactory fact,
-                          SnmpLcd lcd,
-                          int port) throws UnknownHostException {
-        init(lcd, fact);
-        initEngineID();
-        if(engineid == null)
-           engineid = SnmpEngineId.createEngineId(port);
-
-        lcd.storeEngineId(engineid);
-
-        if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_LOGGER.logp(Level.FINER, SnmpEngineImpl.class.getName(),
-                    "SnmpEngineImpl(SnmpEngineFactory,SnmpLcd,int)",
-                    "LOCAL ENGINE ID: " + engineid + " / " +
-                    "LOCAL ENGINE NB BOOTS: " + boot + " / " +
-                    "LOCAL ENGINE START TIME: " + getEngineTime());
-        }
-    }
-
-    /**
-     * Constructor. A Local Configuration Datastore is passed to the engine. It will be used to store and retrieve data (engine ID, engine boots).
-     * <P> WARNING : The SnmpEngineId is computed as follow:
-     * <ul>
-     * <li> If an lcd file is provided containing the property "localEngineID", this property value is used.</li>.
-     * <li> If not, a time based engineID is computed.</li>
-     * </ul>
-     * When no configuration nor java property is set for the engine ID value, a unique time based engine ID will be generated.
-     * This constructor should be called by an <CODE>SnmpEngineFactory</CODE>. Don't call it directly.
-     * @param fact The factory used to instantiate this engine.
-     * @param lcd The local configuration datastore.
-     */
-    public SnmpEngineImpl(SnmpEngineFactory fact,
-                          SnmpLcd lcd) throws UnknownHostException {
-        init(lcd, fact);
-        initEngineID();
-        if(engineid == null)
-            engineid = SnmpEngineId.createEngineId();
-
-        lcd.storeEngineId(engineid);
-
-        if (SNMP_LOGGER.isLoggable(Level.FINER)) {
-            SNMP_LOGGER.logp(Level.FINER, SnmpEngineImpl.class.getName(),
-                    "SnmpEngineImpl(SnmpEngineFactory,SnmpLcd)",
-                    "LOCAL ENGINE ID: " + engineid + " / " +
-                    "LOCAL ENGINE NB BOOTS: " + boot + " / " +
-                    "LOCAL ENGINE START TIME: " + getEngineTime());
-        }
-    }
-
-    /**
-     * Access Control will check the oids. By default is false.
-     */
-    public synchronized void activateCheckOid() {
-        checkOid = true;
-    }
-
-    /**
-     * Access Control will not check the oids. By default is false.
-     */
-    public synchronized void deactivateCheckOid() {
-        checkOid = false;
-    }
-
-    /**
-     * Access Control check or not the oids. By default is false.
-     */
-    public synchronized boolean isCheckOidActivated() {
-        return checkOid;
-    }
-
-    //Do some check and store the nb boots value.
-    private void storeNBBoots(int boot) {
-        if(boot < 0 || boot == 0x7FFFFFFF) {
-            boot = 0x7FFFFFFF;
-            lcd.storeEngineBoots(boot);
-        }
-        else
-            lcd.storeEngineBoots(boot + 1);
-    }
-
-    // Initialize internal status.
-    private void init(SnmpLcd lcd, SnmpEngineFactory fact) {
-        this.factory = fact;
-        this.lcd = lcd;
-        boot = lcd.getEngineBoots();
-
-        if(boot == -1 || boot == 0)
-            boot = 1;
-
-        storeNBBoots(boot);
-
-        startTime = System.currentTimeMillis() / 1000;
-
-    }
-
-    void setUsmKeyHandler(SnmpUsmKeyHandler usmKeyHandler) {
-        this.usmKeyHandler = usmKeyHandler;
-    }
-
-    //Initialize the engineID.
-    private void initEngineID() throws UnknownHostException {
-        String id = lcd.getEngineId();
-        if(id != null) {
-            engineid = SnmpEngineId.createEngineId(id);
-        }
-    }
-
-
-    /**
-     * Returns the Message Processing Sub System.
-     * @return The Message Processing Sub System.
-     */
-    public SnmpMsgProcessingSubSystem getMsgProcessingSubSystem() {
-        return messageSub;
-    }
-
-    /**
-     * Sets the Message Processing Sub System.
-     * @param sys The Message Processing Sub System.
-     */
-    public void setMsgProcessingSubSystem(SnmpMsgProcessingSubSystem sys) {
-        messageSub = sys;
-    }
-
-     /**
-     * Returns the Security Sub System.
-     * @return The Security Sub System.
-     */
-    public SnmpSecuritySubSystem getSecuritySubSystem() {
-        return securitySub;
-    }
-    /**
-     * Sets the Security Sub System.
-     * @param sys The Security Sub System.
-     */
-    public void setSecuritySubSystem(SnmpSecuritySubSystem sys) {
-        securitySub = sys;
-    }
-     /**
-     * Sets the Access Control Sub System.
-     * @param sys The Access Control Sub System.
-     */
-    public void setAccessControlSubSystem(SnmpAccessControlSubSystem sys) {
-        accessSub = sys;
-    }
-
-    /**
-     * Returns the Access Control Sub System.
-     * @return The Access Control Sub System.
-     */
-    public SnmpAccessControlSubSystem getAccessControlSubSystem() {
-        return accessSub;
-    }
-    /**
-     * Checks the passed msg flags according to the rules specified in RFC 2572.
-     * @param msgFlags The msg flags.
-     */
-    public static void checkSecurityLevel(byte msgFlags)
-        throws SnmpBadSecurityLevelException {
-        int secLevel = msgFlags & SnmpDefinitions.authPriv;
-        if((secLevel & SnmpDefinitions.privMask) != 0)
-            if((secLevel & SnmpDefinitions.authMask) == 0) {
-                throw new SnmpBadSecurityLevelException("Security level:"+
-                                                        " noAuthPriv!!!");
-            }
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpIncomingRequest.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.internal;
-
-import java.net.InetAddress;
-
-import com.sun.jmx.snmp.SnmpSecurityParameters;
-import com.sun.jmx.snmp.SnmpTooBigException;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpMsg;
-
-import com.sun.jmx.snmp.SnmpUnknownSecModelException;
-import com.sun.jmx.snmp.SnmpBadSecurityLevelException;
-
-/**
-<P> An <CODE>SnmpIncomingRequest</CODE> handles both sides of an incoming SNMP request:
-<ul>
-<li> The request. Unmarshalling of the received message. </li>
-<li> The response. Marshalling of the message to send. </li>
-</ul>
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpIncomingRequest {
-    /**
-     * Once the incoming request decoded, returns the decoded security parameters.
-     * @return The decoded security parameters.
-     */
-    public SnmpSecurityParameters getSecurityParameters();
-     /**
-     * Tests if a report is expected.
-     * @return boolean indicating if a report is to be sent.
-     */
-    public boolean isReport();
-    /**
-     * Tests if a response is expected.
-     * @return boolean indicating if a response is to be sent.
-     */
-    public boolean isResponse();
-
-    /**
-     * Tells this request that no response will be sent.
-     */
-    public void noResponse();
-    /**
-     * Gets the incoming request principal.
-     * @return The request principal.
-     **/
-    public String getPrincipal();
-    /**
-     * Gets the incoming request security level. This level is defined in {@link com.sun.jmx.snmp.SnmpEngine SnmpEngine}.
-     * @return The security level.
-     */
-    public int getSecurityLevel();
-    /**
-     * Gets the incoming request security model.
-     * @return The security model.
-     */
-    public int getSecurityModel();
-    /**
-     * Gets the incoming request context name.
-     * @return The context name.
-     */
-    public byte[] getContextName();
-    /**
-     * Gets the incoming request context engine Id.
-     * @return The context engine Id.
-     */
-    public byte[] getContextEngineId();
-    /**
-     * Gets the incoming request context name used by Access Control Model in order to allow or deny the access to OIDs.
-     */
-    public byte[] getAccessContext();
-    /**
-     * Encodes the response message to send and puts the result in the specified byte array.
-     *
-     * @param outputBytes An array to receive the resulting encoding.
-     *
-     * @exception ArrayIndexOutOfBoundsException If the result does not fit
-     *                                           into the specified array.
-     */
-    public int encodeMessage(byte[] outputBytes)
-        throws SnmpTooBigException;
-
-    /**
-     * Decodes the specified bytes and initializes the request with the incoming message.
-     *
-     * @param inputBytes The bytes to be decoded.
-     *
-     * @exception SnmpStatusException If the specified bytes are not a valid encoding or if the security applied to this request failed and no report is to be sent (typically trap PDU).
-     */
-    public void decodeMessage(byte[] inputBytes,
-                              int byteCount,
-                              InetAddress address,
-                              int port)
-        throws SnmpStatusException, SnmpUnknownSecModelException,
-               SnmpBadSecurityLevelException;
-
-     /**
-     * Initializes the response to send with the passed Pdu.
-     * <P>
-     * If the encoding length exceeds <CODE>maxDataLength</CODE>,
-     * the method throws an exception.
-     *
-     * @param p The PDU to be encoded.
-     * @param maxDataLength The maximum length permitted for the data field.
-     *
-     * @exception SnmpStatusException If the specified <CODE>pdu</CODE>
-     *     is not valid.
-     * @exception SnmpTooBigException If the resulting encoding does not fit
-     * into <CODE>maxDataLength</CODE> bytes.
-     * @exception ArrayIndexOutOfBoundsException If the encoding exceeds
-     *   <CODE>maxDataLength</CODE>.
-     */
-    public SnmpMsg encodeSnmpPdu(SnmpPdu p,
-                                 int maxDataLength)
-        throws SnmpStatusException, SnmpTooBigException;
-
-    /**
-     * Gets the request PDU encoded in the received message.
-     * <P>
-     * This method decodes the data field and returns the resulting PDU.
-     *
-     * @return The resulting PDU.
-     * @exception SnmpStatusException If the encoding is not valid.
-     */
-    public SnmpPdu decodeSnmpPdu()
-        throws SnmpStatusException;
-
-    /**
-     * Returns a stringified form of the received message.
-     * @return The message state string.
-     */
-    public String printRequestMessage();
-    /**
-     * Returns a stringified form of the message to send.
-     * @return The message state string.
-     */
-    public String printResponseMessage();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpIncomingResponse.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.internal;
-
-import java.net.InetAddress;
-import com.sun.jmx.snmp.SnmpPduFactory;
-import com.sun.jmx.snmp.SnmpSecurityParameters;
-import com.sun.jmx.snmp.SnmpSecurityException;
-import com.sun.jmx.snmp.SnmpTooBigException;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpMsg;
-
-import com.sun.jmx.snmp.internal.SnmpSecurityCache;
-import com.sun.jmx.snmp.SnmpBadSecurityLevelException;
-/**
- * <P> An <CODE>SnmpIncomingResponse</CODE> handles the unmarshalling of the received response.</P>
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-
-public interface SnmpIncomingResponse {
-    /**
-     * Returns the source address.
-     * @return The source address.
-     */
-    public InetAddress getAddress();
-
-    /**
-     * Returns the source port.
-     * @return The source port.
-     */
-    public int getPort();
-
-    /**
-     * Gets the incoming response security parameters.
-     * @return The security parameters.
-     **/
-    public SnmpSecurityParameters getSecurityParameters();
-    /**
-     * Call this method in order to reuse <CODE>SnmpOutgoingRequest</CODE> cache.
-     * @param cache The security cache.
-     */
-    public void setSecurityCache(SnmpSecurityCache cache);
-    /**
-     * Gets the incoming response security level. This level is defined in
-     * {@link com.sun.jmx.snmp.SnmpEngine SnmpEngine}.
-     * @return The security level.
-     */
-    public int getSecurityLevel();
-    /**
-     * Gets the incoming response security model.
-     * @return The security model.
-     */
-    public int getSecurityModel();
-    /**
-     * Gets the incoming response context name.
-     * @return The context name.
-     */
-    public byte[] getContextName();
-
-    /**
-     * Decodes the specified bytes and initializes itself with the received
-     * response.
-     *
-     * @param inputBytes The bytes to be decoded.
-     *
-     * @exception SnmpStatusException If the specified bytes are not a valid encoding.
-     */
-    public SnmpMsg decodeMessage(byte[] inputBytes,
-                                 int byteCount,
-                                 InetAddress address,
-                                 int port)
-        throws SnmpStatusException, SnmpSecurityException;
-
-    /**
-     * Gets the request PDU encoded in the received response.
-     * <P>
-     * This method decodes the data field and returns the resulting PDU.
-     *
-     * @return The resulting PDU.
-     * @exception SnmpStatusException If the encoding is not valid.
-     */
-    public SnmpPdu decodeSnmpPdu()
-        throws SnmpStatusException;
-
-    /**
-     * Returns the response request Id.
-     * @param data The flat message.
-     * @return The request Id.
-     */
-    public int getRequestId(byte[] data) throws SnmpStatusException;
-
-    /**
-     * Returns a stringified form of the message to send.
-     * @return The message state string.
-     */
-    public String printMessage();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpLcd.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.internal;
-
-import java.util.Hashtable;
-import com.sun.jmx.snmp.SnmpEngineId;
-import com.sun.jmx.snmp.SnmpUnknownModelLcdException;
-import com.sun.jmx.snmp.SnmpUnknownSubSystemException;
-/**
- * Class to extend in order to develop a customized Local Configuration Datastore. The Lcd is used by the <CODE>SnmpEngine</CODE> to store and retrieve data.
- *<P> <CODE>SnmpLcd</CODE> manages the Lcds needed by every {@link com.sun.jmx.snmp.internal.SnmpModel SnmpModel}. It is possible to add and remove {@link com.sun.jmx.snmp.internal.SnmpModelLcd SnmpModelLcd}.</P>
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public abstract class SnmpLcd {
-
-    class SubSysLcdManager {
-        private Hashtable<Integer, SnmpModelLcd> models =
-                new Hashtable<Integer, SnmpModelLcd>();
-
-        public void addModelLcd(int id,
-                                SnmpModelLcd usmlcd) {
-            models.put(id, usmlcd);
-        }
-
-        public SnmpModelLcd getModelLcd(int id) {
-            return models.get(id);
-        }
-
-        public SnmpModelLcd removeModelLcd(int id) {
-            return models.remove(id);
-        }
-    }
-
-
-    private Hashtable<SnmpSubSystem, SubSysLcdManager> subs =
-            new Hashtable<SnmpSubSystem, SubSysLcdManager>();
-
-    /**
-     * Returns the number of time the engine rebooted.
-     * @return The number of reboots or -1 if the information is not present in the Lcd.
-     */
-    public abstract int getEngineBoots();
-    /**
-     * Returns the engine Id located in the Lcd.
-     * @return The engine Id or null if the information is not present in the Lcd.
-     */
-    public abstract String getEngineId();
-
-    /**
-     * Persists the number of reboots.
-     * @param i Reboot number.
-     */
-    public abstract void storeEngineBoots(int i);
-
-    /**
-     * Persists the engine Id.
-     * @param id The engine Id.
-     */
-    public abstract void  storeEngineId(SnmpEngineId id);
-    /**
-     * Adds an Lcd model.
-     * @param sys The subsytem managing the model.
-     * @param id The model Id.
-     * @param lcd The Lcd model.
-     */
-    public void addModelLcd(SnmpSubSystem sys,
-                            int id,
-                            SnmpModelLcd lcd) {
-
-        SubSysLcdManager subsys = subs.get(sys);
-        if( subsys == null ) {
-            subsys = new SubSysLcdManager();
-            subs.put(sys, subsys);
-        }
-
-        subsys.addModelLcd(id, lcd);
-    }
-     /**
-     * Removes an Lcd model.
-     * @param sys The subsytem managing the model.
-     * @param id The model Id.
-     */
-    public void removeModelLcd(SnmpSubSystem sys,
-                                int id)
-        throws SnmpUnknownModelLcdException, SnmpUnknownSubSystemException {
-
-        SubSysLcdManager subsys = subs.get(sys);
-        if( subsys != null ) {
-            SnmpModelLcd lcd = subsys.removeModelLcd(id);
-            if(lcd == null) {
-                throw new SnmpUnknownModelLcdException("Model : " + id);
-            }
-        }
-        else
-            throw new SnmpUnknownSubSystemException(sys.toString());
-    }
-
-    /**
-     * Gets an Lcd model.
-     * @param sys The subsytem managing the model
-     * @param id The model Id.
-     * @return The Lcd model or null if no Lcd model were found.
-     */
-    public SnmpModelLcd getModelLcd(SnmpSubSystem sys,
-                                    int id) {
-        SubSysLcdManager subsys = subs.get(sys);
-
-        if(subsys == null) return null;
-
-        return subsys.getModelLcd(id);
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpModel.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.internal;
-/**
- * Interface that every SNMP model must implement in order to be integrated in the engine framework.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpModel {
-
-    /**
-     * Returns the sub system that manages this model.
-     * @return The sub system.
-     */
-    public SnmpSubSystem getSubSystem();
-    /**
-     * A human readable model name.
-     * @return The model name.
-     */
-    public String getName();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpModelLcd.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.internal;
-
-/**
- * An interface to implement when developping customized model configuration datastore.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpModelLcd {
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpMsgProcessingModel.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.internal;
-
-
-import com.sun.jmx.snmp.mpm.SnmpMsgTranslator;
-
-import com.sun.jmx.snmp.SnmpTooBigException;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpPduFactory;
-import com.sun.jmx.snmp.SnmpSecurityParameters;
-
-import com.sun.jmx.snmp.SnmpParams;
-/**
- * The message processing model interface. Any message processing model must implement this interface in order to be integrated in the engine framework.
- * The model is called by the dispatcher when a call is received or when a call is sent.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpMsgProcessingModel extends SnmpModel {
-    /**
-     * This method is called when a call is to be sent to the network.
-     * @param factory The pdu factory to use to encode and decode pdu.
-     * @return The object that will handle every steps of the sending (mainly marshalling and security).
-     */
-    public SnmpOutgoingRequest getOutgoingRequest(SnmpPduFactory factory);
-    /**
-     * This method is called when a call is received from the network.
-     * @param factory The pdu factory to use to encode and decode pdu.
-     * @return The object that will handle every steps of the receiving (mainly unmarshalling and security).
-     */
-    public SnmpIncomingRequest getIncomingRequest(SnmpPduFactory factory);
-
-     /**
-     * This method is called when a response is received from the network.
-     * @param factory The pdu factory to use to encode and decode pdu.
-     * @return The object that will handle every steps of the receiving (mainly unmarshalling and security).
-     */
-    public SnmpIncomingResponse getIncomingResponse(SnmpPduFactory factory);
-    /**
-     * This method is called to instantiate a pdu according to the passed pdu type and parameters.
-     * @param p The request parameters.
-     * @param type The pdu type.
-     * @return The pdu.
-     */
-    public SnmpPdu getRequestPdu(SnmpParams p, int type) throws SnmpStatusException;
-
-    /**
-     * This method is called to encode a full scoped pdu that has not been encrypted. <CODE>contextName</CODE>, <CODE>contextEngineID</CODE> and data are known.
-     * <BR>The specified parameters are defined in RFC 2572 (see also the {@link com.sun.jmx.snmp.SnmpV3Message} class).
-     * @param version The SNMP protocol version.
-     * @param msgID The SNMP message ID.
-     * @param msgMaxSize The max message size.
-     * @param msgFlags The message flags.
-     * @param msgSecurityModel The message security model.
-     * @param params The security parameters.
-     * @param contextEngineID The context engine ID.
-     * @param contextName The context name.
-     * @param data The encoded data.
-     * @param dataLength The encoded data length.
-     * @param outputBytes The buffer containing the encoded message.
-     * @return The encoded bytes number.
-     */
-    public int encode(int version,
-                      int msgID,
-                      int msgMaxSize,
-                      byte msgFlags,
-                      int msgSecurityModel,
-                      SnmpSecurityParameters params,
-                      byte[] contextEngineID,
-                      byte[] contextName,
-                      byte[] data,
-                      int dataLength,
-                      byte[] outputBytes) throws SnmpTooBigException;
-    /**
-     * This method is called to encode a full scoped pdu that as been encrypted. <CODE>contextName</CODE>, <CODE>contextEngineID</CODE> and data are known.
-     * <BR>The specified parameters are defined in RFC 2572 (see also the {@link com.sun.jmx.snmp.SnmpV3Message} class).
-     * @param version The SNMP protocol version.
-     * @param msgID The SNMP message ID.
-     * @param msgMaxSize The max message size.
-     * @param msgFlags The message flags.
-     * @param msgSecurityModel The message security model.
-     * @param params The security parameters.
-     * @param encryptedPdu The encrypted pdu.
-     * @param outputBytes The buffer containing the encoded message.
-     * @return The encoded bytes number.
-     */
-    public int encodePriv(int version,
-                          int msgID,
-                          int msgMaxSize,
-                          byte msgFlags,
-                          int msgSecurityModel,
-                          SnmpSecurityParameters params,
-                          byte[] encryptedPdu,
-                          byte[] outputBytes) throws SnmpTooBigException;
-     /**
-     * This method returns a decoded scoped pdu. This method decodes only the <CODE>contextEngineID</CODE>, <CODE>contextName</CODE> and data. It is needed by the <CODE>SnmpSecurityModel</CODE> after decryption.
-     * @param pdu The encoded pdu.
-     * @return The partialy scoped pdu.
-     */
-    public SnmpDecryptedPdu decode(byte[] pdu) throws SnmpStatusException;
-
-    /**
-     * This method returns an encoded scoped pdu. This method encode only the <CODE>contextEngineID</CODE>, <CODE>contextName</CODE> and data. It is needed by the <CODE>SnmpSecurityModel</CODE> for decryption.
-     * @param pdu The pdu to encode.
-     * @param outputBytes The partialy scoped pdu.
-     * @return The encoded bytes number.
-     */
-    public int encode(SnmpDecryptedPdu pdu,
-                      byte[] outputBytes) throws SnmpTooBigException;
-
-    /**
-     * In order to change the behavior of the translator, set it.
-     * @param translator The translator that will be used.
-     */
-    public void setMsgTranslator(SnmpMsgTranslator translator);
-
-    /**
-     * Returns the current translator.
-     * @return The current translator.
-     */
-    public SnmpMsgTranslator getMsgTranslator();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpMsgProcessingSubSystem.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.internal;
-
-import java.util.Vector;
-import com.sun.jmx.snmp.SnmpMsg;
-import com.sun.jmx.snmp.SnmpParams;
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpTooBigException;
-import com.sun.jmx.snmp.SnmpPduFactory;
-import com.sun.jmx.snmp.SnmpSecurityParameters;
-
-import com.sun.jmx.snmp.SnmpUnknownMsgProcModelException;
-
-/**
- * Message processing sub system interface. To allow engine integration, a message processing sub system must implement this interface. This sub system is called by the dispatcher when receiving or sending calls.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpMsgProcessingSubSystem extends SnmpSubSystem {
-
-    /**
-     * Attaches the security sub system to this sub system. Message processing model are making usage of various security sub systems. This direct attachement avoid the need of accessing the engine to retrieve the Security sub system.
-     * @param security The security sub system.
-     */
-    public void setSecuritySubSystem(SnmpSecuritySubSystem security);
-    /** Gets the attached security sub system.
-     * @return The security sub system.
-     */
-    public SnmpSecuritySubSystem getSecuritySubSystem();
-
-    /**
-     * This method is called when a call is received from the network.
-     * @param model The model ID.
-     * @param factory The pdu factory to use to encode and decode pdu.
-     * @return The object that will handle every steps of the receiving (mainly unmarshalling and security).
-     */
-    public SnmpIncomingRequest getIncomingRequest(int model,
-                                                  SnmpPduFactory factory)
-        throws SnmpUnknownMsgProcModelException;
-    /**
-     * This method is called when a call is to be sent to the network. The sub system routes the call to the dedicated model according to the model ID.
-     * @param model The model ID.
-     * @param factory The pdu factory to use to encode and decode pdu.
-     * @return The object that will handle every steps of the sending (mainly marshalling and security).
-     */
-    public SnmpOutgoingRequest getOutgoingRequest(int model,
-                                                  SnmpPduFactory factory) throws SnmpUnknownMsgProcModelException ;
-    /**
-     * This method is called to instantiate a pdu according to the passed pdu type and parameters. The sub system routes the call to the dedicated model according to the model ID.
-     * @param model The model ID.
-     * @param p The request parameters.
-     * @param type The pdu type.
-     * @return The pdu.
-     */
-    public SnmpPdu getRequestPdu(int model, SnmpParams p, int type) throws SnmpUnknownMsgProcModelException, SnmpStatusException ;
-     /**
-     * This method is called when a call is received from the network. The sub system routes the call to the dedicated model according to the model ID.
-     * @param model The model ID.
-     * @param factory The pdu factory to use to decode pdu.
-     * @return The object that will handle every steps of the receiving (mainly marshalling and security).
-     */
-    public SnmpIncomingResponse getIncomingResponse(int model,
-                                                    SnmpPduFactory factory) throws SnmpUnknownMsgProcModelException;
-    /**
-     * This method is called to encode a full scoped pdu that as not been encrypted. <CODE>contextName</CODE>, <CODE>contextEngineID</CODE> and data are known. It will be routed to the dedicated model according to the version value.
-     * <BR>The specified parameters are defined in RFC 2572 (see also the {@link com.sun.jmx.snmp.SnmpV3Message} class).
-     * @param version The SNMP protocol version.
-     * @param msgID The SNMP message ID.
-     * @param msgMaxSize The max message size.
-     * @param msgFlags The message flags.
-     * @param msgSecurityModel The message security model.
-     * @param params The security parameters.
-     * @param contextEngineID The context engine ID.
-     * @param contextName The context name.
-     * @param data The encoded data.
-     * @param dataLength The encoded data length.
-     * @param outputBytes The buffer containing the encoded message.
-     * @return The encoded bytes number.
-     */
-    public int encode(int version,
-                      int msgID,
-                      int msgMaxSize,
-                      byte msgFlags,
-                      int msgSecurityModel,
-                      SnmpSecurityParameters params,
-                      byte[] contextEngineID,
-                      byte[] contextName,
-                      byte[] data,
-                      int dataLength,
-                      byte[] outputBytes)
-        throws SnmpTooBigException,
-               SnmpUnknownMsgProcModelException ;
-    /**
-     * This method is called to encode a full scoped pdu that as been encrypted. <CODE>contextName</CODE>, <CODE>contextEngineID</CODE> and data are not known. It will be routed to the dedicated model according to the version value.
-     * <BR>The specified parameters are defined in RFC 2572 (see also the {@link com.sun.jmx.snmp.SnmpV3Message} class).
-     * @param version The SNMP protocol version.
-     * @param msgID The SNMP message ID.
-     * @param msgMaxSize The max message size.
-     * @param msgFlags The message flags.
-     * @param msgSecurityModel The message security model.
-     * @param params The security parameters.
-     * @param encryptedPdu The encrypted pdu.
-     * @param outputBytes The buffer containing the encoded message.
-     * @return The encoded bytes number.
-     */
-    public int encodePriv(int version,
-                          int msgID,
-                          int msgMaxSize,
-                          byte msgFlags,
-                          int msgSecurityModel,
-                          SnmpSecurityParameters params,
-                          byte[] encryptedPdu,
-                          byte[] outputBytes) throws SnmpTooBigException, SnmpUnknownMsgProcModelException;
-
-     /**
-     * This method returns a decoded scoped pdu. This method decodes only the <CODE>contextEngineID</CODE>, <CODE>contextName</CODE> and data. It is needed by the <CODE>SnmpSecurityModel</CODE> after decryption. It will be routed to the dedicated model according to the version value.
-     * @param version The SNMP protocol version.
-     * @param pdu The encoded pdu.
-     * @return the partialy scoped pdu.
-     */
-    public SnmpDecryptedPdu decode(int version,
-                                   byte[] pdu)
-        throws SnmpStatusException, SnmpUnknownMsgProcModelException;
-
-      /**
-     * This method returns an encoded scoped pdu. This method encodes only the <CODE>contextEngineID</CODE>, <CODE>contextName</CODE> and data. It is needed by the <CODE>SnmpSecurityModel</CODE> for decryption. It will be routed to the dedicated model according to the version value.
-     * @param version The SNMP protocol version.
-     * @param pdu The pdu to encode.
-     * @param outputBytes The partialy scoped pdu.
-     * @return The encoded bytes number.
-     */
-    public int encode(int version,
-                      SnmpDecryptedPdu pdu,
-                      byte[] outputBytes)
-        throws SnmpTooBigException, SnmpUnknownMsgProcModelException;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpOutgoingRequest.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.internal;
-
-import java.net.InetAddress;
-
-import com.sun.jmx.snmp.SnmpSecurityException;
-import com.sun.jmx.snmp.SnmpTooBigException;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpMsg;
-
-import com.sun.jmx.snmp.internal.SnmpSecurityCache;
-import com.sun.jmx.snmp.SnmpUnknownSecModelException;
-import com.sun.jmx.snmp.SnmpBadSecurityLevelException;
-/**
- * <P> An <CODE>SnmpOutgoingRequest</CODE> handles the marshalling of the message to send.</P>
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-
-public interface SnmpOutgoingRequest {
-    /**
-     * Returns the cached security data used when marshalling the call as a secure one.
-     * @return The cached data.
-     */
-    public SnmpSecurityCache getSecurityCache();
-    /**
-     * Encodes the message to send and puts the result in the specified byte array.
-     *
-     * @param outputBytes An array to receive the resulting encoding.
-     *
-     * @exception ArrayIndexOutOfBoundsException If the result does not fit
-     *                                           into the specified array.
-     */
-    public int encodeMessage(byte[] outputBytes)
-        throws SnmpStatusException,
-               SnmpTooBigException, SnmpSecurityException,
-               SnmpUnknownSecModelException, SnmpBadSecurityLevelException;
-  /**
-     * Initializes the message to send with the passed Pdu.
-     * <P>
-     * If the encoding length exceeds <CODE>maxDataLength</CODE>,
-     * the method throws an exception.</P>
-     *
-     * @param p The PDU to be encoded.
-     * @param maxDataLength The maximum length permitted for the data field.
-     *
-     * @exception SnmpStatusException If the specified PDU <CODE>p</CODE> is
-     *    not valid.
-     * @exception SnmpTooBigException If the resulting encoding does not fit
-     *    into <CODE>maxDataLength</CODE> bytes.
-     * @exception ArrayIndexOutOfBoundsException If the encoding exceeds
-     *    <CODE>maxDataLength</CODE>.
-     */
-    public SnmpMsg encodeSnmpPdu(SnmpPdu p,
-                                 int maxDataLength)
-        throws SnmpStatusException, SnmpTooBigException;
-    /**
-     * Returns a stringified form of the message to send.
-     * @return The message state string.
-     */
-    public String printMessage();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpSecurityCache.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.internal;
-
-/**
- * Cache is returned by <CODE>SnmpSecurityModel</CODE> when handling requests. The cache contants is security dependant. This interface is a marker that every cache classes must implement.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpSecurityCache {
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpSecurityModel.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.internal;
-
-import com.sun.jmx.snmp.SnmpSecurityException;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpTooBigException;
-import com.sun.jmx.snmp.SnmpSecurityParameters;
-
-/**
- * Security model interface. Any security model implementation must implement this interface in order to be integrated in the engine framework. Security models are called when SNMP messages are received or sent. They deal with security (authentication and privacy).
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpSecurityModel extends SnmpModel {
-    /**
-     * Called when a request is to be sent to the network. It must be securized.
-     * <BR>The specified parameters are defined in RFC 2572 (see also the {@link com.sun.jmx.snmp.SnmpV3Message} class).
-     * @param cache The cache that has been created by calling <CODE>createSecurityCache</CODE> on this model.
-     * @param version The SNMP protocol version.
-     * @param msgID The current request id.
-     * @param msgMaxSize The message max size.
-     * @param msgFlags The message flags (reportable, Auth and Priv).
-     * @param msgSecurityModel This current security model.
-     * @param params The security parameters that contain the model dependant parameters.
-     * @param contextEngineID The context engine ID.
-     * @param contextName The context name.
-     * @param data The marshalled varbind list.
-     * @param dataLength The marshalled varbind list length.
-     * @param outputBytes The buffer to fill with securized request. This is a representation independant marshalled format. This buffer will be sent to the network.
-     * @return The marshalled byte number.
-     */
-    public int generateRequestMsg(SnmpSecurityCache cache,
-                                  int version,
-                                  int msgID,
-                                  int msgMaxSize,
-                                  byte msgFlags,
-                                  int msgSecurityModel,
-                                  SnmpSecurityParameters params,
-                                  byte[] contextEngineID,
-                                  byte[] contextName,
-                                  byte[] data,
-                                  int dataLength,
-                                  byte[] outputBytes)
-        throws SnmpTooBigException, SnmpStatusException,
-               SnmpSecurityException;
-
-    /**
-     * Called when a response is to be sent to the network. It must be securized.
-     * <BR>The specified parameters are defined in RFC 2572 (see also the {@link com.sun.jmx.snmp.SnmpV3Message} class).
-     * @param cache The cache that has been created by calling <CODE>createSecurityCache</CODE> on this model.
-     * @param version The SNMP protocol version.
-     * @param msgID The current request id.
-     * @param msgMaxSize The message max size.
-     * @param msgFlags The message flags (reportable, Auth and Priv)
-     * @param msgSecurityModel This current security model.
-     * @param params The security parameters that contain the model dependant parameters.
-     * @param contextEngineID The context engine ID.
-     * @param contextName The context name.
-     * @param data The marshalled varbind list.
-     * @param dataLength The marshalled varbind list length.
-     * @param outputBytes The buffer to fill with securized request. This is a representation independant marshalled format. This buffer will be sent to the network.
-     * @return The marshalled byte number.
-     */
-    public int generateResponseMsg(SnmpSecurityCache cache,
-                                   int version,
-                                   int msgID,
-                                   int msgMaxSize,
-                                   byte msgFlags,
-                                   int msgSecurityModel,
-                                   SnmpSecurityParameters params,
-                                   byte[] contextEngineID,
-                                   byte[] contextName,
-                                   byte[] data,
-                                   int dataLength,
-                                   byte[] outputBytes)
-        throws SnmpTooBigException, SnmpStatusException,
-               SnmpSecurityException;
-    /**
-     * Called when a request is received from the network. It handles authentication and privacy.
-     * <BR>The specified parameters are defined in RFC 2572 (see also the {@link com.sun.jmx.snmp.SnmpV3Message} class).
-     * @param cache The cache that has been created by calling <CODE>createSecurityCache</CODE> on this model.
-     * @param version The SNMP protocol version.
-     * @param msgID The current request id.
-     * @param msgMaxSize The message max size.
-     * @param msgFlags The message flags (reportable, Auth and Priv)
-     * @param msgSecurityModel This current security model.
-     * @param params The security parameters in a marshalled format. The informations contained in this array are model dependant.
-     * @param contextEngineID The context engine ID or null if encrypted.
-     * @param contextName The context name or null if encrypted.
-     * @param data The marshalled varbind list or null if encrypted
-     * @param encryptedPdu The encrypted pdu or null if not encrypted.
-     * @param decryptedPdu The decrypted pdu. If no decryption is to be done, the passed context engine ID, context name and data could be used to fill this object.
-     * @return The decoded security parameters.
-
-     */
-    public SnmpSecurityParameters
-        processIncomingRequest(SnmpSecurityCache cache,
-                               int version,
-                               int msgID,
-                               int msgMaxSize,
-                               byte msgFlags,
-                               int msgSecurityModel,
-                               byte[] params,
-                               byte[] contextEngineID,
-                               byte[] contextName,
-                               byte[] data,
-                               byte[] encryptedPdu,
-                               SnmpDecryptedPdu decryptedPdu)
-        throws SnmpStatusException, SnmpSecurityException;
- /**
-     * Called when a response is received from the network. It handles authentication and privacy.
-     * <BR>The specified parameters are defined in RFC 2572 (see also the {@link com.sun.jmx.snmp.SnmpV3Message} class).
-     * @param cache The cache that has been created by calling <CODE>createSecurityCache</CODE> on this model.
-     * @param version The SNMP protocol version.
-     * @param msgID The current request id.
-     * @param msgMaxSize The message max size.
-     * @param msgFlags The message flags (reportable, Auth and Priv)
-     * @param msgSecurityModel This current security model.
-     * @param params The security parameters in a marshalled format. The informations cointained in this array are model dependant.
-     * @param contextEngineID The context engine ID or null if encrypted.
-     * @param contextName The context name or null if encrypted.
-     * @param data The marshalled varbind list or null if encrypted
-     * @param encryptedPdu The encrypted pdu or null if not encrypted.
-     * @param decryptedPdu The decrypted pdu. If no decryption is to be done, the passed context engine ID, context name and data could be used to fill this object.
-     * @return The security parameters.
-
-     */
-    public SnmpSecurityParameters processIncomingResponse(SnmpSecurityCache cache,
-                                                          int version,
-                                                          int msgID,
-                                                          int msgMaxSize,
-                                                          byte msgFlags,
-                                                          int msgSecurityModel,
-                                                          byte[] params,
-                                                          byte[] contextEngineID,
-                                                          byte[] contextName,
-                                                          byte[] data,
-                                                          byte[] encryptedPdu,
-                                                          SnmpDecryptedPdu decryptedPdu)
-        throws SnmpStatusException, SnmpSecurityException;
-
-    /**
-     * Instantiate an <CODE>SnmpSecurityCache</CODE> that is dependant to the model implementation.
-     * @return The model dependant security cache.
-     */
-    public SnmpSecurityCache createSecurityCache();
-    /**
-     * Release the previously created cache.
-     * @param cache The security cache to release.
-     */
-    public void releaseSecurityCache(SnmpSecurityCache cache);
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpSecuritySubSystem.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.internal;
-
-import com.sun.jmx.snmp.SnmpTooBigException;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpUnknownSecModelException;
-import com.sun.jmx.snmp.SnmpSecurityException;
-import com.sun.jmx.snmp.SnmpSecurityParameters;
-
-/**
- * Security sub system interface. To allow engine integration, a security sub system must implement this interface.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-public interface SnmpSecuritySubSystem extends SnmpSubSystem {
-     /**
-     * Instantiates an <CODE>SnmpSecurityCache</CODE> that is dependant to the model implementation. This call is routed to the dedicated model according to the model ID.
-     * @param id The model ID.
-     * @return The model dependant security cache.
-     */
-    public SnmpSecurityCache createSecurityCache(int id) throws SnmpUnknownSecModelException;
-    /**
-     * To release the previously created cache. This call is routed to the dedicated model according to the model ID.
-     * @param id The model ID.
-     * @param cache The security cache to release.
-     */
-    public void releaseSecurityCache(int id,
-                                     SnmpSecurityCache cache) throws SnmpUnknownSecModelException;
-
-     /**
-     * Called when a request is to be sent to the network. It must be securized. This call is routed to the dedicated model according to the model ID.
-     * <BR>The specified parameters are defined in RFC 2572 (see also the {@link com.sun.jmx.snmp.SnmpV3Message} class).
-     * @param cache The cache that has been created by calling <CODE>createSecurityCache</CODE> on this model.
-     * @param version The SNMP protocol version.
-     * @param msgID The current request id.
-     * @param msgMaxSize The message max size.
-     * @param msgFlags The message flags (reportable, Auth and Priv).
-     * @param msgSecurityModel This current security model.
-     * @param params The security parameters that contain the model dependant parameters.
-     * @param contextEngineID The context engine ID.
-     * @param contextName The context name.
-     * @param data The marshalled varbind list
-     * @param dataLength The marshalled varbind list length.
-     * @param outputBytes The buffer to fill with securized request. This is a representation independant marshalled format. This buffer will be sent to the network.
-     * @return The marshalled byte number.
-     */
-    public int generateRequestMsg(SnmpSecurityCache cache,
-                                  int version,
-                                  int msgID,
-                                  int msgMaxSize,
-                                  byte msgFlags,
-                                  int msgSecurityModel,
-                                  SnmpSecurityParameters params,
-                                  byte[] contextEngineID,
-                                  byte[] contextName,
-                                  byte[] data,
-                                  int dataLength,
-                                  byte[] outputBytes)
-        throws SnmpTooBigException, SnmpStatusException, SnmpSecurityException, SnmpUnknownSecModelException;
-
-    /**
-     * Called when a response is to be sent to the network. It must be securized. This call is routed to the dedicated model according to the model ID.
-     * <BR>The specified parameters are defined in RFC 2572 (see also the {@link com.sun.jmx.snmp.SnmpV3Message} class).
-     * @param cache The cache that has been created by calling <CODE>createSecurityCache</CODE> on this model.
-     * @param version The SNMP protocol version.
-     * @param msgID The current request id.
-     * @param msgMaxSize The message max size.
-     * @param msgFlags The message flags (reportable, Auth and Priv).
-     * @param msgSecurityModel This current security model.
-     * @param params The security parameters that contain the model dependant parameters.
-     * @param contextEngineID The context engine ID.
-     * @param contextName The context name.
-     * @param data The marshalled varbind list
-     * @param dataLength The marshalled varbind list length.
-     * @param outputBytes The buffer to fill with securized request. This is a representation independant marshalled format. This buffer will be sent to the network.
-     * @return The marshalled byte number.
-     */
-    public int generateResponseMsg(SnmpSecurityCache cache,
-                                   int version,
-                                   int msgID,
-                                   int msgMaxSize,
-                                   byte msgFlags,
-                                   int msgSecurityModel,
-                                   SnmpSecurityParameters params,
-                                   byte[] contextEngineID,
-                                   byte[] contextName,
-                                   byte[] data,
-                                   int dataLength,
-                                   byte[] outputBytes)
-        throws SnmpTooBigException, SnmpStatusException,
-               SnmpSecurityException, SnmpUnknownSecModelException;
-      /**
-     * Called when a request is received from the network. It handles authentication and privacy. This call is routed to the dedicated model according to the model ID.
-     * <BR>The specified parameters are defined in RFC 2572 (see also the {@link com.sun.jmx.snmp.SnmpV3Message} class).
-     * @param cache The cache that has been created by calling <CODE>createSecurityCache</CODE> on this model.
-     * @param version The SNMP protocol version.
-     * @param msgID The current request id.
-     * @param msgMaxSize The message max size.
-     * @param msgFlags The message flags (reportable, Auth and Priv)
-     * @param msgSecurityModel This current security model.
-     * @param params The security parameters in a marshalled format. The informations cointained in this array are model dependant.
-     * @param contextEngineID The context engine ID or null if encrypted.
-     * @param contextName The context name or null if encrypted.
-     * @param data The marshalled varbind list or null if encrypted.
-     * @param encryptedPdu The encrypted pdu or null if not encrypted.
-     * @param decryptedPdu The decrypted pdu. If no decryption is to be done, the passed context engine ID, context name and data could be used to fill this object.
-     * @return The decoded security parameters.
-
-     */
-    public SnmpSecurityParameters
-        processIncomingRequest(SnmpSecurityCache cache,
-                               int version,
-                               int msgID,
-                               int msgMaxSize,
-                               byte msgFlags,
-                               int msgSecurityModel,
-                               byte[] params,
-                               byte[] contextEngineID,
-                               byte[] contextName,
-                               byte[] data,
-                               byte[] encryptedPdu,
-                               SnmpDecryptedPdu decryptedPdu)
-        throws SnmpStatusException, SnmpSecurityException, SnmpUnknownSecModelException;
-          /**
-     * Called when a response is received from the network. It handles authentication and privacy. This call is routed to the dedicated model according to the model ID.
-     * <BR>The specified parameters are defined in RFC 2572 (see also the {@link com.sun.jmx.snmp.SnmpV3Message} class).
-     * @param cache The cache that has been created by calling <CODE>createSecurityCache</CODE> on this model.
-     * @param version The SNMP protocol version.
-     * @param msgID The current request id.
-     * @param msgMaxSize The message max size.
-     * @param msgFlags The message flags (reportable, Auth and Priv).
-     * @param msgSecurityModel This current security model.
-     * @param params The security parameters in a marshalled format. The informations cointained in this array are model dependant.
-     * @param contextEngineID The context engine ID or null if encrypted.
-     * @param contextName The context name or null if encrypted.
-     * @param data The marshalled varbind list or null if encrypted.
-     * @param encryptedPdu The encrypted pdu or null if not encrypted.
-     * @param decryptedPdu The decrypted pdu. If no decryption is to be done, the passed context engine ID, context name and data could be used to fill this object.
-     * @return The security parameters.
-
-     */
-    public SnmpSecurityParameters processIncomingResponse(SnmpSecurityCache cache,
-                                                          int version,
-                                                          int msgID,
-                                                          int msgMaxSize,
-                                                          byte msgFlags,
-                                                          int msgSecurityModel,
-                                                          byte[] params,
-                                                          byte[] contextEngineID,
-                                                          byte[] contextName,
-                                                          byte[] data,
-                                                          byte[] encryptedPdu,
-                                                          SnmpDecryptedPdu decryptedPdu)
-        throws SnmpStatusException, SnmpSecurityException, SnmpUnknownSecModelException;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpSubSystem.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.internal;
-
-import com.sun.jmx.snmp.SnmpEngine;
-import com.sun.jmx.snmp.SnmpUnknownModelException;
-import java.util.Hashtable;
-/**
- * SNMP sub system interface. To allow engine framework integration, a sub system must implement this interface. A sub system is a model manager. Every model is identified by an ID. A sub system can retrieve a previously registered model using this ID.
- * <P> Every sub system is associated to its SNMP engine.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- */
-public interface SnmpSubSystem {
-    /**
-     * Returns the associated engine.
-     * @return The engine.
-     */
-    public SnmpEngine getEngine();
-
-    /**
-     * Adds a model to this sub system.
-     * @param id The model ID.
-     * @param model The model to add.
-     */
-    public void addModel(int id, SnmpModel model);
-
-    /**
-     * Removes a model from this sub system.
-     * @param id The model ID to remove.
-     * @return The removed model.
-     */
-    public SnmpModel removeModel(int id) throws SnmpUnknownModelException;
-
-    /**
-     * Gets a model from this sub system.
-     * @param id The model ID to get.
-     * @return The model.
-     */
-    public SnmpModel getModel(int id) throws SnmpUnknownModelException;
-
-    /**
-     * Returns the set of model Ids that have been registered within the sub system.
-     */
-    public int[] getModelIds();
-
-    /**
-     * Returns the set of model names that have been registered within the sub system.
-     */
-    public String[] getModelNames();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpTools.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.internal;
-
-import com.sun.jmx.snmp.SnmpDefinitions;
-/**
- * Utility class used to deal with various data representations.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public class SnmpTools implements SnmpDefinitions {
-
-    /**
-     * Translates a binary representation in an ASCII one. The returned string is an hexadecimal string starting with 0x.
-     * @param data Binary to translate.
-     * @return Translated binary.
-     */
-    static public String binary2ascii(byte[] data, int length)
-    {
-        if(data == null) return null;
-        final int size = (length * 2) + 2;
-        byte[] asciiData = new byte[size];
-        asciiData[0] = (byte) '0';
-        asciiData[1] = (byte) 'x';
-        for (int i=0; i < length; i++) {
-            int j = i*2;
-            int v = (data[i] & 0xf0);
-            v = v >> 4;
-            if (v < 10)
-                asciiData[j+2] = (byte) ('0' + v);
-            else
-                asciiData[j+2] = (byte) ('A' + (v - 10));
-            v = ((data[i] & 0xf));
-            if (v < 10)
-                asciiData[j+1+2] = (byte) ('0' + v);
-            else
-                asciiData[j+1+2] = (byte) ('A' + (v - 10));
-        }
-        return new String(asciiData);
-    }
-
-    /**
-     * Translates a binary representation in an ASCII one. The returned string is an hexadecimal string starting with 0x.
-     * @param data Binary to translate.
-     * @return Translated binary.
-     */
-    static public String binary2ascii(byte[] data)
-    {
-        return binary2ascii(data, data.length);
-    }
-    /**
-     * Translates a stringified representation in a binary one. The passed string is an hexadecimal one starting with 0x.
-     * @param str String to translate.
-     * @return Translated string.
-     */
-    static public byte[] ascii2binary(String str) {
-        if(str == null) return null;
-        String val = str.substring(2);
-
-        int size = val.length();
-        byte []buf = new byte[size/2];
-        byte []p = val.getBytes();
-
-        for(int i = 0; i < (size / 2); i++)
-        {
-            int j = i * 2;
-            byte v = 0;
-            if (p[j] >= '0' && p[j] <= '9') {
-                v = (byte) ((p[j] - '0') << 4);
-            }
-            else if (p[j] >= 'a' && p[j] <= 'f') {
-                v = (byte) ((p[j] - 'a' + 10) << 4);
-            }
-            else if (p[j] >= 'A' && p[j] <= 'F') {
-                v = (byte) ((p[j] - 'A' + 10) << 4);
-            }
-            else
-                throw new Error("BAD format :" + str);
-
-            if (p[j+1] >= '0' && p[j+1] <= '9') {
-                //System.out.println("ascii : " + p[j+1]);
-                v += (p[j+1] - '0');
-                //System.out.println("binary : " + v);
-            }
-            else if (p[j+1] >= 'a' && p[j+1] <= 'f') {
-                //System.out.println("ascii : " + p[j+1]);
-                v += (p[j+1] - 'a' + 10);
-                //System.out.println("binary : " + v+1);
-            }
-            else if (p[j+1] >= 'A' && p[j+1] <= 'F') {
-                //System.out.println("ascii : " + p[j+1]);
-                v += (p[j+1] - 'A' + 10);
-                //System.out.println("binary : " + v);
-            }
-            else
-                throw new Error("BAD format :" + str);
-
-            buf[i] = v;
-        }
-        return buf;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/package.html	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<HTML>
-<HEAD>
-<!--
- 
-Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-</HEAD>
-<BODY>
-    Public internal SNMP classes. These classes are not exposed by the API.
-<p><b>This API is a Sun Microsystems internal API  and is subject 
-   to change without notice.</b></p>
-</BODY>
-</HTML>
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/mpm/SnmpMsgTranslator.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.mpm;
-
-import com.sun.jmx.snmp.SnmpSecurityParameters;
-import com.sun.jmx.snmp.SnmpMsg;
-/**
- * The translator interface is implemented by classes dealing with a specific SNMP protocol version. SnmpMsgTranslator are used in conjonction with SnmpMsgProcessingModel implementations.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @since 1.5
- */
-public interface SnmpMsgTranslator {
-    /**
-     * Returns the request or message Id contained in the passed message. The message is a generic one that is narrowed in the object implementing this interface.
-     */
-    public int getMsgId(SnmpMsg msg);
-    /**
-     * Returns the response max message size. The message is a generic one that is narrowed in the object implementing this interface.
-     */
-    public int getMsgMaxSize(SnmpMsg msg);
-    /**
-     * Returns the message flags. The message is a generic one that is narrowed in the object implementing this interface.
-     */
-    public byte getMsgFlags(SnmpMsg msg);
-    /**
-     * Returns the message security model. The message is a generic one that is narrowed in the object implementing this interface.
-     */
-    public int getMsgSecurityModel(SnmpMsg msg);
-    /**
-     * Returns the message security level. The message is a generic one that is narrowed in the object implementing this interface.
-     */
-    public int getSecurityLevel(SnmpMsg msg);
-     /**
-     * Returns an encoded representation of security parameters contained in the passed msg. The message is a generic one that is narrowed in the object implementing this interface.
-     */
-    public byte[] getFlatSecurityParameters(SnmpMsg msg);
-    /**
-     * Returns the message security parameters. The message is a generic one that is narrowed in the object implementing this interface.
-     */
-    public SnmpSecurityParameters getSecurityParameters(SnmpMsg msg);
-    /**
-     * Returns the message context Engine Id. The message is a generic one that is narrowed in the object implementing this interface.
-     */
-    public byte[] getContextEngineId(SnmpMsg msg);
-    /**
-     * Returns the message context name. The message is a generic one that is narrowed in the object implementing this interface.
-     */
-    public byte[] getContextName(SnmpMsg msg);
-    /**
-     * Returns the raw message context name. Raw mean as it is received from the network, without translation. It can be useful when some data are piggy backed in the context name.The message is a generic one that is narrowed in the object implementing this interface.
-     */
-    public byte[] getRawContextName(SnmpMsg msg);
-    /**
-     * Returns the message accesscontext name. This access context name is used when dealing with access rights (eg: community for V1/V2 or context name for V3).The message is a generic one that is narrowed in the object implementing this interface.
-     */
-    public byte[] getAccessContext(SnmpMsg msg);
-    /**
-     * Returns the message encrypted pdu or null if no encryption. The message is a generic one that is narrowed in the object implementing this interface.
-     */
-    public byte[] getEncryptedPdu(SnmpMsg msg);
-    /**
-     * Set the context name of the passed message.
-     */
-    public void setContextName(SnmpMsg req, byte[] contextName);
-     /**
-     * Set the context engine Id of the passed message.
-     */
-    public void setContextEngineId(SnmpMsg req, byte[] contextEngineId);
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/mpm/package.html	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<HTML>
-<HEAD>
-<!--
- 
-Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-</HEAD>
-<BODY>
-Provides the classes which implement the <B>Message Processing Models</B> for SNMP version 1, version 2c and version 3. 
-<p><b>This API is a Sun Microsystems internal API  and is subject 
-   to change without notice.</b></p>
-</BODY>
-</HTML>
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/package.html	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<HTML>
-<HEAD>
-<!--
- 
-Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-</HEAD>
-<BODY>
-    Provides the core classes which implement <B>common SNMP data types and services</B>.
-<p><b>This API is a Sun Microsystems internal API  and is subject 
-   to change without notice.</b></p>
-</BODY>
-</HTML>
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/tasks/Task.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-// NPCTE fix for bugId 4510777, esc 532372, MR October 2001
-// file Task.java created for this bug fix
-/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.jmx.snmp.tasks;
-
-/**
- * This interface is implemented by objects that can be executed
- * by a {@link com.sun.jmx.snmp.tasks.TaskServer}.
- * <p>A <code>Task</code> object implements two methods:
- * <ul><li><code>public void run(): </code> from
- *               {@link java.lang.Runnable}</li>
- * <ul>This method is called by the {@link com.sun.jmx.snmp.tasks.TaskServer}
- *     when the task is executed.</ul>
- * <li><code>public void cancel(): </code></li>
- * <ul>This method is called by the {@link com.sun.jmx.snmp.tasks.TaskServer}
- *     if the <code>TaskServer</code> is stopped before the
- *     <code>Task</code> is executed.</ul>
- * </ul>
- * An implementation of {@link com.sun.jmx.snmp.tasks.TaskServer} shall call
- * either <code>run()</code> or <code>cancel()</code>.
- * Whether the task is executed synchronously in the current
- * thread (when calling <code>TaskServer.submitTask()</code> or in a new
- * thread dedicated to the task, or in a daemon thread, depends on the
- * implementation of the <code>TaskServer</code> through which the task
- * is executed.
- * <p>The implementation of <code>Task</code> must not make any
- * assumption on the implementation of the <code>TaskServer</code> through
- * which it will be executed.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @see com.sun.jmx.snmp.tasks.TaskServer
- *
- * @since 1.5
- **/
-public interface Task extends Runnable {
-    /**
-     * Cancel the submitted task.
-     * The implementation of this method is Task-implementation dependent.
-     * It could involve some message logging, or even call the run() method.
-     * Note that only one of run() or cancel() will be called - and exactly
-     * one.
-     **/
-    public void cancel();
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/tasks/TaskServer.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-// NPCTE fix for bugId 4510777, esc 532372, MR October 2001
-// file TaskServer.java created for this bug fix
-
-/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.jmx.snmp.tasks;
-
-/**
- * This interface is implemented by objects that are able to execute
- * tasks. Whether the task is executed in the client thread or in another
- * thread depends on the TaskServer implementation.
- *
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- * @see com.sun.jmx.snmp.tasks.Task
- *
- * @since 1.5
- **/
-public interface TaskServer {
-    /**
-     * Submit a task to be executed.
-     * Once a task is submitted, it is guaranteed that either
-     * {@link com.sun.jmx.snmp.tasks.Task#run() task.run()} or
-     * {@link com.sun.jmx.snmp.tasks.Task#cancel() task.cancel()} will be called.
-     * <p>Whether the task is executed in the client thread (e.g.
-     * <code>public void submitTask(Task task) { task.run(); }</code>) or in
-     * another thread (e.g. <code>
-     * public void submitTask(Task task) { new Thrad(task).start(); }</code>)
-     * depends on the TaskServer implementation.
-     * @param task The task to be executed.
-     **/
-    public void submitTask(Task task);
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/tasks/ThreadService.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,246 +0,0 @@
-/*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.jmx.snmp.tasks;
-
-import java.util.ArrayList;
-import com.sun.jmx.snmp.tasks.Task;
-import com.sun.jmx.snmp.tasks.TaskServer;
-
-/**
- * This class implements a {@link com.sun.jmx.snmp.tasks.TaskServer} over
- * a thread pool.
- * <p><b>This API is a Sun Microsystems internal API  and is subject
- * to change without notice.</b></p>
- **/
-public class ThreadService implements TaskServer {
-
-    public ThreadService(int threadNumber) {
-        if (threadNumber <= 0) {
-            throw new IllegalArgumentException("The thread number should bigger than zero.");
-        }
-
-        minThreads = threadNumber;
-        threadList = new ExecutorThread[threadNumber];
-
-        priority = Thread.currentThread().getPriority();
-        cloader = Thread.currentThread().getContextClassLoader();
-
-    }
-
-// public methods
-// --------------
-
-    /**
-     * Submit a task to be executed.
-     * Once a task is submitted, it is guaranteed that either
-     * {@link com.sun.jmx.snmp.tasks.Task#run() task.run()} or
-     * {@link com.sun.jmx.snmp.tasks.Task#cancel() task.cancel()} will be called.
-     * This implementation of TaskServer uses a thread pool to execute
-     * the submitted tasks.
-     * @param task The task to be executed.
-     * @exception IllegalArgumentException if the submitted task is null.
-     **/
-    public void submitTask(Task task) throws IllegalArgumentException {
-        submitTask((Runnable)task);
-    }
-
-    /**
-     * Submit a task to be executed.
-     * This implementation of TaskServer uses a thread pool to execute
-     * the submitted tasks.
-     * @param task The task to be executed.
-     * @exception IllegalArgumentException if the submitted task is null.
-     **/
-    public void submitTask(Runnable task) throws IllegalArgumentException {
-        stateCheck();
-
-        if (task == null) {
-            throw new IllegalArgumentException("No task specified.");
-        }
-
-        synchronized(jobList) {
-            jobList.add(jobList.size(), task);
-
-            jobList.notify();
-        }
-
-        createThread();
-    }
-
-    public Runnable removeTask(Runnable task) {
-        stateCheck();
-
-        Runnable removed = null;
-        synchronized(jobList) {
-            int lg = jobList.indexOf(task);
-            if (lg >= 0) {
-                removed = jobList.remove(lg);
-            }
-        }
-        if (removed != null && removed instanceof Task)
-            ((Task) removed).cancel();
-        return removed;
-    }
-
-    public void removeAll() {
-        stateCheck();
-
-        final Object[] jobs;
-        synchronized(jobList) {
-            jobs = jobList.toArray();
-            jobList.clear();
-        }
-        final int len = jobs.length;
-        for (int i=0; i<len ; i++) {
-            final Object o = jobs[i];
-            if (o!= null && o instanceof Task) ((Task)o).cancel();
-        }
-    }
-
-    // to terminate
-    public void terminate() {
-
-        if (terminated == true) {
-            return;
-        }
-
-        terminated = true;
-
-        synchronized(jobList) {
-            jobList.notifyAll();
-        }
-
-        removeAll();
-
-        for (int i=0; i<currThreds; i++) {
-            try {
-                threadList[i].interrupt();
-            } catch (Exception e) {
-                // TODO
-            }
-        }
-
-        threadList = null;
-    }
-
-// private classes
-// ---------------
-
-    // A thread used to execute jobs
-    //
-    private class ExecutorThread extends Thread {
-        public ExecutorThread() {
-            super(threadGroup, "ThreadService-"+counter++);
-            setDaemon(true);
-
-            // init
-            this.setPriority(priority);
-            this.setContextClassLoader(cloader);
-
-            idle++;
-        }
-
-        public void run() {
-
-            while(!terminated) {
-                Runnable job = null;
-
-                synchronized(jobList) {
-                    if (jobList.size() > 0) {
-                        job = jobList.remove(0);
-                        if (jobList.size() > 0) {
-                            jobList.notify();
-                        }
-
-                    } else {
-                        try {
-                            jobList.wait();
-                        } catch (InterruptedException ie) {
-                            // terminated ?
-                        } finally {
-                        }
-                        continue;
-                    }
-                }
-                if (job != null) {
-                    try {
-                        idle--;
-                        job.run();
-                    } catch (Exception e) {
-                        // TODO
-                        e.printStackTrace();
-                    } finally {
-                        idle++;
-                    }
-                }
-
-                // re-init
-                this.setPriority(priority);
-                Thread.interrupted();
-                this.setContextClassLoader(cloader);
-            }
-        }
-    }
-
-// private methods
-    private void stateCheck() throws IllegalStateException {
-        if (terminated) {
-            throw new IllegalStateException("The thread service has been terminated.");
-        }
-    }
-
-    private void createThread() {
-        if (idle < 1) {
-            synchronized(threadList) {
-                if (jobList.size() > 0 && currThreds < minThreads) {
-                    ExecutorThread et = new ExecutorThread();
-                    et.start();
-                    threadList[currThreds++] = et;
-                }
-            }
-        }
-    }
-
-
-// protected or private variables
-// ------------------------------
-    private ArrayList<Runnable> jobList = new ArrayList<Runnable>(0);
-
-    private ExecutorThread[] threadList;
-    private int minThreads = 1;
-    private int currThreds = 0;
-    private int idle = 0;
-
-    private boolean terminated = false;
-    private int priority;
-    private ThreadGroup threadGroup = new ThreadGroup("ThreadService");
-    private ClassLoader cloader;
-
-    private static long counter = 0;
-
-    private int addedJobs = 1;
-    private int doneJobs = 1;
-}
--- a/jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/tasks/package.html	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<HTML>
-<HEAD>
-<!--
- 
-Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-</HEAD>
-<BODY>
-Provides some <B>common</B> classes to control JDMK threading.
-<p><b>This API is a Sun Microsystems internal API  and is subject 
-   to change without notice.</b></p>
-</BODY>
-</HTML>
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/AdaptorBootstrap.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,396 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp;
-
-import com.sun.jmx.snmp.daemon.SnmpAdaptorServer;
-import com.sun.jmx.snmp.InetAddressAcl;
-import com.sun.jmx.snmp.IPAcl.SnmpAcl;
-import sun.management.snmp.jvmmib.JVM_MANAGEMENT_MIB;
-import sun.management.snmp.jvminstr.JVM_MANAGEMENT_MIB_IMPL;
-import sun.management.snmp.jvminstr.NotificationTarget;
-import sun.management.snmp.jvminstr.NotificationTargetImpl;
-import sun.management.snmp.util.MibLogger;
-import sun.management.snmp.util.JvmContextFactory;
-
-import sun.management.Agent;
-import sun.management.AgentConfigurationError;
-import static sun.management.AgentConfigurationError.*;
-import sun.management.FileSystem;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Properties;
-
-import java.io.IOException;
-import java.io.File;
-import java.io.FileInputStream;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-/**
- * This class initializes and starts the SNMP Adaptor for JSR 163 SNMP
- * Monitoring.
- **/
-public final class AdaptorBootstrap {
-
-    private static final MibLogger log = new MibLogger(AdaptorBootstrap.class);
-
-    /**
-     * Default values for SNMP configuration properties.
-     **/
-    public static interface DefaultValues {
-        public static final String PORT="161";
-        public static final String CONFIG_FILE_NAME="management.properties";
-        public static final String TRAP_PORT="162";
-        public static final String USE_ACL="true";
-        public static final String ACL_FILE_NAME="snmp.acl";
-        public static final String BIND_ADDRESS="localhost";
-    }
-
-    /**
-     * Names of SNMP configuration properties.
-     **/
-    public static interface PropertyNames {
-        public static final String PORT="com.sun.management.snmp.port";
-        public static final String CONFIG_FILE_NAME=
-            "com.sun.management.config.file";
-        public static final String TRAP_PORT=
-            "com.sun.management.snmp.trap";
-        public static final String USE_ACL=
-            "com.sun.management.snmp.acl";
-        public static final String ACL_FILE_NAME=
-            "com.sun.management.snmp.acl.file";
-        public static final String BIND_ADDRESS=
-            "com.sun.management.snmp.interface";
-    }
-
-    /**
-     * We keep a reference - so that we can possibly call
-     * terminate(). As of now, terminate() is only called by unit tests
-     * (makes it possible to run several testcases sequentially in the
-     * same JVM).
-     **/
-    private SnmpAdaptorServer       adaptor;
-    private JVM_MANAGEMENT_MIB_IMPL jvmmib;
-
-    private AdaptorBootstrap(SnmpAdaptorServer snmpas,
-                             JVM_MANAGEMENT_MIB_IMPL mib) {
-        jvmmib  = mib;
-        adaptor = snmpas;
-    }
-
-    /**
-     * Compute the full path name for a default file.
-     * @param basename basename (with extension) of the default file.
-     * @return ${JRE}/lib/management/${basename}
-     **/
-    private static String getDefaultFileName(String basename) {
-        final String fileSeparator = File.separator;
-        return System.getProperty("java.home") + fileSeparator + "lib" +
-            fileSeparator + "management" + fileSeparator + basename;
-    }
-
-    /**
-     * Retrieve the Trap Target List from the ACL file.
-     **/
-    @SuppressWarnings("unchecked")
-    private static List<NotificationTarget> getTargetList(InetAddressAcl acl,
-                                                          int defaultTrapPort) {
-        final ArrayList<NotificationTarget> result =
-                new ArrayList<>();
-        if (acl != null) {
-            if (log.isDebugOn())
-                log.debug("getTargetList",Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.processing"));
-
-            final Enumeration<InetAddress> td = acl.getTrapDestinations();
-            for (; td.hasMoreElements() ;) {
-                final InetAddress targetAddr = td.nextElement();
-                final Enumeration<String> tc =
-                    acl.getTrapCommunities(targetAddr);
-                for (;tc.hasMoreElements() ;) {
-                    final String community = tc.nextElement();
-                    final NotificationTarget target =
-                        new NotificationTargetImpl(targetAddr,
-                                                   defaultTrapPort,
-                                                   community);
-                    if (log.isDebugOn())
-                        log.debug("getTargetList",
-                                  Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.adding",
-                                                target.toString()));
-                    result.add(target);
-                }
-            }
-        }
-        return result;
-    }
-
-    /**
-     * Initializes and starts the SNMP Adaptor Server.
-     * If the com.sun.management.snmp.port property is not defined,
-     * simply return. Otherwise, attempts to load the config file, and
-     * then calls {@link #initialize(java.lang.String, java.util.Properties)}.
-     *
-     **/
-    public static synchronized AdaptorBootstrap initialize() {
-
-        // Load a new properties
-        final Properties props = Agent.loadManagementProperties();
-        if (props == null) return null;
-
-        final String portStr = props.getProperty(PropertyNames.PORT);
-
-        return initialize(portStr,props);
-    }
-
-    /**
-     * Initializes and starts the SNMP Adaptor Server.
-     **/
-    public static synchronized
-        AdaptorBootstrap initialize(String portStr, Properties props) {
-
-        // Get port number
-        if (portStr.length()==0) portStr=DefaultValues.PORT;
-        final int port;
-        try {
-            port = Integer.parseInt(portStr);
-        } catch (NumberFormatException x) {
-            throw new AgentConfigurationError(INVALID_SNMP_PORT, x, portStr);
-        }
-
-        if (port < 0) {
-            throw new AgentConfigurationError(INVALID_SNMP_PORT, portStr);
-        }
-
-        // Get trap port number
-        final String trapPortStr =
-            props.getProperty(PropertyNames.TRAP_PORT,
-                              DefaultValues.TRAP_PORT);
-
-        final int trapPort;
-        try {
-            trapPort = Integer.parseInt(trapPortStr);
-        } catch (NumberFormatException x) {
-            throw new AgentConfigurationError(INVALID_SNMP_TRAP_PORT, x, trapPortStr);
-        }
-
-        if (trapPort < 0) {
-            throw new AgentConfigurationError(INVALID_SNMP_TRAP_PORT, trapPortStr);
-        }
-
-        // Get bind address
-        final String addrStr =
-            props.getProperty(PropertyNames.BIND_ADDRESS,
-                              DefaultValues.BIND_ADDRESS);
-
-        // Get ACL File
-        final String defaultAclFileName   =
-            getDefaultFileName(DefaultValues.ACL_FILE_NAME);
-        final String aclFileName =
-            props.getProperty(PropertyNames.ACL_FILE_NAME,
-                               defaultAclFileName);
-        final String  useAclStr =
-            props.getProperty(PropertyNames.USE_ACL,DefaultValues.USE_ACL);
-        final boolean useAcl =
-            Boolean.valueOf(useAclStr).booleanValue();
-
-        if (useAcl) checkAclFile(aclFileName);
-
-        AdaptorBootstrap adaptor = null;
-        try {
-            adaptor = getAdaptorBootstrap(port, trapPort, addrStr,
-                                          useAcl, aclFileName);
-        } catch (Exception e) {
-            throw new AgentConfigurationError(AGENT_EXCEPTION, e, e.getMessage());
-        }
-        return adaptor;
-    }
-
-    private static AdaptorBootstrap getAdaptorBootstrap
-        (int port, int trapPort, String bindAddress, boolean useAcl,
-         String aclFileName) {
-
-        final InetAddress address;
-        try {
-            address = InetAddress.getByName(bindAddress);
-        } catch (UnknownHostException e) {
-            throw new AgentConfigurationError(UNKNOWN_SNMP_INTERFACE, e, bindAddress);
-        }
-        if (log.isDebugOn()) {
-            log.debug("initialize",
-                      Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.starting" +
-                      "\n\t" + PropertyNames.PORT + "=" + port +
-                      "\n\t" + PropertyNames.TRAP_PORT + "=" + trapPort +
-                      "\n\t" + PropertyNames.BIND_ADDRESS + "=" + address +
-                      (useAcl?("\n\t" + PropertyNames.ACL_FILE_NAME + "="
-                               + aclFileName):"\n\tNo ACL")+
-                      ""));
-        }
-
-        final InetAddressAcl acl;
-        try {
-            acl = useAcl ? new SnmpAcl(System.getProperty("user.name"),aclFileName)
-                         : null;
-        } catch (UnknownHostException e) {
-            throw new AgentConfigurationError(UNKNOWN_SNMP_INTERFACE, e, e.getMessage());
-        }
-
-        // Create adaptor
-        final SnmpAdaptorServer adaptor =
-            new SnmpAdaptorServer(acl, port, address);
-        adaptor.setUserDataFactory(new JvmContextFactory());
-        adaptor.setTrapPort(trapPort);
-
-        // Create MIB
-        //
-        final JVM_MANAGEMENT_MIB_IMPL mib = new JVM_MANAGEMENT_MIB_IMPL();
-        try {
-            mib.init();
-        } catch (IllegalAccessException x) {
-            throw new AgentConfigurationError(SNMP_MIB_INIT_FAILED, x, x.getMessage());
-        }
-
-        // Configure the trap destinations.
-        //
-        mib.addTargets(getTargetList(acl,trapPort));
-
-
-        // Start Adaptor
-        //
-        try {
-            // Will wait until the adaptor starts or fails to start.
-            // If the adaptor fails to start, a CommunicationException or
-            // an InterruptedException is thrown.
-            //
-            adaptor.start(Long.MAX_VALUE);
-        } catch (Exception x) {
-            Throwable t=x;
-            if (x instanceof com.sun.jmx.snmp.daemon.CommunicationException) {
-                final Throwable next = t.getCause();
-                if (next != null) t = next;
-            }
-            throw new AgentConfigurationError(SNMP_ADAPTOR_START_FAILED, t,
-                                              address + ":" + port,
-                                              "(" + t.getMessage() + ")");
-        }
-
-        // double check that adaptor is actually started (should always
-        // be active, so that exception should never be thrown from here)
-        //
-        if (!adaptor.isActive()) {
-            throw new AgentConfigurationError(SNMP_ADAPTOR_START_FAILED,
-                                              address + ":" + port);
-        }
-
-        try {
-            // Add MIB to adaptor
-            //
-            adaptor.addMib(mib);
-
-            // Add Adaptor to the MIB
-            //
-            mib.setSnmpAdaptor(adaptor);
-        } catch (RuntimeException x) {
-            new AdaptorBootstrap(adaptor,mib).terminate();
-            throw x;
-        }
-
-        log.debug("initialize",
-                  Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.initialize1"));
-        log.config("initialize",
-                   Agent.getText("jmxremote.AdaptorBootstrap.getTargetList.initialize2",
-                                 address.toString(), java.lang.Integer.toString(adaptor.getPort())));
-        return new AdaptorBootstrap(adaptor,mib);
-    }
-
-    private static void checkAclFile(String aclFileName) {
-        if (aclFileName == null || aclFileName.length()==0) {
-            throw new AgentConfigurationError(SNMP_ACL_FILE_NOT_SET);
-        }
-        final File file = new File(aclFileName);
-        if (!file.exists()) {
-            throw new AgentConfigurationError(SNMP_ACL_FILE_NOT_FOUND, aclFileName);
-        }
-        if (!file.canRead()) {
-            throw new AgentConfigurationError(SNMP_ACL_FILE_NOT_READABLE, aclFileName);
-        }
-
-        FileSystem fs = FileSystem.open();
-        try {
-            if (fs.supportsFileSecurity(file)) {
-                if (!fs.isAccessUserOnly(file)) {
-                    throw new AgentConfigurationError(SNMP_ACL_FILE_ACCESS_NOT_RESTRICTED,
-                        aclFileName);
-                }
-            }
-        } catch (IOException e) {
-            throw new AgentConfigurationError(SNMP_ACL_FILE_READ_FAILED, aclFileName);
-
-        }
-    }
-
-
-    /**
-     * Get the port on which the adaptor is bound.
-     * Returns 0 if the adaptor is already terminated.
-     *
-     **/
-    public synchronized int getPort() {
-        if (adaptor != null) return adaptor.getPort();
-        return 0;
-    }
-
-    /**
-     * Stops the adaptor server.
-     **/
-    public synchronized void terminate() {
-        if (adaptor == null) return;
-
-        // Terminate the MIB (deregister NotificationListener from
-        // MemoryMBean)
-        //
-        try {
-            jvmmib.terminate();
-        } catch (Exception x) {
-            // Must not prevent to stop...
-            //
-            log.debug("jmxremote.AdaptorBootstrap.getTargetList.terminate",
-                      x.toString());
-        } finally {
-            jvmmib=null;
-        }
-
-        // Stop the adaptor
-        //
-        try {
-            adaptor.stop();
-        } finally {
-            adaptor = null;
-        }
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JVM_MANAGEMENT_MIB_IMPL.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,694 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.util.Hashtable;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.lang.ref.WeakReference;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.NotificationEmitter;
-import javax.management.NotificationListener;
-import javax.management.Notification;
-import javax.management.ListenerNotFoundException;
-import javax.management.openmbean.CompositeData;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.daemon.SnmpAdaptorServer;
-import com.sun.jmx.snmp.SnmpPeer;
-import com.sun.jmx.snmp.SnmpParameters;
-
-import com.sun.jmx.snmp.SnmpOidTable;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpVarBindList;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.Enumerated;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-
-import sun.management.snmp.jvmmib.JVM_MANAGEMENT_MIBOidTable;
-import sun.management.snmp.jvmmib.JVM_MANAGEMENT_MIB;
-import sun.management.snmp.jvmmib.JvmMemoryMeta;
-import sun.management.snmp.jvmmib.JvmThreadingMeta;
-import sun.management.snmp.jvmmib.JvmRuntimeMeta;
-import sun.management.snmp.jvmmib.JvmClassLoadingMeta;
-import sun.management.snmp.jvmmib.JvmCompilationMeta;
-import sun.management.snmp.util.MibLogger;
-import sun.management.snmp.util.SnmpCachedData;
-import sun.management.snmp.util.SnmpTableHandler;
-
-//java management imports
-import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryPoolMXBean;
-import java.lang.management.MemoryNotificationInfo;
-import java.lang.management.MemoryType;
-
-public class JVM_MANAGEMENT_MIB_IMPL extends JVM_MANAGEMENT_MIB {
-    private static final long serialVersionUID = -8104825586888859831L;
-
-    private static final MibLogger log =
-        new MibLogger(JVM_MANAGEMENT_MIB_IMPL.class);
-
-    private static WeakReference<SnmpOidTable> tableRef;
-
-    public static SnmpOidTable getOidTable() {
-        SnmpOidTable table = null;
-        if(tableRef == null) {
-            table =  new JVM_MANAGEMENT_MIBOidTable();
-            tableRef = new WeakReference<>(table);
-            return table;
-        }
-
-        table = tableRef.get();
-        if(table == null) {
-            table = new JVM_MANAGEMENT_MIBOidTable();
-            tableRef = new WeakReference<>(table);
-        }
-
-        return table;
-    }
-
-    /**
-     * Handler waiting for memory <CODE>Notification</CODE>.
-     * Translate each JMX notification in SNMP trap.
-     */
-    private class NotificationHandler implements NotificationListener {
-        public void handleNotification(Notification notification,
-                                       Object handback) {
-            log.debug("handleNotification", "Received notification [ " +
-                      notification.getType() + "]");
-
-            String type = notification.getType();
-            if (type.equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED) ||
-                type.equals(MemoryNotificationInfo.
-                    MEMORY_COLLECTION_THRESHOLD_EXCEEDED)) {
-                MemoryNotificationInfo minfo = MemoryNotificationInfo.
-                    from((CompositeData) notification.getUserData());
-                SnmpCounter64 count = new SnmpCounter64(minfo.getCount());
-                SnmpCounter64 used =
-                    new SnmpCounter64(minfo.getUsage().getUsed());
-                SnmpString poolName = new SnmpString(minfo.getPoolName());
-                SnmpOid entryIndex =
-                    getJvmMemPoolEntryIndex(minfo.getPoolName());
-
-                if (entryIndex == null) {
-                    log.error("handleNotification",
-                              "Error: Can't find entry index for Memory Pool: "
-                              + minfo.getPoolName() +": " +
-                              "No trap emitted for " + type);
-                    return;
-                }
-
-                SnmpOid trap = null;
-
-                final SnmpOidTable mibTable = getOidTable();
-                try {
-                    SnmpOid usedOid  = null;
-                    SnmpOid countOid = null;
-
-                    if (type.equals(MemoryNotificationInfo.
-                                   MEMORY_THRESHOLD_EXCEEDED)) {
-                        trap = new SnmpOid(mibTable.
-                        resolveVarName("jvmLowMemoryPoolUsageNotif").getOid());
-                        usedOid =
-                            new SnmpOid(mibTable.
-                            resolveVarName("jvmMemPoolUsed").getOid() +
-                                    "." + entryIndex);
-                        countOid =
-                            new SnmpOid(mibTable.
-                            resolveVarName("jvmMemPoolThreshdCount").getOid()
-                                    + "." + entryIndex);
-                    } else if  (type.equals(MemoryNotificationInfo.
-                                   MEMORY_COLLECTION_THRESHOLD_EXCEEDED)) {
-                        trap = new SnmpOid(mibTable.
-                        resolveVarName("jvmLowMemoryPoolCollectNotif").
-                                           getOid());
-                        usedOid =
-                            new SnmpOid(mibTable.
-                            resolveVarName("jvmMemPoolCollectUsed").getOid() +
-                                        "." + entryIndex);
-                        countOid =
-                            new SnmpOid(mibTable.
-                            resolveVarName("jvmMemPoolCollectThreshdCount").
-                                        getOid() +
-                                        "." + entryIndex);
-                    }
-
-                    //Datas
-                    SnmpVarBindList list = new SnmpVarBindList();
-                    SnmpOid poolNameOid =
-                        new SnmpOid(mibTable.
-                                    resolveVarName("jvmMemPoolName").getOid() +
-                                    "." + entryIndex);
-
-                    SnmpVarBind varCount = new SnmpVarBind(countOid, count);
-                    SnmpVarBind varUsed = new SnmpVarBind(usedOid, used);
-                    SnmpVarBind varPoolName = new SnmpVarBind(poolNameOid,
-                                              poolName);
-
-                    list.add(varPoolName);
-                    list.add(varCount);
-                    list.add(varUsed);
-
-                    sendTrap(trap, list);
-                }catch(Exception e) {
-                    log.error("handleNotification",
-                              "Exception occurred : " + e);
-                }
-            }
-        }
-    }
-
-    /**
-     * List of notification targets.
-     */
-    private ArrayList<NotificationTarget> notificationTargets =
-            new ArrayList<>();
-    private final NotificationEmitter emitter;
-    private final NotificationHandler handler;
-
-
-    /**
-     * Instantiate a JVM MIB intrusmentation.
-     * A <CODE>NotificationListener</CODE> is added to the <CODE>MemoryMXBean</CODE>
-     * <CODE>NotificationEmitter</CODE>
-     */
-    public JVM_MANAGEMENT_MIB_IMPL() {
-        handler = new NotificationHandler();
-        emitter = (NotificationEmitter) ManagementFactory.getMemoryMXBean();
-        emitter.addNotificationListener(handler, null, null);
-    }
-
-    private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
-        final Iterator<NotificationTarget> iterator = notificationTargets.iterator();
-        final SnmpAdaptorServer adaptor =
-            (SnmpAdaptorServer) getSnmpAdaptor();
-
-        if (adaptor == null) {
-            log.error("sendTrap", "Cannot send trap: adaptor is null.");
-            return;
-        }
-
-        if (!adaptor.isActive()) {
-            log.config("sendTrap", "Adaptor is not active: trap not sent.");
-            return;
-        }
-
-        while(iterator.hasNext()) {
-            NotificationTarget target = null;
-            try {
-                target = iterator.next();
-                SnmpPeer peer =
-                    new SnmpPeer(target.getAddress(), target.getPort());
-                SnmpParameters p = new SnmpParameters();
-                p.setRdCommunity(target.getCommunity());
-                peer.setParams(p);
-                log.debug("handleNotification", "Sending trap to " +
-                          target.getAddress() + ":" + target.getPort());
-                adaptor.snmpV2Trap(peer, trap, list, null);
-            }catch(Exception e) {
-                log.error("sendTrap",
-                          "Exception occurred while sending trap to [" +
-                          target + "]. Exception : " + e);
-                log.debug("sendTrap",e);
-            }
-        }
-    }
-
-    /**
-     * Add a notification target.
-     * @param target The target to add
-     * @throws IllegalArgumentException If target parameter is null.
-     */
-    public synchronized void addTarget(NotificationTarget target)
-        throws IllegalArgumentException {
-        if(target == null)
-            throw new IllegalArgumentException("Target is null");
-
-        notificationTargets.add(target);
-    }
-
-    /**
-     * Remove notification listener.
-     */
-    public void terminate() {
-        try {
-            emitter.removeNotificationListener(handler);
-        }catch(ListenerNotFoundException e) {
-            log.error("terminate", "Listener Not found : " + e);
-        }
-    }
-
-    /**
-     * Add notification targets.
-     * @param targets A list of
-     * <CODE>sun.management.snmp.jvminstr.NotificationTarget</CODE>
-     * @throws IllegalArgumentException If targets parameter is null.
-     */
-    public synchronized void addTargets(List<NotificationTarget> targets)
-        throws IllegalArgumentException {
-        if(targets == null)
-            throw new IllegalArgumentException("Target list is null");
-
-        notificationTargets.addAll(targets);
-    }
-
-    /**
-     * Factory method for "JvmMemory" group MBean.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated MBean class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmMemory")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the MBean class generated for the
-     *         "JvmMemory" group (JvmMemory)
-     *
-     * Note that when using standard metadata,
-     * the returned object must implement the "JvmMemoryMBean"
-     * interface.
-     **/
-    protected Object createJvmMemoryMBean(String groupName,
-                String groupOid,  ObjectName groupObjname,
-                                          MBeanServer server)  {
-
-        // Note that when using standard metadata,
-        // the returned object must implement the "JvmMemoryMBean"
-        // interface.
-        //
-        if (server != null)
-            return new JvmMemoryImpl(this,server);
-        else
-            return new JvmMemoryImpl(this);
-    }
-
-    /**
-     * Factory method for "JvmMemory" group metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmMemory")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmMemory" group (JvmMemoryMeta)
-     *
-     **/
-    protected JvmMemoryMeta createJvmMemoryMetaNode(String groupName,
-                                                    String groupOid,
-                                                    ObjectName groupObjname,
-                                                    MBeanServer server) {
-        return new JvmMemoryMetaImpl(this, objectserver);
-    }
-
-    /**
-     * Factory method for "JvmThreading" group metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmThreading")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmThreading" group (JvmThreadingMeta)
-     *
-     **/
-    protected JvmThreadingMeta createJvmThreadingMetaNode(String groupName,
-                                                          String groupOid,
-                                                          ObjectName groupObjname,
-                                                          MBeanServer server)  {
-        return new JvmThreadingMetaImpl(this, objectserver);
-    }
-
-    /**
-     * Factory method for "JvmThreading" group MBean.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated MBean class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmThreading")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the MBean class generated for the
-     *         "JvmThreading" group (JvmThreading)
-     *
-     * Note that when using standard metadata,
-     * the returned object must implement the "JvmThreadingMBean"
-     * interface.
-     **/
-    protected Object createJvmThreadingMBean(String groupName,
-                                             String groupOid,
-                                             ObjectName groupObjname,
-                                             MBeanServer server)  {
-
-        // Note that when using standard metadata,
-        // the returned object must implement the "JvmThreadingMBean"
-        // interface.
-        //
-        if (server != null)
-            return new JvmThreadingImpl(this,server);
-        else
-            return new JvmThreadingImpl(this);
-    }
-
-    /**
-     * Factory method for "JvmRuntime" group metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmRuntime")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmRuntime" group (JvmRuntimeMeta)
-     *
-     **/
-    protected JvmRuntimeMeta createJvmRuntimeMetaNode(String groupName,
-                                                      String groupOid,
-                                                      ObjectName groupObjname,
-                                                      MBeanServer server)  {
-        return new JvmRuntimeMetaImpl(this, objectserver);
-    }
-
-    /**
-     * Factory method for "JvmRuntime" group MBean.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated MBean class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmRuntime")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the MBean class generated for the
-     *         "JvmRuntime" group (JvmRuntime)
-     *
-     * Note that when using standard metadata,
-     * the returned object must implement the "JvmRuntimeMBean"
-     * interface.
-     **/
-    protected Object createJvmRuntimeMBean(String groupName,
-                                           String groupOid,
-                                           ObjectName groupObjname,
-                                           MBeanServer server)  {
-
-        // Note that when using standard metadata,
-        // the returned object must implement the "JvmRuntimeMBean"
-        // interface.
-        //
-        if (server != null)
-            return new JvmRuntimeImpl(this,server);
-        else
-            return new JvmRuntimeImpl(this);
-    }
-
-    /**
-     * Factory method for "JvmCompilation" group metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmCompilation")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmCompilation" group (JvmCompilationMeta)
-     *
-     **/
-    protected JvmCompilationMeta
-        createJvmCompilationMetaNode(String groupName,
-                                     String groupOid,
-                                     ObjectName groupObjname,
-                                     MBeanServer server)  {
-        // If there is no compilation system, the jvmCompilation  will not
-        // be instantiated.
-        //
-        if (ManagementFactory.getCompilationMXBean() == null) return null;
-        return super.createJvmCompilationMetaNode(groupName,groupOid,
-                                                  groupObjname,server);
-    }
-
-    /**
-     * Factory method for "JvmCompilation" group MBean.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated MBean class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmCompilation")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the MBean class generated for the
-     *         "JvmCompilation" group (JvmCompilation)
-     *
-     * Note that when using standard metadata,
-     * the returned object must implement the "JvmCompilationMBean"
-     * interface.
-     **/
-    protected Object createJvmCompilationMBean(String groupName,
-                String groupOid,  ObjectName groupObjname, MBeanServer server)  {
-
-        // Note that when using standard metadata,
-        // the returned object must implement the "JvmCompilationMBean"
-        // interface.
-        //
-        if (server != null)
-            return new JvmCompilationImpl(this,server);
-        else
-            return new JvmCompilationImpl(this);
-    }
-
-    /**
-     * Factory method for "JvmOS" group MBean.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated MBean class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmOS")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the MBean class generated for the
-     *         "JvmOS" group (JvmOS)
-     *
-     * Note that when using standard metadata,
-     * the returned object must implement the "JvmOSMBean"
-     * interface.
-     **/
-    protected Object createJvmOSMBean(String groupName,
-                String groupOid,  ObjectName groupObjname, MBeanServer server)  {
-
-        // Note that when using standard metadata,
-        // the returned object must implement the "JvmOSMBean"
-        // interface.
-        //
-        if (server != null)
-            return new JvmOSImpl(this,server);
-        else
-            return new JvmOSImpl(this);
-    }
-
-
-    /**
-     * Factory method for "JvmClassLoading" group MBean.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated MBean class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmClassLoading")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the MBean class generated for the
-     *         "JvmClassLoading" group (JvmClassLoading)
-     *
-     * Note that when using standard metadata,
-     * the returned object must implement the "JvmClassLoadingMBean"
-     * interface.
-     **/
-    protected Object createJvmClassLoadingMBean(String groupName,
-                                                String groupOid,
-                                                ObjectName groupObjname,
-                                                MBeanServer server)  {
-
-        // Note that when using standard metadata,
-        // the returned object must implement the "JvmClassLoadingMBean"
-        // interface.
-        //
-        if (server != null)
-            return new JvmClassLoadingImpl(this,server);
-        else
-            return new JvmClassLoadingImpl(this);
-    }
-
-    static String validDisplayStringTC(String str) {
-
-        if(str == null) return "";
-
-        if(str.length() > DISPLAY_STRING_MAX_LENGTH) {
-            return str.substring(0, DISPLAY_STRING_MAX_LENGTH);
-        }
-        else
-            return str;
-    }
-
-    static String validJavaObjectNameTC(String str) {
-
-        if(str == null) return "";
-
-        if(str.length() > JAVA_OBJECT_NAME_MAX_LENGTH) {
-            return str.substring(0, JAVA_OBJECT_NAME_MAX_LENGTH);
-        }
-        else
-            return str;
-    }
-
-    static String validPathElementTC(String str) {
-
-        if(str == null) return "";
-
-        if(str.length() > PATH_ELEMENT_MAX_LENGTH) {
-            return str.substring(0, PATH_ELEMENT_MAX_LENGTH);
-        }
-        else
-            return str;
-    }
-    static String validArgValueTC(String str) {
-
-        if(str == null) return "";
-
-        if(str.length() > ARG_VALUE_MAX_LENGTH) {
-            return str.substring(0, ARG_VALUE_MAX_LENGTH);
-        }
-        else
-            return str;
-    }
-
-    /**
-     * WARNING: This should probably be moved to JvmMemPoolTableMetaImpl
-     **/
-    private SnmpTableHandler getJvmMemPoolTableHandler(Object userData) {
-        final SnmpMibTable meta =
-            getRegisteredTableMeta("JvmMemPoolTable");
-        if (! (meta instanceof JvmMemPoolTableMetaImpl)) {
-            final String err = ((meta==null)?"No metadata for JvmMemPoolTable":
-                                "Bad metadata class for JvmMemPoolTable: " +
-                                meta.getClass().getName());
-            log.error("getJvmMemPoolTableHandler", err);
-            return null;
-        }
-        final JvmMemPoolTableMetaImpl memPoolTable =
-            (JvmMemPoolTableMetaImpl) meta;
-        return memPoolTable.getHandler(userData);
-    }
-
-    /**
-     * WARNING: This should probably be moved to JvmMemPoolTableMetaImpl
-     **/
-    private int findInCache(SnmpTableHandler handler,
-                            String poolName) {
-
-        if (!(handler instanceof SnmpCachedData)) {
-            if (handler != null) {
-                final String err = "Bad class for JvmMemPoolTable datas: " +
-                    handler.getClass().getName();
-                log.error("getJvmMemPoolEntry", err);
-            }
-            return -1;
-        }
-
-        final SnmpCachedData data = (SnmpCachedData)handler;
-        final int len = data.datas.length;
-        for (int i=0; i < data.datas.length ; i++) {
-            final MemoryPoolMXBean pool = (MemoryPoolMXBean) data.datas[i];
-            if (poolName.equals(pool.getName())) return i;
-        }
-        return -1;
-    }
-
-    /**
-     * WARNING: This should probably be moved to JvmMemPoolTableMetaImpl
-     **/
-    private SnmpOid getJvmMemPoolEntryIndex(SnmpTableHandler handler,
-                                            String poolName) {
-        final int index = findInCache(handler,poolName);
-        if (index < 0) return null;
-        return ((SnmpCachedData)handler).indexes[index];
-    }
-
-    private SnmpOid getJvmMemPoolEntryIndex(String poolName) {
-        return getJvmMemPoolEntryIndex(getJvmMemPoolTableHandler(null),
-                                       poolName);
-    }
-
-    // cache validity
-    //
-    // Should we define a property for this? Should we have different
-    // cache validity periods depending on which table we cache?
-    //
-    public long validity() {
-        return DEFAULT_CACHE_VALIDITY_PERIOD;
-    }
-
-    // Defined in RFC 2579
-    private final static int DISPLAY_STRING_MAX_LENGTH=255;
-    private final static int JAVA_OBJECT_NAME_MAX_LENGTH=1023;
-    private final static int PATH_ELEMENT_MAX_LENGTH=1023;
-    private final static int ARG_VALUE_MAX_LENGTH=1023;
-    private final static int DEFAULT_CACHE_VALIDITY_PERIOD=1000;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmClassLoadingImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.io.Serializable;
-
-import java.lang.management.ClassLoadingMXBean;
-import java.lang.management.ManagementFactory;
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-
-import sun.management.snmp.jvmmib.JvmClassLoadingMBean;
-import sun.management.snmp.jvmmib.EnumJvmClassesVerboseLevel;
-import sun.management.snmp.util.MibLogger;
-
-/**
- * The class is used for implementing the "JvmClassLoading" group.
- */
-public class JvmClassLoadingImpl implements JvmClassLoadingMBean {
-
-    /**
-     * Variable for storing the value of "JvmClassesVerboseLevel".
-     *
-     * "verbose: if the -verbose:class flag is set.
-     * silent:  otherwise.
-     *
-     * See java.management.ClassLoadingMXBean.isVerbose(),
-     * java.management.ClassLoadingMXBean.setVerbose()
-     * "
-     *
-     */
-    static final EnumJvmClassesVerboseLevel JvmClassesVerboseLevelVerbose =
-        new EnumJvmClassesVerboseLevel("verbose");
-    static final EnumJvmClassesVerboseLevel JvmClassesVerboseLevelSilent =
-        new EnumJvmClassesVerboseLevel("silent");
-
-    /**
-     * Constructor for the "JvmClassLoading" group.
-     * If the group contains a table, the entries created through an
-     * SNMP SET will not be registered in Java DMK.
-     */
-    public JvmClassLoadingImpl(SnmpMib myMib) {
-    }
-
-    /**
-     * Constructor for the "JvmClassLoading" group.
-     * If the group contains a table, the entries created through an SNMP SET
-     * will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmClassLoadingImpl(SnmpMib myMib, MBeanServer server) {
-    }
-
-    static ClassLoadingMXBean getClassLoadingMXBean() {
-        return ManagementFactory.getClassLoadingMXBean();
-    }
-
-    /**
-     * Getter for the "JvmClassesVerboseLevel" variable.
-     */
-    public EnumJvmClassesVerboseLevel getJvmClassesVerboseLevel()
-        throws SnmpStatusException {
-        if(getClassLoadingMXBean().isVerbose())
-            return JvmClassesVerboseLevelVerbose;
-        else
-            return JvmClassesVerboseLevelSilent;
-    }
-
-    /**
-     * Setter for the "JvmClassesVerboseLevel" variable.
-     */
-    public void setJvmClassesVerboseLevel(EnumJvmClassesVerboseLevel x)
-        throws SnmpStatusException {
-        final boolean verbose;
-        if (JvmClassesVerboseLevelVerbose.equals(x)) verbose=true;
-        else if (JvmClassesVerboseLevelSilent.equals(x)) verbose=false;
-        // Should never happen, this case is handled by
-        // checkJvmClassesVerboseLevel();
-        else throw new
-            SnmpStatusException(SnmpStatusException.snmpRspWrongValue);
-        getClassLoadingMXBean().setVerbose(verbose);
-    }
-
-    /**
-     * Checker for the "JvmClassesVerboseLevel" variable.
-     */
-    public void checkJvmClassesVerboseLevel(EnumJvmClassesVerboseLevel x)
-        throws SnmpStatusException {
-        //
-        // Add your own checking policy.
-        //
-        if (JvmClassesVerboseLevelVerbose.equals(x)) return;
-        if (JvmClassesVerboseLevelSilent.equals(x))  return;
-        throw new SnmpStatusException(SnmpStatusException.snmpRspWrongValue);
-
-    }
-
-    /**
-     * Getter for the "JvmClassesUnloadedCount" variable.
-     */
-    public Long getJvmClassesUnloadedCount() throws SnmpStatusException {
-        return getClassLoadingMXBean().getUnloadedClassCount();
-    }
-
-    /**
-     * Getter for the "JvmClassesTotalLoadedCount" variable.
-     */
-    public Long getJvmClassesTotalLoadedCount() throws SnmpStatusException {
-        return getClassLoadingMXBean().getTotalLoadedClassCount();
-    }
-
-    /**
-     * Getter for the "JvmClassesLoadedCount" variable.
-     */
-    public Long getJvmClassesLoadedCount() throws SnmpStatusException {
-        return (long)getClassLoadingMXBean().getLoadedClassCount();
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmCompilationImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.io.Serializable;
-import java.lang.management.ManagementFactory;
-import java.lang.management.CompilationMXBean;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-
-import sun.management.snmp.jvmmib.JvmCompilationMBean;
-import sun.management.snmp.jvmmib.EnumJvmJITCompilerTimeMonitoring;
-import sun.management.snmp.util.MibLogger;
-
-/**
- * The class is used for implementing the "JvmCompilation" group.
- */
-public class JvmCompilationImpl implements JvmCompilationMBean {
-
-    /**
-     * Variable for storing the value of "JvmJITCompilerTimeMonitoring".
-     *
-     * "Indicates whether the Java virtual machine supports
-     * compilation time monitoring.
-     *
-     * See java.management.CompilationMXBean.
-     * isCompilationTimeMonitoringSupported()
-     * "
-     *
-     */
-    static final EnumJvmJITCompilerTimeMonitoring
-        JvmJITCompilerTimeMonitoringSupported =
-        new EnumJvmJITCompilerTimeMonitoring("supported");
-    static final EnumJvmJITCompilerTimeMonitoring
-        JvmJITCompilerTimeMonitoringUnsupported =
-        new EnumJvmJITCompilerTimeMonitoring("unsupported");
-
-
-    /**
-     * Constructor for the "JvmCompilation" group.
-     * If the group contains a table, the entries created through an SNMP SET
-     * will not be registered in Java DMK.
-     */
-    public JvmCompilationImpl(SnmpMib myMib) {
-    }
-
-
-    /**
-     * Constructor for the "JvmCompilation" group.
-     * If the group contains a table, the entries created through an SNMP
-     * SET will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmCompilationImpl(SnmpMib myMib, MBeanServer server) {
-    }
-
-    private static CompilationMXBean getCompilationMXBean() {
-        return ManagementFactory.getCompilationMXBean();
-    }
-
-    /**
-     * Getter for the "JvmJITCompilerTimeMonitoring" variable.
-     */
-    public EnumJvmJITCompilerTimeMonitoring getJvmJITCompilerTimeMonitoring()
-        throws SnmpStatusException {
-
-        // If we reach this point, then we can safely assume that
-        // getCompilationMXBean() will not return null, because this
-        // object will not be instantiated when there is no compilation
-        // system (see JVM_MANAGEMENT_MIB_IMPL).
-        //
-        if(getCompilationMXBean().isCompilationTimeMonitoringSupported())
-            return JvmJITCompilerTimeMonitoringSupported;
-        else
-            return JvmJITCompilerTimeMonitoringUnsupported;
-    }
-
-    /**
-     * Getter for the "JvmJITCompilerTimeMs" variable.
-     */
-    public Long getJvmJITCompilerTimeMs() throws SnmpStatusException {
-        final long t;
-        if(getCompilationMXBean().isCompilationTimeMonitoringSupported())
-            t = getCompilationMXBean().getTotalCompilationTime();
-        else
-            t = 0;
-        return t;
-    }
-
-    /**
-     * Getter for the "JvmJITCompilerName" variable.
-     */
-    public String getJvmJITCompilerName() throws SnmpStatusException {
-        return JVM_MANAGEMENT_MIB_IMPL.
-            validJavaObjectNameTC(getCompilationMXBean().getName());
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemGCEntryImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-
-import java.lang.management.GarbageCollectorMXBean;
-
-import sun.management.snmp.jvmmib.JvmMemGCEntryMBean;
-import sun.management.snmp.util.MibLogger;
-
-/**
- * The class is used for implementing the "JvmMemGCEntry" group.
- */
-public class JvmMemGCEntryImpl implements JvmMemGCEntryMBean {
-
-    /**
-     * Variable for storing the value of "JvmMemManagerIndex".
-     *
-     * "An index opaquely computed by the agent and which uniquely
-     * identifies a Memory Manager."
-     *
-     */
-    protected final int JvmMemManagerIndex;
-
-    protected final GarbageCollectorMXBean gcm;
-
-    /**
-     * Constructor for the "JvmMemGCEntry" group.
-     */
-    public JvmMemGCEntryImpl(GarbageCollectorMXBean gcm, int index) {
-        this.gcm=gcm;
-        this.JvmMemManagerIndex = index;
-    }
-
-    /**
-     * Getter for the "JvmMemGCTimeMs" variable.
-     */
-    // Don't bother to uses the request contextual cache for this.
-    public Long getJvmMemGCTimeMs() throws SnmpStatusException {
-        return gcm.getCollectionTime();
-    }
-
-    /**
-     * Getter for the "JvmMemGCCount" variable.
-     */
-    // Don't bother to uses the request contextual cache for this.
-    public Long getJvmMemGCCount() throws SnmpStatusException {
-        return gcm.getCollectionCount();
-    }
-
-    /**
-     * Getter for the "JvmMemManagerIndex" variable.
-     */
-    public Integer getJvmMemManagerIndex() throws SnmpStatusException {
-        return JvmMemManagerIndex;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemGCTableMetaImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,362 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-import java.lang.management.MemoryManagerMXBean;
-import java.lang.management.GarbageCollectorMXBean;
-import java.lang.management.ManagementFactory;
-
-import sun.management.snmp.jvmmib.JvmMemGCTableMeta;
-import sun.management.snmp.util.SnmpCachedData;
-import sun.management.snmp.util.SnmpTableCache;
-import sun.management.snmp.util.SnmpTableHandler;
-import sun.management.snmp.util.MibLogger;
-import sun.management.snmp.util.JvmContextFactory;
-
-/**
- * The class is used for implementing the "JvmMemGCTable" table.
- */
-public class JvmMemGCTableMetaImpl extends  JvmMemGCTableMeta {
-
-    static final long serialVersionUID = 8250461197108867607L;
-
-    /**
-     * This class acts as a filter over the SnmpTableHandler
-     * used for the JvmMemoryManagerTable. It filters out
-     * (skip) all MemoryManagerMXBean that are not instances of
-     * GarbageCollectorMXBean so that only Garbage Collectors are
-     * seen. This is a better solution than relying on
-     * ManagementFactory.getGarbageCollectorMXBeans() because it makes it
-     * possible to guarantee the consistency betwen the MemoryManager table
-     * and the GCTable since both will be sharing the same cache.
-     **/
-    protected static class GCTableFilter {
-
-        /**
-         * Returns the index that immediately follows the given
-         * <var>index</var>. The returned index is strictly greater
-         * than the given <var>index</var>, and is contained in the table.
-         * <br>If the given <var>index</var> is null, returns the first
-         * index in the table.
-         * <br>If there are no index after the given <var>index</var>,
-         * returns null.
-         * This method is an optimization for the case where the
-         * SnmpTableHandler is in fact an instance of SnmpCachedData.
-         **/
-        public SnmpOid getNext(SnmpCachedData datas, SnmpOid index) {
-
-            final boolean dbg = log.isDebugOn();
-
-            // We're going to loop until we find an instance of
-            // GarbageCollectorMXBean. First we attempt to find
-            // the next element whose OID follows the given index.
-            // If `index' is null, the insertion point is -1
-            // (the next is 0 = -insertion - 1)
-            //
-            final int insertion = (index==null)?-1:datas.find(index);
-            if (dbg) log.debug("GCTableFilter","oid="+index+
-                               " at insertion="+insertion);
-
-            int next;
-            if (insertion > -1) next = insertion+1;
-            else next = -insertion -1;
-
-            // Now `next' points to the element that imediately
-            // follows the given `index'. We're going to loop
-            // through the table, starting at `next' (included),
-            // and return the first element which is an instance
-            // of GarbageCollectorMXBean.
-            //
-            for (;next<datas.indexes.length;next++) {
-                if (dbg) log.debug("GCTableFilter","next="+next);
-                final Object value = datas.datas[next];
-                if (dbg) log.debug("GCTableFilter","value["+next+"]=" +
-                      ((MemoryManagerMXBean)value).getName());
-                if (value instanceof GarbageCollectorMXBean) {
-                    // That's the next: return it.
-                    if (dbg) log.debug("GCTableFilter",
-                          ((MemoryManagerMXBean)value).getName() +
-                          " is a  GarbageCollectorMXBean.");
-                    return datas.indexes[next];
-                }
-                if (dbg) log.debug("GCTableFilter",
-                      ((MemoryManagerMXBean)value).getName() +
-                      " is not a  GarbageCollectorMXBean: " +
-                      value.getClass().getName());
-                // skip to next index...
-            }
-            return null;
-        }
-
-        /**
-         * Returns the index that immediately follows the given
-         * <var>index</var>. The returned index is strictly greater
-         * than the given <var>index</var>, and is contained in the table.
-         * <br>If the given <var>index</var> is null, returns the first
-         * index in the table.
-         * <br>If there are no index after the given <var>index</var>,
-         * returns null.
-         **/
-        public SnmpOid getNext(SnmpTableHandler handler, SnmpOid index) {
-
-            // try to call the optimized method
-            if (handler instanceof SnmpCachedData)
-                return getNext((SnmpCachedData)handler, index);
-
-            // too bad - revert to non-optimized generic algorithm
-            SnmpOid next = index;
-            do {
-                next = handler.getNext(next);
-                final Object value = handler.getData(next);
-                if (value instanceof GarbageCollectorMXBean)
-                    // That's the next! return it
-                    return next;
-                // skip to next index...
-            } while (next != null);
-            return null;
-        }
-
-        /**
-         * Returns the data associated with the given index.
-         * If the given index is not found, null is returned.
-         * Note that returning null does not necessarily means that
-         * the index was not found.
-         **/
-        public Object  getData(SnmpTableHandler handler, SnmpOid index) {
-            final Object value = handler.getData(index);
-            if (value instanceof GarbageCollectorMXBean) return value;
-            // Behaves as if there was nothing at this index...
-            //
-            return null;
-        }
-
-        /**
-         * Returns true if the given <var>index</var> is present.
-         **/
-        public boolean contains(SnmpTableHandler handler, SnmpOid index) {
-            if (handler.getData(index) instanceof GarbageCollectorMXBean)
-                return true;
-            // Behaves as if there was nothing at this index...
-            //
-            return false;
-        }
-    }
-
-
-    private transient JvmMemManagerTableMetaImpl managers = null;
-    private static GCTableFilter filter = new GCTableFilter();
-
-
-    /**
-     * Constructor for the table. Initialize metadata for "JvmMemGCTableMeta".
-     */
-    public JvmMemGCTableMetaImpl(SnmpMib myMib,
-                                 SnmpStandardObjectServer objserv) {
-        super(myMib,objserv);
-    }
-
-    // Returns a pointer to the JvmMemManager meta node - we're going
-    // to reuse its SnmpTableHandler by filtering out all that is
-    // not a GarbageCollectorMXBean.
-    private final JvmMemManagerTableMetaImpl getManagers(SnmpMib mib) {
-        if (managers == null) {
-            managers = (JvmMemManagerTableMetaImpl)
-                mib.getRegisteredTableMeta("JvmMemManagerTable");
-        }
-        return managers;
-    }
-
-    /**
-     * Returns the JvmMemManagerTable SnmpTableHandler
-     **/
-    protected SnmpTableHandler getHandler(Object userData) {
-        JvmMemManagerTableMetaImpl managerTable= getManagers(theMib);
-        return managerTable.getHandler(userData);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(Object userData)
-        throws SnmpStatusException {
-        // null means get the first OID.
-        return getNextOid(null,userData);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(SnmpOid oid, Object userData)
-        throws SnmpStatusException {
-        final boolean dbg = log.isDebugOn();
-        try {
-            if (dbg) log.debug("getNextOid", "previous=" + oid);
-
-            // Get the data handler.
-            //
-            SnmpTableHandler handler = getHandler(userData);
-            if (handler == null) {
-                // This should never happen.
-                // If we get here it's a bug.
-                //
-                if (dbg) log.debug("getNextOid", "handler is null!");
-                throw new
-                    SnmpStatusException(SnmpStatusException.noSuchInstance);
-            }
-
-
-            // Get the next oid, using the GC filter.
-            //
-            final SnmpOid next = filter.getNext(handler,oid);
-            if (dbg) log.debug("getNextOid", "next=" + next);
-
-            // if next is null: we reached the end of the table.
-            //
-            if (next == null)
-                throw new
-                    SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-            return next;
-        } catch (RuntimeException x) {
-            // debug. This should never happen.
-            //
-            if (dbg) log.debug("getNextOid",x);
-            throw x;
-        }
-    }
-
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected boolean contains(SnmpOid oid, Object userData) {
-        // Get the handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            return false;
-        return filter.contains(handler,oid);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    public Object getEntry(SnmpOid oid)
-        throws SnmpStatusException {
-
-        if (oid == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // Get the request contextual cache (userData).
-        //
-        final Map<Object, Object> m = JvmContextFactory.getUserData();
-
-        // First look in the request contextual cache: maybe we've already
-        // created this entry...
-        //
-
-        // We know in the case of this table that the index is an integer,
-        // it is thus the first OID arc of the index OID.
-        //
-        final long   index    = oid.getOidArc(0);
-
-        // We're going to use this name to store/retrieve the entry in
-        // the request contextual cache.
-        //
-        // Revisit: Probably better programming to put all these strings
-        //          in some interface.
-        //
-        final String entryTag = ((m==null)?null:("JvmMemGCTable.entry." +
-                                                 index));
-
-        // If the entry is in the cache, simply return it.
-        //
-        if (m != null) {
-            final Object entry = m.get(entryTag);
-            if (entry != null) return entry;
-        }
-
-        // Entry was not in request cache. Make a new one.
-        //
-        // Get the data hanler.
-        //
-        SnmpTableHandler handler = getHandler(m);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // Use the filter to retrieve only GarabageCollectorMBean data.
-        //
-        final Object data = filter.getData(handler,oid);
-
-        // data may be null if the OID we were given is not valid.
-        // (e.g. it identifies a MemoryManager which is not a
-        // GarbageCollector)
-        //
-        if (data == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // Make a new entryy (transient object that will be kept only
-        // for the duration of the request.
-        //
-        final Object entry =
-            new JvmMemGCEntryImpl((GarbageCollectorMXBean)data,(int)index);
-
-        // Put the entry in the request cache in case we need it later
-        // in the processing of the request. Note that we could have
-        // optimized this by making JvmMemGCEntryImpl extend
-        // JvmMemManagerEntryImpl, and then make sure that
-        // JvmMemManagerTableMetaImpl creates an instance of JvmMemGCEntryImpl
-        // instead of JvmMemManagerEntryImpl when the associated data is
-        // an instance of GarbageCollectorMXBean. This would have made it
-        // possible to share the transient entry object.
-        // As it is, we may have two transient objects that points to
-        // the same underlying MemoryManagerMXBean (which is definitely
-        // not a problem - but is only a small dysatisfaction)
-        //
-        if (m != null && entry != null) {
-            m.put(entryTag,entry);
-        }
-
-        return entry;
-    }
-
-    static final MibLogger log = new MibLogger(JvmMemGCTableMetaImpl.class);
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemManagerEntryImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-
-import java.lang.management.MemoryManagerMXBean;
-
-import sun.management.snmp.jvmmib.JvmMemManagerEntryMBean;
-import sun.management.snmp.jvmmib.EnumJvmMemManagerState;
-
-
-/**
- * The class is used for implementing the "JvmMemManagerEntry" group.
- * The group is defined with the following
- */
-public class JvmMemManagerEntryImpl implements JvmMemManagerEntryMBean {
-
-    /**
-     * Variable for storing the value of "JvmMemManagerIndex".
-     *
-     * "An index opaquely computed by the agent and which uniquely
-     * identifies a Memory Manager."
-     *
-     */
-    protected final int JvmMemManagerIndex;
-
-    protected MemoryManagerMXBean manager;
-
-    /**
-     * Constructor for the "JvmMemManagerEntry" group.
-     */
-    public JvmMemManagerEntryImpl(MemoryManagerMXBean m, int myindex) {
-        manager = m;
-        JvmMemManagerIndex = myindex;
-    }
-
-    /**
-     * Getter for the "JvmMemManagerName" variable.
-     */
-    public String getJvmMemManagerName() throws SnmpStatusException {
-        return JVM_MANAGEMENT_MIB_IMPL.
-            validJavaObjectNameTC(manager.getName());
-    }
-
-    /**
-     * Getter for the "JvmMemManagerIndex" variable.
-     */
-    public Integer getJvmMemManagerIndex() throws SnmpStatusException {
-        return JvmMemManagerIndex;
-    }
-
-    /**
-     * Getter for the "JvmMemManagerState" variable.
-     */
-    public EnumJvmMemManagerState getJvmMemManagerState()
-        throws SnmpStatusException {
-        if (manager.isValid())
-            return JvmMemManagerStateValid;
-        else
-            return JvmMemManagerStateInvalid;
-    }
-
-    private final static EnumJvmMemManagerState JvmMemManagerStateValid =
-        new EnumJvmMemManagerState("valid");
-    private final static EnumJvmMemManagerState JvmMemManagerStateInvalid =
-        new EnumJvmMemManagerState("invalid");
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemManagerTableMetaImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,303 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-
-// java imports
-//
-import com.sun.jmx.mbeanserver.Util;
-import java.io.Serializable;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-import java.lang.management.MemoryManagerMXBean;
-import java.lang.management.ManagementFactory;
-
-import sun.management.snmp.jvmmib.JvmMemManagerTableMeta;
-import sun.management.snmp.util.SnmpTableCache;
-import sun.management.snmp.util.SnmpNamedListTableCache;
-import sun.management.snmp.util.SnmpTableHandler;
-import sun.management.snmp.util.MibLogger;
-import sun.management.snmp.util.JvmContextFactory;
-
-/**
- * The class is used for implementing the "JvmMemManagerTable" table.
- *
- * This custom implementation show how to implement an SNMP table
- * over a weak cache, recomputing the cahed data when needed.
- */
-public class JvmMemManagerTableMetaImpl extends JvmMemManagerTableMeta {
-
-    static final long serialVersionUID = 36176771566817592L;
-
-    /**
-     * A concrete implementation of {@link SnmpNamedListTableCache}, for the
-     * jvmMemManagerTable.
-     **/
-    private static class JvmMemManagerTableCache
-        extends SnmpNamedListTableCache {
-
-        static final long serialVersionUID = 6564294074653009240L;
-
-        /**
-         * Create a weak cache for the jvmMemManagerTable.
-         * @param validity validity of the cached data, in ms.
-         **/
-        JvmMemManagerTableCache(long validity) {
-            this.validity = validity;
-        }
-
-        /**
-         * Use the MemoryManagerMXBean name as key.
-         * @param context A {@link TreeMap} as allocated by the parent
-         *        {@link SnmpNamedListTableCache} class.
-         * @param rawDatas List of {@link MemoryManagerMXBean}, as
-         *        returned by
-         * <code>ManagementFactory.getMemoryMBean().getMemoryManagers()</code>
-         * @param rank The <var>rank</var> of <var>item</var> in the list.
-         * @param item The <var>rank</var><super>th</super>
-         *        <code>MemoryManagerMXBean</code> in the list.
-         * @return  <code>((MemoryManagerMXBean)item).getName()</code>
-         **/
-        protected String getKey(Object context, List<?> rawDatas,
-                                int rank, Object item) {
-            if (item == null) return null;
-            final String name = ((MemoryManagerMXBean)item).getName();
-            log.debug("getKey", "key=" + name);
-            return name;
-        }
-
-        /**
-         * Call <code>getTableHandler(JvmContextFactory.getUserData())</code>.
-         **/
-        public SnmpTableHandler getTableHandler() {
-            final Map<Object, Object> userData = JvmContextFactory.getUserData();
-            return getTableDatas(userData);
-        }
-
-        /**
-         * Return the key used to cache the raw data of this table.
-         **/
-        protected String getRawDatasKey() {
-            return "JvmMemManagerTable.getMemoryManagers";
-        }
-
-        /**
-         * Call ManagementFactory.getMemoryManagerMXBeans() to
-         * load the raw data of this table.
-         **/
-        protected List<MemoryManagerMXBean> loadRawDatas(Map<Object, Object> userData) {
-            return ManagementFactory.getMemoryManagerMXBeans();
-        }
-
-    }
-
-    // The weak cache for this table.
-    protected SnmpTableCache cache;
-
-    /**
-     * Constructor for the table. Initialize metadata for
-     * "JvmMemManagerTableMeta".
-     * The reference on the MBean server is updated so the entries
-     * created through an SNMP SET will be AUTOMATICALLY REGISTERED
-     * in Java DMK.
-     */
-    public JvmMemManagerTableMetaImpl(SnmpMib myMib,
-                                      SnmpStandardObjectServer objserv) {
-        super(myMib,objserv);
-        this.cache = new
-            JvmMemManagerTableCache(((JVM_MANAGEMENT_MIB_IMPL)myMib).
-                                    validity());
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(Object userData)
-        throws SnmpStatusException {
-        // null means get the first OID.
-        return getNextOid(null,userData);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(SnmpOid oid, Object userData)
-        throws SnmpStatusException {
-        final boolean dbg = log.isDebugOn();
-        if (dbg) log.debug("getNextOid", "previous=" + oid);
-
-
-        // Get the data handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-        if (handler == null) {
-            // This should never happen.
-            // If we get here it's a bug.
-            //
-            if (dbg) log.debug("getNextOid", "handler is null!");
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        // Get the next oid
-        //
-        final SnmpOid next = handler.getNext(oid);
-        if (dbg) log.debug("getNextOid", "next=" + next);
-
-        // if next is null: we reached the end of the table.
-        //
-        if (next == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        return next;
-    }
-
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected boolean contains(SnmpOid oid, Object userData) {
-
-        // Get the handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            return false;
-
-        return handler.contains(oid);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    public Object getEntry(SnmpOid oid)
-        throws SnmpStatusException {
-
-        if (oid == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // Get the request contextual cache (userData).
-        //
-        final Map<Object, Object> m = JvmContextFactory.getUserData();
-
-        // We know in the case of this table that the index is an integer,
-        // it is thus the first OID arc of the index OID.
-        //
-        final long   index    = oid.getOidArc(0);
-
-        // We're going to use this name to store/retrieve the entry in
-        // the request contextual cache.
-        //
-        // Revisit: Probably better programming to put all these strings
-        //          in some interface.
-        //
-        final String entryTag = ((m==null)?null:("JvmMemManagerTable.entry." +
-                                                 index));
-
-        // If the entry is in the cache, simply return it.
-        //
-        if (m != null) {
-            final Object entry = m.get(entryTag);
-            if (entry != null) return entry;
-        }
-
-        // The entry was not in the cache, make a new one.
-        //
-        // Get the data hanler.
-        //
-        SnmpTableHandler handler = getHandler(m);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // Get the data associated with our entry.
-        //
-        final Object data = handler.getData(oid);
-
-        // data may be null if the OID we were given is not valid.
-        //
-        if (data == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // make the new entry (transient object that will be kept only
-        // for the duration of the request.
-        //
-        final Object entry =
-            new JvmMemManagerEntryImpl((MemoryManagerMXBean)data,(int)index);
-
-        // Put the entry in the cache in case we need it later while processing
-        // the request.
-        //
-        if (m != null && entry != null) {
-            m.put(entryTag,entry);
-        }
-
-        return entry;
-    }
-
-    /**
-     * Get the SnmpTableHandler that holds the jvmMemManagerTable data.
-     * First look it up in the request contextual cache, and if it is
-     * not found, obtain it from the weak cache.
-     * <br>The request contextual cache will be released at the end of the
-     * current requests, and is used only to process this request.
-     * <br>The weak cache is shared by all requests, and is only
-     * recomputed when it is found to be obsolete.
-     * <br>Note that the data put in the request contextual cache is
-     *     never considered to be obsolete, in order to preserve data
-     *     coherency.
-     **/
-    protected SnmpTableHandler getHandler(Object userData) {
-        final Map<Object, Object> m;
-        if (userData instanceof Map) m=Util.cast(userData);
-        else m=null;
-
-        // Look in the contextual cache.
-        if (m != null) {
-            final SnmpTableHandler handler =
-                (SnmpTableHandler)m.get("JvmMemManagerTable.handler");
-            if (handler != null) return handler;
-        }
-
-        // No handler in contextual cache, make a new one.
-        final SnmpTableHandler handler = cache.getTableHandler();
-
-        if (m != null && handler != null )
-            m.put("JvmMemManagerTable.handler",handler);
-
-        return handler;
-    }
-
-    static final MibLogger log =
-        new MibLogger(JvmMemManagerTableMetaImpl.class);
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemMgrPoolRelEntryImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-
-
-import sun.management.snmp.jvmmib.JvmMemMgrPoolRelEntryMBean;
-
-/**
- * The class is used for implementing the "JvmMemMgrPoolRelEntry" group.
- */
-public class JvmMemMgrPoolRelEntryImpl
-    implements JvmMemMgrPoolRelEntryMBean {
-
-    /**
-     * Variable for storing the value of "JvmMemManagerIndex".
-     *
-     * "An index opaquely computed by the agent and which uniquely
-     * identifies a Memory Manager."
-     *
-     */
-    final protected int JvmMemManagerIndex;
-
-    /**
-     * Variable for storing the value of "JvmMemPoolIndex".
-     *
-     * "An index value opaquely computed by the agent which uniquely
-     * identifies a row in the jvmMemPoolTable.
-     * "
-     *
-     */
-    final protected int JvmMemPoolIndex;
-    final protected String mmmName;
-    final protected String mpmName;
-
-    /**
-     * Constructor for the "JvmMemMgrPoolRelEntry" group.
-     */
-    public JvmMemMgrPoolRelEntryImpl(String mmmName,
-                                     String mpmName,
-                                     int mmarc, int mparc) {
-        JvmMemManagerIndex = mmarc;
-        JvmMemPoolIndex    = mparc;
-
-        this.mmmName = mmmName;
-        this.mpmName = mpmName;
-    }
-
-    /**
-     * Getter for the "JvmMemMgrRelPoolName" variable.
-     */
-    public String getJvmMemMgrRelPoolName() throws SnmpStatusException {
-        return JVM_MANAGEMENT_MIB_IMPL.validJavaObjectNameTC(mpmName);
-    }
-
-    /**
-     * Getter for the "JvmMemMgrRelManagerName" variable.
-     */
-    public String getJvmMemMgrRelManagerName() throws SnmpStatusException {
-        return JVM_MANAGEMENT_MIB_IMPL.validJavaObjectNameTC(mmmName);
-    }
-
-    /**
-     * Getter for the "JvmMemManagerIndex" variable.
-     */
-    public Integer getJvmMemManagerIndex() throws SnmpStatusException {
-        return JvmMemManagerIndex;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolIndex" variable.
-     */
-    public Integer getJvmMemPoolIndex() throws SnmpStatusException {
-        return JvmMemPoolIndex;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemMgrPoolRelTableMetaImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,523 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import com.sun.jmx.mbeanserver.Util;
-import java.io.Serializable;
-import java.util.List;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.TreeMap;
-import java.util.Collections;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-
-import java.lang.management.MemoryManagerMXBean;
-import java.lang.management.MemoryPoolMXBean;
-
-import sun.management.snmp.jvmmib.JvmMemMgrPoolRelTableMeta;
-import sun.management.snmp.util.SnmpTableCache;
-import sun.management.snmp.util.SnmpCachedData;
-import sun.management.snmp.util.SnmpTableHandler;
-import sun.management.snmp.util.MibLogger;
-import sun.management.snmp.util.JvmContextFactory;
-
-/**
- * The class is used for implementing the "JvmMemMgrPoolRelTable" group.
- */
-public class JvmMemMgrPoolRelTableMetaImpl extends JvmMemMgrPoolRelTableMeta
-    implements Serializable {
-
-    static final long serialVersionUID = 1896509775012355443L;
-
-    /**
-     * A concrete implementation of {@link SnmpTableCache}, for the
-     * jvmMemMgrPoolRelTable.
-     **/
-
-    private static class JvmMemMgrPoolRelTableCache
-        extends SnmpTableCache {
-
-        static final long serialVersionUID = 6059937161990659184L;
-        final private JvmMemMgrPoolRelTableMetaImpl meta;
-
-        /**
-         * Create a weak cache for the jvmMemMgrPoolRelTable.
-         * @param validity validity of the cached data, in ms.
-         **/
-        JvmMemMgrPoolRelTableCache(JvmMemMgrPoolRelTableMetaImpl meta,
-                                   long validity) {
-            this.validity = validity;
-            this.meta     = meta;
-        }
-
-        /**
-         * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>.
-         **/
-        public SnmpTableHandler getTableHandler() {
-            final Map<Object,Object> userData = JvmContextFactory.getUserData();
-            return getTableDatas(userData);
-        }
-
-        /**
-         * Builds a map pool-name => pool-index from the SnmpTableHandler
-         * of the JvmMemPoolTable.
-         **/
-        private static Map<String, SnmpOid> buildPoolIndexMap(SnmpTableHandler handler) {
-            // optimization...
-            if (handler instanceof SnmpCachedData)
-                return buildPoolIndexMap((SnmpCachedData)handler);
-
-            // not optimizable... too bad.
-            final Map<String, SnmpOid> m = new HashMap<>();
-            SnmpOid index=null;
-            while ((index = handler.getNext(index))!=null) {
-                final MemoryPoolMXBean mpm =
-                    (MemoryPoolMXBean)handler.getData(index);
-                if (mpm == null) continue;
-                final String name = mpm.getName();
-                if (name == null) continue;
-                m.put(name,index);
-            }
-            return m;
-        }
-
-        /**
-         * Builds a map pool-name => pool-index from the SnmpTableHandler
-         * of the JvmMemPoolTable.
-         * Optimized algorithm.
-         **/
-        private static Map<String, SnmpOid> buildPoolIndexMap(SnmpCachedData cached) {
-            if (cached == null) return Collections.emptyMap();
-            final SnmpOid[] indexes = cached.indexes;
-            final Object[]  datas   = cached.datas;
-            final int len = indexes.length;
-            final Map<String, SnmpOid> m = new HashMap<>(len);
-            for (int i=0; i<len; i++) {
-                final SnmpOid index = indexes[i];
-                if (index == null) continue;
-                final MemoryPoolMXBean mpm =
-                    (MemoryPoolMXBean)datas[i];
-                if (mpm == null) continue;
-                final String name = mpm.getName();
-                if (name == null) continue;
-                m.put(name,index);
-            }
-            return m;
-        }
-
-        /**
-         * Return a table handler that holds the jvmMemManagerTable table data.
-         * This method return the cached table data if it is still
-         * valid, recompute it and cache the new value if it's not.
-         * If it needs to recompute the cached data, it first
-         * try to obtain the list of memory managers from the request
-         * contextual cache, and if it is not found, it calls
-         * <code>ManagementFactory.getMemoryMBean().getMemoryManagers()</code>
-         * and caches the value.
-         * This ensures that
-         * <code>ManagementFactory.getMemoryMBean().getMemoryManagers()</code>
-         * is not called more than once per request, thus ensuring a
-         * consistent view of the table.
-         **/
-        protected SnmpCachedData updateCachedDatas(Object userData) {
-            // Get the MemoryManager     table
-            final SnmpTableHandler mmHandler =
-                meta.getManagerHandler(userData);
-
-            // Get the MemoryPool        table
-            final SnmpTableHandler mpHandler =
-                meta.getPoolHandler(userData);
-
-            // Time stamp for the cache
-            final long time = System.currentTimeMillis();
-
-            //     Build a Map poolname -> index
-            final Map<String,SnmpOid> poolIndexMap = buildPoolIndexMap(mpHandler);
-
-            // For each memory manager, get the list of memory pools
-            // For each memory pool, find its index in the memory pool table
-            // Create a row in the relation table.
-            final TreeMap<SnmpOid, Object> table =
-                    new TreeMap<>(SnmpCachedData.oidComparator);
-            updateTreeMap(table,userData,mmHandler,mpHandler,poolIndexMap);
-
-            return new SnmpCachedData(time,table);
-        }
-
-
-        /**
-         * Get the list of memory pool associated with the
-         * given MemoryManagerMXBean.
-         **/
-        protected String[] getMemoryPools(Object userData,
-                                      MemoryManagerMXBean mmm, long mmarc) {
-            final String listTag =
-                "JvmMemManager." + mmarc + ".getMemoryPools";
-
-            String[] result=null;
-            if (userData instanceof Map) {
-                result = (String[])((Map)userData).get(listTag);
-                if (result != null) return result;
-            }
-
-            if (mmm!=null) {
-                result = mmm.getMemoryPoolNames();
-            }
-            if ((result!=null)&&(userData instanceof Map)) {
-                Map<Object, Object> map = Util.cast(userData);
-                map.put(listTag,result);
-            }
-
-            return result;
-        }
-
-        protected void updateTreeMap(TreeMap<SnmpOid, Object> table, Object userData,
-                                     MemoryManagerMXBean mmm,
-                                     SnmpOid mmIndex,
-                                     Map<String, SnmpOid> poolIndexMap) {
-
-            // The MemoryManager index is an int, so it's the first
-            // and only subidentifier.
-            final long mmarc;
-            try {
-                mmarc = mmIndex.getOidArc(0);
-            } catch (SnmpStatusException x) {
-                log.debug("updateTreeMap",
-                          "Bad MemoryManager OID index: "+mmIndex);
-                log.debug("updateTreeMap",x);
-                return;
-            }
-
-
-            // Cache this in userData + get it from cache?
-            final String[] mpList = getMemoryPools(userData,mmm,mmarc);
-            if (mpList == null || mpList.length < 1) return;
-
-            final String mmmName = mmm.getName();
-            for (int i = 0; i < mpList.length; i++) {
-                final String mpmName = mpList[i];
-                if (mpmName == null) continue;
-                final SnmpOid mpIndex = poolIndexMap.get(mpmName);
-                if (mpIndex == null) continue;
-
-                // The MemoryPool index is an int, so it's the first
-                // and only subidentifier.
-                final long mparc;
-                try {
-                    mparc  = mpIndex.getOidArc(0);
-                } catch (SnmpStatusException x) {
-                    log.debug("updateTreeMap","Bad MemoryPool OID index: " +
-                          mpIndex);
-                    log.debug("updateTreeMap",x);
-                    continue;
-                }
-                // The MemoryMgrPoolRel table indexed is composed
-                // of the MemoryManager index, to which the MemoryPool
-                // index is appended.
-                final long[] arcs = { mmarc, mparc };
-
-                final SnmpOid index = new SnmpOid(arcs);
-
-                table.put(index, new JvmMemMgrPoolRelEntryImpl(mmmName,
-                                                               mpmName,
-                                                               (int)mmarc,
-                                                               (int)mparc));
-            }
-        }
-
-        protected void updateTreeMap(TreeMap<SnmpOid, Object> table, Object userData,
-                                     SnmpTableHandler mmHandler,
-                                     SnmpTableHandler mpHandler,
-                                     Map<String, SnmpOid> poolIndexMap) {
-            if (mmHandler instanceof SnmpCachedData) {
-                updateTreeMap(table,userData,(SnmpCachedData)mmHandler,
-                              mpHandler,poolIndexMap);
-                return;
-            }
-
-            SnmpOid mmIndex=null;
-            while ((mmIndex = mmHandler.getNext(mmIndex))!=null) {
-                final MemoryManagerMXBean mmm =
-                    (MemoryManagerMXBean)mmHandler.getData(mmIndex);
-                if (mmm == null) continue;
-                updateTreeMap(table,userData,mmm,mmIndex,poolIndexMap);
-            }
-        }
-
-        protected void updateTreeMap(TreeMap<SnmpOid, Object> table, Object userData,
-                                     SnmpCachedData mmHandler,
-                                     SnmpTableHandler mpHandler,
-                                     Map<String, SnmpOid> poolIndexMap) {
-
-            final SnmpOid[] indexes = mmHandler.indexes;
-            final Object[]  datas   = mmHandler.datas;
-            final int size = indexes.length;
-            for (int i=size-1; i>-1; i--) {
-                final MemoryManagerMXBean mmm =
-                    (MemoryManagerMXBean)datas[i];
-                if (mmm == null) continue;
-                updateTreeMap(table,userData,mmm,indexes[i],poolIndexMap);
-            }
-        }
-    }
-
-    // The weak cache for this table.
-    protected SnmpTableCache cache;
-
-    private transient JvmMemManagerTableMetaImpl managers = null;
-    private transient JvmMemPoolTableMetaImpl    pools    = null;
-
-    /**
-     * Constructor for the table. Initialize metadata for
-     * "JvmMemMgrPoolRelTableMeta".
-     * The reference on the MBean server is updated so the entries
-     * created through an SNMP SET will be AUTOMATICALLY REGISTERED
-     * in Java DMK.
-     */
-    public JvmMemMgrPoolRelTableMetaImpl(SnmpMib myMib,
-                                      SnmpStandardObjectServer objserv) {
-        super(myMib,objserv);
-        this.cache = new
-            JvmMemMgrPoolRelTableCache(this,((JVM_MANAGEMENT_MIB_IMPL)myMib).
-                                       validity());
-    }
-
-    // Returns a pointer to the JvmMemManager meta node - we're going
-    // to reuse its SnmpTableHandler in order to implement the
-    // relation table.
-    private final JvmMemManagerTableMetaImpl getManagers(SnmpMib mib) {
-        if (managers == null) {
-            managers = (JvmMemManagerTableMetaImpl)
-                mib.getRegisteredTableMeta("JvmMemManagerTable");
-        }
-        return managers;
-    }
-
-    // Returns a pointer to the JvmMemPool meta node - we're going
-    // to reuse its SnmpTableHandler in order to implement the
-    // relation table.
-    private final JvmMemPoolTableMetaImpl getPools(SnmpMib mib) {
-        if (pools == null) {
-            pools = (JvmMemPoolTableMetaImpl)
-                mib.getRegisteredTableMeta("JvmMemPoolTable");
-        }
-        return pools;
-    }
-
-    /**
-     * Returns the JvmMemManagerTable SnmpTableHandler
-     **/
-    protected SnmpTableHandler getManagerHandler(Object userData) {
-        final JvmMemManagerTableMetaImpl managerTable = getManagers(theMib);
-        return managerTable.getHandler(userData);
-    }
-
-    /**
-     * Returns the JvmMemPoolTable SnmpTableHandler
-     **/
-    protected SnmpTableHandler getPoolHandler(Object userData) {
-        final JvmMemPoolTableMetaImpl poolTable = getPools(theMib);
-        return poolTable.getHandler(userData);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(Object userData)
-        throws SnmpStatusException {
-        // null means get the first OID.
-        return getNextOid(null,userData);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(SnmpOid oid, Object userData)
-        throws SnmpStatusException {
-        final boolean dbg = log.isDebugOn();
-        if (dbg) log.debug("getNextOid", "previous=" + oid);
-
-
-        // Get the data handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-        if (handler == null) {
-            // This should never happen.
-            // If we get here it's a bug.
-            //
-            if (dbg) log.debug("getNextOid", "handler is null!");
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        // Get the next oid
-        //
-        final SnmpOid next = handler.getNext(oid);
-        if (dbg) log.debug("getNextOid", "next=" + next);
-
-        // if next is null: we reached the end of the table.
-        //
-        if (next == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        return next;
-    }
-
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected boolean contains(SnmpOid oid, Object userData) {
-
-        // Get the handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            return false;
-
-        return handler.contains(oid);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    public Object getEntry(SnmpOid oid)
-        throws SnmpStatusException {
-
-        if (oid == null || oid.getLength() < 2)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // Get the request contextual cache (userData).
-        //
-        final Map<Object, Object> m = JvmContextFactory.getUserData();
-
-        // We know in the case of this table that the index is composed
-        // of two integers,
-        //  o The MemoryManager is the first  OID arc of the index OID.
-        //  o The MemoryPool    is the second OID arc of the index OID.
-        //
-        final long   mgrIndex     = oid.getOidArc(0);
-        final long   poolIndex    = oid.getOidArc(1);
-
-        // We're going to use this name to store/retrieve the entry in
-        // the request contextual cache.
-        //
-        // Revisit: Probably better programming to put all these strings
-        //          in some interface.
-        //
-        final String entryTag = ((m==null)?null:
-                                 ("JvmMemMgrPoolRelTable.entry." +
-                                  mgrIndex + "." + poolIndex));
-
-        // If the entry is in the cache, simply return it.
-        //
-        if (m != null) {
-            final Object entry = m.get(entryTag);
-            if (entry != null) return entry;
-        }
-
-        // The entry was not in the cache, make a new one.
-        //
-        // Get the data hanler.
-        //
-        SnmpTableHandler handler = getHandler(m);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // Get the data associated with our entry.
-        //
-        final Object data = handler.getData(oid);
-
-        // data may be null if the OID we were given is not valid.
-        //
-        if (!(data instanceof JvmMemMgrPoolRelEntryImpl))
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // make the new entry (transient object that will be kept only
-        // for the duration of the request.
-        //
-        final Object entry = (JvmMemMgrPoolRelEntryImpl)data;
-        // XXXXX Revisit
-        // new JvmMemMgrPoolRelEntryImpl((MemoryManagerMXBean)data,
-        //                                (int)mgrIndex,(int)poolIndex);
-
-        // Put the entry in the cache in case we need it later while processing
-        // the request.
-        //
-        if (m != null && entry != null) {
-            m.put(entryTag,entry);
-        }
-
-        return entry;
-    }
-
-    /**
-     * Get the SnmpTableHandler that holds the jvmMemManagerTable data.
-     * First look it up in the request contextual cache, and if it is
-     * not found, obtain it from the weak cache.
-     * <br>The request contextual cache will be released at the end of the
-     * current requests, and is used only to process this request.
-     * <br>The weak cache is shared by all requests, and is only
-     * recomputed when it is found to be obsolete.
-     * <br>Note that the data put in the request contextual cache is
-     *     never considered to be obsolete, in order to preserve data
-     *     coherency.
-     **/
-    protected SnmpTableHandler getHandler(Object userData) {
-        final Map<Object, Object> m;
-        if (userData instanceof Map) m=Util.cast(userData);
-        else m=null;
-
-        // Look in the contextual cache.
-        if (m != null) {
-            final SnmpTableHandler handler =
-                (SnmpTableHandler)m.get("JvmMemMgrPoolRelTable.handler");
-            if (handler != null) return handler;
-        }
-
-        // No handler in contextual cache, make a new one.
-        final SnmpTableHandler handler = cache.getTableHandler();
-
-        if (m != null && handler != null )
-            m.put("JvmMemMgrPoolRelTable.handler",handler);
-
-        return handler;
-    }
-
-    static final MibLogger log =
-        new MibLogger(JvmMemMgrPoolRelTableMetaImpl.class);
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemPoolEntryImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,506 +0,0 @@
-/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.util.Map;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-// jdmk imports
-//
-
-import java.lang.management.MemoryUsage;
-import java.lang.management.MemoryType;
-import java.lang.management.MemoryPoolMXBean;
-
-import sun.management.snmp.jvmmib.JvmMemPoolEntryMBean;
-import sun.management.snmp.jvmmib.EnumJvmMemPoolState;
-import sun.management.snmp.jvmmib.EnumJvmMemPoolType;
-import sun.management.snmp.jvmmib.EnumJvmMemPoolThreshdSupport;
-import sun.management.snmp.jvmmib.EnumJvmMemPoolCollectThreshdSupport;
-import sun.management.snmp.util.MibLogger;
-import sun.management.snmp.util.JvmContextFactory;
-
-/**
- * The class is used for implementing the "JvmMemPoolEntry" group.
- */
-public class JvmMemPoolEntryImpl implements JvmMemPoolEntryMBean {
-
-    /**
-     * Variable for storing the value of "JvmMemPoolIndex".
-     *
-     * "An index value opaquely computed by the agent which uniquely
-     * identifies a row in the jvmMemPoolTable.
-     * "
-     *
-     */
-    final protected int jvmMemPoolIndex;
-
-
-    final static String memoryTag = "jvmMemPoolEntry.getUsage";
-    final static String peakMemoryTag = "jvmMemPoolEntry.getPeakUsage";
-    final static String collectMemoryTag =
-        "jvmMemPoolEntry.getCollectionUsage";
-    final static MemoryUsage ZEROS = new MemoryUsage(0,0,0,0);
-
-    final String entryMemoryTag;
-    final String entryPeakMemoryTag;
-    final String entryCollectMemoryTag;
-
-    MemoryUsage getMemoryUsage() {
-        try {
-            final Map<Object, Object> m = JvmContextFactory.getUserData();
-
-            if (m != null) {
-                final MemoryUsage cached = (MemoryUsage)
-                    m.get(entryMemoryTag);
-                if (cached != null) {
-                    log.debug("getMemoryUsage",entryMemoryTag+
-                          " found in cache.");
-                    return cached;
-                }
-
-                MemoryUsage u = pool.getUsage();
-                if (u == null) u = ZEROS;
-
-                m.put(entryMemoryTag,u);
-                return u;
-            }
-            // Should never come here.
-            // Log error!
-            log.trace("getMemoryUsage", "ERROR: should never come here!");
-            return pool.getUsage();
-        } catch (RuntimeException x) {
-            log.trace("getMemoryUsage",
-                  "Failed to get MemoryUsage: " + x);
-            log.debug("getMemoryUsage",x);
-            throw x;
-        }
-
-    }
-
-    MemoryUsage getPeakMemoryUsage() {
-        try {
-            final Map<Object, Object> m = JvmContextFactory.getUserData();
-
-            if (m != null) {
-                final MemoryUsage cached = (MemoryUsage)
-                    m.get(entryPeakMemoryTag);
-                if (cached != null) {
-                    if (log.isDebugOn())
-                        log.debug("getPeakMemoryUsage",
-                              entryPeakMemoryTag + " found in cache.");
-                    return cached;
-                }
-
-                MemoryUsage u = pool.getPeakUsage();
-                if (u == null) u = ZEROS;
-
-                m.put(entryPeakMemoryTag,u);
-                return u;
-            }
-            // Should never come here.
-            // Log error!
-            log.trace("getPeakMemoryUsage", "ERROR: should never come here!");
-            return ZEROS;
-        } catch (RuntimeException x) {
-            log.trace("getPeakMemoryUsage",
-                  "Failed to get MemoryUsage: " + x);
-            log.debug("getPeakMemoryUsage",x);
-            throw x;
-        }
-
-    }
-
-    MemoryUsage getCollectMemoryUsage() {
-        try {
-            final Map<Object, Object> m = JvmContextFactory.getUserData();
-
-            if (m != null) {
-                final MemoryUsage cached = (MemoryUsage)
-                    m.get(entryCollectMemoryTag);
-                if (cached != null) {
-                    if (log.isDebugOn())
-                        log.debug("getCollectMemoryUsage",
-                                  entryCollectMemoryTag + " found in cache.");
-                    return cached;
-                }
-
-                MemoryUsage u = pool.getCollectionUsage();
-                if (u == null) u = ZEROS;
-
-                m.put(entryCollectMemoryTag,u);
-                return u;
-            }
-            // Should never come here.
-            // Log error!
-            log.trace("getCollectMemoryUsage",
-                      "ERROR: should never come here!");
-            return ZEROS;
-        } catch (RuntimeException x) {
-            log.trace("getPeakMemoryUsage",
-                  "Failed to get MemoryUsage: " + x);
-            log.debug("getPeakMemoryUsage",x);
-            throw x;
-        }
-
-    }
-
-    final MemoryPoolMXBean pool;
-
-    /**
-     * Constructor for the "JvmMemPoolEntry" group.
-     */
-    public JvmMemPoolEntryImpl(MemoryPoolMXBean mp, final int index) {
-        this.pool=mp;
-        this.jvmMemPoolIndex = index;
-        this.entryMemoryTag = memoryTag + "." + index;
-        this.entryPeakMemoryTag = peakMemoryTag + "." + index;
-        this.entryCollectMemoryTag = collectMemoryTag + "." + index;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolMaxSize" variable.
-     */
-    public Long getJvmMemPoolMaxSize() throws SnmpStatusException {
-        final long val = getMemoryUsage().getMax();
-        if (val > -1) return  val;
-        else return JvmMemoryImpl.Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolUsed" variable.
-     */
-    public Long getJvmMemPoolUsed() throws SnmpStatusException {
-        final long val = getMemoryUsage().getUsed();
-        if (val > -1) return  val;
-        else return JvmMemoryImpl.Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolInitSize" variable.
-     */
-    public Long getJvmMemPoolInitSize() throws SnmpStatusException {
-        final long val = getMemoryUsage().getInit();
-        if (val > -1) return  val;
-        else return JvmMemoryImpl.Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolCommitted" variable.
-     */
-    public Long getJvmMemPoolCommitted() throws SnmpStatusException {
-        final long val = getMemoryUsage().getCommitted();
-        if (val > -1) return  val;
-        else return JvmMemoryImpl.Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolPeakMaxSize" variable.
-     */
-    public Long getJvmMemPoolPeakMaxSize() throws SnmpStatusException {
-        final long val = getPeakMemoryUsage().getMax();
-        if (val > -1) return  val;
-        else return JvmMemoryImpl.Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolPeakUsed" variable.
-     */
-    public Long getJvmMemPoolPeakUsed() throws SnmpStatusException {
-        final long val = getPeakMemoryUsage().getUsed();
-        if (val > -1) return  val;
-        else return JvmMemoryImpl.Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolPeakCommitted" variable.
-     */
-    public Long getJvmMemPoolPeakCommitted() throws SnmpStatusException {
-        final long val = getPeakMemoryUsage().getCommitted();
-        if (val > -1) return  val;
-        else return JvmMemoryImpl.Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolCollectMaxSize" variable.
-     */
-    public Long getJvmMemPoolCollectMaxSize() throws SnmpStatusException {
-        final long val = getCollectMemoryUsage().getMax();
-        if (val > -1) return  val;
-        else return JvmMemoryImpl.Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolCollectUsed" variable.
-     */
-    public Long getJvmMemPoolCollectUsed() throws SnmpStatusException {
-        final long val = getCollectMemoryUsage().getUsed();
-        if (val > -1) return  val;
-        else return JvmMemoryImpl.Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolCollectCommitted" variable.
-     */
-    public Long getJvmMemPoolCollectCommitted() throws SnmpStatusException {
-        final long val = getCollectMemoryUsage().getCommitted();
-        if (val > -1) return  val;
-        else return JvmMemoryImpl.Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolThreshold" variable.
-     */
-    public Long getJvmMemPoolThreshold() throws SnmpStatusException {
-        if (!pool.isUsageThresholdSupported())
-            return JvmMemoryImpl.Long0;
-        final long val = pool.getUsageThreshold();
-        if (val > -1) return  val;
-        else return JvmMemoryImpl.Long0;
-    }
-
-    /**
-     * Setter for the "JvmMemPoolThreshold" variable.
-     */
-    public void setJvmMemPoolThreshold(Long x) throws SnmpStatusException {
-        final long val = x.longValue();
-        if (val < 0 )
-            throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
-        // This should never throw an exception has the checks have
-        // already been performed in checkJvmMemPoolThreshold().
-        //
-        pool.setUsageThreshold(val);
-    }
-
-    /**
-     * Checker for the "JvmMemPoolThreshold" variable.
-     */
-    public void checkJvmMemPoolThreshold(Long x) throws SnmpStatusException {
-        // if threshold is -1, it means that low memory detection is not
-        // supported.
-
-        if (!pool.isUsageThresholdSupported())
-            throw new
-                SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
-        final long val = x.longValue();
-        if (val < 0 )
-            throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
-    }
-
-    /**
-     * Getter for the "JvmMemPoolThreshdSupport" variable.
-     */
-    public EnumJvmMemPoolThreshdSupport getJvmMemPoolThreshdSupport()
-        throws SnmpStatusException {
-        if (pool.isUsageThresholdSupported())
-            return EnumJvmMemPoolThreshdSupported;
-        else
-            return EnumJvmMemPoolThreshdUnsupported;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolThreshdCount" variable.
-     */
-    public Long getJvmMemPoolThreshdCount()
-        throws SnmpStatusException {
-        if (!pool.isUsageThresholdSupported())
-            return JvmMemoryImpl.Long0;
-        final long val = pool.getUsageThresholdCount();
-        if (val > -1) return  val;
-        else return JvmMemoryImpl.Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolCollectThreshold" variable.
-     */
-    public Long getJvmMemPoolCollectThreshold() throws SnmpStatusException {
-        if (!pool.isCollectionUsageThresholdSupported())
-            return JvmMemoryImpl.Long0;
-        final long val = pool.getCollectionUsageThreshold();
-        if (val > -1) return  val;
-        else return JvmMemoryImpl.Long0;
-    }
-
-    /**
-     * Setter for the "JvmMemPoolCollectThreshold" variable.
-     */
-    public void setJvmMemPoolCollectThreshold(Long x)
-        throws SnmpStatusException {
-        final long val = x.longValue();
-        if (val < 0 )
-            throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
-        // This should never throw an exception has the checks have
-        // already been performed in checkJvmMemPoolCollectThreshold().
-        //
-        pool.setCollectionUsageThreshold(val);
-    }
-
-    /**
-     * Checker for the "JvmMemPoolCollectThreshold" variable.
-     */
-    public void checkJvmMemPoolCollectThreshold(Long x)
-        throws SnmpStatusException {
-        // if threshold is -1, it means that low memory detection is not
-        // supported.
-
-        if (!pool.isCollectionUsageThresholdSupported())
-            throw new
-                SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
-        final long val = x.longValue();
-        if (val < 0 )
-            throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
-    }
-
-    /**
-     * Getter for the "JvmMemPoolThreshdSupport" variable.
-     */
-    public EnumJvmMemPoolCollectThreshdSupport
-        getJvmMemPoolCollectThreshdSupport()
-        throws SnmpStatusException {
-        if (pool.isCollectionUsageThresholdSupported())
-            return EnumJvmMemPoolCollectThreshdSupported;
-        else
-            return EnumJvmMemPoolCollectThreshdUnsupported;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolCollectThreshdCount" variable.
-     */
-    public Long getJvmMemPoolCollectThreshdCount()
-        throws SnmpStatusException {
-        if (!pool.isCollectionUsageThresholdSupported())
-            return JvmMemoryImpl.Long0;
-        final long val = pool.getCollectionUsageThresholdCount();
-        if (val > -1) return  val;
-        else return JvmMemoryImpl.Long0;
-    }
-
-    public static EnumJvmMemPoolType jvmMemPoolType(MemoryType type)
-        throws SnmpStatusException {
-        if (type.equals(MemoryType.HEAP))
-            return  EnumJvmMemPoolTypeHeap;
-        else if (type.equals(MemoryType.NON_HEAP))
-            return EnumJvmMemPoolTypeNonHeap;
-        throw new SnmpStatusException(SnmpStatusException.snmpRspWrongValue);
-    }
-
-    /**
-     * Getter for the "JvmMemPoolType" variable.
-     */
-    public EnumJvmMemPoolType getJvmMemPoolType() throws SnmpStatusException {
-        return jvmMemPoolType(pool.getType());
-    }
-
-    /**
-     * Getter for the "JvmMemPoolName" variable.
-     */
-    public String getJvmMemPoolName() throws SnmpStatusException {
-        return JVM_MANAGEMENT_MIB_IMPL.validJavaObjectNameTC(pool.getName());
-    }
-
-    /**
-     * Getter for the "JvmMemPoolIndex" variable.
-     */
-    public Integer getJvmMemPoolIndex() throws SnmpStatusException {
-        return jvmMemPoolIndex;
-    }
-
-
-    /**
-     * Getter for the "JvmMemPoolState" variable.
-     */
-    public EnumJvmMemPoolState getJvmMemPoolState()
-        throws SnmpStatusException {
-        if (pool.isValid())
-            return JvmMemPoolStateValid;
-        else
-            return JvmMemPoolStateInvalid;
-    }
-
-    /**
-     * Getter for the "JvmMemPoolPeakReset" variable.
-     */
-    public synchronized Long getJvmMemPoolPeakReset()
-        throws SnmpStatusException {
-        return jvmMemPoolPeakReset;
-    }
-
-    /**
-     * Setter for the "JvmMemPoolPeakReset" variable.
-     */
-    public synchronized void setJvmMemPoolPeakReset(Long x)
-        throws SnmpStatusException {
-        final long l = x.longValue();
-        if (l > jvmMemPoolPeakReset) {
-            final long stamp = System.currentTimeMillis();
-            pool.resetPeakUsage();
-            jvmMemPoolPeakReset = stamp;
-            log.debug("setJvmMemPoolPeakReset",
-                      "jvmMemPoolPeakReset="+stamp);
-        }
-    }
-
-    /**
-     * Checker for the "JvmMemPoolPeakReset" variable.
-     */
-    public void checkJvmMemPoolPeakReset(Long x) throws SnmpStatusException {
-    }
-
-    /* Last time peak usage was reset */
-    private long jvmMemPoolPeakReset = 0;
-
-    private final static EnumJvmMemPoolState JvmMemPoolStateValid =
-        new EnumJvmMemPoolState("valid");
-    private final static EnumJvmMemPoolState JvmMemPoolStateInvalid =
-        new EnumJvmMemPoolState("invalid");
-
-    private static final EnumJvmMemPoolType EnumJvmMemPoolTypeHeap =
-        new EnumJvmMemPoolType("heap");
-    private static final EnumJvmMemPoolType EnumJvmMemPoolTypeNonHeap =
-        new EnumJvmMemPoolType("nonheap");
-
-    private static final EnumJvmMemPoolThreshdSupport
-        EnumJvmMemPoolThreshdSupported =
-        new EnumJvmMemPoolThreshdSupport("supported");
-    private static final EnumJvmMemPoolThreshdSupport
-        EnumJvmMemPoolThreshdUnsupported =
-        new EnumJvmMemPoolThreshdSupport("unsupported");
-
-    private static final EnumJvmMemPoolCollectThreshdSupport
-        EnumJvmMemPoolCollectThreshdSupported =
-        new EnumJvmMemPoolCollectThreshdSupport("supported");
-    private static final EnumJvmMemPoolCollectThreshdSupport
-        EnumJvmMemPoolCollectThreshdUnsupported=
-        new EnumJvmMemPoolCollectThreshdSupport("unsupported");
-
-
-    static final MibLogger log = new MibLogger(JvmMemPoolEntryImpl.class);
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemPoolTableMetaImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,311 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import com.sun.jmx.mbeanserver.Util;
-import java.io.Serializable;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-import java.lang.management.MemoryPoolMXBean;
-import java.lang.management.ManagementFactory;
-
-import sun.management.snmp.jvmmib.JvmMemPoolTableMeta;
-import sun.management.snmp.util.SnmpTableCache;
-import sun.management.snmp.util.SnmpNamedListTableCache;
-import sun.management.snmp.util.SnmpTableHandler;
-import sun.management.snmp.util.MibLogger;
-import sun.management.snmp.util.JvmContextFactory;
-
-/**
- * The class is used for implementing the "JvmMemPoolTable" group.
- */
-public class JvmMemPoolTableMetaImpl extends JvmMemPoolTableMeta {
-
-    static final long serialVersionUID = -2525820976094284957L;
-
-    /**
-     * A concrete implementation of {@link SnmpNamedListTableCache}, for the
-     * jvmMemPoolTable.
-     **/
-    private static class JvmMemPoolTableCache extends SnmpNamedListTableCache {
-
-        static final long serialVersionUID = -1755520683086760574L;
-
-        /**
-         * Create a weak cache for the jvmMemPoolTable.
-         * @param validity validity of the cached data, in ms.
-         **/
-        JvmMemPoolTableCache(long validity) {
-            this.validity = validity;
-        }
-
-        /**
-         * Use the MemoryPoolMXBean name as key.
-         * @param context A {@link TreeMap} as allocated by the parent
-         *        {@link SnmpNamedListTableCache} class.
-         * @param rawDatas List of {@link MemoryPoolMXBean}, as
-         *        returned by
-         * <code>ManagementFactory.getMemoryPoolMXBeans()</code>
-         * @param rank The <var>rank</var> of <var>item</var> in the list.
-         * @param item The <var>rank</var><super>th</super>
-         *        <code>MemoryPoolMXBean</code> in the list.
-         * @return  <code>((MemoryPoolMXBean)item).getName()</code>
-         **/
-        protected String getKey(Object context, List<?> rawDatas,
-                                int rank, Object item) {
-            if (item == null) return null;
-            final String name = ((MemoryPoolMXBean)item).getName();
-            log.debug("getKey", "key=" + name);
-            return name;
-        }
-
-        /**
-         * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>.
-         **/
-        public SnmpTableHandler getTableHandler() {
-            final Map<Object, Object> userData = JvmContextFactory.getUserData();
-            return getTableDatas(userData);
-        }
-
-        /**
-         * Return the key used to cache the raw data of this table.
-         **/
-        protected String getRawDatasKey() {
-            return "JvmMemManagerTable.getMemoryPools";
-        }
-
-        /**
-         * Call ManagementFactory.getMemoryPoolMXBeans() to
-         * load the raw data of this table.
-         **/
-        protected List<MemoryPoolMXBean> loadRawDatas(Map<Object, Object> userData) {
-            return ManagementFactory.getMemoryPoolMXBeans();
-        }
-    }
-
-    // The weak cache for this table.
-    protected SnmpTableCache cache;
-
-    /**
-     * Constructor for the table.
-     * Initialize metadata for "JvmMemPoolTableMeta".
-     */
-    public JvmMemPoolTableMetaImpl(SnmpMib myMib,
-                                   SnmpStandardObjectServer objserv) {
-        super(myMib,objserv);
-        this.cache = new
-            JvmMemPoolTableCache(((JVM_MANAGEMENT_MIB_IMPL)myMib).
-                                    validity()*30);
-    }
-
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(Object userData)
-        throws SnmpStatusException {
-        // null means get the first OID.
-        return getNextOid(null,userData);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(SnmpOid oid, Object userData)
-        throws SnmpStatusException {
-        final boolean dbg = log.isDebugOn();
-        try {
-            if (dbg) log.debug("getNextOid", "previous=" + oid);
-
-
-            // Get the data handler.
-            //
-            SnmpTableHandler handler = getHandler(userData);
-            if (handler == null) {
-                // This should never happen.
-                // If we get here it's a bug.
-                //
-                if (dbg) log.debug("getNextOid", "handler is null!");
-                throw new
-                    SnmpStatusException(SnmpStatusException.noSuchInstance);
-            }
-
-            // Get the next oid
-            //
-            final SnmpOid next = handler.getNext(oid);
-            if (dbg) log.debug("getNextOid", "next=" + next);
-
-            // if next is null: we reached the end of the table.
-            //
-            if (next == null)
-                throw new
-                    SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-            return next;
-        } catch (SnmpStatusException x) {
-            if (dbg) log.debug("getNextOid", "End of MIB View: " + x);
-            throw x;
-        } catch (RuntimeException r) {
-            if (dbg) log.debug("getNextOid", "Unexpected exception: " + r);
-            if (dbg) log.debug("getNextOid",r);
-            throw r;
-        }
-    }
-
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected boolean contains(SnmpOid oid, Object userData) {
-
-        // Get the handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            return false;
-
-        return handler.contains(oid);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    public Object getEntry(SnmpOid oid)
-        throws SnmpStatusException {
-
-        if (oid == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // Get the request contextual cache (userData).
-        //
-        final Map<Object, Object> m = Util.cast(JvmContextFactory.getUserData());
-
-        // We know in the case of this table that the index is an integer,
-        // it is thus the first OID arc of the index OID.
-        //
-        final long   index    = oid.getOidArc(0);
-
-        // We're going to use this name to store/retrieve the entry in
-        // the request contextual cache.
-        //
-        // Revisit: Probably better programming to put all these strings
-        //          in some interface.
-        //
-        final String entryTag = ((m==null)?null:("JvmMemPoolTable.entry." +
-                                                 index));
-
-        // If the entry is in the cache, simply return it.
-        //
-        if (m != null) {
-            final Object entry = m.get(entryTag);
-            if (entry != null) return entry;
-        }
-
-        // The entry was not in the cache, make a new one.
-        //
-        // Get the data hanler.
-        //
-        SnmpTableHandler handler = getHandler(m);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // Get the data associated with our entry.
-        //
-        final Object data = handler.getData(oid);
-
-        // data may be null if the OID we were given is not valid.
-        //
-        if (data == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // make the new entry (transient object that will be kept only
-        // for the duration of the request.
-        //
-        if (log.isDebugOn())
-            log.debug("getEntry","data is a: " + data.getClass().getName());
-        final Object entry =
-            new JvmMemPoolEntryImpl((MemoryPoolMXBean)data,(int)index);
-
-        // Put the entry in the cache in case we need it later while processing
-        // the request.
-        //
-        if (m != null && entry != null) {
-            m.put(entryTag,entry);
-        }
-
-        return entry;
-    }
-
-    /**
-     * Get the SnmpTableHandler that holds the jvmMemPoolTable data.
-     * First look it up in the request contextual cache, and if it is
-     * not found, obtain it from the weak cache.
-     * <br>The request contextual cache will be released at the end of the
-     * current requests, and is used only to process this request.
-     * <br>The weak cache is shared by all requests, and is only
-     * recomputed when it is found to be obsolete.
-     * <br>Note that the data put in the request contextual cache is
-     *     never considered to be obsolete, in order to preserve data
-     *     coherency.
-     **/
-    protected SnmpTableHandler getHandler(Object userData) {
-        final Map<Object, Object> m;
-        if (userData instanceof Map) m = Util.cast(userData);
-        else m = null;
-
-        // Look in the contextual cache.
-        if (m != null) {
-            final SnmpTableHandler handler =
-                (SnmpTableHandler)m.get("JvmMemPoolTable.handler");
-            if (handler != null) return handler;
-        }
-
-        // No handler in contextual cache, make a new one.
-        final SnmpTableHandler handler = cache.getTableHandler();
-
-        if (m != null && handler != null )
-            m.put("JvmMemPoolTable.handler",handler);
-
-        return handler;
-    }
-
-    static final MibLogger log = new MibLogger(JvmMemPoolTableMetaImpl.class);
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemoryImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,391 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-
-import java.util.Map;
-import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryUsage;
-import java.lang.management.MemoryType;
-import java.lang.management.MemoryMXBean;
-import javax.management.openmbean.CompositeData;
-
-import sun.management.snmp.jvmmib.JvmMemoryMBean;
-import sun.management.snmp.jvmmib.EnumJvmMemoryGCCall;
-import sun.management.snmp.jvmmib.EnumJvmMemoryGCVerboseLevel;
-import sun.management.snmp.util.MibLogger;
-import sun.management.snmp.util.JvmContextFactory;
-
-/**
- * The class is used for implementing the "JvmMemory" group.
- */
-public class JvmMemoryImpl implements JvmMemoryMBean {
-
-    /**
-     * Variable for storing the value of "JvmMemoryGCCall".
-     *
-     * "This object makes it possible to remotelly trigger the
-     * Garbage Collector in the JVM.
-     *
-     * This object's syntax is an enumeration which defines:
-     *
-     * * Two state values, that can be returned from a GET request:
-     *
-     * unsupported(1): means that remote invocation of gc() is not
-     * supported by the SNMP agent.
-     * supported(2)  : means that remote invocation of gc() is supported
-     * by the SNMP agent.
-     *
-     * * One action value, that can be provided in a SET request to
-     * trigger the garbage collector:
-     *
-     * start(3)      : means that a manager wishes to trigger
-     * garbage collection.
-     *
-     * * Two result value, that will be returned as a result of a
-     * SET request when remote invocation of gc is supported
-     * by the SNMP agent:
-     *
-     * started(4)       : means that garbage collection was
-     * successfully triggered. It does not mean
-     * however that the action was successfullly
-     * completed: gc might still be running when
-     * this value is returned.
-     * failed(5)     : means that garbage collection couldn't be
-     * triggered.
-     *
-     * * If remote invocation is not supported by the SNMP agent, then
-     * unsupported(1) will always be returned as a result of either
-     * a GET request, or a SET request with start(3) as input value.
-     *
-     * * If a SET request with anything but start(3) is received, then
-     * the agent will return a wrongValue error.
-     *
-     * See java.management.MemoryMXBean.gc()
-     * "
-     *
-     */
-    final static EnumJvmMemoryGCCall JvmMemoryGCCallSupported
-        = new EnumJvmMemoryGCCall("supported");
-    final static EnumJvmMemoryGCCall JvmMemoryGCCallStart
-        = new EnumJvmMemoryGCCall("start");
-    final static EnumJvmMemoryGCCall JvmMemoryGCCallFailed
-        = new EnumJvmMemoryGCCall("failed");
-    final static EnumJvmMemoryGCCall JvmMemoryGCCallStarted
-        = new EnumJvmMemoryGCCall("started");
-
-    /**
-     * Variable for storing the value of "JvmMemoryGCVerboseLevel".
-     *
-     * "State of the -verbose:gc state.
-     *
-     * verbose: if the -verbose:gc flag is on,
-     * silent:  otherwise.
-     *
-     * See java.management.MemoryMXBean.isVerbose(),
-     * java.management.MemoryMXBean.setVerbose()
-     * "
-     *
-     */
-    final static EnumJvmMemoryGCVerboseLevel JvmMemoryGCVerboseLevelVerbose =
-        new EnumJvmMemoryGCVerboseLevel("verbose");
-    final static EnumJvmMemoryGCVerboseLevel JvmMemoryGCVerboseLevelSilent =
-        new EnumJvmMemoryGCVerboseLevel("silent");
-
-    /**
-     * Constructor for the "JvmMemory" group.
-     * If the group contains a table, the entries created through an
-     * SNMP SET will not be registered in Java DMK.
-     */
-    public JvmMemoryImpl(SnmpMib myMib) {
-    }
-
-
-    /**
-     * Constructor for the "JvmMemory" group.
-     * If the group contains a table, the entries created through an
-     * SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmMemoryImpl(SnmpMib myMib, MBeanServer server) {
-        // no entry will be registered since the table is virtual.
-    }
-
-    final static String heapMemoryTag = "jvmMemory.getHeapMemoryUsage";
-    final static String nonHeapMemoryTag = "jvmMemory.getNonHeapMemoryUsage";
-
-    private MemoryUsage getMemoryUsage(MemoryType type) {
-        if (type == MemoryType.HEAP) {
-            return ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
-        } else {
-            return ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage();
-        }
-    }
-
-    MemoryUsage getNonHeapMemoryUsage() {
-        try {
-            final Map<Object, Object> m = JvmContextFactory.getUserData();
-
-            if (m != null) {
-                final MemoryUsage cached = (MemoryUsage)
-                    m.get(nonHeapMemoryTag);
-                if (cached != null) {
-                    log.debug("getNonHeapMemoryUsage",
-                          "jvmMemory.getNonHeapMemoryUsage found in cache.");
-                    return cached;
-                }
-
-                final MemoryUsage u = getMemoryUsage(MemoryType.NON_HEAP);
-
-                //  getNonHeapMemoryUsage() never returns null.
-                //
-                // if (u == null) u=MemoryUsage.INVALID;
-
-                m.put(nonHeapMemoryTag,u);
-                return u;
-            }
-            // Should never come here.
-            // Log error!
-            log.trace("getNonHeapMemoryUsage",
-                      "ERROR: should never come here!");
-            return getMemoryUsage(MemoryType.NON_HEAP);
-        } catch (RuntimeException x) {
-            log.trace("getNonHeapMemoryUsage",
-                  "Failed to get NonHeapMemoryUsage: " + x);
-            log.debug("getNonHeapMemoryUsage",x);
-            throw x;
-        }
-
-    }
-
-    MemoryUsage getHeapMemoryUsage() {
-        try {
-            final Map<Object, Object> m = JvmContextFactory.getUserData();
-
-            if (m != null) {
-                final MemoryUsage cached = (MemoryUsage)m.get(heapMemoryTag);
-                if (cached != null) {
-                    log.debug("getHeapMemoryUsage",
-                          "jvmMemory.getHeapMemoryUsage found in cache.");
-                    return cached;
-                }
-
-                final MemoryUsage u = getMemoryUsage(MemoryType.HEAP);
-
-                // getHeapMemoryUsage() never returns null.
-                //
-                // if (u == null) u=MemoryUsage.INVALID;
-
-                m.put(heapMemoryTag,u);
-                return u;
-            }
-
-            // Should never come here.
-            // Log error!
-            log.trace("getHeapMemoryUsage", "ERROR: should never come here!");
-            return getMemoryUsage(MemoryType.HEAP);
-        } catch (RuntimeException x) {
-            log.trace("getHeapMemoryUsage",
-                  "Failed to get HeapMemoryUsage: " + x);
-            log.debug("getHeapMemoryUsage",x);
-            throw x;
-        }
-    }
-
-    static final Long Long0 = 0L;
-
-    /**
-     * Getter for the "JvmMemoryNonHeapMaxSize" variable.
-     */
-    public Long getJvmMemoryNonHeapMaxSize()
-        throws SnmpStatusException {
-        final long val = getNonHeapMemoryUsage().getMax();
-        if (val > -1) return  val;
-        else return Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemoryNonHeapCommitted" variable.
-     */
-    public Long getJvmMemoryNonHeapCommitted() throws SnmpStatusException {
-        final long val = getNonHeapMemoryUsage().getCommitted();
-        if (val > -1) return val;
-        else return Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemoryNonHeapUsed" variable.
-     */
-    public Long getJvmMemoryNonHeapUsed() throws SnmpStatusException {
-        final long val = getNonHeapMemoryUsage().getUsed();
-        if (val > -1) return val;
-        else return Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemoryNonHeapInitSize" variable.
-     */
-    public Long getJvmMemoryNonHeapInitSize() throws SnmpStatusException {
-        final long val = getNonHeapMemoryUsage().getInit();
-        if (val > -1) return val;
-        else return Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemoryHeapMaxSize" variable.
-     */
-    public Long getJvmMemoryHeapMaxSize() throws SnmpStatusException {
-        final long val = getHeapMemoryUsage().getMax();
-        if (val > -1) return val;
-        else return Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemoryGCCall" variable.
-     */
-    public EnumJvmMemoryGCCall getJvmMemoryGCCall()
-        throws SnmpStatusException {
-        final Map<Object,Object> m = JvmContextFactory.getUserData();
-
-        if (m != null) {
-            final EnumJvmMemoryGCCall cached
-                = (EnumJvmMemoryGCCall) m.get("jvmMemory.getJvmMemoryGCCall");
-            if (cached != null) return cached;
-        }
-        return JvmMemoryGCCallSupported;
-    }
-
-    /**
-     * Setter for the "JvmMemoryGCCall" variable.
-     */
-    public void setJvmMemoryGCCall(EnumJvmMemoryGCCall x)
-        throws SnmpStatusException {
-        if (x.intValue() == JvmMemoryGCCallStart.intValue()) {
-            final Map<Object, Object> m = JvmContextFactory.getUserData();
-
-            try {
-                ManagementFactory.getMemoryMXBean().gc();
-                if (m != null) m.put("jvmMemory.getJvmMemoryGCCall",
-                                     JvmMemoryGCCallStarted);
-            } catch (Exception ex) {
-                if (m != null) m.put("jvmMemory.getJvmMemoryGCCall",
-                                     JvmMemoryGCCallFailed);
-            }
-            return;
-        }
-        throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
-    }
-
-    /**
-     * Checker for the "JvmMemoryGCCall" variable.
-     */
-    public void checkJvmMemoryGCCall(EnumJvmMemoryGCCall x)
-        throws SnmpStatusException {
-        if (x.intValue() != JvmMemoryGCCallStart.intValue())
-        throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
-    }
-
-    /**
-     * Getter for the "JvmMemoryHeapCommitted" variable.
-     */
-    public Long getJvmMemoryHeapCommitted() throws SnmpStatusException {
-        final long val = getHeapMemoryUsage().getCommitted();
-        if (val > -1) return val;
-        else return Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemoryGCVerboseLevel" variable.
-     */
-    public EnumJvmMemoryGCVerboseLevel getJvmMemoryGCVerboseLevel()
-        throws SnmpStatusException {
-        if (ManagementFactory.getMemoryMXBean().isVerbose())
-            return JvmMemoryGCVerboseLevelVerbose;
-        else
-            return JvmMemoryGCVerboseLevelSilent;
-    }
-
-    /**
-     * Setter for the "JvmMemoryGCVerboseLevel" variable.
-     */
-    public void setJvmMemoryGCVerboseLevel(EnumJvmMemoryGCVerboseLevel x)
-        throws SnmpStatusException {
-        if (JvmMemoryGCVerboseLevelVerbose.intValue() == x.intValue())
-            ManagementFactory.getMemoryMXBean().setVerbose(true);
-        else
-            ManagementFactory.getMemoryMXBean().setVerbose(false);
-    }
-
-    /**
-     * Checker for the "JvmMemoryGCVerboseLevel" variable.
-     */
-    public void checkJvmMemoryGCVerboseLevel(EnumJvmMemoryGCVerboseLevel x)
-        throws SnmpStatusException {
-        // Nothing to check...
-    }
-
-    /**
-     * Getter for the "JvmMemoryHeapUsed" variable.
-     */
-    public Long getJvmMemoryHeapUsed() throws SnmpStatusException {
-        final long val = getHeapMemoryUsage().getUsed();
-        if (val > -1) return val;
-        else return Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemoryHeapInitSize" variable.
-     */
-    public Long getJvmMemoryHeapInitSize() throws SnmpStatusException {
-        final long val = getHeapMemoryUsage().getInit();
-        if (val > -1) return val;
-        else return Long0;
-    }
-
-    /**
-     * Getter for the "JvmMemoryPendingFinalCount" variable.
-     */
-    public Long getJvmMemoryPendingFinalCount()
-        throws SnmpStatusException {
-        final long val = ManagementFactory.getMemoryMXBean().
-            getObjectPendingFinalizationCount();
-
-        if (val > -1) return Long.valueOf((int) val);
-
-        // Should never happen... but stay safe all the same.
-        //
-        else return 0L;
-    }
-
-    static final MibLogger log = new MibLogger(JvmMemoryImpl.class);
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemoryMetaImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-import sun.management.snmp.jvmmib.JvmMemoryMeta;
-import sun.management.snmp.jvmmib.JvmMemManagerTableMeta;
-import sun.management.snmp.jvmmib.JvmMemGCTableMeta;
-import sun.management.snmp.jvmmib.JvmMemPoolTableMeta;
-import sun.management.snmp.jvmmib.JvmMemMgrPoolRelTableMeta;
-import sun.management.snmp.util.MibLogger;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmMemory" group.
- */
-public class JvmMemoryMetaImpl extends JvmMemoryMeta {
-
-    static final long serialVersionUID = -6500448253825893071L;
-    /**
-     * Constructor for the metadata associated to "JvmMemory".
-     */
-    public JvmMemoryMetaImpl(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        super(myMib,objserv);
-    }
-
-    /**
-     * Factory method for "JvmMemManagerTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmMemManagerTable")
-     * @param groupName Name of the group to which this table belong
-     *        ("JvmMemory")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmMemManagerTable" table (JvmMemManagerTableMeta)
-     *
-     **/
-    protected JvmMemManagerTableMeta createJvmMemManagerTableMetaNode(
-        String tableName, String groupName, SnmpMib mib, MBeanServer server)  {
-        return new JvmMemManagerTableMetaImpl(mib, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmMemGCTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmMemGCTable")
-     * @param groupName Name of the group to which this table belong
-     *        ("JvmMemory")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmMemGCTable" table (JvmMemGCTableMeta)
-     *
-     **/
-    protected JvmMemGCTableMeta createJvmMemGCTableMetaNode(String tableName,
-                      String groupName, SnmpMib mib, MBeanServer server)  {
-        return new JvmMemGCTableMetaImpl(mib, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmMemPoolTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmMemPoolTable")
-     * @param groupName Name of the group to which this table belong
-     *        ("JvmMemory")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmMemPoolTable" table (JvmMemPoolTableMeta)
-     *
-     **/
-    protected JvmMemPoolTableMeta
-        createJvmMemPoolTableMetaNode(String tableName, String groupName,
-                                      SnmpMib mib, MBeanServer server)  {
-        return new JvmMemPoolTableMetaImpl(mib, objectserver);
-    }
-
-    /**
-     * Factory method for "JvmMemMgrPoolRelTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmMemMgrPoolRelTable")
-     * @param groupName Name of the group to which this table belong
-     *        ("JvmMemory")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmMemMgrPoolRelTable" table (JvmMemMgrPoolRelTableMeta)
-     *
-     **/
-    protected JvmMemMgrPoolRelTableMeta
-        createJvmMemMgrPoolRelTableMetaNode(String tableName,
-                                            String groupName,
-                                            SnmpMib mib, MBeanServer server) {
-        return new JvmMemMgrPoolRelTableMetaImpl(mib, objectserver);
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmOSImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.io.Serializable;
-import java.lang.management.ManagementFactory;
-import java.lang.management.OperatingSystemMXBean;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-
-import sun.management.snmp.jvmmib.JvmOSMBean;
-
-/**
- * The class is used for implementing the "JvmOS" group.
- */
-public class JvmOSImpl implements JvmOSMBean, Serializable {
-
-     static final long serialVersionUID = 1839834731763310809L;
-
-    /**
-     * Constructor for the "JvmOS" group.
-     * If the group contains a table, the entries created through an
-     * SNMP SET will not be registered in Java DMK.
-     */
-    public JvmOSImpl(SnmpMib myMib) {
-    }
-
-
-    /**
-     * Constructor for the "JvmOS" group.
-     * If the group contains a table, the entries created through an
-     * SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmOSImpl(SnmpMib myMib, MBeanServer server) {
-    }
-
-    static OperatingSystemMXBean getOSMBean() {
-        return ManagementFactory.getOperatingSystemMXBean();
-    }
-
-    private static String validDisplayStringTC(String str) {
-        return JVM_MANAGEMENT_MIB_IMPL.validDisplayStringTC(str);
-    }
-
-    private static String validJavaObjectNameTC(String str) {
-        return JVM_MANAGEMENT_MIB_IMPL.validJavaObjectNameTC(str);
-    }
-
-    /**
-     * Getter for the "JvmRTProcessorCount" variable.
-     */
-    public Integer getJvmOSProcessorCount() throws SnmpStatusException {
-        return getOSMBean().getAvailableProcessors();
-
-    }
-
-    /**
-     * Getter for the "JvmOSVersion" variable.
-     */
-    public String getJvmOSVersion() throws SnmpStatusException {
-        return validDisplayStringTC(getOSMBean().getVersion());
-    }
-
-    /**
-     * Getter for the "JvmOSArch" variable.
-     */
-    public String getJvmOSArch() throws SnmpStatusException {
-        return validDisplayStringTC(getOSMBean().getArch());
-    }
-
-    /**
-     * Getter for the "JvmOSName" variable.
-     */
-    public String getJvmOSName() throws SnmpStatusException {
-        return validJavaObjectNameTC(getOSMBean().getName());
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTBootClassPathEntryImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-
-import sun.management.snmp.jvmmib.JvmRTBootClassPathEntryMBean;
-
-/**
- * The class is used for implementing the "JvmRTBootClassPathEntry" group.
- */
-public class JvmRTBootClassPathEntryImpl
-    implements JvmRTBootClassPathEntryMBean, Serializable {
-
-    static final long serialVersionUID = -2282652055235913013L;
-
-    private final String item;
-    private final int index;
-
-    /**
-     * Constructor for the "JvmRTBootClassPathEntry" group.
-     */
-    public JvmRTBootClassPathEntryImpl(String item, int index) {
-        this.item = validPathElementTC(item);
-        this.index = index;
-    }
-
-    private String validPathElementTC(String str) {
-        return JVM_MANAGEMENT_MIB_IMPL.validPathElementTC(str);
-    }
-
-    /**
-     * Getter for the "JvmRTBootClassPathItem" variable.
-     */
-    public String getJvmRTBootClassPathItem() throws SnmpStatusException {
-        return item;
-    }
-
-    /**
-     * Getter for the "JvmRTBootClassPathIndex" variable.
-     */
-    public Integer getJvmRTBootClassPathIndex() throws SnmpStatusException {
-        return index;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTBootClassPathTableMetaImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,303 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import com.sun.jmx.mbeanserver.Util;
-import java.util.List;
-import java.util.Map;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpIndex;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-import sun.management.snmp.jvmmib.JvmRTBootClassPathTableMeta;
-import sun.management.snmp.util.SnmpCachedData;
-import sun.management.snmp.util.SnmpTableCache;
-import sun.management.snmp.util.SnmpTableHandler;
-import sun.management.snmp.util.MibLogger;
-import sun.management.snmp.util.JvmContextFactory;
-
-/**
- * The class is used for implementing the "JvmRTBootClassPathTable".
-  */
-public class JvmRTBootClassPathTableMetaImpl
-    extends JvmRTBootClassPathTableMeta {
-
-    static final long serialVersionUID = -8659886610487538299L;
-
-    private SnmpTableCache cache;
-
-     /**
-     * A concrete implementation of {@link SnmpTableCache}, for the
-     * JvmRTBootClassPathTable.
-     **/
-    private static class JvmRTBootClassPathTableCache extends SnmpTableCache {
-        static final long serialVersionUID = -2637458695413646098L;
-        private JvmRTBootClassPathTableMetaImpl meta;
-
-        JvmRTBootClassPathTableCache(JvmRTBootClassPathTableMetaImpl meta,
-                                 long validity) {
-            this.meta = meta;
-            this.validity = validity;
-        }
-
-        /**
-         * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>.
-         **/
-        public SnmpTableHandler getTableHandler() {
-            final Map<Object,Object> userData = JvmContextFactory.getUserData();
-            return getTableDatas(userData);
-        }
-
-
-        /**
-         * Return a table handler containing the Thread indexes.
-         * Indexes are computed from the ThreadId.
-         **/
-        protected SnmpCachedData updateCachedDatas(Object userData) {
-
-
-            // We are getting all the input args
-            final String[] path =
-                JvmRuntimeImpl.getBootClassPath(userData);
-
-            // Time stamp for the cache
-            final long time = System.currentTimeMillis();
-            final int len = path.length;
-
-            SnmpOid indexes[] = new SnmpOid[len];
-
-            for(int i = 0; i < len; i++) {
-                indexes[i] = new SnmpOid(i + 1);
-            }
-
-            return new SnmpCachedData(time, indexes, path);
-        }
-    }
-
-    /**
-     * Constructor for the table. Initialize metadata for
-     * "JvmRTBootClassPathTableMeta".
-     * The reference on the MBean server is updated so the entries
-     * created through an SNMP SET will be AUTOMATICALLY REGISTERED
-     * in Java DMK.
-     */
-    public JvmRTBootClassPathTableMetaImpl(SnmpMib myMib,
-                                       SnmpStandardObjectServer objserv) {
-        super(myMib, objserv);
-        cache = new JvmRTBootClassPathTableCache(this, -1);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(Object userData)
-        throws SnmpStatusException {
-        // null means get the first OID.
-        return getNextOid(null,userData);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(SnmpOid oid, Object userData)
-        throws SnmpStatusException {
-        final boolean dbg = log.isDebugOn();
-        if (dbg) log.debug("getNextOid", "previous=" + oid);
-
-
-        // Get the data handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-        if (handler == null) {
-            // This should never happen.
-            // If we get here it's a bug.
-            //
-            if (dbg) log.debug("getNextOid", "handler is null!");
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        // Get the next oid
-        //
-        final SnmpOid next = handler.getNext(oid);
-        if (dbg) log.debug("*** **** **** **** getNextOid", "next=" + next);
-
-        // if next is null: we reached the end of the table.
-        //
-        if (next == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        return next;
-    }
-
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected boolean contains(SnmpOid oid, Object userData) {
-
-        // Get the handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            return false;
-
-        return handler.contains(oid);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    public Object getEntry(SnmpOid oid)
-        throws SnmpStatusException {
-        final boolean dbg = log.isDebugOn();
-        if (dbg) log.debug("getEntry", "oid [" + oid + "]");
-        if (oid == null || oid.getLength() != 1) {
-            if (dbg) log.debug("getEntry", "Invalid oid [" + oid + "]");
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        // Get the request contextual cache (userData).
-        //
-        final Map<Object, Object> m = JvmContextFactory.getUserData();
-
-        // We're going to use this name to store/retrieve the entry in
-        // the request contextual cache.
-        //
-        // Revisit: Probably better programming to put all these strings
-        //          in some interface.
-        //
-        final String entryTag = ((m==null)?null:
-                                 ("JvmRTBootClassPathTable.entry." +
-                                  oid.toString()));
-
-        // If the entry is in the cache, simply return it.
-        //
-        if (m != null) {
-            final Object entry = m.get(entryTag);
-            if (entry != null) {
-                if (dbg)
-                    log.debug("getEntry", "Entry is already in the cache");
-                return entry;
-            } else
-                if (dbg) log.debug("getEntry", "Entry is not in the cache");
-        }
-
-        // The entry was not in the cache, make a new one.
-        //
-        // Get the data hanler.
-        //
-        SnmpTableHandler handler = getHandler(m);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // Get the data associated with our entry.
-        //
-        final Object data = handler.getData(oid);
-
-        // data may be null if the OID we were given is not valid.
-        //
-        if (data == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // make the new entry (transient object that will be kept only
-        // for the duration of the request.
-        //
-        if (dbg)
-            log.debug("getEntry","data is a: " + data.getClass().getName());
-        final Object entry =
-            new JvmRTBootClassPathEntryImpl((String) data,
-                                            (int) oid.getOidArc(0));
-
-        // Put the entry in the cache in case we need it later while processing
-        // the request.
-        //
-        if (m != null && entry != null) {
-            m.put(entryTag,entry);
-        }
-
-        return entry;
-    }
-
-    /**
-     * Get the SnmpTableHandler that holds the jvmThreadInstanceTable data.
-     * First look it up in the request contextual cache, and if it is
-     * not found, obtain it from the weak cache.
-     * <br>The request contextual cache will be released at the end of the
-     * current requests, and is used only to process this request.
-     * <br>The weak cache is shared by all requests, and is only
-     * recomputed when it is found to be obsolete.
-     * <br>Note that the data put in the request contextual cache is
-     *     never considered to be obsolete, in order to preserve data
-     *     coherency.
-     **/
-    protected SnmpTableHandler getHandler(Object userData) {
-        final Map<Object, Object> m;
-        if (userData instanceof Map) m=Util.cast(userData);
-        else m=null;
-
-        // Look in the contextual cache.
-        if (m != null) {
-            final SnmpTableHandler handler =
-                (SnmpTableHandler)m.get("JvmRTBootClassPathTable.handler");
-            if (handler != null) return handler;
-        }
-
-        // No handler in contextual cache, make a new one.
-        final SnmpTableHandler handler = cache.getTableHandler();
-
-        if (m != null && handler != null )
-            m.put("JvmRTBootClassPathTable.handler",handler);
-
-        return handler;
-    }
-
-    static final MibLogger log =
-        new MibLogger(JvmRTBootClassPathTableMetaImpl.class);
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTClassPathEntryImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-
-import sun.management.snmp.jvmmib.JvmRTClassPathEntryMBean;
-
-/**
- * The class is used for implementing the "JvmRTClassPathEntry" group.
- */
-public class JvmRTClassPathEntryImpl implements JvmRTClassPathEntryMBean,
-                                                Serializable {
-
-    static final long serialVersionUID = 8524792845083365742L;
-    private final String item;
-    private final int index;
-
-    /**
-     * Constructor for the "JvmRTClassPathEntry" group.
-     */
-    public JvmRTClassPathEntryImpl(String item, int index) {
-        this.item = validPathElementTC(item);
-        this.index = index;
-    }
-
-    private String validPathElementTC(String str) {
-        return JVM_MANAGEMENT_MIB_IMPL.validPathElementTC(str);
-    }
-
-    /**
-     * Getter for the "JvmRTClassPathItem" variable.
-     */
-    public String getJvmRTClassPathItem() throws SnmpStatusException {
-        return item;
-    }
-
-    /**
-     * Getter for the "JvmRTClassPathIndex" variable.
-     */
-    public Integer getJvmRTClassPathIndex() throws SnmpStatusException {
-        return index;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTClassPathTableMetaImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,301 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import com.sun.jmx.mbeanserver.Util;
-import java.util.List;
-import java.util.Map;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpIndex;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-import sun.management.snmp.jvmmib.JvmRTClassPathTableMeta;
-import sun.management.snmp.util.SnmpCachedData;
-import sun.management.snmp.util.SnmpTableCache;
-import sun.management.snmp.util.SnmpTableHandler;
-import sun.management.snmp.util.MibLogger;
-import sun.management.snmp.util.JvmContextFactory;
-
-/**
- * The class is used for implementing the "JvmRTClassPathTable".
-  */
-public class JvmRTClassPathTableMetaImpl extends JvmRTClassPathTableMeta {
-
-    static final long serialVersionUID = -6914494148818455166L;
-
-    private SnmpTableCache cache;
-
-     /**
-     * A concrete implementation of {@link SnmpTableCache}, for the
-     * JvmRTClassPathTable.
-     **/
-    private static class JvmRTClassPathTableCache extends SnmpTableCache {
-        static final long serialVersionUID = 3805032372592117315L;
-        private JvmRTClassPathTableMetaImpl meta;
-
-        JvmRTClassPathTableCache(JvmRTClassPathTableMetaImpl meta,
-                                 long validity) {
-            this.meta = meta;
-            this.validity = validity;
-        }
-
-        /**
-         * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>.
-         **/
-        public SnmpTableHandler getTableHandler() {
-            final Map<Object, Object> userData = JvmContextFactory.getUserData();
-            return getTableDatas(userData);
-        }
-
-
-        /**
-         * Return a table handler containing the Thread indexes.
-         * Indexes are computed from the ThreadId.
-         **/
-        protected SnmpCachedData updateCachedDatas(Object userData) {
-
-
-            // We are getting all the input args
-            final String[] path =
-                JvmRuntimeImpl.getClassPath(userData);
-
-            // Time stamp for the cache
-            final long time = System.currentTimeMillis();
-            final int len = path.length;
-
-            SnmpOid indexes[] = new SnmpOid[len];
-
-            for(int i = 0; i < len; i++) {
-                indexes[i] = new SnmpOid(i + 1);
-            }
-
-            return new SnmpCachedData(time, indexes, path);
-        }
-    }
-
-    /**
-     * Constructor for the table. Initialize metadata for
-     * "JvmRTClassPathTableMeta".
-     * The reference on the MBean server is updated so the entries
-     * created through an SNMP SET will be AUTOMATICALLY REGISTERED
-     * in Java DMK.
-     */
-    public JvmRTClassPathTableMetaImpl(SnmpMib myMib,
-                                       SnmpStandardObjectServer objserv) {
-        super(myMib, objserv);
-        cache = new JvmRTClassPathTableCache(this, -1);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(Object userData)
-        throws SnmpStatusException {
-        // null means get the first OID.
-        return getNextOid(null,userData);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(SnmpOid oid, Object userData)
-        throws SnmpStatusException {
-        final boolean dbg = log.isDebugOn();
-        if (dbg) log.debug("getNextOid", "previous=" + oid);
-
-
-        // Get the data handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-        if (handler == null) {
-            // This should never happen.
-            // If we get here it's a bug.
-            //
-            if (dbg) log.debug("getNextOid", "handler is null!");
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        // Get the next oid
-        //
-        final SnmpOid next = handler.getNext(oid);
-        if (dbg) log.debug("*** **** **** **** getNextOid", "next=" + next);
-
-        // if next is null: we reached the end of the table.
-        //
-        if (next == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        return next;
-    }
-
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected boolean contains(SnmpOid oid, Object userData) {
-
-        // Get the handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            return false;
-
-        return handler.contains(oid);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    public Object getEntry(SnmpOid oid)
-        throws SnmpStatusException {
-        final boolean dbg = log.isDebugOn();
-        if (dbg) log.debug("getEntry", "oid [" + oid + "]");
-        if (oid == null || oid.getLength() != 1) {
-            if (dbg) log.debug("getEntry", "Invalid oid [" + oid + "]");
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        // Get the request contextual cache (userData).
-        //
-        final Map<Object, Object> m = JvmContextFactory.getUserData();
-
-        // We're going to use this name to store/retrieve the entry in
-        // the request contextual cache.
-        //
-        // Revisit: Probably better programming to put all these strings
-        //          in some interface.
-        //
-        final String entryTag = ((m==null)?null:
-                                 ("JvmRTClassPathTable.entry." +
-                                  oid.toString()));
-
-        // If the entry is in the cache, simply return it.
-        //
-        if (m != null) {
-            final Object entry = m.get(entryTag);
-            if (entry != null) {
-                if (dbg)
-                    log.debug("getEntry", "Entry is already in the cache");
-                return entry;
-            } else
-                if (dbg) log.debug("getEntry", "Entry is not in the cache");
-        }
-
-        // The entry was not in the cache, make a new one.
-        //
-        // Get the data hanler.
-        //
-        SnmpTableHandler handler = getHandler(m);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // Get the data associated with our entry.
-        //
-        final Object data = handler.getData(oid);
-
-        // data may be null if the OID we were given is not valid.
-        //
-        if (data == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // make the new entry (transient object that will be kept only
-        // for the duration of the request.
-        //
-        if (dbg)
-            log.debug("getEntry","data is a: " + data.getClass().getName());
-        final Object entry =
-            new JvmRTClassPathEntryImpl((String) data, (int) oid.getOidArc(0));
-
-        // Put the entry in the cache in case we need it later while processing
-        // the request.
-        //
-        if (m != null && entry != null) {
-            m.put(entryTag,entry);
-        }
-
-        return entry;
-    }
-
-    /**
-     * Get the SnmpTableHandler that holds the jvmThreadInstanceTable data.
-     * First look it up in the request contextual cache, and if it is
-     * not found, obtain it from the weak cache.
-     * <br>The request contextual cache will be released at the end of the
-     * current requests, and is used only to process this request.
-     * <br>The weak cache is shared by all requests, and is only
-     * recomputed when it is found to be obsolete.
-     * <br>Note that the data put in the request contextual cache is
-     *     never considered to be obsolete, in order to preserve data
-     *     coherency.
-     **/
-    protected SnmpTableHandler getHandler(Object userData) {
-        final Map<Object, Object> m;
-        if (userData instanceof Map) m=Util.cast(userData);
-        else m=null;
-
-        // Look in the contextual cache.
-        if (m != null) {
-            final SnmpTableHandler handler =
-                (SnmpTableHandler)m.get("JvmRTClassPathTable.handler");
-            if (handler != null) return handler;
-        }
-
-        // No handler in contextual cache, make a new one.
-        final SnmpTableHandler handler = cache.getTableHandler();
-
-        if (m != null && handler != null )
-            m.put("JvmRTClassPathTable.handler",handler);
-
-        return handler;
-    }
-
-    static final MibLogger log =
-        new MibLogger(JvmRTClassPathTableMetaImpl.class);
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTInputArgsEntryImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-
-import sun.management.snmp.jvmmib.JvmRTInputArgsEntryMBean;
-
-/**
- * The class is used for implementing the "JvmRTInputArgsEntry" group.
- */
-public class JvmRTInputArgsEntryImpl implements JvmRTInputArgsEntryMBean,
-                                                Serializable {
-
-    static final long serialVersionUID = 1000306518436503395L;
-    private final String item;
-    private final int index;
-
-    /**
-     * Constructor for the "JvmRTInputArgsEntry" group.
-     */
-    public JvmRTInputArgsEntryImpl(String item, int index) {
-        this.item = validArgValueTC(item);
-        this.index = index;
-    }
-
-    private String validArgValueTC(String str) {
-        return JVM_MANAGEMENT_MIB_IMPL.validArgValueTC(str);
-    }
-
-    /**
-     * Getter for the "JvmRTInputArgsItem" variable.
-     */
-    public String getJvmRTInputArgsItem() throws SnmpStatusException {
-        return item;
-    }
-
-    /**
-     * Getter for the "JvmRTInputArgsIndex" variable.
-     */
-    public Integer getJvmRTInputArgsIndex() throws SnmpStatusException {
-        return index;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTInputArgsTableMetaImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,297 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import com.sun.jmx.mbeanserver.Util;
-import java.util.List;
-import java.util.Map;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpIndex;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-import sun.management.snmp.jvmmib.JvmRTInputArgsTableMeta;
-import sun.management.snmp.util.SnmpCachedData;
-import sun.management.snmp.util.SnmpTableCache;
-import sun.management.snmp.util.SnmpTableHandler;
-import sun.management.snmp.util.MibLogger;
-import sun.management.snmp.util.JvmContextFactory;
-
-/**
- * The class is used for implementing the "JvmRTInputArgsTable" group.
- */
-public class JvmRTInputArgsTableMetaImpl extends JvmRTInputArgsTableMeta {
-
-    static final long serialVersionUID = -2083438094888099238L;
-    private SnmpTableCache cache;
-
-     /**
-     * A concrete implementation of {@link SnmpTableCache}, for the
-     * JvmRTInputArgsTable.
-     **/
-    private static class JvmRTInputArgsTableCache extends SnmpTableCache {
-
-        static final long serialVersionUID = 1693751105464785192L;
-        private JvmRTInputArgsTableMetaImpl meta;
-
-        JvmRTInputArgsTableCache(JvmRTInputArgsTableMetaImpl meta,
-                                 long validity) {
-            this.meta = meta;
-            this.validity = validity;
-        }
-
-        /**
-         * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>.
-         **/
-        public SnmpTableHandler getTableHandler() {
-            final Map<Object,Object> userData = JvmContextFactory.getUserData();
-            return getTableDatas(userData);
-        }
-
-
-        /**
-         * Return a table handler containing the Thread indexes.
-         * Indexes are computed from the ThreadId.
-         **/
-        protected SnmpCachedData updateCachedDatas(Object userData) {
-
-
-            // We are getting all the input args
-            final String[] args = JvmRuntimeImpl.getInputArguments(userData);
-
-            // Time stamp for the cache
-            final long time = System.currentTimeMillis();
-            SnmpOid indexes[] = new SnmpOid[args.length];
-
-            for(int i = 0; i < args.length; i++) {
-                indexes[i] = new SnmpOid(i + 1);
-            }
-
-            return new SnmpCachedData(time, indexes, args);
-        }
-    }
-
-    /**
-     * Constructor for the table. Initialize metadata for
-     * "JvmRTInputArgsTableMeta".
-     * The reference on the MBean server is updated so the entries
-     * created through an SNMP SET will be AUTOMATICALLY REGISTERED
-     * in Java DMK.
-     */
-    public JvmRTInputArgsTableMetaImpl(SnmpMib myMib,
-                                       SnmpStandardObjectServer objserv) {
-        super(myMib, objserv);
-        cache = new JvmRTInputArgsTableCache(this, -1);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(Object userData)
-        throws SnmpStatusException {
-        // null means get the first OID.
-        return getNextOid(null,userData);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(SnmpOid oid, Object userData)
-        throws SnmpStatusException {
-        final boolean dbg = log.isDebugOn();
-        if (dbg) log.debug("getNextOid", "previous=" + oid);
-
-
-        // Get the data handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-        if (handler == null) {
-            // This should never happen.
-            // If we get here it's a bug.
-            //
-            if (dbg) log.debug("getNextOid", "handler is null!");
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        // Get the next oid
-        //
-        final SnmpOid next = handler.getNext(oid);
-        if (dbg) log.debug("*** **** **** **** getNextOid", "next=" + next);
-
-        // if next is null: we reached the end of the table.
-        //
-        if (next == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        return next;
-    }
-
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected boolean contains(SnmpOid oid, Object userData) {
-
-        // Get the handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            return false;
-
-        return handler.contains(oid);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    public Object getEntry(SnmpOid oid)
-        throws SnmpStatusException {
-        final boolean dbg = log.isDebugOn();
-        if (dbg) log.debug("getEntry", "oid [" + oid + "]");
-        if (oid == null || oid.getLength() != 1) {
-            if (dbg) log.debug("getEntry", "Invalid oid [" + oid + "]");
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        // Get the request contextual cache (userData).
-        //
-        final Map<Object, Object> m = JvmContextFactory.getUserData();
-
-        // We're going to use this name to store/retrieve the entry in
-        // the request contextual cache.
-        //
-        // Revisit: Probably better programming to put all these strings
-        //          in some interface.
-        //
-        final String entryTag = ((m==null)?null:
-                                 ("JvmRTInputArgsTable.entry." +
-                                  oid.toString()));
-
-        // If the entry is in the cache, simply return it.
-        //
-        if (m != null) {
-            final Object entry = m.get(entryTag);
-            if (entry != null) {
-                if (dbg)
-                    log.debug("getEntry", "Entry is already in the cache");
-                return entry;
-            } else if (dbg) log.debug("getEntry", "Entry is not in the cache");
-        }
-
-        // The entry was not in the cache, make a new one.
-        //
-        // Get the data hanler.
-        //
-        SnmpTableHandler handler = getHandler(m);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // Get the data associated with our entry.
-        //
-        final Object data = handler.getData(oid);
-
-        // data may be null if the OID we were given is not valid.
-        //
-        if (data == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // make the new entry (transient object that will be kept only
-        // for the duration of the request.
-        //
-        if (dbg) log.debug("getEntry","data is a: " +
-                           data.getClass().getName());
-        final Object entry =
-            new JvmRTInputArgsEntryImpl((String) data, (int) oid.getOidArc(0));
-
-        // Put the entry in the cache in case we need it later while processing
-        // the request.
-        //
-        if (m != null && entry != null) {
-            m.put(entryTag,entry);
-        }
-
-        return entry;
-    }
-
-    /**
-     * Get the SnmpTableHandler that holds the jvmThreadInstanceTable data.
-     * First look it up in the request contextual cache, and if it is
-     * not found, obtain it from the weak cache.
-     * <br>The request contextual cache will be released at the end of the
-     * current requests, and is used only to process this request.
-     * <br>The weak cache is shared by all requests, and is only
-     * recomputed when it is found to be obsolete.
-     * <br>Note that the data put in the request contextual cache is
-     *     never considered to be obsolete, in order to preserve data
-     *     coherency.
-     **/
-    protected SnmpTableHandler getHandler(Object userData) {
-        final Map<Object, Object> m;
-        if (userData instanceof Map) m=Util.cast(userData);
-        else m=null;
-
-        // Look in the contextual cache.
-        if (m != null) {
-            final SnmpTableHandler handler =
-                (SnmpTableHandler)m.get("JvmRTInputArgsTable.handler");
-            if (handler != null) return handler;
-        }
-
-        // No handler in contextual cache, make a new one.
-        final SnmpTableHandler handler = cache.getTableHandler();
-
-        if (m != null && handler != null )
-            m.put("JvmRTInputArgsTable.handler",handler);
-
-        return handler;
-    }
-
-    static final MibLogger log =
-        new MibLogger(JvmRTInputArgsTableMetaImpl.class);
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTLibraryPathEntryImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-
-import sun.management.snmp.jvmmib.JvmRTLibraryPathEntryMBean;
-
-/**
- * The class is used for implementing the "JvmRTLibraryPathEntry" group.
- */
-public class JvmRTLibraryPathEntryImpl implements JvmRTLibraryPathEntryMBean,
-                                                Serializable {
-
-    static final long serialVersionUID = -3322438153507369765L;
-    private final String item;
-    private final int index;
-
-    /**
-     * Constructor for the "JvmRTLibraryPathEntry" group.
-     */
-    public JvmRTLibraryPathEntryImpl(String item, int index) {
-        this.item  = validPathElementTC(item);
-        this.index = index;
-    }
-
-    private String validPathElementTC(String str) {
-        return JVM_MANAGEMENT_MIB_IMPL.validPathElementTC(str);
-    }
-
-    /**
-     * Getter for the "JvmRTLibraryPathItem" variable.
-     */
-    public String getJvmRTLibraryPathItem() throws SnmpStatusException {
-        return item;
-    }
-
-    /**
-     * Getter for the "JvmRTLibraryPathIndex" variable.
-     */
-    public Integer getJvmRTLibraryPathIndex() throws SnmpStatusException {
-        return index;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTLibraryPathTableMetaImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,300 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import com.sun.jmx.mbeanserver.Util;
-import java.util.List;
-import java.util.Map;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpIndex;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-import sun.management.snmp.jvmmib.JvmRTLibraryPathTableMeta;
-import sun.management.snmp.util.SnmpCachedData;
-import sun.management.snmp.util.SnmpTableCache;
-import sun.management.snmp.util.SnmpTableHandler;
-import sun.management.snmp.util.MibLogger;
-import sun.management.snmp.util.JvmContextFactory;
-
-/**
- * The class is used for implementing the "JvmRTLibraryPathTable".
-  */
-public class JvmRTLibraryPathTableMetaImpl extends JvmRTLibraryPathTableMeta {
-
-    static final long serialVersionUID = 6713252710712502068L;
-    private SnmpTableCache cache;
-
-     /**
-     * A concrete implementation of {@link SnmpTableCache}, for the
-     * JvmRTLibraryPathTable.
-     **/
-    private static class JvmRTLibraryPathTableCache extends SnmpTableCache {
-        static final long serialVersionUID = 2035304445719393195L;
-        private JvmRTLibraryPathTableMetaImpl meta;
-
-        JvmRTLibraryPathTableCache(JvmRTLibraryPathTableMetaImpl meta,
-                                 long validity) {
-            this.meta = meta;
-            this.validity = validity;
-        }
-
-        /**
-         * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>.
-         **/
-        public SnmpTableHandler getTableHandler() {
-            final Map<Object,Object> userData = JvmContextFactory.getUserData();
-            return getTableDatas(userData);
-        }
-
-
-        /**
-         * Return a table handler containing the Thread indexes.
-         * Indexes are computed from the ThreadId.
-         **/
-        protected SnmpCachedData updateCachedDatas(Object userData) {
-
-
-            // We are getting all the input args
-            final String[] path =
-                JvmRuntimeImpl.getLibraryPath(userData);
-
-            // Time stamp for the cache
-            final long time = System.currentTimeMillis();
-            final int len = path.length;
-
-            SnmpOid indexes[] = new SnmpOid[len];
-
-            for(int i = 0; i < len; i++) {
-                indexes[i] = new SnmpOid(i + 1);
-            }
-
-            return new SnmpCachedData(time, indexes, path);
-        }
-    }
-
-    /**
-     * Constructor for the table. Initialize metadata for
-     * "JvmRTLibraryPathTableMeta".
-     * The reference on the MBean server is updated so the entries
-     * created through an SNMP SET will be AUTOMATICALLY REGISTERED
-     * in Java DMK.
-     */
-    public JvmRTLibraryPathTableMetaImpl(SnmpMib myMib,
-                                       SnmpStandardObjectServer objserv) {
-        super(myMib, objserv);
-        cache = new JvmRTLibraryPathTableCache(this, -1);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(Object userData)
-        throws SnmpStatusException {
-        // null means get the first OID.
-        return getNextOid(null,userData);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(SnmpOid oid, Object userData)
-        throws SnmpStatusException {
-        final boolean dbg = log.isDebugOn();
-        if (dbg) log.debug("getNextOid", "previous=" + oid);
-
-
-        // Get the data handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-        if (handler == null) {
-            // This should never happen.
-            // If we get here it's a bug.
-            //
-            if (dbg) log.debug("getNextOid", "handler is null!");
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        // Get the next oid
-        //
-        final SnmpOid next = handler.getNext(oid);
-        if (dbg) log.debug("*** **** **** **** getNextOid", "next=" + next);
-
-        // if next is null: we reached the end of the table.
-        //
-        if (next == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        return next;
-    }
-
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected boolean contains(SnmpOid oid, Object userData) {
-
-        // Get the handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            return false;
-
-        return handler.contains(oid);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    public Object getEntry(SnmpOid oid)
-        throws SnmpStatusException {
-        final boolean dbg = log.isDebugOn();
-        if (dbg) log.debug("getEntry", "oid [" + oid + "]");
-        if (oid == null || oid.getLength() != 1) {
-            if (dbg) log.debug("getEntry", "Invalid oid [" + oid + "]");
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        // Get the request contextual cache (userData).
-        //
-        final Map<Object, Object> m = JvmContextFactory.getUserData();
-
-        // We're going to use this name to store/retrieve the entry in
-        // the request contextual cache.
-        //
-        // Revisit: Probably better programming to put all these strings
-        //          in some interface.
-        //
-        final String entryTag = ((m==null)?null:
-                                 ("JvmRTLibraryPathTable.entry." +
-                                  oid.toString()));
-
-        // If the entry is in the cache, simply return it.
-        //
-        if (m != null) {
-            final Object entry = m.get(entryTag);
-            if (entry != null) {
-                if (dbg)
-                    log.debug("getEntry", "Entry is already in the cache");
-                return entry;
-            } else if (dbg) log.debug("getEntry", "Entry is not in the cache");
-
-        }
-
-        // The entry was not in the cache, make a new one.
-        //
-        // Get the data hanler.
-        //
-        SnmpTableHandler handler = getHandler(m);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // Get the data associated with our entry.
-        //
-        final Object data = handler.getData(oid);
-
-        // data may be null if the OID we were given is not valid.
-        //
-        if (data == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        // make the new entry (transient object that will be kept only
-        // for the duration of the request.
-        //
-        if (dbg) log.debug("getEntry","data is a: "+
-                           data.getClass().getName());
-        final Object entry =
-            new JvmRTLibraryPathEntryImpl((String) data,(int)oid.getOidArc(0));
-
-        // Put the entry in the cache in case we need it later while processing
-        // the request.
-        //
-        if (m != null && entry != null) {
-            m.put(entryTag,entry);
-        }
-
-        return entry;
-    }
-
-    /**
-     * Get the SnmpTableHandler that holds the jvmThreadInstanceTable data.
-     * First look it up in the request contextual cache, and if it is
-     * not found, obtain it from the weak cache.
-     * <br>The request contextual cache will be released at the end of the
-     * current requests, and is used only to process this request.
-     * <br>The weak cache is shared by all requests, and is only
-     * recomputed when it is found to be obsolete.
-     * <br>Note that the data put in the request contextual cache is
-     *     never considered to be obsolete, in order to preserve data
-     *     coherency.
-     **/
-    protected SnmpTableHandler getHandler(Object userData) {
-        final Map<Object, Object> m;
-        if (userData instanceof Map) m=Util.cast(userData);
-        else m=null;
-
-        // Look in the contextual cache.
-        if (m != null) {
-            final SnmpTableHandler handler =
-                (SnmpTableHandler)m.get("JvmRTLibraryPathTable.handler");
-            if (handler != null) return handler;
-        }
-
-        // No handler in contextual cache, make a new one.
-        final SnmpTableHandler handler = cache.getTableHandler();
-
-        if (m != null && handler != null )
-            m.put("JvmRTLibraryPathTable.handler",handler);
-
-        return handler;
-    }
-
-    static final MibLogger log =
-        new MibLogger(JvmRTLibraryPathTableMetaImpl.class);
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRuntimeImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,286 +0,0 @@
-/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import com.sun.jmx.mbeanserver.Util;
-import java.io.Serializable;
-import java.lang.management.RuntimeMXBean;
-import java.lang.management.ManagementFactory;
-import java.util.List;
-import java.util.Map;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-
-import sun.management.snmp.jvmmib.JvmRuntimeMBean;
-import sun.management.snmp.jvmmib.EnumJvmRTBootClassPathSupport;
-import sun.management.snmp.util.JvmContextFactory;
-
-/**
- * The class is used for implementing the "JvmRuntime" group.
- */
-public class JvmRuntimeImpl implements JvmRuntimeMBean {
-
-    /**
-     * Variable for storing the value of "JvmRTBootClassPathSupport".
-     *
-     * "Indicates whether the Java virtual machine supports the
-     * boot class path mechanism used by the system class loader
-     * to search for class files.
-     *
-     * See java.management.RuntimeMXBean.isBootClassPathSupported()
-     * "
-     *
-     */
-    static final EnumJvmRTBootClassPathSupport
-        JvmRTBootClassPathSupportSupported =
-        new EnumJvmRTBootClassPathSupport("supported");
-    static final EnumJvmRTBootClassPathSupport
-        JvmRTBootClassPathSupportUnSupported =
-        new EnumJvmRTBootClassPathSupport("unsupported");
-
-    /**
-     * Constructor for the "JvmRuntime" group.
-     * If the group contains a table, the entries created through an SNMP SET
-     * will not be registered in Java DMK.
-     */
-    public JvmRuntimeImpl(SnmpMib myMib) {
-
-    }
-
-
-    /**
-     * Constructor for the "JvmRuntime" group.
-     * If the group contains a table, the entries created through an SNMP SET
-     * will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmRuntimeImpl(SnmpMib myMib, MBeanServer server) {
-
-    }
-
-    static RuntimeMXBean getRuntimeMXBean() {
-        return ManagementFactory.getRuntimeMXBean();
-    }
-
-    private static String validDisplayStringTC(String str) {
-        return JVM_MANAGEMENT_MIB_IMPL.validDisplayStringTC(str);
-    }
-
-    private static String validPathElementTC(String str) {
-        return JVM_MANAGEMENT_MIB_IMPL.validPathElementTC(str);
-    }
-
-    private static String validJavaObjectNameTC(String str) {
-        return JVM_MANAGEMENT_MIB_IMPL.validJavaObjectNameTC(str);
-    }
-
-
-    static String[] splitPath(String path) {
-        final String[] items = path.split(java.io.File.pathSeparator);
-        // for (int i=0;i<items.length;i++) {
-        //    items[i]=validPathElementTC(items[i]);
-        // }
-        return items;
-    }
-
-    static String[] getClassPath(Object userData) {
-        final Map<Object, Object> m =
-                Util.cast((userData instanceof Map)?userData:null);
-        final String tag = "JvmRuntime.getClassPath";
-
-        // If the list is in the cache, simply return it.
-        //
-        if (m != null) {
-            final String[] cached = (String[])m.get(tag);
-            if (cached != null) return cached;
-        }
-
-        final String[] args = splitPath(getRuntimeMXBean().getClassPath());
-
-        if (m != null) m.put(tag,args);
-        return args;
-    }
-
-    static String[] getBootClassPath(Object userData) {
-        if (!getRuntimeMXBean().isBootClassPathSupported())
-        return new String[0];
-
-        final Map<Object, Object> m =
-                Util.cast((userData instanceof Map)?userData:null);
-        final String tag = "JvmRuntime.getBootClassPath";
-
-        // If the list is in the cache, simply return it.
-        //
-        if (m != null) {
-            final String[] cached = (String[])m.get(tag);
-            if (cached != null) return cached;
-        }
-
-        final String[] args = splitPath(getRuntimeMXBean().getBootClassPath());
-
-        if (m != null) m.put(tag,args);
-        return args;
-    }
-
-    static String[] getLibraryPath(Object userData) {
-        final Map<Object, Object> m =
-                Util.cast((userData instanceof Map)?userData:null);
-        final String tag = "JvmRuntime.getLibraryPath";
-
-        // If the list is in the cache, simply return it.
-        //
-        if (m != null) {
-            final String[] cached = (String[])m.get(tag);
-            if (cached != null) return cached;
-        }
-
-        final String[] args = splitPath(getRuntimeMXBean().getLibraryPath());
-
-        if (m != null) m.put(tag,args);
-        return args;
-    }
-
-    static String[] getInputArguments(Object userData) {
-        final Map<Object, Object> m =
-                Util.cast((userData instanceof Map)?userData:null);
-        final String tag = "JvmRuntime.getInputArguments";
-
-        // If the list is in the cache, simply return it.
-        //
-        if (m != null) {
-            final String[] cached = (String[])m.get(tag);
-            if (cached != null) return cached;
-        }
-
-        final List<String> l = getRuntimeMXBean().getInputArguments();
-        final String[] args = l.toArray(new String[0]);
-
-        if (m != null) m.put(tag,args);
-        return args;
-    }
-
-    /**
-     * Getter for the "JvmRTSpecVendor" variable.
-     */
-    public String getJvmRTSpecVendor() throws SnmpStatusException {
-        return validDisplayStringTC(getRuntimeMXBean().getSpecVendor());
-    }
-
-    /**
-     * Getter for the "JvmRTSpecName" variable.
-     */
-    public String getJvmRTSpecName() throws SnmpStatusException {
-        return validDisplayStringTC(getRuntimeMXBean().getSpecName());
-    }
-
-    /**
-     * Getter for the "JvmRTVersion" variable.
-     */
-    public String getJvmRTVMVersion() throws SnmpStatusException {
-        return validDisplayStringTC(getRuntimeMXBean().getVmVersion());
-    }
-
-    /**
-     * Getter for the "JvmRTVendor" variable.
-     */
-    public String getJvmRTVMVendor() throws SnmpStatusException {
-        return validDisplayStringTC(getRuntimeMXBean().getVmVendor());
-    }
-
-    /**
-     * Getter for the "JvmRTManagementSpecVersion" variable.
-     */
-    public String getJvmRTManagementSpecVersion() throws SnmpStatusException {
-        return validDisplayStringTC(getRuntimeMXBean().
-                                    getManagementSpecVersion());
-    }
-
-    /**
-     * Getter for the "JvmRTVMName" variable.
-     */
-    public String getJvmRTVMName() throws SnmpStatusException {
-        return validJavaObjectNameTC(getRuntimeMXBean().getVmName());
-    }
-
-
-    /**
-     * Getter for the "JvmRTInputArgsCount" variable.
-     */
-    public Integer getJvmRTInputArgsCount() throws SnmpStatusException {
-
-        final String[] args = getInputArguments(JvmContextFactory.
-                                                getUserData());
-        return args.length;
-    }
-
-    /**
-     * Getter for the "JvmRTBootClassPathSupport" variable.
-     */
-    public EnumJvmRTBootClassPathSupport getJvmRTBootClassPathSupport()
-        throws SnmpStatusException {
-        if(getRuntimeMXBean().isBootClassPathSupported())
-            return JvmRTBootClassPathSupportSupported;
-        else
-            return JvmRTBootClassPathSupportUnSupported;
-    }
-
-    /**
-     * Getter for the "JvmRTUptimeMs" variable.
-     */
-    public Long getJvmRTUptimeMs() throws SnmpStatusException {
-        return getRuntimeMXBean().getUptime();
-    }
-
-    /**
-     * Getter for the "JvmRTStartTimeMs" variable.
-     */
-    public Long getJvmRTStartTimeMs() throws SnmpStatusException {
-        return getRuntimeMXBean().getStartTime();
-    }
-
-    /**
-     * Getter for the "JvmRTSpecVersion" variable.
-     */
-    public String getJvmRTSpecVersion() throws SnmpStatusException {
-        return validDisplayStringTC(getRuntimeMXBean().getSpecVersion());
-    }
-
-    /**
-     * Getter for the "JvmRTName" variable.
-     */
-    public String getJvmRTName() throws SnmpStatusException {
-        return validDisplayStringTC(getRuntimeMXBean().getName());
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRuntimeMetaImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibGroup;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-
-import sun.management.snmp.jvmmib.JvmRuntimeMeta;
-import sun.management.snmp.jvmmib.JvmRTInputArgsTableMeta;
-import sun.management.snmp.jvmmib.JvmRTClassPathTableMeta;
-import sun.management.snmp.jvmmib.JvmRTBootClassPathTableMeta;
-import sun.management.snmp.jvmmib.JvmRTLibraryPathTableMeta;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmRuntime" group.
- */
-public class JvmRuntimeMetaImpl extends JvmRuntimeMeta {
-
-     static final long serialVersionUID = -6570428414857608618L;
-    /**
-     * Constructor for the metadata associated to "JvmRuntime".
-     */
-    public JvmRuntimeMetaImpl(SnmpMib myMib,
-                              SnmpStandardObjectServer objserv) {
-        super(myMib, objserv);
-    }
-
-    /**
-     * Factory method for "JvmRTInputArgsTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmRTInputArgsTable")
-     * @param groupName Name of the group to which this table belong
-     *        ("JvmRuntime")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmRTInputArgsTable" table (JvmRTInputArgsTableMeta)
-     *
-     **/
-    protected JvmRTInputArgsTableMeta
-        createJvmRTInputArgsTableMetaNode(String tableName, String groupName,
-                                          SnmpMib mib, MBeanServer server)  {
-        return new JvmRTInputArgsTableMetaImpl(mib, objectserver);
-    }
-
-    /**
-     * Factory method for "JvmRTLibraryPathTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmRTLibraryPathTable")
-     * @param groupName Name of the group to which this table belong
-     *        ("JvmRuntime")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmRTLibraryPathTable" table (JvmRTLibraryPathTableMeta)
-     *
-     **/
-    protected JvmRTLibraryPathTableMeta
-        createJvmRTLibraryPathTableMetaNode(String tableName,
-                                            String groupName,
-                                            SnmpMib mib,
-                                            MBeanServer server)  {
-        return new JvmRTLibraryPathTableMetaImpl(mib, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmRTClassPathTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmRTClassPathTable")
-     * @param groupName Name of the group to which this table belong
-     *        ("JvmRuntime")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmRTClassPathTable" table (JvmRTClassPathTableMeta)
-     *
-     **/
-    protected JvmRTClassPathTableMeta
-        createJvmRTClassPathTableMetaNode(String tableName, String groupName,
-                                          SnmpMib mib, MBeanServer server)  {
-        return new JvmRTClassPathTableMetaImpl(mib, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmRTBootClassPathTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmRTBootClassPathTable")
-     * @param groupName Name of the group to which this table belong
-     *        ("JvmRuntime")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmRTBootClassPathTable" table (JvmRTBootClassPathTableMeta)
-     *
-     **/
-    protected JvmRTBootClassPathTableMeta
-        createJvmRTBootClassPathTableMetaNode(String tableName,
-                                              String groupName,
-                                              SnmpMib mib,
-                                              MBeanServer server)  {
-        return new JvmRTBootClassPathTableMetaImpl(mib, objectserver);
-    }
-
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmThreadInstanceEntryImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,330 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.io.Serializable;
-import java.lang.management.ThreadInfo;
-import java.lang.management.ManagementFactory;
-import java.lang.management.ThreadMXBean;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpDefinitions;
-import com.sun.jmx.snmp.SnmpOidTable;
-import com.sun.jmx.snmp.SnmpOidRecord;
-
-import sun.management.snmp.jvmmib.JvmThreadInstanceEntryMBean;
-import sun.management.snmp.jvmmib.JVM_MANAGEMENT_MIBOidTable;
-import sun.management.snmp.util.MibLogger;
-
-/**
- * The class is used for implementing the "JvmThreadInstanceEntry" group.
- */
-public class JvmThreadInstanceEntryImpl
-    implements JvmThreadInstanceEntryMBean, Serializable {
-
-    static final long serialVersionUID = 910173589985461347L;
-
-    public final static class ThreadStateMap {
-        public final static class Byte0 {
-            public final static byte inNative     = (byte)0x80; // bit 1
-            public final static byte suspended    = (byte)0x40; // bit 2
-            public final static byte newThread    = (byte)0x20; // bit 3
-            public final static byte runnable     = (byte)0x10; // bit 4
-            public final static byte blocked      = (byte)0x08; // bit 5
-            public final static byte terminated   = (byte)0x04; // bit 6
-            public final static byte waiting      = (byte)0x02; // bit 7
-            public final static byte timedWaiting = (byte)0x01; // bit 8
-        }
-        public final static class Byte1 {
-            public final static byte other        = (byte)0x80; // bit 9
-            public final static byte reserved10   = (byte)0x40; // bit 10
-            public final static byte reserved11   = (byte)0x20; // bit 11
-            public final static byte reserved12   = (byte)0x10; // bit 12
-            public final static byte reserved13   = (byte)0x08; // bit 13
-            public final static byte reserved14   = (byte)0x04; // bit 14
-            public final static byte reserved15   = (byte)0x02; // bit 15
-            public final static byte reserved16   = (byte)0x01; // bit 16
-        }
-
-        public final static byte mask0 = (byte)0x3F;
-        public final static byte mask1 = (byte)0x80;
-
-        private static void setBit(byte[] bitmap, int index, byte state) {
-            bitmap[index] = (byte) (bitmap[index] | state);
-        }
-        public static void setNative(byte[] bitmap) {
-            setBit(bitmap,0,Byte0.inNative);
-        }
-        public static void setSuspended(byte[] bitmap) {
-            setBit(bitmap,0,Byte0.suspended);
-        }
-        public static void setState(byte[] bitmap, Thread.State state) {
-            switch(state) {
-            case BLOCKED:
-                setBit(bitmap,0,Byte0.blocked);
-                return;
-            case NEW:
-                setBit(bitmap,0,Byte0.newThread);
-                return;
-            case RUNNABLE:
-                setBit(bitmap,0,Byte0.runnable);
-                return;
-            case TERMINATED:
-                setBit(bitmap,0,Byte0.terminated);
-                return;
-            case TIMED_WAITING:
-                setBit(bitmap,0,Byte0.timedWaiting);
-                return;
-            case WAITING:
-                setBit(bitmap,0,Byte0.waiting);
-                return;
-            }
-        }
-
-        public static void checkOther(byte[] bitmap) {
-            if (((bitmap[0]&mask0)==(byte)0x00) &&
-                ((bitmap[1]&mask1)==(byte)0x00))
-                setBit(bitmap,1,Byte1.other);
-        }
-
-        public static Byte[] getState(ThreadInfo info) {
-            byte[] bitmap = new byte[] {(byte)0x00, (byte)0x00};
-            try {
-                final Thread.State state = info.getThreadState();
-                final boolean inNative  = info.isInNative();
-                final boolean suspended = info.isSuspended();
-                log.debug("getJvmThreadInstState",
-                          "[State=" + state +
-                          ",isInNative=" + inNative +
-                          ",isSuspended=" + suspended + "]");
-                setState(bitmap,state);
-                if (inNative)  setNative(bitmap);
-                if (suspended) setSuspended(bitmap);
-                checkOther(bitmap);
-            } catch (RuntimeException r) {
-                bitmap[0]=(byte)0x00;
-                bitmap[1]=Byte1.other;
-                log.trace("getJvmThreadInstState",
-                          "Unexpected exception: " + r);
-                log.debug("getJvmThreadInstState",r);
-            }
-            Byte[] result = {bitmap[0], bitmap[1]};
-            return result;
-        }
-    }
-
-    private final ThreadInfo info;
-    private final Byte[] index;
-
-    /**
-     * Constructor for the "JvmThreadInstanceEntry" group.
-     */
-    public JvmThreadInstanceEntryImpl(ThreadInfo info,
-                                      Byte[] index) {
-        this.info = info;
-        this.index = index;
-    }
-
-
-    private static String  jvmThreadInstIndexOid = null;
-    public static String getJvmThreadInstIndexOid()
-        throws SnmpStatusException {
-        if (jvmThreadInstIndexOid == null) {
-            final SnmpOidTable  table = new JVM_MANAGEMENT_MIBOidTable();
-            final SnmpOidRecord record =
-                table.resolveVarName("jvmThreadInstIndex");
-            jvmThreadInstIndexOid = record.getOid();
-        }
-        return jvmThreadInstIndexOid;
-    }
-
-
-
-    /**
-     * Getter for the "JvmThreadInstLockedOwnerId" variable.
-     */
-    public String getJvmThreadInstLockOwnerPtr() throws SnmpStatusException {
-       long id = info.getLockOwnerId();
-
-       if(id == -1)
-           return new String("0.0");
-
-       SnmpOid oid = JvmThreadInstanceTableMetaImpl.makeOid(id);
-
-       return getJvmThreadInstIndexOid() + "." + oid.toString();
-    }
-
-    private String validDisplayStringTC(String str) {
-        return JVM_MANAGEMENT_MIB_IMPL.validDisplayStringTC(str);
-    }
-
-    private String validJavaObjectNameTC(String str) {
-        return JVM_MANAGEMENT_MIB_IMPL.validJavaObjectNameTC(str);
-    }
-
-    private String validPathElementTC(String str) {
-        return JVM_MANAGEMENT_MIB_IMPL.validPathElementTC(str);
-    }
-
-    /**
-     * Getter for the "JvmThreadInstLockName" variable.
-     */
-    public String getJvmThreadInstLockName() throws SnmpStatusException {
-        return validJavaObjectNameTC(info.getLockName());
-    }
-
-    /**
-     * Getter for the "JvmThreadInstName" variable.
-     */
-    public String getJvmThreadInstName() throws SnmpStatusException {
-        return validJavaObjectNameTC(info.getThreadName());
-    }
-
-    /**
-     * Getter for the "JvmThreadInstCpuTimeNs" variable.
-     */
-    public Long getJvmThreadInstCpuTimeNs() throws SnmpStatusException {
-        long l = 0;
-        final ThreadMXBean tmb = JvmThreadingImpl.getThreadMXBean();
-
-        try {
-            if (tmb.isThreadCpuTimeSupported()) {
-                l = tmb.getThreadCpuTime(info.getThreadId());
-                log.debug("getJvmThreadInstCpuTimeNs", "Cpu time ns : " + l);
-
-                //Cpu time measurement is disabled or the id is not valid.
-                if(l == -1) l = 0;
-            }
-        } catch (UnsatisfiedLinkError e) {
-            // XXX Revisit: catch TO BE EVENTUALLY REMOVED
-            log.debug("getJvmThreadInstCpuTimeNs",
-                      "Operation not supported: " + e);
-        }
-        return l;
-    }
-
-    /**
-     * Getter for the "JvmThreadInstBlockTimeMs" variable.
-     */
-    public Long getJvmThreadInstBlockTimeMs() throws SnmpStatusException {
-        long l = 0;
-
-        final ThreadMXBean tmb = JvmThreadingImpl.getThreadMXBean();
-
-        if (tmb.isThreadContentionMonitoringSupported()) {
-            l = info.getBlockedTime();
-
-            //Monitoring is disabled
-            if(l == -1) l = 0;
-        }
-        return l;
-    }
-
-    /**
-     * Getter for the "JvmThreadInstBlockCount" variable.
-     */
-    public Long getJvmThreadInstBlockCount() throws SnmpStatusException {
-        return info.getBlockedCount();
-    }
-
-    /**
-     * Getter for the "JvmThreadInstWaitTimeMs" variable.
-     */
-    public Long getJvmThreadInstWaitTimeMs() throws SnmpStatusException {
-        long l = 0;
-
-        final ThreadMXBean tmb = JvmThreadingImpl.getThreadMXBean();
-
-        if (tmb.isThreadContentionMonitoringSupported()) {
-            l = info.getWaitedTime();
-
-            //Monitoring is disabled
-            if(l == -1) l = 0;
-        }
-        return l;
-    }
-
-    /**
-     * Getter for the "JvmThreadInstWaitCount" variable.
-     */
-    public Long getJvmThreadInstWaitCount() throws SnmpStatusException {
-        return info.getWaitedCount();
-    }
-
-    /**
-     * Getter for the "JvmThreadInstState" variable.
-     */
-    public Byte[] getJvmThreadInstState()
-        throws SnmpStatusException {
-        return ThreadStateMap.getState(info);
-    }
-
-    /**
-     * Getter for the "JvmThreadInstId" variable.
-     */
-    public Long getJvmThreadInstId() throws SnmpStatusException {
-        return info.getThreadId();
-    }
-
-    /**
-     * Getter for the "JvmThreadInstIndex" variable.
-     */
-    public Byte[] getJvmThreadInstIndex() throws SnmpStatusException {
-        return index;
-    }
-
-    /**
-     * Getter for the "JvmThreadInstStackTrace" variable.
-     */
-    private String getJvmThreadInstStackTrace() throws SnmpStatusException {
-        StackTraceElement[] stackTrace = info.getStackTrace();
-        //We append the stack trace in a buffer
-        // XXX Revisit: should check isDebugOn()
-        StringBuilder sb = new StringBuilder();
-        final int stackSize = stackTrace.length;
-        log.debug("getJvmThreadInstStackTrace", "Stack size : " + stackSize);
-        for(int i = 0; i < stackSize; i++) {
-            log.debug("getJvmThreadInstStackTrace", "Append " +
-                      stackTrace[i].toString());
-            sb.append(stackTrace[i].toString());
-            //Append \n at the end of each line except the last one
-            if(i < stackSize)
-                sb.append("\n");
-        }
-        //The stack trace is truncated if its size exceeds 255.
-        return validPathElementTC(sb.toString());
-    }
-    static final MibLogger log =
-        new MibLogger(JvmThreadInstanceEntryImpl.class);
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmThreadInstanceTableMetaImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,404 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import com.sun.jmx.mbeanserver.Util;
-import java.io.Serializable;
-import java.util.Vector;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.Enumeration;
-
-import java.lang.management.ThreadInfo;
-import java.lang.management.ManagementFactory;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpIndex;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-import sun.management.snmp.jvmmib.JvmThreadInstanceEntryMBean;
-import sun.management.snmp.jvmmib.JvmThreadInstanceTableMeta;
-import sun.management.snmp.util.SnmpTableCache;
-import sun.management.snmp.util.SnmpCachedData;
-import sun.management.snmp.util.SnmpTableHandler;
-import sun.management.snmp.util.MibLogger;
-import sun.management.snmp.util.JvmContextFactory;
-
-/**
- * The class is used for implementing the "JvmThreadInstanceTable" group.
- */
-public class JvmThreadInstanceTableMetaImpl
-    extends JvmThreadInstanceTableMeta {
-
-    static final long serialVersionUID = -8432271929226397492L;
-
-    /**
-     * Maximum depth of the stacktrace that might be returned through
-     * SNMP.
-     *
-     * Since we do not export the stack trace through SNMP, we set
-     * MAX_STACK_TRACE_DEPTH=0 so that ThreadMXBean.getThreadInfo(long) does
-     * not compute the stack trace.
-     *
-     **/
-    public static final int MAX_STACK_TRACE_DEPTH=0;
-
-    /**
-     * Translate from a long to a Oid. Arc follow the long big-endian order.
-     * @param l The long to make the index from
-     * @return The arc array.
-     */
-    static SnmpOid makeOid(long l) {
-        long[] x =  new long [8];
-        x[0] = (l >> 56) & 0xFF;
-        x[1] =  (l >> 48) & 0x00FF;
-        x[2] =  (l >> 40) & 0x0000FF;
-        x[3] =  (l >> 32) & 0x000000FF;
-        x[4] =  (l >> 24) & 0x00000000FF;
-        x[5] =  (l >> 16) & 0x0000000000FF;
-        x[6] =  (l >> 8)  & 0x000000000000FF;
-        x[7] =  l         & 0x00000000000000FF;
-        return new SnmpOid(x);
-    }
-
-    /**
-     * Translate an Oid to a thread id. Arc follow the long big-endian order.
-     * @param oid The oid to make the id from
-     * @return The thread id.
-     */
-    static long makeId(SnmpOid oid) {
-        long id = 0;
-        long[] arcs = oid.longValue(false);
-
-        id |= arcs[0] << 56;
-        id |= arcs[1] << 48;
-        id |= arcs[2] << 40;
-        id |= arcs[3] << 32;
-        id |= arcs[4] << 24;
-        id |= arcs[5] << 16;
-        id |= arcs[6] << 8;
-        id |= arcs[7];
-
-        return id;
-    }
-
-    /**
-     * A concrete implementation of {@link SnmpTableCache}, for the
-     * JvmThreadInstanceTable.
-     **/
-    private static class JvmThreadInstanceTableCache
-        extends SnmpTableCache {
-
-        static final long serialVersionUID = 4947330124563406878L;
-        final private JvmThreadInstanceTableMetaImpl meta;
-
-        /**
-         * Create a weak cache for the JvmThreadInstanceTable.
-         * @param validity validity of the cached data, in ms.
-         **/
-        JvmThreadInstanceTableCache(JvmThreadInstanceTableMetaImpl meta,
-                                   long validity) {
-            this.validity = validity;
-            this.meta     = meta;
-        }
-
-        /**
-         * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>.
-         **/
-        public SnmpTableHandler getTableHandler() {
-            final Map<Object, Object> userData = JvmContextFactory.getUserData();
-            return getTableDatas(userData);
-        }
-
-        /**
-         * Return a table handler containing the Thread indexes.
-         * Indexes are computed from the ThreadId.
-         **/
-        protected SnmpCachedData updateCachedDatas(Object userData) {
-
-            // We are getting all the thread ids. WARNING.
-            // Some of them will be not valid when accessed for data...
-            // See getEntry
-            long[] id = JvmThreadingImpl.getThreadMXBean().getAllThreadIds();
-
-
-            // Time stamp for the cache
-            final long time = System.currentTimeMillis();
-
-            SnmpOid indexes[] = new SnmpOid[id.length];
-            final TreeMap<SnmpOid, Object> table =
-                    new TreeMap<>(SnmpCachedData.oidComparator);
-            for(int i = 0; i < id.length; i++) {
-                log.debug("", "Making index for thread id [" + id[i] +"]");
-                //indexes[i] = makeOid(id[i]);
-                SnmpOid oid = makeOid(id[i]);
-                table.put(oid, oid);
-            }
-
-            return new SnmpCachedData(time, table);
-        }
-
-    }
-
-
-    // The weak cache for this table.
-    protected SnmpTableCache cache;
-
-    /**
-     * Constructor for the table. Initialize metadata for
-     * "JvmThreadInstanceTableMeta".
-     * The reference on the MBean server is updated so the entries created
-     * through an SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmThreadInstanceTableMetaImpl(SnmpMib myMib,
-                                          SnmpStandardObjectServer objserv) {
-        super(myMib, objserv);
-        cache = new JvmThreadInstanceTableCache(this,
-                            ((JVM_MANAGEMENT_MIB_IMPL)myMib).validity());
-        log.debug("JvmThreadInstanceTableMetaImpl", "Create Thread meta");
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(Object userData)
-        throws SnmpStatusException {
-        log.debug("JvmThreadInstanceTableMetaImpl", "getNextOid");
-        // null means get the first OID.
-        return getNextOid(null,userData);
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected SnmpOid getNextOid(SnmpOid oid, Object userData)
-        throws SnmpStatusException {
-        log.debug("getNextOid", "previous=" + oid);
-
-
-        // Get the data handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-        if (handler == null) {
-            // This should never happen.
-            // If we get here it's a bug.
-            //
-            log.debug("getNextOid", "handler is null!");
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        // Get the next oid
-        //
-        SnmpOid next = oid;
-        while(true) {
-            next = handler.getNext(next);
-            if (next == null) break;
-            if (getJvmThreadInstance(userData,next) != null) break;
-        }
-
-        log.debug("*** **** **** **** getNextOid", "next=" + next);
-
-        // if next is null: we reached the end of the table.
-        //
-        if (next == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        return next;
-    }
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    protected boolean contains(SnmpOid oid, Object userData) {
-
-        // Get the handler.
-        //
-        SnmpTableHandler handler = getHandler(userData);
-
-        // handler should never be null.
-        //
-        if (handler == null)
-            return false;
-        if(!handler.contains(oid))
-            return false;
-
-        JvmThreadInstanceEntryImpl inst = getJvmThreadInstance(userData, oid);
-        return (inst != null);
-    }
-
-
-    // See com.sun.jmx.snmp.agent.SnmpMibTable
-    public Object getEntry(SnmpOid oid)
-        throws SnmpStatusException {
-        log.debug("*** **** **** **** getEntry", "oid [" + oid + "]");
-        if (oid == null || oid.getLength() != 8) {
-            log.debug("getEntry", "Invalid oid [" + oid + "]");
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-        }
-
-        // Get the request contextual cache (userData).
-        //
-        final Map<Object,Object> m = JvmContextFactory.getUserData();
-
-        // Get the handler.
-        //
-        SnmpTableHandler handler = getHandler(m);
-
-        // handler should never be null.
-        //
-        if (handler == null || !handler.contains(oid))
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        final JvmThreadInstanceEntryImpl entry = getJvmThreadInstance(m,oid);
-
-        if (entry == null)
-            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-
-        return entry;
-    }
-
-    /**
-     * Get the SnmpTableHandler that holds the jvmThreadInstanceTable data.
-     * First look it up in the request contextual cache, and if it is
-     * not found, obtain it from the weak cache.
-     * <br>The request contextual cache will be released at the end of the
-     * current requests, and is used only to process this request.
-     * <br>The weak cache is shared by all requests, and is only
-     * recomputed when it is found to be obsolete.
-     * <br>Note that the data put in the request contextual cache is
-     *     never considered to be obsolete, in order to preserve data
-     *     coherency.
-     **/
-    protected SnmpTableHandler getHandler(Object userData) {
-        final Map<Object, Object> m;
-        if (userData instanceof Map) m=Util.cast(userData);
-        else m=null;
-
-        // Look in the contextual cache.
-        if (m != null) {
-            final SnmpTableHandler handler =
-                (SnmpTableHandler)m.get("JvmThreadInstanceTable.handler");
-            if (handler != null) return handler;
-        }
-
-        // No handler in contextual cache, make a new one.
-        final SnmpTableHandler handler = cache.getTableHandler();
-
-        if (m != null && handler != null )
-            m.put("JvmThreadInstanceTable.handler",handler);
-
-        return handler;
-    }
-
-    private ThreadInfo getThreadInfo(long id) {
-        return JvmThreadingImpl.getThreadMXBean().
-                  getThreadInfo(id,MAX_STACK_TRACE_DEPTH);
-    }
-
-    private ThreadInfo getThreadInfo(SnmpOid oid) {
-        return getThreadInfo(makeId(oid));
-    }
-
-    private JvmThreadInstanceEntryImpl getJvmThreadInstance(Object userData,
-                                                            SnmpOid oid) {
-        JvmThreadInstanceEntryImpl cached = null;
-        String entryTag = null;
-        Map<Object, Object> map = null;
-        final boolean dbg = log.isDebugOn();
-
-        if (userData instanceof Map) {
-            map = Util.cast(userData);
-
-            // We're going to use this name to store/retrieve the entry in
-            // the request contextual cache.
-            //
-            // Revisit: Probably better programming to put all these strings
-            //          in some interface.
-            //
-            entryTag = "JvmThreadInstanceTable.entry." + oid.toString();
-
-            cached = (JvmThreadInstanceEntryImpl) map.get(entryTag);
-        }
-
-        // If the entry is in the cache, simply return it.
-        //
-        if (cached != null) {
-            if (dbg) log.debug("*** getJvmThreadInstance",
-                               "Entry found in cache: " + entryTag);
-            return cached;
-        }
-
-        if (dbg) log.debug("*** getJvmThreadInstance", "Entry [" +
-                           oid + "] is not in cache");
-
-        // Entry not in cache. We will create one if needed.
-        //
-        ThreadInfo info = null;
-        try {
-            info = getThreadInfo(oid);
-        } catch (RuntimeException r) {
-            log.trace("*** getJvmThreadInstance",
-                      "Failed to get thread info for rowOid: " + oid);
-            log.debug("*** getJvmThreadInstance",r);
-        }
-
-        // No thread by that id => no entry.
-        //
-        if(info == null) {
-            if (dbg) log.debug("*** getJvmThreadInstance",
-                               "No entry by that oid [" + oid + "]");
-            return null;
-        }
-
-        cached = new JvmThreadInstanceEntryImpl(info, oid.toByte());
-        if (map != null) map.put(entryTag, cached);
-        if (dbg) log.debug("*** getJvmThreadInstance",
-                           "Entry created for Thread OID [" + oid + "]");
-        return cached;
-    }
-
-     static final MibLogger log =
-        new MibLogger(JvmThreadInstanceTableMetaImpl.class);
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmThreadingImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,364 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.io.Serializable;
-
-import java.lang.management.ThreadMXBean;
-import java.lang.management.ManagementFactory;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-import sun.management.snmp.jvmmib.JvmThreadingMBean;
-import sun.management.snmp.jvmmib.EnumJvmThreadCpuTimeMonitoring;
-import sun.management.snmp.jvmmib.EnumJvmThreadContentionMonitoring;
-import sun.management.snmp.util.MibLogger;
-
-/**
- * The class is used for implementing the "JvmThreading" group.
- */
-public class JvmThreadingImpl implements JvmThreadingMBean {
-
-    /**
-     * Variable for storing the value of "JvmThreadCpuTimeMonitoring".
-     *
-     * "The state of the Thread CPU Time Monitoring feature.
-     * This feature can be:
-     *
-     * unsupported: The JVM does not support Thread CPU Time Monitoring.
-     * enabled    : The JVM supports Thread CPU Time Monitoring, and it
-     * is enabled.
-     * disabled   : The JVM supports Thread CPU Time Monitoring, and it
-     * is disabled.
-     *
-     * Only enabled(3) and disabled(4) may be supplied as values to a
-     * SET request. unsupported(1) can only be set internally by the
-     * agent.
-     *
-     * See java.lang.management.ThreadMXBean.isThreadCpuTimeSupported(),
-     * java.lang.management.ThreadMXBean.isThreadCpuTimeEnabled(),
-     * java.lang.management.ThreadMXBean.setThreadCpuTimeEnabled()
-     * "
-     *
-     */
-    final static EnumJvmThreadCpuTimeMonitoring
-        JvmThreadCpuTimeMonitoringUnsupported =
-        new EnumJvmThreadCpuTimeMonitoring("unsupported");
-    final static EnumJvmThreadCpuTimeMonitoring
-        JvmThreadCpuTimeMonitoringEnabled =
-        new EnumJvmThreadCpuTimeMonitoring("enabled");
-    final static EnumJvmThreadCpuTimeMonitoring
-        JvmThreadCpuTimeMonitoringDisabled =
-        new EnumJvmThreadCpuTimeMonitoring("disabled");
-
-
-    /**
-     * Variable for storing the value of "JvmThreadContentionMonitoring".
-     *
-     * "The state of the Thread Contention Monitoring feature.
-     * This feature can be:
-     *
-     * unsupported: The JVM does not support Thread Contention Monitoring.
-     * enabled    : The JVM supports Thread Contention Monitoring, and it
-     * is enabled.
-     * disabled   : The JVM supports Thread Contention Monitoring, and it
-     * is disabled.
-     *
-     * Only enabled(3) and disabled(4) may be supplied as values to a
-     * SET request. unsupported(1) can only be set internally by the
-     * agent.
-     *
-     * See java.lang.management.ThreadMXBean.isThreadContentionMonitoringSupported(),
-     * java.lang.management.ThreadMXBean.isThreadContentionMonitoringEnabled(),
-     * java.lang.management.ThreadMXBean.setThreadContentionMonitoringEnabled()
-     * "
-     *
-     */
-    static final EnumJvmThreadContentionMonitoring
-        JvmThreadContentionMonitoringUnsupported =
-        new EnumJvmThreadContentionMonitoring("unsupported");
-    static final EnumJvmThreadContentionMonitoring
-        JvmThreadContentionMonitoringEnabled =
-        new EnumJvmThreadContentionMonitoring("enabled");
-    static final EnumJvmThreadContentionMonitoring
-        JvmThreadContentionMonitoringDisabled =
-        new EnumJvmThreadContentionMonitoring("disabled");
-
-    /**
-     * Constructor for the "JvmThreading" group.
-     * If the group contains a table, the entries created through an SNMP SET
-     * will not be registered in Java DMK.
-     */
-    public JvmThreadingImpl(SnmpMib myMib) {
-        log.debug("JvmThreadingImpl","Constructor");
-    }
-
-
-    /**
-     * Constructor for the "JvmThreading" group.
-     * If the group contains a table, the entries created through an SNMP SET
-     * will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmThreadingImpl(SnmpMib myMib, MBeanServer server) {
-        log.debug("JvmThreadingImpl","Constructor with server");
-    }
-
-    /**
-     * ThreadMXBean accessor. It is acquired from the
-     * java.lang.management.ManagementFactory
-     * @return The local ThreadMXBean.
-     */
-    static ThreadMXBean getThreadMXBean() {
-        return ManagementFactory.getThreadMXBean();
-    }
-
-    /**
-     * Getter for the "JvmThreadCpuTimeMonitoring" variable.
-     */
-    public EnumJvmThreadCpuTimeMonitoring getJvmThreadCpuTimeMonitoring()
-        throws SnmpStatusException {
-
-        ThreadMXBean mbean = getThreadMXBean();
-
-        if(!mbean.isThreadCpuTimeSupported()) {
-            log.debug("getJvmThreadCpuTimeMonitoring",
-                      "Unsupported ThreadCpuTimeMonitoring");
-            return JvmThreadCpuTimeMonitoringUnsupported;
-        }
-
-        try {
-            if(mbean.isThreadCpuTimeEnabled()) {
-                log.debug("getJvmThreadCpuTimeMonitoring",
-                      "Enabled ThreadCpuTimeMonitoring");
-                return JvmThreadCpuTimeMonitoringEnabled;
-            } else {
-                log.debug("getJvmThreadCpuTimeMonitoring",
-                          "Disabled ThreadCpuTimeMonitoring");
-                return JvmThreadCpuTimeMonitoringDisabled;
-            }
-        }catch(UnsupportedOperationException e) {
-            log.debug("getJvmThreadCpuTimeMonitoring",
-                      "Newly unsupported ThreadCpuTimeMonitoring");
-
-            return JvmThreadCpuTimeMonitoringUnsupported;
-        }
-    }
-
-    /**
-     * Setter for the "JvmThreadCpuTimeMonitoring" variable.
-     */
-    public void setJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring x)
-        throws SnmpStatusException {
-
-        ThreadMXBean mbean = getThreadMXBean();
-
-        // We can trust the received value, it has been checked in
-        // checkJvmThreadCpuTimeMonitoring
-        if(JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue())
-            mbean.setThreadCpuTimeEnabled(true);
-        else
-            mbean.setThreadCpuTimeEnabled(false);
-    }
-
-    /**
-     * Checker for the "JvmThreadCpuTimeMonitoring" variable.
-     */
-    public void checkJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring
-                                                x)
-        throws SnmpStatusException {
-
-        //Can't be set externaly to unsupported state.
-        if(JvmThreadCpuTimeMonitoringUnsupported.intValue() == x.intValue()) {
-             log.debug("checkJvmThreadCpuTimeMonitoring",
-                      "Try to set to illegal unsupported value");
-            throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
-        }
-
-        if ((JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue()) ||
-            (JvmThreadCpuTimeMonitoringDisabled.intValue() == x.intValue())) {
-
-            // The value is a valid value. But is the feature supported?
-            ThreadMXBean mbean = getThreadMXBean();
-            if(mbean.isThreadCpuTimeSupported()) return;
-
-            // Not supported.
-            log.debug("checkJvmThreadCpuTimeMonitoring",
-                      "Unsupported operation, can't set state");
-            throw new
-                SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
-        }
-
-        // Unknown value.
-        log.debug("checkJvmThreadCpuTimeMonitoring",
-                  "unknown enum value ");
-        throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
-    }
-
-    /**
-     * Getter for the "JvmThreadContentionMonitoring" variable.
-     */
-    public EnumJvmThreadContentionMonitoring getJvmThreadContentionMonitoring()
-        throws SnmpStatusException {
-
-        ThreadMXBean mbean = getThreadMXBean();
-
-        if(!mbean.isThreadContentionMonitoringSupported()) {
-            log.debug("getJvmThreadContentionMonitoring",
-                      "Unsupported ThreadContentionMonitoring");
-            return JvmThreadContentionMonitoringUnsupported;
-        }
-
-        if(mbean.isThreadContentionMonitoringEnabled()) {
-            log.debug("getJvmThreadContentionMonitoring",
-                      "Enabled ThreadContentionMonitoring");
-            return JvmThreadContentionMonitoringEnabled;
-        } else {
-            log.debug("getJvmThreadContentionMonitoring",
-                      "Disabled ThreadContentionMonitoring");
-            return JvmThreadContentionMonitoringDisabled;
-        }
-    }
-
-    /**
-     * Setter for the "JvmThreadContentionMonitoring" variable.
-     */
-    public void setJvmThreadContentionMonitoring(
-                            EnumJvmThreadContentionMonitoring x)
-        throws SnmpStatusException {
-        ThreadMXBean mbean = getThreadMXBean();
-
-        // We can trust the received value, it has been checked in
-        // checkJvmThreadContentionMonitoring
-        if(JvmThreadContentionMonitoringEnabled.intValue() == x.intValue())
-            mbean.setThreadContentionMonitoringEnabled(true);
-        else
-            mbean.setThreadContentionMonitoringEnabled(false);
-    }
-
-    /**
-     * Checker for the "JvmThreadContentionMonitoring" variable.
-     */
-    public void checkJvmThreadContentionMonitoring(
-                              EnumJvmThreadContentionMonitoring x)
-        throws SnmpStatusException {
-        //Can't be set externaly to unsupported state.
-        if(JvmThreadContentionMonitoringUnsupported.intValue()==x.intValue()) {
-            log.debug("checkJvmThreadContentionMonitoring",
-                      "Try to set to illegal unsupported value");
-            throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
-        }
-
-        if ((JvmThreadContentionMonitoringEnabled.intValue()==x.intValue()) ||
-            (JvmThreadContentionMonitoringDisabled.intValue()==x.intValue())) {
-
-            // The value is valid, but is the feature supported ?
-            ThreadMXBean mbean = getThreadMXBean();
-            if(mbean.isThreadContentionMonitoringSupported()) return;
-
-            log.debug("checkJvmThreadContentionMonitoring",
-                      "Unsupported operation, can't set state");
-            throw new
-                SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
-        }
-
-        log.debug("checkJvmThreadContentionMonitoring",
-                  "Try to set to unknown value");
-        throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
-    }
-
-    /**
-     * Getter for the "JvmThreadTotalStartedCount" variable.
-     */
-    public Long getJvmThreadTotalStartedCount() throws SnmpStatusException {
-        return getThreadMXBean().getTotalStartedThreadCount();
-    }
-
-    /**
-     * Getter for the "JvmThreadPeakCount" variable.
-     */
-    public Long getJvmThreadPeakCount() throws SnmpStatusException {
-        return (long)getThreadMXBean().getPeakThreadCount();
-    }
-
-    /**
-     * Getter for the "JvmThreadDaemonCount" variable.
-     */
-    public Long getJvmThreadDaemonCount() throws SnmpStatusException {
-        return (long)getThreadMXBean().getDaemonThreadCount();
-    }
-
-    /**
-     * Getter for the "JvmThreadCount" variable.
-     */
-    public Long getJvmThreadCount() throws SnmpStatusException {
-        return (long)getThreadMXBean().getThreadCount();
-    }
-
-   /**
-     * Getter for the "JvmThreadPeakCountReset" variable.
-     */
-    public synchronized Long getJvmThreadPeakCountReset()
-        throws SnmpStatusException {
-        return jvmThreadPeakCountReset;
-    }
-
-    /**
-     * Setter for the "JvmThreadPeakCountReset" variable.
-     */
-    public synchronized void setJvmThreadPeakCountReset(Long x)
-        throws SnmpStatusException {
-        final long l = x.longValue();
-        if (l > jvmThreadPeakCountReset) {
-            final long stamp = System.currentTimeMillis();
-            getThreadMXBean().resetPeakThreadCount();
-            jvmThreadPeakCountReset = stamp;
-            log.debug("setJvmThreadPeakCountReset",
-                      "jvmThreadPeakCountReset="+stamp);
-        }
-    }
-
-    /**
-     * Checker for the "JvmThreadPeakCountReset" variable.
-     */
-    public void checkJvmThreadPeakCountReset(Long x)
-        throws SnmpStatusException {
-    }
-
-    /* Last time thread peak count was reset */
-    private long jvmThreadPeakCountReset=0;
-
-    static final MibLogger log = new MibLogger(JvmThreadingImpl.class);
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmThreadingMetaImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibGroup;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-
-import sun.management.snmp.jvmmib.JvmThreadingMeta;
-import sun.management.snmp.jvmmib.JvmThreadInstanceTableMeta;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmThreading"
- * group.
- */
-public class JvmThreadingMetaImpl extends JvmThreadingMeta {
-
-    static final long serialVersionUID = -2104788458393251457L;
-
-    /**
-     * Constructor for the metadata associated to "JvmThreading".
-     */
-    public JvmThreadingMetaImpl(SnmpMib myMib,
-                                SnmpStandardObjectServer objserv) {
-        super(myMib, objserv);
-    }
-
-    /**
-     * Factory method for "JvmThreadInstanceTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmThreadInstanceTable")
-     * @param groupName Name of the group to which this table belong
-     *        ("JvmThreading")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmThreadInstanceTable" table (JvmThreadInstanceTableMeta)
-     *
-     **/
-    protected JvmThreadInstanceTableMeta
-        createJvmThreadInstanceTableMetaNode(String tableName,
-                                             String groupName,
-                                             SnmpMib mib,
-                                             MBeanServer server)  {
-        return new JvmThreadInstanceTableMetaImpl(mib, objectserver);
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/NotificationTarget.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-import java.net.InetAddress;
-
-/**
- * Target notification.
- */
-public interface NotificationTarget {
-    public InetAddress getAddress();
-    public int getPort();
-    public String getCommunity();
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/NotificationTargetImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.jvminstr;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-/**
- * Notification Target data.
- */
-public class NotificationTargetImpl implements NotificationTarget {
-    private InetAddress address;
-    private int port;
-    private String community;
-
-    /**
-     * Target parameter is a <CODE>java.lang.String</CODE>
-     * target synctax is <host>:<port>:community. Eg: "localhost:163:private".
-     * <p>The <code><em>host</em></code> is a host name, an IPv4 numeric
-     * host address, or an IPv6 numeric address enclosed in square
-     * brackets.</p>
-     * @throws IllegalArgumentException In case the target is malformed
-     */
-    public NotificationTargetImpl(String target)
-        throws IllegalArgumentException, UnknownHostException  {
-        parseTarget(target);
-    }
-
-    public NotificationTargetImpl(String address, int port,
-                                  String community)
-        throws UnknownHostException {
-        this(InetAddress.getByName(address),port,community);
-    }
-
-    public NotificationTargetImpl(InetAddress address, int port,
-                                  String community) {
-        this.address = address;
-        this.port = port;
-        this.community = community;
-    }
-
-    private void parseTarget(String target)
-        throws IllegalArgumentException, UnknownHostException {
-
-        if(target == null ||
-           target.length() == 0) throw new
-               IllegalArgumentException("Invalid target [" + target + "]");
-
-        String addrStr;
-        if (target.startsWith("[")) {
-            final int index = target.indexOf(']');
-            final int index2 = target.lastIndexOf(':');
-            if(index == -1)
-                throw new IllegalArgumentException("Host starts with [ but " +
-                                                   "does not end with ]");
-            addrStr = target.substring(1, index);
-            port = Integer.parseInt(target.substring(index + 2,
-                                                     index2));
-            if (!isNumericIPv6Address(addrStr)) {
-            throw new IllegalArgumentException("Address inside [...] must " +
-                                               "be numeric IPv6 address");
-            }
-            if (addrStr.startsWith("["))
-                throw new IllegalArgumentException("More than one [[...]]");
-        } else {
-            final int index = target.indexOf(':');
-            final int index2 = target.lastIndexOf(':');
-            if(index == -1) throw new
-                IllegalArgumentException("Missing port separator \":\"");
-            addrStr = target.substring(0, index);
-
-            port = Integer.parseInt(target.substring(index + 1,
-                                                     index2));
-        }
-
-        address = InetAddress.getByName(addrStr);
-
-        //THE CHECK SHOULD BE STRONGER!!!
-        final int index = target.lastIndexOf(':');
-
-        community = target.substring(index + 1, target.length());
-
-    }
-
-    /* True if this string, assumed to be a valid argument to
-     * InetAddress.getByName, is a numeric IPv6 address.
-     */
-    private static boolean isNumericIPv6Address(String s) {
-        // address contains colon iff it's a numeric IPv6 address
-        return (s.indexOf(':') >= 0);
-    }
-
-    public String getCommunity() {
-        return community;
-    }
-
-    public InetAddress getAddress() {
-        return address;
-    }
-
-    public int getPort() {
-        return port;
-    }
-
-    public String toString() {
-        return "address : " + address + " port : " + port +
-            " community : " + community;
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/README	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,244 +0,0 @@
-#==============================================================================
-#          JVM Management MIB - Instrumentation Classes
-#==============================================================================
-
-In this directory:
-------------------
-
-README:              this file
-commands.env:        a file containing some ksh variables & functions
-                     that I have used to generate & compile all the 
-                     stuff. Probably only valid in my own environment.
-logging.properties:  logging.properties file that can be used to obtain
-                     trace information.
-*.java:              utility and custom classes for the JVM Management MIB.
-                     These classes show how to provide instrumentation for
-                     a mibgen generated MIB, how to simulate virtual tables,
-		     and how to make use of the SnmpUserDataFactory.
-		     Only the jvmMemory group and its tables are instrumented.
-
-Dependency
-----------
-
-    jvmManagementMib.txt : the JVM Management MIB module in compilable form.
-    Tiger SNMP Runtime   : SNMP Runtime classes for Tiger. We assume these
-                           classes could be part of the JMX delivery
-                           (classes in com.sun.jmx.snmp.*)
-    JDMK 5.1 : The jdmktk.jar contains the com.sun.jdmk.tools.MibGen class
-               used to compile the MIB. JDMK also has a mibgen.sh script
-               to start mibgen. By default mibgen generates code that can
-               integrate with JDMK SNMP runtime. In order to generate
-               code that integrate with Tiger SNMP runtime, you need to
-	       start mibgen with a non-default resource file. 
-               JDMK 5.1 workspace contains a mibgen resource file
-               specific for tiger: mibgen.property.tiger 
-    Custom Instrumentation Code: the files in this directory.
-
-How to proceed:
----------------
-
-Get mibgen from JDMK 5.1. Start mibgen with mibgen resource file for
-tiger (add -Dcom.sun.jdmk.tools.mibgen.config.file=<mibgen.properties.tiger>)
-on the Java command line.
-
-Use mibgen to generate code for the jvmManagementMib.txt file. Note that
-the custom classes provided in this directory are all in the 
-sun.management.snmp.jvminstr package, and expect the generated classes to
-be in another sun.management.snmp.jvmmib package (use mibgen option 
--tp sun.management.snmp.jvmmib)
-
-If this package name does not suit you, simply change it to something else,
-both in the custom classes below (you might use 'sed' or do it manually) 
-and in the -tp option that you will pass to mibgen.
-
-It is recommended to generate all classes in a different directory (if
-you read command.env you will see that I have put the custom classes
-in a "custom" directory, and the generated classes in a "parsed" 
-directory. This makes it easier to cleanup the mib. You can safely
-do a rm -rf <parsed> and call mibgen again.
-
-Then compile the generated classes - you will need JMX and Tiger SNMP
-runtime classes in your classpath - if you compile with a tiger build that
-already have them then you don't need to specify anything special.
-
-Then make your classpath point to the compiled generated classes, and
-compile the custom code in this directory.
-
-Then you can use the SnmpDaemonTest class to start a JVM with the
-intsrumented MIB, and you can use e.g. the easymanager contrib of
-JDMK to view the MIB through SNMP. 
-
-#==============================================================================
-#  Classes Details
-#==============================================================================
-
-Utility Classes developped for the JVM Management MIB:
-------------------------------------------------------
-JvmContextFactory.java        : The context factory allocates a Map that
-                                serves as request contextual cache.
-                                Values obtained from JSR 163 API can be
-                                cached in this object.
-                                A request contextual cache is allocated
-                                each time a request is being processed,
-                                and is released at the end of processing.
-				Object: 1) preserve atomicity
-                                        2) minimize API calls
-					3) ensure consistency of the
-					   various pieces of data returned.
-
-MibLogger.java                : Send traces to java.util.logging
-
-SnmpTableHandler.java         : an interface used to access table data.
-
-SnmpCachedData.java           : This object can be use to cache a snapshot
-                                of the data contained in a table. 
-
-SnmpTableCache.java           : A weak cache for table data. The data is
-                                computed on demand and cached in a 
-                                weakreference. Makes it possible to specify
-                                a validity period for the cache data.
-
-SnmpListTableCache.java       : Extends SnmpTableCache - for tables whose
-                                data is returned in a List object.
-
-SnmpNamedListTableCache.java  : Extends SnmpListTableCache - for tables whose
-                                elements can be named by a unique string.
-
-SnmpDaemonTest.java           : A dummy standalone SNMP agent that registers
-                                the JVM Managemnt MIB in Tiger's SNMP
-                                adaptor.  This is the "main". Note that
-                                this not the class that will be used to
-			        start the adaptor in the final Tiger - it is
-                                just a dummy test main.
-
-JVM Management MIB
-------------------
-
-JVM_MANAGEMENT_MIB_IMPL.java  : subclasses the generated JVM_MANAGEMENT_MIB
-                                class. 
-				Object: overriding factory method in order
-                                        to instantiate custom code instead
-				        of generated code.
-
-
-JVM Memory Group
-----------------
-
-JvmMemoryImpl.java            : Provides instrumentation for the jvmMemory
-                                group. Replaces the generated JvmMemory class,
-                                which is not used and can be thrown away.
-                                Implements the generated JvmMemoryMBean 
-                                interface (which was also implemented by
-                                the generated JvmMemory skeleton class)
-                                Use  the request contextual cache
-				in order to ensure consistency when
-				returning MemoryUsage datas. Note that all
-                                tables in this group have been implemented
-                                as virtual tables. As a consequence, the
-                                generated TableJvmMemXXXXXTable.java classes
-                                are not needed.
-
-JvmMemoryMetaImpl.java        : Custom MetaData class for the jvmMemory group.
-			        Subclasses the generated JvmMemoryMeta class.
-                                Object: overrides the factory methods in order
-                                        to instantiate custom meta data classes
-                                        for the jvmMemManagerTable,
-						jvmMemGCTable,
-						jvmMemPoolTable,
-						jvmMemMgrPoolRelTable.
-
-JVM Memory Manager Table
-------------------------
-
-JvmMemManagerTableMetaImpl.java : Custom MetaData class for the 
-                                  jvmMemManagerTable. This MetaData traps
-				  all the SNMP Runtime calls made to the 
-                                  table - in order to make the Memory Manager
-				  table virtual: i.e. the table does not have
-				  to be maintained permanently in memory.
-				  Instead, the table is computed "on demand",
-                                  and the data is cached in a weak cache
-                                  (see SnmpNamedListTableCache) which remains
-				  valid for a few ms. If the data is found
-				  to be obsolete, or was garbage collected,
-				  the table is recomputed.
-
-JvmMemManagerEntryImpl.java     : Custom Entry class for jvmMemManagerTable.
-				  Entries are created on the fly when it
-				  becomes necessary to get data from a 
-				  Memory Managers. They are temporary objects
-				  that wrap the MemoryManager just for the
-			          call duration - and are released just after. 
-
-JVM Memory GC Table
--------------------
-
-JvmMemGCTableMetaImpl.java     : Custom MetaData class for the 
-                                 jvmMemGCTable. This MetaData traps
-				 all the SNMP Runtime calls made to the 
-                                 table - in order to make the GC
-				 table virtual: the GC table reuses the
-			         cached data computed for the 
-                                 jvmMemManagerTable - simply acting as a 
-                                 filter that only shows those elements that
-                                 are instance of GarbageCollectorMetrics. 
-                                 In other words it implements a fitered view
-                                 of the jvmMemManagerTable.
-
-JvmMemGCEntryImpl.java         : Provide access to the data specific to
-				 GarbageCollectorMetrics objects. Objects
-				 of this classes are created on the fly,
-				 when data needs to be returned from a 
-				 GarbageCollectorMetrics object, and are
-                                 released just after. They are not kept in
-				 memory.
-
-JVM Memory Pool Table
----------------------
-
-JvmMemPoolTableMetaImpl.java   : Custom MetaData class for the jvmMemPoolTable.
-			         This is quite similar to what was done for
-                                 the jvmMemManagerTable in 
-                                 JvmMemManagerTableMetaImpl. Most of the code
-                                 here was obtain by cut&paste-ing from
-                                 JvmMemManagerTableMetaImpl and replacing
-                                 "Manager" with "Pool".
-
-JvmMemPoolEntryImpl.java       : Provide access to the data specific to
-				 MemoryPoolMetrics objects. Objects
-				 of this classes are created on the fly,
-				 when data needs to be returned from a 
-				 MemoryPoolMetrics object, and are
-                                 released just after. They are not kept in
-				 memory. Use  the request contextual cache
-				 in order to ensure consistency when
-				 returning MemoryUsage datas. 
-
-JVM Memory Manager / Memory Pool Relation  Table
-------------------------------------------------
-
-
-JvmMemMgrPoolRelTableMetaImpl.java : Custom MetaData class for the 
-                                 jvmMemMgrPoolRelTable. This meta data
-			         uses the JvmMemManagerTableMetaImpl and
-                                 JvmMemPoolTableMetaImpl in order to 
-                                 find out the content of the 
-			         jvmMemManagerTable and the mapping between 
-				 Memory Pool Name and Memory Pool Index.
-				 For each element of the jvmMemManagerTable
-                                 it calls the JSR 163 APIs to find the
-				 related Memory Pool, then finds out their
-				 index, and then creates the corresponding
-				 row in the jvmMemMgrPoolRelTable cached data.
-				 Like all the other tables, this table is
-				 virtual: the data is kept on a weak cache
-				 and recomputed on demand, if its validity
-				 as expired or if it has been gc'ed.
-
-JvmMemMgrPoolRelEntryImpl.java : A simple couple MemoryManager/MemoryPool.
-                                 Models a row in the jvmMemMgrPoolRelTable.
-				 Objects of this type are cached in the
-				 jvmMemMgrPoolRelTable cached data.
-
-#==============================================================================
-#==============================================================================
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/package.html	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-  <head>
-<!--
- 
- Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
-
--->
-  </head>
-
-  <body>
-    Instrumented Classes for JSR 163 MIB. These are the classes that
-    tie the SNMP Runtime with the JSR 163 Management API.
-    <p><b>This API is a Sun Microsystems internal API  and is subject 
-          to change without notice.</b></p>
-  </body>
-</html>
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmClassesVerboseLevel.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Hashtable;
-
-// RI imports
-//
-import com.sun.jmx.snmp.Enumerated;
-
-/**
- * The class is used for representing "JvmClassesVerboseLevel".
- */
-public class EnumJvmClassesVerboseLevel extends Enumerated implements Serializable {
-
-    static final long serialVersionUID = -620710366914810374L;
-    protected static Hashtable<Integer, String> intTable =
-            new Hashtable<>();
-    protected static Hashtable<String, Integer> stringTable =
-            new Hashtable<>();
-    static  {
-        intTable.put(2, "verbose");
-        intTable.put(1, "silent");
-        stringTable.put("verbose", 2);
-        stringTable.put("silent", 1);
-    }
-
-    public EnumJvmClassesVerboseLevel(int valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmClassesVerboseLevel(Integer valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmClassesVerboseLevel() throws IllegalArgumentException {
-        super();
-    }
-
-    public EnumJvmClassesVerboseLevel(String x) throws IllegalArgumentException {
-        super(x);
-    }
-
-    protected Hashtable<Integer,String> getIntTable() {
-        return intTable ;
-    }
-
-    protected Hashtable<String,Integer> getStringTable() {
-        return stringTable ;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmJITCompilerTimeMonitoring.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Hashtable;
-
-// RI imports
-//
-import com.sun.jmx.snmp.Enumerated;
-
-/**
- * The class is used for representing "JvmJITCompilerTimeMonitoring".
- */
-public class EnumJvmJITCompilerTimeMonitoring extends Enumerated implements Serializable {
-
-    static final long serialVersionUID = 3953565918146461236L;
-    protected static Hashtable<Integer, String> intTable =
-            new Hashtable<>();
-    protected static Hashtable<String, Integer> stringTable =
-            new Hashtable<>();
-    static  {
-        intTable.put(2, "supported");
-        intTable.put(1, "unsupported");
-        stringTable.put("supported", 2);
-        stringTable.put("unsupported", 1);
-    }
-
-    public EnumJvmJITCompilerTimeMonitoring(int valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmJITCompilerTimeMonitoring(Integer valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmJITCompilerTimeMonitoring() throws IllegalArgumentException {
-        super();
-    }
-
-    public EnumJvmJITCompilerTimeMonitoring(String x) throws IllegalArgumentException {
-        super(x);
-    }
-
-    protected Hashtable<Integer, String> getIntTable() {
-        return intTable ;
-    }
-
-    protected Hashtable<String, Integer> getStringTable() {
-        return stringTable ;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmMemManagerState.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Hashtable;
-
-// RI imports
-//
-import com.sun.jmx.snmp.Enumerated;
-
-/**
- * The class is used for representing "JvmMemManagerState".
- */
-public class EnumJvmMemManagerState extends Enumerated implements Serializable {
-
-    static final long serialVersionUID = 8249515157795166343L;
-
-    protected static Hashtable<Integer, String> intTable =
-            new Hashtable<>();
-    protected static Hashtable<String, Integer> stringTable =
-            new Hashtable<>();
-    static  {
-        intTable.put(2, "valid");
-        intTable.put(1, "invalid");
-        stringTable.put("valid", 2);
-        stringTable.put("invalid", 1);
-    }
-
-    public EnumJvmMemManagerState(int valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmMemManagerState(Integer valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmMemManagerState() throws IllegalArgumentException {
-        super();
-    }
-
-    public EnumJvmMemManagerState(String x) throws IllegalArgumentException {
-        super(x);
-    }
-
-    protected Hashtable<Integer, String> getIntTable() {
-        return intTable ;
-    }
-
-    protected Hashtable<String, Integer> getStringTable() {
-        return stringTable ;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmMemPoolCollectThreshdSupport.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Hashtable;
-
-// RI imports
-//
-import com.sun.jmx.snmp.Enumerated;
-
-/**
- * The class is used for representing "JvmMemPoolCollectThreshdSupport".
- */
-public class EnumJvmMemPoolCollectThreshdSupport extends Enumerated implements Serializable {
-
-    static final long serialVersionUID = 8610091819732806282L;
-    protected static Hashtable<Integer, String> intTable =
-            new Hashtable<>();
-    protected static Hashtable<String, Integer> stringTable =
-            new Hashtable<>();
-    static  {
-        intTable.put(2, "supported");
-        intTable.put(1, "unsupported");
-        stringTable.put("supported", 2);
-        stringTable.put("unsupported", 1);
-    }
-
-    public EnumJvmMemPoolCollectThreshdSupport(int valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmMemPoolCollectThreshdSupport(Integer valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmMemPoolCollectThreshdSupport() throws IllegalArgumentException {
-        super();
-    }
-
-    public EnumJvmMemPoolCollectThreshdSupport(String x) throws IllegalArgumentException {
-        super(x);
-    }
-
-    protected Hashtable<Integer, String> getIntTable() {
-        return intTable ;
-    }
-
-    protected Hashtable<String, Integer> getStringTable() {
-        return stringTable ;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmMemPoolState.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Hashtable;
-
-// RI imports
-//
-import com.sun.jmx.snmp.Enumerated;
-
-/**
- * The class is used for representing "JvmMemPoolState".
- */
-public class EnumJvmMemPoolState extends Enumerated implements Serializable {
-
-    static final long serialVersionUID = 3038175407527743027L;
-    protected static Hashtable<Integer, String> intTable =
-            new Hashtable<>();
-    protected static Hashtable<String, Integer> stringTable =
-            new Hashtable<>();
-    static  {
-        intTable.put(2, "valid");
-        intTable.put(1, "invalid");
-        stringTable.put("valid", 2);
-        stringTable.put("invalid", 1);
-    }
-
-    public EnumJvmMemPoolState(int valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmMemPoolState(Integer valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmMemPoolState() throws IllegalArgumentException {
-        super();
-    }
-
-    public EnumJvmMemPoolState(String x) throws IllegalArgumentException {
-        super(x);
-    }
-
-    protected Hashtable<Integer,String> getIntTable() {
-        return intTable ;
-    }
-
-    protected Hashtable<String,Integer> getStringTable() {
-        return stringTable ;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmMemPoolThreshdSupport.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Hashtable;
-
-// RI imports
-//
-import com.sun.jmx.snmp.Enumerated;
-
-/**
- * The class is used for representing "JvmMemPoolThreshdSupport".
- */
-public class EnumJvmMemPoolThreshdSupport extends Enumerated implements Serializable {
-
-    static final long serialVersionUID = 7014693561120661029L;
-    protected static Hashtable<Integer, String> intTable =
-            new Hashtable<>();
-    protected static Hashtable<String, Integer> stringTable =
-            new Hashtable<>();
-    static  {
-        intTable.put(2, "supported");
-        intTable.put(1, "unsupported");
-        stringTable.put("supported", 2);
-        stringTable.put("unsupported", 1);
-    }
-
-    public EnumJvmMemPoolThreshdSupport(int valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmMemPoolThreshdSupport(Integer valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmMemPoolThreshdSupport() throws IllegalArgumentException {
-        super();
-    }
-
-    public EnumJvmMemPoolThreshdSupport(String x) throws IllegalArgumentException {
-        super(x);
-    }
-
-    protected Hashtable<Integer,String> getIntTable() {
-        return intTable ;
-    }
-
-    protected Hashtable<String,Integer> getStringTable() {
-        return stringTable ;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmMemPoolType.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Hashtable;
-
-// RI imports
-//
-import com.sun.jmx.snmp.Enumerated;
-
-/**
- * The class is used for representing "JvmMemPoolType".
- */
-public class EnumJvmMemPoolType extends Enumerated implements Serializable {
-
-    static final long serialVersionUID = -7214498472962396555L;
-    protected static Hashtable<Integer, String> intTable =
-            new Hashtable<>();
-    protected static Hashtable<String, Integer> stringTable =
-            new Hashtable<>();
-    static  {
-        intTable.put(2, "heap");
-        intTable.put(1, "nonheap");
-        stringTable.put("heap", 2);
-        stringTable.put("nonheap", 1);
-    }
-
-    public EnumJvmMemPoolType(int valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmMemPoolType(Integer valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmMemPoolType() throws IllegalArgumentException {
-        super();
-    }
-
-    public EnumJvmMemPoolType(String x) throws IllegalArgumentException {
-        super(x);
-    }
-
-    protected Hashtable<Integer,String> getIntTable() {
-        return intTable ;
-    }
-
-    protected Hashtable<String,Integer> getStringTable() {
-        return stringTable ;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmMemoryGCCall.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Hashtable;
-
-// RI imports
-//
-import com.sun.jmx.snmp.Enumerated;
-
-/**
- * The class is used for representing "JvmMemoryGCCall".
- */
-public class EnumJvmMemoryGCCall extends Enumerated implements Serializable {
-
-    static final long serialVersionUID = -2869147994287351375L;
-    protected static Hashtable<Integer, String> intTable =
-            new Hashtable<>();
-    protected static Hashtable<String, Integer> stringTable =
-            new Hashtable<>();
-    static  {
-        intTable.put(2, "supported");
-        intTable.put(5, "failed");
-        intTable.put(4, "started");
-        intTable.put(1, "unsupported");
-        intTable.put(3, "start");
-        stringTable.put("supported", 2);
-        stringTable.put("failed", 5);
-        stringTable.put("started", 4);
-        stringTable.put("unsupported", 1);
-        stringTable.put("start", 3);
-    }
-
-    public EnumJvmMemoryGCCall(int valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmMemoryGCCall(Integer valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmMemoryGCCall() throws IllegalArgumentException {
-        super();
-    }
-
-    public EnumJvmMemoryGCCall(String x) throws IllegalArgumentException {
-        super(x);
-    }
-
-    protected Hashtable<Integer, String> getIntTable() {
-        return intTable ;
-    }
-
-    protected Hashtable<String, Integer> getStringTable() {
-        return stringTable ;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmMemoryGCVerboseLevel.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Hashtable;
-
-// RI imports
-//
-import com.sun.jmx.snmp.Enumerated;
-
-/**
- * The class is used for representing "JvmMemoryGCVerboseLevel".
- */
-public class EnumJvmMemoryGCVerboseLevel extends Enumerated implements Serializable {
-
-    static final long serialVersionUID = 1362427628755978190L;
-    protected static Hashtable<Integer, String> intTable =
-            new Hashtable<>();
-    protected static Hashtable<String, Integer> stringTable =
-            new Hashtable<>();
-    static  {
-        intTable.put(2, "verbose");
-        intTable.put(1, "silent");
-        stringTable.put("verbose", 2);
-        stringTable.put("silent", 1);
-    }
-
-    public EnumJvmMemoryGCVerboseLevel(int valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmMemoryGCVerboseLevel(Integer valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmMemoryGCVerboseLevel() throws IllegalArgumentException {
-        super();
-    }
-
-    public EnumJvmMemoryGCVerboseLevel(String x) throws IllegalArgumentException {
-        super(x);
-    }
-
-    protected Hashtable<Integer,String> getIntTable() {
-        return intTable ;
-    }
-
-    protected Hashtable<String,Integer> getStringTable() {
-        return stringTable ;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmRTBootClassPathSupport.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Hashtable;
-
-// RI imports
-//
-import com.sun.jmx.snmp.Enumerated;
-
-/**
- * The class is used for representing "JvmRTBootClassPathSupport".
- */
-public class EnumJvmRTBootClassPathSupport extends Enumerated implements Serializable {
-
-    static final long serialVersionUID = -5957542680437939894L;
-    protected static Hashtable<Integer, String> intTable =
-            new Hashtable<>();
-    protected static Hashtable<String, Integer> stringTable =
-            new Hashtable<>();
-    static  {
-        intTable.put(2, "supported");
-        intTable.put(1, "unsupported");
-        stringTable.put("supported", 2);
-        stringTable.put("unsupported", 1);
-    }
-
-    public EnumJvmRTBootClassPathSupport(int valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmRTBootClassPathSupport(Integer valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmRTBootClassPathSupport() throws IllegalArgumentException {
-        super();
-    }
-
-    public EnumJvmRTBootClassPathSupport(String x) throws IllegalArgumentException {
-        super(x);
-    }
-
-    protected Hashtable<Integer, String> getIntTable() {
-        return intTable ;
-    }
-
-    protected Hashtable<String, Integer> getStringTable() {
-        return stringTable ;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmThreadContentionMonitoring.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Hashtable;
-
-// RI imports
-//
-import com.sun.jmx.snmp.Enumerated;
-
-/**
- * The class is used for representing "JvmThreadContentionMonitoring".
- */
-public class EnumJvmThreadContentionMonitoring extends Enumerated implements Serializable {
-
-    static final long serialVersionUID = -6411827583604137210L;
-    protected static Hashtable<Integer, String> intTable =
-            new Hashtable<>();
-    protected static Hashtable<String, Integer> stringTable =
-            new Hashtable<>();
-    static  {
-        intTable.put(3, "enabled");
-        intTable.put(4, "disabled");
-        intTable.put(1, "unsupported");
-        stringTable.put("enabled", 3);
-        stringTable.put("disabled", 4);
-        stringTable.put("unsupported", 1);
-    }
-
-    public EnumJvmThreadContentionMonitoring(int valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmThreadContentionMonitoring(Integer valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmThreadContentionMonitoring() throws IllegalArgumentException {
-        super();
-    }
-
-    public EnumJvmThreadContentionMonitoring(String x) throws IllegalArgumentException {
-        super(x);
-    }
-
-    protected Hashtable<Integer,String> getIntTable() {
-        return intTable ;
-    }
-
-    protected Hashtable<String,Integer> getStringTable() {
-        return stringTable ;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmThreadCpuTimeMonitoring.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Hashtable;
-
-// RI imports
-//
-import com.sun.jmx.snmp.Enumerated;
-
-/**
- * The class is used for representing "JvmThreadCpuTimeMonitoring".
- */
-public class EnumJvmThreadCpuTimeMonitoring extends Enumerated implements Serializable {
-
-    static final long serialVersionUID = -532837824105215699L;
-    protected static Hashtable<Integer, String> intTable =
-            new Hashtable<>();
-    protected static Hashtable<String, Integer> stringTable =
-            new Hashtable<>();
-    static  {
-        intTable.put(3, "enabled");
-        intTable.put(4, "disabled");
-        intTable.put(1, "unsupported");
-        stringTable.put("enabled", 3);
-        stringTable.put("disabled", 4);
-        stringTable.put("unsupported", 1);
-    }
-
-    public EnumJvmThreadCpuTimeMonitoring(int valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmThreadCpuTimeMonitoring(Integer valueIndex) throws IllegalArgumentException {
-        super(valueIndex);
-    }
-
-    public EnumJvmThreadCpuTimeMonitoring() throws IllegalArgumentException {
-        super();
-    }
-
-    public EnumJvmThreadCpuTimeMonitoring(String x) throws IllegalArgumentException {
-        super(x);
-    }
-
-    protected Hashtable<Integer,String> getIntTable() {
-        return intTable ;
-    }
-
-    protected Hashtable<String,Integer> getStringTable() {
-        return stringTable ;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JVM_MANAGEMENT_MIB.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,687 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Hashtable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.management.InstanceAlreadyExistsException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibNode;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-/**
- * The class is used for representing "JVM-MANAGEMENT-MIB".
- * You can edit the file if you want to modify the behaviour of the MIB.
- */
-public abstract class JVM_MANAGEMENT_MIB extends SnmpMib implements Serializable {
-
-    static final long serialVersionUID = 6895037919735816732L;
-    /**
-     * Default constructor. Initialize the Mib tree.
-     */
-    public JVM_MANAGEMENT_MIB() {
-        mibName = "JVM_MANAGEMENT_MIB";
-    }
-
-    /**
-     * Initialization of the MIB with no registration in Java DMK.
-     */
-    public void init() throws IllegalAccessException {
-        // Allow only one initialization of the MIB.
-        //
-        if (isInitialized == true) {
-            return ;
-        }
-
-        try  {
-            populate(null, null);
-        } catch(IllegalAccessException x)  {
-            throw x;
-        } catch(RuntimeException x)  {
-            throw x;
-        } catch(Exception x)  {
-            throw new Error(x.getMessage());
-        }
-
-        isInitialized = true;
-    }
-
-    /**
-     * Initialization of the MIB with AUTOMATIC REGISTRATION in Java DMK.
-     */
-    public ObjectName preRegister(MBeanServer server, ObjectName name)
-            throws Exception {
-        // Allow only one initialization of the MIB.
-        //
-        if (isInitialized == true) {
-            throw new InstanceAlreadyExistsException();
-        }
-
-        // Initialize MBeanServer information.
-        //
-        this.server = server;
-
-        populate(server, name);
-
-        isInitialized = true;
-        return name;
-    }
-
-    /**
-     * Initialization of the MIB with no registration in Java DMK.
-     */
-    public void populate(MBeanServer server, ObjectName name)
-        throws Exception {
-        // Allow only one initialization of the MIB.
-        //
-        if (isInitialized == true) {
-            return ;
-        }
-
-        if (objectserver == null)
-            objectserver = new SnmpStandardObjectServer();
-
-        // Initialization of the "JvmOS" group.
-        // To disable support of this group, redefine the
-        // "createJvmOSMetaNode()" factory method, and make it return "null"
-        //
-        initJvmOS(server);
-
-        // Initialization of the "JvmCompilation" group.
-        // To disable support of this group, redefine the
-        // "createJvmCompilationMetaNode()" factory method, and make it return "null"
-        //
-        initJvmCompilation(server);
-
-        // Initialization of the "JvmRuntime" group.
-        // To disable support of this group, redefine the
-        // "createJvmRuntimeMetaNode()" factory method, and make it return "null"
-        //
-        initJvmRuntime(server);
-
-        // Initialization of the "JvmThreading" group.
-        // To disable support of this group, redefine the
-        // "createJvmThreadingMetaNode()" factory method, and make it return "null"
-        //
-        initJvmThreading(server);
-
-        // Initialization of the "JvmMemory" group.
-        // To disable support of this group, redefine the
-        // "createJvmMemoryMetaNode()" factory method, and make it return "null"
-        //
-        initJvmMemory(server);
-
-        // Initialization of the "JvmClassLoading" group.
-        // To disable support of this group, redefine the
-        // "createJvmClassLoadingMetaNode()" factory method, and make it return "null"
-        //
-        initJvmClassLoading(server);
-
-        isInitialized = true;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Initialization of the "JvmOS" group.
-    //
-    // ------------------------------------------------------------
-
-
-    /**
-     * Initialization of the "JvmOS" group.
-     *
-     * To disable support of this group, redefine the
-     * "createJvmOSMetaNode()" factory method, and make it return "null"
-     *
-     * @param server    MBeanServer for this group (may be null)
-     *
-     **/
-    protected void initJvmOS(MBeanServer server)
-        throws Exception {
-        final String oid = getGroupOid("JvmOS", "1.3.6.1.4.1.42.2.145.3.163.1.1.6");
-        ObjectName objname = null;
-        if (server != null) {
-            objname = getGroupObjectName("JvmOS", oid, mibName + ":name=sun.management.snmp.jvmmib.JvmOS");
-        }
-        final JvmOSMeta meta = createJvmOSMetaNode("JvmOS", oid, objname, server);
-        if (meta != null) {
-            meta.registerTableNodes( this, server );
-
-            // Note that when using standard metadata,
-            // the returned object must implement the "JvmOSMBean"
-            // interface.
-            //
-            final JvmOSMBean group = (JvmOSMBean) createJvmOSMBean("JvmOS", oid, objname, server);
-            meta.setInstance( group );
-            registerGroupNode("JvmOS", oid, objname, meta, group, server);
-        }
-    }
-
-
-    /**
-     * Factory method for "JvmOS" group metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmOS")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmOS" group (JvmOSMeta)
-     *
-     **/
-    protected JvmOSMeta createJvmOSMetaNode(String groupName,
-                String groupOid, ObjectName groupObjname, MBeanServer server)  {
-        return new JvmOSMeta(this, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmOS" group MBean.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated MBean class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmOS")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the MBean class generated for the
-     *         "JvmOS" group (JvmOS)
-     *
-     * Note that when using standard metadata,
-     * the returned object must implement the "JvmOSMBean"
-     * interface.
-     **/
-    protected abstract Object createJvmOSMBean(String groupName,
-                String groupOid,  ObjectName groupObjname, MBeanServer server);
-
-
-    // ------------------------------------------------------------
-    //
-    // Initialization of the "JvmCompilation" group.
-    //
-    // ------------------------------------------------------------
-
-
-    /**
-     * Initialization of the "JvmCompilation" group.
-     *
-     * To disable support of this group, redefine the
-     * "createJvmCompilationMetaNode()" factory method, and make it return "null"
-     *
-     * @param server    MBeanServer for this group (may be null)
-     *
-     **/
-    protected void initJvmCompilation(MBeanServer server)
-        throws Exception {
-        final String oid = getGroupOid("JvmCompilation", "1.3.6.1.4.1.42.2.145.3.163.1.1.5");
-        ObjectName objname = null;
-        if (server != null) {
-            objname = getGroupObjectName("JvmCompilation", oid, mibName + ":name=sun.management.snmp.jvmmib.JvmCompilation");
-        }
-        final JvmCompilationMeta meta = createJvmCompilationMetaNode("JvmCompilation", oid, objname, server);
-        if (meta != null) {
-            meta.registerTableNodes( this, server );
-
-            // Note that when using standard metadata,
-            // the returned object must implement the "JvmCompilationMBean"
-            // interface.
-            //
-            final JvmCompilationMBean group = (JvmCompilationMBean) createJvmCompilationMBean("JvmCompilation", oid, objname, server);
-            meta.setInstance( group );
-            registerGroupNode("JvmCompilation", oid, objname, meta, group, server);
-        }
-    }
-
-
-    /**
-     * Factory method for "JvmCompilation" group metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmCompilation")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmCompilation" group (JvmCompilationMeta)
-     *
-     **/
-    protected JvmCompilationMeta createJvmCompilationMetaNode(String groupName,
-                String groupOid, ObjectName groupObjname, MBeanServer server)  {
-        return new JvmCompilationMeta(this, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmCompilation" group MBean.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated MBean class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmCompilation")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the MBean class generated for the
-     *         "JvmCompilation" group (JvmCompilation)
-     *
-     * Note that when using standard metadata,
-     * the returned object must implement the "JvmCompilationMBean"
-     * interface.
-     **/
-    protected abstract Object createJvmCompilationMBean(String groupName,
-                String groupOid,  ObjectName groupObjname, MBeanServer server);
-
-
-    // ------------------------------------------------------------
-    //
-    // Initialization of the "JvmRuntime" group.
-    //
-    // ------------------------------------------------------------
-
-
-    /**
-     * Initialization of the "JvmRuntime" group.
-     *
-     * To disable support of this group, redefine the
-     * "createJvmRuntimeMetaNode()" factory method, and make it return "null"
-     *
-     * @param server    MBeanServer for this group (may be null)
-     *
-     **/
-    protected void initJvmRuntime(MBeanServer server)
-        throws Exception {
-        final String oid = getGroupOid("JvmRuntime", "1.3.6.1.4.1.42.2.145.3.163.1.1.4");
-        ObjectName objname = null;
-        if (server != null) {
-            objname = getGroupObjectName("JvmRuntime", oid, mibName + ":name=sun.management.snmp.jvmmib.JvmRuntime");
-        }
-        final JvmRuntimeMeta meta = createJvmRuntimeMetaNode("JvmRuntime", oid, objname, server);
-        if (meta != null) {
-            meta.registerTableNodes( this, server );
-
-            // Note that when using standard metadata,
-            // the returned object must implement the "JvmRuntimeMBean"
-            // interface.
-            //
-            final JvmRuntimeMBean group = (JvmRuntimeMBean) createJvmRuntimeMBean("JvmRuntime", oid, objname, server);
-            meta.setInstance( group );
-            registerGroupNode("JvmRuntime", oid, objname, meta, group, server);
-        }
-    }
-
-
-    /**
-     * Factory method for "JvmRuntime" group metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmRuntime")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmRuntime" group (JvmRuntimeMeta)
-     *
-     **/
-    protected JvmRuntimeMeta createJvmRuntimeMetaNode(String groupName,
-                String groupOid, ObjectName groupObjname, MBeanServer server)  {
-        return new JvmRuntimeMeta(this, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmRuntime" group MBean.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated MBean class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmRuntime")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the MBean class generated for the
-     *         "JvmRuntime" group (JvmRuntime)
-     *
-     * Note that when using standard metadata,
-     * the returned object must implement the "JvmRuntimeMBean"
-     * interface.
-     **/
-    protected abstract Object createJvmRuntimeMBean(String groupName,
-                String groupOid,  ObjectName groupObjname, MBeanServer server);
-
-
-    // ------------------------------------------------------------
-    //
-    // Initialization of the "JvmThreading" group.
-    //
-    // ------------------------------------------------------------
-
-
-    /**
-     * Initialization of the "JvmThreading" group.
-     *
-     * To disable support of this group, redefine the
-     * "createJvmThreadingMetaNode()" factory method, and make it return "null"
-     *
-     * @param server    MBeanServer for this group (may be null)
-     *
-     **/
-    protected void initJvmThreading(MBeanServer server)
-        throws Exception {
-        final String oid = getGroupOid("JvmThreading", "1.3.6.1.4.1.42.2.145.3.163.1.1.3");
-        ObjectName objname = null;
-        if (server != null) {
-            objname = getGroupObjectName("JvmThreading", oid, mibName + ":name=sun.management.snmp.jvmmib.JvmThreading");
-        }
-        final JvmThreadingMeta meta = createJvmThreadingMetaNode("JvmThreading", oid, objname, server);
-        if (meta != null) {
-            meta.registerTableNodes( this, server );
-
-            // Note that when using standard metadata,
-            // the returned object must implement the "JvmThreadingMBean"
-            // interface.
-            //
-            final JvmThreadingMBean group = (JvmThreadingMBean) createJvmThreadingMBean("JvmThreading", oid, objname, server);
-            meta.setInstance( group );
-            registerGroupNode("JvmThreading", oid, objname, meta, group, server);
-        }
-    }
-
-
-    /**
-     * Factory method for "JvmThreading" group metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmThreading")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmThreading" group (JvmThreadingMeta)
-     *
-     **/
-    protected JvmThreadingMeta createJvmThreadingMetaNode(String groupName,
-                String groupOid, ObjectName groupObjname, MBeanServer server)  {
-        return new JvmThreadingMeta(this, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmThreading" group MBean.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated MBean class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmThreading")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the MBean class generated for the
-     *         "JvmThreading" group (JvmThreading)
-     *
-     * Note that when using standard metadata,
-     * the returned object must implement the "JvmThreadingMBean"
-     * interface.
-     **/
-    protected abstract Object createJvmThreadingMBean(String groupName,
-                String groupOid,  ObjectName groupObjname, MBeanServer server);
-
-
-    // ------------------------------------------------------------
-    //
-    // Initialization of the "JvmMemory" group.
-    //
-    // ------------------------------------------------------------
-
-
-    /**
-     * Initialization of the "JvmMemory" group.
-     *
-     * To disable support of this group, redefine the
-     * "createJvmMemoryMetaNode()" factory method, and make it return "null"
-     *
-     * @param server    MBeanServer for this group (may be null)
-     *
-     **/
-    protected void initJvmMemory(MBeanServer server)
-        throws Exception {
-        final String oid = getGroupOid("JvmMemory", "1.3.6.1.4.1.42.2.145.3.163.1.1.2");
-        ObjectName objname = null;
-        if (server != null) {
-            objname = getGroupObjectName("JvmMemory", oid, mibName + ":name=sun.management.snmp.jvmmib.JvmMemory");
-        }
-        final JvmMemoryMeta meta = createJvmMemoryMetaNode("JvmMemory", oid, objname, server);
-        if (meta != null) {
-            meta.registerTableNodes( this, server );
-
-            // Note that when using standard metadata,
-            // the returned object must implement the "JvmMemoryMBean"
-            // interface.
-            //
-            final JvmMemoryMBean group = (JvmMemoryMBean) createJvmMemoryMBean("JvmMemory", oid, objname, server);
-            meta.setInstance( group );
-            registerGroupNode("JvmMemory", oid, objname, meta, group, server);
-        }
-    }
-
-
-    /**
-     * Factory method for "JvmMemory" group metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmMemory")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmMemory" group (JvmMemoryMeta)
-     *
-     **/
-    protected JvmMemoryMeta createJvmMemoryMetaNode(String groupName,
-                String groupOid, ObjectName groupObjname, MBeanServer server)  {
-        return new JvmMemoryMeta(this, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmMemory" group MBean.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated MBean class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmMemory")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the MBean class generated for the
-     *         "JvmMemory" group (JvmMemory)
-     *
-     * Note that when using standard metadata,
-     * the returned object must implement the "JvmMemoryMBean"
-     * interface.
-     **/
-    protected abstract Object createJvmMemoryMBean(String groupName,
-                String groupOid,  ObjectName groupObjname, MBeanServer server);
-
-
-    // ------------------------------------------------------------
-    //
-    // Initialization of the "JvmClassLoading" group.
-    //
-    // ------------------------------------------------------------
-
-
-    /**
-     * Initialization of the "JvmClassLoading" group.
-     *
-     * To disable support of this group, redefine the
-     * "createJvmClassLoadingMetaNode()" factory method, and make it return "null"
-     *
-     * @param server    MBeanServer for this group (may be null)
-     *
-     **/
-    protected void initJvmClassLoading(MBeanServer server)
-        throws Exception {
-        final String oid = getGroupOid("JvmClassLoading", "1.3.6.1.4.1.42.2.145.3.163.1.1.1");
-        ObjectName objname = null;
-        if (server != null) {
-            objname = getGroupObjectName("JvmClassLoading", oid, mibName + ":name=sun.management.snmp.jvmmib.JvmClassLoading");
-        }
-        final JvmClassLoadingMeta meta = createJvmClassLoadingMetaNode("JvmClassLoading", oid, objname, server);
-        if (meta != null) {
-            meta.registerTableNodes( this, server );
-
-            // Note that when using standard metadata,
-            // the returned object must implement the "JvmClassLoadingMBean"
-            // interface.
-            //
-            final JvmClassLoadingMBean group = (JvmClassLoadingMBean) createJvmClassLoadingMBean("JvmClassLoading", oid, objname, server);
-            meta.setInstance( group );
-            registerGroupNode("JvmClassLoading", oid, objname, meta, group, server);
-        }
-    }
-
-
-    /**
-     * Factory method for "JvmClassLoading" group metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmClassLoading")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmClassLoading" group (JvmClassLoadingMeta)
-     *
-     **/
-    protected JvmClassLoadingMeta createJvmClassLoadingMetaNode(String groupName,
-                String groupOid, ObjectName groupObjname, MBeanServer server)  {
-        return new JvmClassLoadingMeta(this, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmClassLoading" group MBean.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated MBean class with your own customized class.
-     *
-     * @param groupName Name of the group ("JvmClassLoading")
-     * @param groupOid  OID of this group
-     * @param groupObjname ObjectName for this group (may be null)
-     * @param server    MBeanServer for this group (may be null)
-     *
-     * @return An instance of the MBean class generated for the
-     *         "JvmClassLoading" group (JvmClassLoading)
-     *
-     * Note that when using standard metadata,
-     * the returned object must implement the "JvmClassLoadingMBean"
-     * interface.
-     **/
-    protected abstract Object createJvmClassLoadingMBean(String groupName,
-                String groupOid,  ObjectName groupObjname, MBeanServer server);
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "registerTableMeta" method defined in "SnmpMib".
-    // See the "SnmpMib" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void registerTableMeta( String name, SnmpMibTable meta) {
-        if (metadatas == null) return;
-        if (name == null) return;
-        metadatas.put(name,meta);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "getRegisteredTableMeta" method defined in "SnmpMib".
-    // See the "SnmpMib" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public SnmpMibTable getRegisteredTableMeta( String name ) {
-        if (metadatas == null) return null;
-        if (name == null) return null;
-        return metadatas.get(name);
-    }
-
-    public SnmpStandardObjectServer getStandardObjectServer() {
-        if (objectserver == null)
-            objectserver = new SnmpStandardObjectServer();
-        return objectserver;
-    }
-
-    private boolean isInitialized = false;
-
-    protected SnmpStandardObjectServer objectserver;
-
-    protected final Hashtable<String, SnmpMibTable> metadatas =
-            new Hashtable<String, SnmpMibTable>();
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JVM_MANAGEMENT_MIBOidTable.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpOidRecord;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.SnmpOidTableSupport;
-
-/**
- * The class contains metadata definitions for "JVM-MANAGEMENT-MIB".
- * Call SnmpOid.setSnmpOidTable(new JVM_MANAGEMENT_MIBOidTable()) to load the metadata in the SnmpOidTable.
- */
-public class JVM_MANAGEMENT_MIBOidTable extends SnmpOidTableSupport implements Serializable {
-
-    static final long serialVersionUID = -5010870014488732061L;
-    /**
-     * Default constructor. Initialize the Mib tree.
-     */
-    public JVM_MANAGEMENT_MIBOidTable() {
-        super("JVM_MANAGEMENT_MIB");
-        loadMib(varList);
-    }
-
-    static SnmpOidRecord varList [] = {
-        new SnmpOidRecord("jvmOSProcessorCount", "1.3.6.1.4.1.42.2.145.3.163.1.1.6.4", "I"),
-        new SnmpOidRecord("jvmOSVersion", "1.3.6.1.4.1.42.2.145.3.163.1.1.6.3", "S"),
-        new SnmpOidRecord("jvmOSArch", "1.3.6.1.4.1.42.2.145.3.163.1.1.6.2", "S"),
-        new SnmpOidRecord("jvmOSName", "1.3.6.1.4.1.42.2.145.3.163.1.1.6.1", "S"),
-        new SnmpOidRecord("jvmJITCompilerTimeMonitoring", "1.3.6.1.4.1.42.2.145.3.163.1.1.5.3", "I"),
-        new SnmpOidRecord("jvmJITCompilerTimeMs", "1.3.6.1.4.1.42.2.145.3.163.1.1.5.2", "C64"),
-        new SnmpOidRecord("jvmJITCompilerName", "1.3.6.1.4.1.42.2.145.3.163.1.1.5.1", "S"),
-        new SnmpOidRecord("jvmRTLibraryPathTable", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.23", "TA"),
-        new SnmpOidRecord("jvmRTLibraryPathEntry", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.23.1", "EN"),
-        new SnmpOidRecord("jvmRTLibraryPathItem", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.23.1.2", "S"),
-        new SnmpOidRecord("jvmRTLibraryPathIndex", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.23.1.1", "I"),
-        new SnmpOidRecord("jvmRTClassPathTable", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.22", "TA"),
-        new SnmpOidRecord("jvmRTClassPathEntry", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.22.1", "EN"),
-        new SnmpOidRecord("jvmRTClassPathItem", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.22.1.2", "S"),
-        new SnmpOidRecord("jvmRTClassPathIndex", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.22.1.1", "I"),
-        new SnmpOidRecord("jvmRTBootClassPathTable", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.21", "TA"),
-        new SnmpOidRecord("jvmRTBootClassPathEntry", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.21.1", "EN"),
-        new SnmpOidRecord("jvmRTBootClassPathItem", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.21.1.2", "S"),
-        new SnmpOidRecord("jvmRTBootClassPathIndex", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.21.1.1", "I"),
-        new SnmpOidRecord("jvmRTBootClassPathSupport", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.9", "I"),
-        new SnmpOidRecord("jvmRTInputArgsTable", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.20", "TA"),
-        new SnmpOidRecord("jvmRTInputArgsEntry", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.20.1", "EN"),
-        new SnmpOidRecord("jvmRTInputArgsItem", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.20.1.2", "S"),
-        new SnmpOidRecord("jvmRTInputArgsIndex", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.20.1.1", "I"),
-        new SnmpOidRecord("jvmRTManagementSpecVersion", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.8", "S"),
-        new SnmpOidRecord("jvmRTSpecVersion", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.7", "S"),
-        new SnmpOidRecord("jvmRTSpecVendor", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.6", "S"),
-        new SnmpOidRecord("jvmRTSpecName", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.5", "S"),
-        new SnmpOidRecord("jvmRTVMVersion", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.4", "S"),
-        new SnmpOidRecord("jvmRTVMVendor", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.3", "S"),
-        new SnmpOidRecord("jvmRTStartTimeMs", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.12", "C64"),
-        new SnmpOidRecord("jvmRTUptimeMs", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.11", "C64"),
-        new SnmpOidRecord("jvmRTVMName", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.2", "S"),
-        new SnmpOidRecord("jvmRTName", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.1", "S"),
-        new SnmpOidRecord("jvmRTInputArgsCount", "1.3.6.1.4.1.42.2.145.3.163.1.1.4.10", "I"),
-        new SnmpOidRecord("jvmThreadCpuTimeMonitoring", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.6", "I"),
-        new SnmpOidRecord("jvmThreadContentionMonitoring", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.5", "I"),
-        new SnmpOidRecord("jvmThreadTotalStartedCount", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.4", "C64"),
-        new SnmpOidRecord("jvmThreadPeakCount", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.3", "C"),
-        new SnmpOidRecord("jvmThreadDaemonCount", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.2", "G"),
-        new SnmpOidRecord("jvmThreadCount", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.1", "G"),
-        new SnmpOidRecord("jvmThreadInstanceTable", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.10", "TA"),
-        new SnmpOidRecord("jvmThreadInstanceEntry", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.10.1", "EN"),
-        new SnmpOidRecord("jvmThreadInstName", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.10.1.9", "S"),
-        new SnmpOidRecord("jvmThreadInstCpuTimeNs", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.10.1.8", "C64"),
-        new SnmpOidRecord("jvmThreadInstWaitTimeMs", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.10.1.7", "C64"),
-        new SnmpOidRecord("jvmThreadInstWaitCount", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.10.1.6", "C64"),
-        new SnmpOidRecord("jvmThreadInstBlockTimeMs", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.10.1.5", "C64"),
-        new SnmpOidRecord("jvmThreadInstBlockCount", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.10.1.4", "C64"),
-        new SnmpOidRecord("jvmThreadInstState", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.10.1.3", "S"),
-        new SnmpOidRecord("jvmThreadInstLockOwnerPtr", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.10.1.11", "OI"),
-        new SnmpOidRecord("jvmThreadInstId", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.10.1.2", "C64"),
-        new SnmpOidRecord("jvmThreadInstLockName", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.10.1.10", "S"),
-        new SnmpOidRecord("jvmThreadInstIndex", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.10.1.1", "S"),
-        new SnmpOidRecord("jvmThreadPeakCountReset", "1.3.6.1.4.1.42.2.145.3.163.1.1.3.7", "C64"),
-        new SnmpOidRecord("jvmMemMgrPoolRelTable", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.120", "TA"),
-        new SnmpOidRecord("jvmMemMgrPoolRelEntry", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.120.1", "EN"),
-        new SnmpOidRecord("jvmMemMgrRelPoolName", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.120.1.3", "S"),
-        new SnmpOidRecord("jvmMemMgrRelManagerName", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.120.1.2", "S"),
-        new SnmpOidRecord("jvmMemoryNonHeapMaxSize", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.23", "C64"),
-        new SnmpOidRecord("jvmMemoryNonHeapCommitted", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.22", "C64"),
-        new SnmpOidRecord("jvmMemoryNonHeapUsed", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.21", "C64"),
-        new SnmpOidRecord("jvmMemPoolTable", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110", "TA"),
-        new SnmpOidRecord("jvmMemPoolEntry", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1", "EN"),
-        new SnmpOidRecord("jvmMemPoolCollectMaxSize", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.33", "C64"),
-        new SnmpOidRecord("jvmMemPoolCollectCommitted", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.32", "C64"),
-        new SnmpOidRecord("jvmMemPoolCollectUsed", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.31", "C64"),
-        new SnmpOidRecord("jvmMemPoolCollectThreshdSupport", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.133", "I"),
-        new SnmpOidRecord("jvmMemPoolCollectThreshdCount", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.132", "C64"),
-        new SnmpOidRecord("jvmMemPoolCollectThreshold", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.131", "C64"),
-        new SnmpOidRecord("jvmMemPoolMaxSize", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.13", "C64"),
-        new SnmpOidRecord("jvmMemPoolCommitted", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.12", "C64"),
-        new SnmpOidRecord("jvmMemPoolUsed", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11", "C64"),
-        new SnmpOidRecord("jvmMemPoolInitSize", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.10", "C64"),
-        new SnmpOidRecord("jvmMemPoolThreshdSupport", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.112", "I"),
-        new SnmpOidRecord("jvmMemPoolThreshdCount", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.111", "C64"),
-        new SnmpOidRecord("jvmMemPoolThreshold", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.110", "C64"),
-        new SnmpOidRecord("jvmMemPoolPeakReset", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.5", "C64"),
-        new SnmpOidRecord("jvmMemPoolState", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.4", "I"),
-        new SnmpOidRecord("jvmMemPoolType", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.3", "I"),
-        new SnmpOidRecord("jvmMemPoolName", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.2", "S"),
-        new SnmpOidRecord("jvmMemPoolPeakMaxSize", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.23", "C64"),
-        new SnmpOidRecord("jvmMemPoolIndex", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.1", "I"),
-        new SnmpOidRecord("jvmMemPoolPeakCommitted", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.22", "C64"),
-        new SnmpOidRecord("jvmMemPoolPeakUsed", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.21", "C64"),
-        new SnmpOidRecord("jvmMemoryNonHeapInitSize", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.20", "C64"),
-        new SnmpOidRecord("jvmMemoryHeapMaxSize", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.13", "C64"),
-        new SnmpOidRecord("jvmMemoryHeapCommitted", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.12", "C64"),
-        new SnmpOidRecord("jvmMemoryGCCall", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.3", "I"),
-        new SnmpOidRecord("jvmMemoryHeapUsed", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.11", "C64"),
-        new SnmpOidRecord("jvmMemoryGCVerboseLevel", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.2", "I"),
-        new SnmpOidRecord("jvmMemGCTable", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.101", "TA"),
-        new SnmpOidRecord("jvmMemGCEntry", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.101.1", "EN"),
-        new SnmpOidRecord("jvmMemGCTimeMs", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.101.1.3", "C64"),
-        new SnmpOidRecord("jvmMemGCCount", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.101.1.2", "C64"),
-        new SnmpOidRecord("jvmMemoryHeapInitSize", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.10", "C64"),
-        new SnmpOidRecord("jvmMemoryPendingFinalCount", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.1", "G"),
-        new SnmpOidRecord("jvmMemManagerTable", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.100", "TA"),
-        new SnmpOidRecord("jvmMemManagerEntry", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.100.1", "EN"),
-        new SnmpOidRecord("jvmMemManagerState", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.100.1.3", "I"),
-        new SnmpOidRecord("jvmMemManagerName", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.100.1.2", "S"),
-        new SnmpOidRecord("jvmMemManagerIndex", "1.3.6.1.4.1.42.2.145.3.163.1.1.2.100.1.1", "I"),
-        new SnmpOidRecord("jvmClassesVerboseLevel", "1.3.6.1.4.1.42.2.145.3.163.1.1.1.4", "I"),
-        new SnmpOidRecord("jvmClassesUnloadedCount", "1.3.6.1.4.1.42.2.145.3.163.1.1.1.3", "C64"),
-        new SnmpOidRecord("jvmClassesTotalLoadedCount", "1.3.6.1.4.1.42.2.145.3.163.1.1.1.2", "C64"),
-        new SnmpOidRecord("jvmClassesLoadedCount", "1.3.6.1.4.1.42.2.145.3.163.1.1.1.1", "G"),
-        new SnmpOidRecord("jvmLowMemoryPoolUsageNotif", "1.3.6.1.4.1.42.2.145.3.163.1.2.2.1.0.1", "NT"),
-        new SnmpOidRecord("jvmLowMemoryPoolCollectNotif", "1.3.6.1.4.1.42.2.145.3.163.1.2.2.1.0.2", "NT")    };
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmClassLoadingMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is used for representing the remote management interface for the "JvmClassLoading" MBean.
- */
-public interface JvmClassLoadingMBean {
-
-    /**
-     * Getter for the "JvmClassesVerboseLevel" variable.
-     */
-    public EnumJvmClassesVerboseLevel getJvmClassesVerboseLevel() throws SnmpStatusException;
-
-    /**
-     * Setter for the "JvmClassesVerboseLevel" variable.
-     */
-    public void setJvmClassesVerboseLevel(EnumJvmClassesVerboseLevel x) throws SnmpStatusException;
-
-    /**
-     * Checker for the "JvmClassesVerboseLevel" variable.
-     */
-    public void checkJvmClassesVerboseLevel(EnumJvmClassesVerboseLevel x) throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmClassesUnloadedCount" variable.
-     */
-    public Long getJvmClassesUnloadedCount() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmClassesTotalLoadedCount" variable.
-     */
-    public Long getJvmClassesTotalLoadedCount() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmClassesLoadedCount" variable.
-     */
-    public Long getJvmClassesLoadedCount() throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmClassLoadingMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,329 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibGroup;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmClassLoading" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.1.
- */
-public class JvmClassLoadingMeta extends SnmpMibGroup
-     implements Serializable, SnmpStandardMetaServer {
-
-    static final long serialVersionUID = 5722857476941218568L;
-    /**
-     * Constructor for the metadata associated to "JvmClassLoading".
-     */
-    public JvmClassLoadingMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        objectserver = objserv;
-        try {
-            registerObject(4);
-            registerObject(3);
-            registerObject(2);
-            registerObject(1);
-        } catch (IllegalAccessException e) {
-            throw new RuntimeException(e.getMessage());
-        }
-    }
-
-    /**
-     * Get the value of a scalar variable
-     */
-    public SnmpValue get(long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 4:
-                return new SnmpInt(node.getJvmClassesVerboseLevel());
-
-            case 3:
-                return new SnmpCounter64(node.getJvmClassesUnloadedCount());
-
-            case 2:
-                return new SnmpCounter64(node.getJvmClassesTotalLoadedCount());
-
-            case 1:
-                return new SnmpGauge(node.getJvmClassesLoadedCount());
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Set the value of a scalar variable
-     */
-    public SnmpValue set(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 4:
-                if (x instanceof SnmpInt) {
-                    try  {
-                        node.setJvmClassesVerboseLevel( new EnumJvmClassesVerboseLevel (((SnmpInt)x).toInteger()));
-                    } catch(IllegalArgumentException e)  {
-                        throw new SnmpStatusException(SnmpStatusException.snmpRspWrongValue);
-                    }
-                    return new SnmpInt(node.getJvmClassesVerboseLevel());
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-    }
-
-    /**
-     * Check the value of a scalar variable
-     */
-    public void check(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int) var) {
-            case 4:
-                if (x instanceof SnmpInt) {
-                    try  {
-                        node.checkJvmClassesVerboseLevel( new EnumJvmClassesVerboseLevel (((SnmpInt)x).toInteger()));
-                    } catch(IllegalArgumentException e)  {
-                        throw new SnmpStatusException(SnmpStatusException.snmpRspWrongValue);
-                    }
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-                break;
-
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-        }
-    }
-
-    /**
-     * Allow to bind the metadata description to a specific object.
-     */
-    protected void setInstance(JvmClassLoadingMBean var) {
-        node = var;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.get(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.set(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.check(this,req,depth);
-    }
-
-    /**
-     * Returns true if "arc" identifies a scalar object.
-     */
-    public boolean isVariable(long arc) {
-
-        switch((int)arc) {
-            case 4:
-            case 3:
-            case 2:
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if "arc" identifies a readable scalar object.
-     */
-    public boolean isReadable(long arc) {
-
-        switch((int)arc) {
-            case 4:
-            case 3:
-            case 2:
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipVariable" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean  skipVariable(long var, Object data, int pduVersion) {
-        switch((int)var) {
-            case 3:
-            case 2:
-                if (pduVersion==SnmpDefinitions.snmpVersionOne) return true;
-                break;
-            default:
-                break;
-        }
-        return super.skipVariable(var,data,pduVersion);
-    }
-
-    /**
-     * Return the name of the attribute corresponding to the SNMP variable identified by "id".
-     */
-    public String getAttributeName(long id)
-        throws SnmpStatusException {
-        switch((int)id) {
-            case 4:
-                return "JvmClassesVerboseLevel";
-
-            case 3:
-                return "JvmClassesUnloadedCount";
-
-            case 2:
-                return "JvmClassesTotalLoadedCount";
-
-            case 1:
-                return "JvmClassesLoadedCount";
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Returns true if "arc" identifies a table object.
-     */
-    public boolean isTable(long arc) {
-
-        switch((int)arc) {
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns the table object identified by "arc".
-     */
-    public SnmpMibTable getTable(long arc) {
-        return null;
-    }
-
-    /**
-     * Register the group's SnmpMibTable objects with the meta-data.
-     */
-    public void registerTableNodes(SnmpMib mib, MBeanServer server) {
-    }
-
-    protected JvmClassLoadingMBean node;
-    protected SnmpStandardObjectServer objectserver = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmCompilationMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is used for representing the remote management interface for the "JvmCompilation" MBean.
- */
-public interface JvmCompilationMBean {
-
-    /**
-     * Getter for the "JvmJITCompilerTimeMonitoring" variable.
-     */
-    public EnumJvmJITCompilerTimeMonitoring getJvmJITCompilerTimeMonitoring() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmJITCompilerTimeMs" variable.
-     */
-    public Long getJvmJITCompilerTimeMs() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmJITCompilerName" variable.
-     */
-    public String getJvmJITCompilerName() throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmCompilationMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,295 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibGroup;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmCompilation" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.5.
- */
-public class JvmCompilationMeta extends SnmpMibGroup
-     implements Serializable, SnmpStandardMetaServer {
-
-    static final long serialVersionUID = -95492874115033638L;
-    /**
-     * Constructor for the metadata associated to "JvmCompilation".
-     */
-    public JvmCompilationMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        objectserver = objserv;
-        try {
-            registerObject(3);
-            registerObject(2);
-            registerObject(1);
-        } catch (IllegalAccessException e) {
-            throw new RuntimeException(e.getMessage());
-        }
-    }
-
-    /**
-     * Get the value of a scalar variable
-     */
-    public SnmpValue get(long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 3:
-                return new SnmpInt(node.getJvmJITCompilerTimeMonitoring());
-
-            case 2:
-                return new SnmpCounter64(node.getJvmJITCompilerTimeMs());
-
-            case 1:
-                return new SnmpString(node.getJvmJITCompilerName());
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Set the value of a scalar variable
-     */
-    public SnmpValue set(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-    }
-
-    /**
-     * Check the value of a scalar variable
-     */
-    public void check(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int) var) {
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-        }
-    }
-
-    /**
-     * Allow to bind the metadata description to a specific object.
-     */
-    protected void setInstance(JvmCompilationMBean var) {
-        node = var;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.get(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.set(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.check(this,req,depth);
-    }
-
-    /**
-     * Returns true if "arc" identifies a scalar object.
-     */
-    public boolean isVariable(long arc) {
-
-        switch((int)arc) {
-            case 3:
-            case 2:
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if "arc" identifies a readable scalar object.
-     */
-    public boolean isReadable(long arc) {
-
-        switch((int)arc) {
-            case 3:
-            case 2:
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipVariable" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean  skipVariable(long var, Object data, int pduVersion) {
-        switch((int)var) {
-            case 2:
-                if (pduVersion==SnmpDefinitions.snmpVersionOne) return true;
-                break;
-            default:
-                break;
-        }
-        return super.skipVariable(var,data,pduVersion);
-    }
-
-    /**
-     * Return the name of the attribute corresponding to the SNMP variable identified by "id".
-     */
-    public String getAttributeName(long id)
-        throws SnmpStatusException {
-        switch((int)id) {
-            case 3:
-                return "JvmJITCompilerTimeMonitoring";
-
-            case 2:
-                return "JvmJITCompilerTimeMs";
-
-            case 1:
-                return "JvmJITCompilerName";
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Returns true if "arc" identifies a table object.
-     */
-    public boolean isTable(long arc) {
-
-        switch((int)arc) {
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns the table object identified by "arc".
-     */
-    public SnmpMibTable getTable(long arc) {
-        return null;
-    }
-
-    /**
-     * Register the group's SnmpMibTable objects with the meta-data.
-     */
-    public void registerTableNodes(SnmpMib mib, MBeanServer server) {
-    }
-
-    protected JvmCompilationMBean node;
-    protected SnmpStandardObjectServer objectserver = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemGCEntryMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is used for representing the remote management interface for the "JvmMemGCEntry" MBean.
- */
-public interface JvmMemGCEntryMBean {
-
-    /**
-     * Getter for the "JvmMemGCTimeMs" variable.
-     */
-    public Long getJvmMemGCTimeMs() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemGCCount" variable.
-     */
-    public Long getJvmMemGCCount() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemManagerIndex" variable.
-     */
-    public Integer getJvmMemManagerIndex() throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemGCEntryMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,255 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMibNode;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibEntry;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmMemGCEntry" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.2.101.1.
- */
-public class JvmMemGCEntryMeta extends SnmpMibEntry
-     implements Serializable, SnmpStandardMetaServer {
-
-     static final long serialVersionUID = 6082082529298387063L;
-    /**
-     * Constructor for the metadata associated to "JvmMemGCEntry".
-     */
-    public JvmMemGCEntryMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        objectserver = objserv;
-        varList = new int[2];
-        varList[0] = 3;
-        varList[1] = 2;
-        SnmpMibNode.sort(varList);
-    }
-
-    /**
-     * Get the value of a scalar variable
-     */
-    public SnmpValue get(long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 3:
-                return new SnmpCounter64(node.getJvmMemGCTimeMs());
-
-            case 2:
-                return new SnmpCounter64(node.getJvmMemGCCount());
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Set the value of a scalar variable
-     */
-    public SnmpValue set(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-    }
-
-    /**
-     * Check the value of a scalar variable
-     */
-    public void check(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int) var) {
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-        }
-    }
-
-    /**
-     * Allow to bind the metadata description to a specific object.
-     */
-    protected void setInstance(JvmMemGCEntryMBean var) {
-        node = var;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.get(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.set(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.check(this,req,depth);
-    }
-
-    /**
-     * Returns true if "arc" identifies a scalar object.
-     */
-    public boolean isVariable(long arc) {
-
-        switch((int)arc) {
-            case 3:
-            case 2:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if "arc" identifies a readable scalar object.
-     */
-    public boolean isReadable(long arc) {
-
-        switch((int)arc) {
-            case 3:
-            case 2:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipVariable" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean  skipVariable(long var, Object data, int pduVersion) {
-        switch((int)var) {
-            case 3:
-            case 2:
-                if (pduVersion==SnmpDefinitions.snmpVersionOne) return true;
-                break;
-            default:
-                break;
-        }
-        return super.skipVariable(var,data,pduVersion);
-    }
-
-    /**
-     * Return the name of the attribute corresponding to the SNMP variable identified by "id".
-     */
-    public String getAttributeName(long id)
-        throws SnmpStatusException {
-        switch((int)id) {
-            case 3:
-                return "JvmMemGCTimeMs";
-
-            case 2:
-                return "JvmMemGCCount";
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    protected JvmMemGCEntryMBean node;
-    protected SnmpStandardObjectServer objectserver = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemGCTableMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Vector;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpIndex;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-/**
- * The class is used for implementing the "JvmMemGCTable" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.2.101.
- */
-public class JvmMemGCTableMeta extends SnmpMibTable implements Serializable {
-
-    static final long serialVersionUID = -8843296871149264612L;
-    /**
-     * Constructor for the table. Initialize metadata for "JvmMemGCTableMeta".
-     * The reference on the MBean server is updated so the entries created through an SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmMemGCTableMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        super(myMib);
-        objectserver = objserv;
-    }
-
-
-    /**
-     * Factory method for "JvmMemGCEntry" entry metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param snmpEntryName Name of the SNMP Entry object (conceptual row) ("JvmMemGCEntry")
-     * @param tableName Name of the table in which the entries are registered ("JvmMemGCTable")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmMemGCEntry" conceptual row (JvmMemGCEntryMeta)
-     *
-     **/
-    protected JvmMemGCEntryMeta createJvmMemGCEntryMetaNode(String snmpEntryName, String tableName, SnmpMib mib, MBeanServer server)  {
-        return new JvmMemGCEntryMeta(mib, objectserver);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "createNewEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void createNewEntry(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (factory != null)
-            factory.createNewEntry(req, rowOid, depth, this);
-        else
-            throw new SnmpStatusException(
-                SnmpStatusException.snmpRspNoAccess);
-    }
-
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "isRegistrationRequired" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean isRegistrationRequired()  {
-        return false;
-    }
-
-
-
-    public void registerEntryNode(SnmpMib mib, MBeanServer server)  {
-        node = createJvmMemGCEntryMetaNode("JvmMemGCEntry", "JvmMemGCTable", mib, server);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "addEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public synchronized void addEntry(SnmpOid rowOid, ObjectName objname,
-                 Object entry)
-        throws SnmpStatusException {
-        if (! (entry instanceof JvmMemGCEntryMBean) )
-            throw new ClassCastException("Entries for Table \"" +
-                           "JvmMemGCTable" + "\" must implement the \"" +
-                           "JvmMemGCEntryMBean" + "\" interface.");
-        super.addEntry(rowOid, objname, entry);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        JvmMemGCEntryMBean entry = (JvmMemGCEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.get(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmMemGCEntryMBean entry = (JvmMemGCEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.set(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmMemGCEntryMBean entry = (JvmMemGCEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.check(req,depth);
-        }
-    }
-
-    /**
-     * check that the given "var" identifies a columnar object.
-     */
-    public void validateVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        node.validateVarId(var, data);
-    }
-
-    /**
-     * Returns true if "var" identifies a readable scalar object.
-     */
-    public boolean isReadableEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        return node.isReadable(var);
-    }
-
-    /**
-     * Returns the arc of the next columnar object following "var".
-     */
-    public long getNextVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        long nextvar = node.getNextVarId(var, data);
-        while (!isReadableEntryId(rowOid, nextvar, data))
-            nextvar = node.getNextVarId(nextvar, data);
-        return nextvar;
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipEntryVariable" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean skipEntryVariable( SnmpOid rowOid, long var, Object data, int pduVersion) {
-        try {
-            JvmMemGCEntryMBean entry = (JvmMemGCEntryMBean) getEntry(rowOid);
-            synchronized (this) {
-                node.setInstance(entry);
-                return node.skipVariable(var, data, pduVersion);
-            }
-        } catch (SnmpStatusException x) {
-            return false;
-        }
-    }
-
-
-    /**
-     * Reference to the entry metadata.
-     */
-    private JvmMemGCEntryMeta node;
-
-    /**
-     * Reference to the object server.
-     */
-    protected SnmpStandardObjectServer objectserver;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemManagerEntryMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is used for representing the remote management interface for the "JvmMemManagerEntry" MBean.
- */
-public interface JvmMemManagerEntryMBean {
-
-    /**
-     * Getter for the "JvmMemManagerState" variable.
-     */
-    public EnumJvmMemManagerState getJvmMemManagerState() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemManagerName" variable.
-     */
-    public String getJvmMemManagerName() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemManagerIndex" variable.
-     */
-    public Integer getJvmMemManagerIndex() throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemManagerEntryMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMibNode;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibEntry;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmMemManagerEntry" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.2.100.1.
- */
-public class JvmMemManagerEntryMeta extends SnmpMibEntry
-     implements Serializable, SnmpStandardMetaServer {
-
-    static final long serialVersionUID = 8166956416408970453L;
-    /**
-     * Constructor for the metadata associated to "JvmMemManagerEntry".
-     */
-    public JvmMemManagerEntryMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        objectserver = objserv;
-        varList = new int[2];
-        varList[0] = 3;
-        varList[1] = 2;
-        SnmpMibNode.sort(varList);
-    }
-
-    /**
-     * Get the value of a scalar variable
-     */
-    public SnmpValue get(long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 3:
-                return new SnmpInt(node.getJvmMemManagerState());
-
-            case 2:
-                return new SnmpString(node.getJvmMemManagerName());
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Set the value of a scalar variable
-     */
-    public SnmpValue set(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-    }
-
-    /**
-     * Check the value of a scalar variable
-     */
-    public void check(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int) var) {
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-        }
-    }
-
-    /**
-     * Allow to bind the metadata description to a specific object.
-     */
-    protected void setInstance(JvmMemManagerEntryMBean var) {
-        node = var;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.get(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.set(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.check(this,req,depth);
-    }
-
-    /**
-     * Returns true if "arc" identifies a scalar object.
-     */
-    public boolean isVariable(long arc) {
-
-        switch((int)arc) {
-            case 3:
-            case 2:
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if "arc" identifies a readable scalar object.
-     */
-    public boolean isReadable(long arc) {
-
-        switch((int)arc) {
-            case 3:
-            case 2:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipVariable" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean  skipVariable(long var, Object data, int pduVersion) {
-        switch((int)var) {
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return super.skipVariable(var,data,pduVersion);
-    }
-
-    /**
-     * Return the name of the attribute corresponding to the SNMP variable identified by "id".
-     */
-    public String getAttributeName(long id)
-        throws SnmpStatusException {
-        switch((int)id) {
-            case 3:
-                return "JvmMemManagerState";
-
-            case 2:
-                return "JvmMemManagerName";
-
-            case 1:
-                return "JvmMemManagerIndex";
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    protected JvmMemManagerEntryMBean node;
-    protected SnmpStandardObjectServer objectserver = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemManagerTableMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Vector;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpIndex;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-/**
- * The class is used for implementing the "JvmMemManagerTable" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.2.100.
- */
-public class JvmMemManagerTableMeta extends SnmpMibTable implements Serializable {
-
-    static final long serialVersionUID = 5026520607518015233L;
-    /**
-     * Constructor for the table. Initialize metadata for "JvmMemManagerTableMeta".
-     * The reference on the MBean server is updated so the entries created through an SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmMemManagerTableMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        super(myMib);
-        objectserver = objserv;
-    }
-
-
-    /**
-     * Factory method for "JvmMemManagerEntry" entry metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param snmpEntryName Name of the SNMP Entry object (conceptual row) ("JvmMemManagerEntry")
-     * @param tableName Name of the table in which the entries are registered ("JvmMemManagerTable")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmMemManagerEntry" conceptual row (JvmMemManagerEntryMeta)
-     *
-     **/
-    protected JvmMemManagerEntryMeta createJvmMemManagerEntryMetaNode(String snmpEntryName, String tableName, SnmpMib mib, MBeanServer server)  {
-        return new JvmMemManagerEntryMeta(mib, objectserver);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "createNewEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void createNewEntry(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (factory != null)
-            factory.createNewEntry(req, rowOid, depth, this);
-        else
-            throw new SnmpStatusException(
-                SnmpStatusException.snmpRspNoAccess);
-    }
-
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "isRegistrationRequired" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean isRegistrationRequired()  {
-        return false;
-    }
-
-
-
-    public void registerEntryNode(SnmpMib mib, MBeanServer server)  {
-        node = createJvmMemManagerEntryMetaNode("JvmMemManagerEntry", "JvmMemManagerTable", mib, server);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "addEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public synchronized void addEntry(SnmpOid rowOid, ObjectName objname,
-                 Object entry)
-        throws SnmpStatusException {
-        if (! (entry instanceof JvmMemManagerEntryMBean) )
-            throw new ClassCastException("Entries for Table \"" +
-                           "JvmMemManagerTable" + "\" must implement the \"" +
-                           "JvmMemManagerEntryMBean" + "\" interface.");
-        super.addEntry(rowOid, objname, entry);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        JvmMemManagerEntryMBean entry = (JvmMemManagerEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.get(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmMemManagerEntryMBean entry = (JvmMemManagerEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.set(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmMemManagerEntryMBean entry = (JvmMemManagerEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.check(req,depth);
-        }
-    }
-
-    /**
-     * check that the given "var" identifies a columnar object.
-     */
-    public void validateVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        node.validateVarId(var, data);
-    }
-
-    /**
-     * Returns true if "var" identifies a readable scalar object.
-     */
-    public boolean isReadableEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        return node.isReadable(var);
-    }
-
-    /**
-     * Returns the arc of the next columnar object following "var".
-     */
-    public long getNextVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        long nextvar = node.getNextVarId(var, data);
-        while (!isReadableEntryId(rowOid, nextvar, data))
-            nextvar = node.getNextVarId(nextvar, data);
-        return nextvar;
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipEntryVariable" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean skipEntryVariable( SnmpOid rowOid, long var, Object data, int pduVersion) {
-        try {
-            JvmMemManagerEntryMBean entry = (JvmMemManagerEntryMBean) getEntry(rowOid);
-            synchronized (this) {
-                node.setInstance(entry);
-                return node.skipVariable(var, data, pduVersion);
-            }
-        } catch (SnmpStatusException x) {
-            return false;
-        }
-    }
-
-
-    /**
-     * Reference to the entry metadata.
-     */
-    private JvmMemManagerEntryMeta node;
-
-    /**
-     * Reference to the object server.
-     */
-    protected SnmpStandardObjectServer objectserver;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemMgrPoolRelEntryMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is used for representing the remote management interface for the "JvmMemMgrPoolRelEntry" MBean.
- */
-public interface JvmMemMgrPoolRelEntryMBean {
-
-    /**
-     * Getter for the "JvmMemMgrRelPoolName" variable.
-     */
-    public String getJvmMemMgrRelPoolName() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemMgrRelManagerName" variable.
-     */
-    public String getJvmMemMgrRelManagerName() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemManagerIndex" variable.
-     */
-    public Integer getJvmMemManagerIndex() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolIndex" variable.
-     */
-    public Integer getJvmMemPoolIndex() throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemMgrPoolRelEntryMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,247 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMibNode;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibEntry;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmMemMgrPoolRelEntry" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.2.120.1.
- */
-public class JvmMemMgrPoolRelEntryMeta extends SnmpMibEntry
-     implements Serializable, SnmpStandardMetaServer {
-
-    static final long serialVersionUID = 7414270971113459798L;
-    /**
-     * Constructor for the metadata associated to "JvmMemMgrPoolRelEntry".
-     */
-    public JvmMemMgrPoolRelEntryMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        objectserver = objserv;
-        varList = new int[2];
-        varList[0] = 3;
-        varList[1] = 2;
-        SnmpMibNode.sort(varList);
-    }
-
-    /**
-     * Get the value of a scalar variable
-     */
-    public SnmpValue get(long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 3:
-                return new SnmpString(node.getJvmMemMgrRelPoolName());
-
-            case 2:
-                return new SnmpString(node.getJvmMemMgrRelManagerName());
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Set the value of a scalar variable
-     */
-    public SnmpValue set(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-    }
-
-    /**
-     * Check the value of a scalar variable
-     */
-    public void check(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int) var) {
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-        }
-    }
-
-    /**
-     * Allow to bind the metadata description to a specific object.
-     */
-    protected void setInstance(JvmMemMgrPoolRelEntryMBean var) {
-        node = var;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.get(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.set(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.check(this,req,depth);
-    }
-
-    /**
-     * Returns true if "arc" identifies a scalar object.
-     */
-    public boolean isVariable(long arc) {
-
-        switch((int)arc) {
-            case 3:
-            case 2:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if "arc" identifies a readable scalar object.
-     */
-    public boolean isReadable(long arc) {
-
-        switch((int)arc) {
-            case 3:
-            case 2:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipVariable" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean  skipVariable(long var, Object data, int pduVersion) {
-        return super.skipVariable(var,data,pduVersion);
-    }
-
-    /**
-     * Return the name of the attribute corresponding to the SNMP variable identified by "id".
-     */
-    public String getAttributeName(long id)
-        throws SnmpStatusException {
-        switch((int)id) {
-            case 3:
-                return "JvmMemMgrRelPoolName";
-
-            case 2:
-                return "JvmMemMgrRelManagerName";
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    protected JvmMemMgrPoolRelEntryMBean node;
-    protected SnmpStandardObjectServer objectserver = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemMgrPoolRelTableMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Vector;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpIndex;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-/**
- * The class is used for implementing the "JvmMemMgrPoolRelTable" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.2.120.
- */
-public class JvmMemMgrPoolRelTableMeta extends SnmpMibTable implements Serializable {
-
-    static final long serialVersionUID = -310733366542788998L;
-    /**
-     * Constructor for the table. Initialize metadata for "JvmMemMgrPoolRelTableMeta".
-     * The reference on the MBean server is updated so the entries created through an SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmMemMgrPoolRelTableMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        super(myMib);
-        objectserver = objserv;
-    }
-
-
-    /**
-     * Factory method for "JvmMemMgrPoolRelEntry" entry metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param snmpEntryName Name of the SNMP Entry object (conceptual row) ("JvmMemMgrPoolRelEntry")
-     * @param tableName Name of the table in which the entries are registered ("JvmMemMgrPoolRelTable")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmMemMgrPoolRelEntry" conceptual row (JvmMemMgrPoolRelEntryMeta)
-     *
-     **/
-    protected JvmMemMgrPoolRelEntryMeta createJvmMemMgrPoolRelEntryMetaNode(String snmpEntryName, String tableName, SnmpMib mib, MBeanServer server)  {
-        return new JvmMemMgrPoolRelEntryMeta(mib, objectserver);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "createNewEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void createNewEntry(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (factory != null)
-            factory.createNewEntry(req, rowOid, depth, this);
-        else
-            throw new SnmpStatusException(
-                SnmpStatusException.snmpRspNoAccess);
-    }
-
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "isRegistrationRequired" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean isRegistrationRequired()  {
-        return false;
-    }
-
-
-
-    public void registerEntryNode(SnmpMib mib, MBeanServer server)  {
-        node = createJvmMemMgrPoolRelEntryMetaNode("JvmMemMgrPoolRelEntry", "JvmMemMgrPoolRelTable", mib, server);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "addEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public synchronized void addEntry(SnmpOid rowOid, ObjectName objname,
-                 Object entry)
-        throws SnmpStatusException {
-        if (! (entry instanceof JvmMemMgrPoolRelEntryMBean) )
-            throw new ClassCastException("Entries for Table \"" +
-                           "JvmMemMgrPoolRelTable" + "\" must implement the \"" +
-                           "JvmMemMgrPoolRelEntryMBean" + "\" interface.");
-        super.addEntry(rowOid, objname, entry);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        JvmMemMgrPoolRelEntryMBean entry = (JvmMemMgrPoolRelEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.get(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmMemMgrPoolRelEntryMBean entry = (JvmMemMgrPoolRelEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.set(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmMemMgrPoolRelEntryMBean entry = (JvmMemMgrPoolRelEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.check(req,depth);
-        }
-    }
-
-    /**
-     * check that the given "var" identifies a columnar object.
-     */
-    public void validateVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        node.validateVarId(var, data);
-    }
-
-    /**
-     * Returns true if "var" identifies a readable scalar object.
-     */
-    public boolean isReadableEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        return node.isReadable(var);
-    }
-
-    /**
-     * Returns the arc of the next columnar object following "var".
-     */
-    public long getNextVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        long nextvar = node.getNextVarId(var, data);
-        while (!isReadableEntryId(rowOid, nextvar, data))
-            nextvar = node.getNextVarId(nextvar, data);
-        return nextvar;
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipEntryVariable" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean skipEntryVariable( SnmpOid rowOid, long var, Object data, int pduVersion) {
-        try {
-            JvmMemMgrPoolRelEntryMBean entry = (JvmMemMgrPoolRelEntryMBean) getEntry(rowOid);
-            synchronized (this) {
-                node.setInstance(entry);
-                return node.skipVariable(var, data, pduVersion);
-            }
-        } catch (SnmpStatusException x) {
-            return false;
-        }
-    }
-
-
-    /**
-     * Reference to the entry metadata.
-     */
-    private JvmMemMgrPoolRelEntryMeta node;
-
-    /**
-     * Reference to the object server.
-     */
-    protected SnmpStandardObjectServer objectserver;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemPoolEntryMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is used for representing the remote management interface for the "JvmMemPoolEntry" MBean.
- */
-public interface JvmMemPoolEntryMBean {
-
-    /**
-     * Getter for the "JvmMemPoolCollectMaxSize" variable.
-     */
-    public Long getJvmMemPoolCollectMaxSize() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolCollectCommitted" variable.
-     */
-    public Long getJvmMemPoolCollectCommitted() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolCollectUsed" variable.
-     */
-    public Long getJvmMemPoolCollectUsed() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolCollectThreshdSupport" variable.
-     */
-    public EnumJvmMemPoolCollectThreshdSupport getJvmMemPoolCollectThreshdSupport() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolCollectThreshdCount" variable.
-     */
-    public Long getJvmMemPoolCollectThreshdCount() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolCollectThreshold" variable.
-     */
-    public Long getJvmMemPoolCollectThreshold() throws SnmpStatusException;
-
-    /**
-     * Setter for the "JvmMemPoolCollectThreshold" variable.
-     */
-    public void setJvmMemPoolCollectThreshold(Long x) throws SnmpStatusException;
-
-    /**
-     * Checker for the "JvmMemPoolCollectThreshold" variable.
-     */
-    public void checkJvmMemPoolCollectThreshold(Long x) throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolMaxSize" variable.
-     */
-    public Long getJvmMemPoolMaxSize() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolCommitted" variable.
-     */
-    public Long getJvmMemPoolCommitted() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolUsed" variable.
-     */
-    public Long getJvmMemPoolUsed() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolInitSize" variable.
-     */
-    public Long getJvmMemPoolInitSize() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolThreshdSupport" variable.
-     */
-    public EnumJvmMemPoolThreshdSupport getJvmMemPoolThreshdSupport() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolThreshdCount" variable.
-     */
-    public Long getJvmMemPoolThreshdCount() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolThreshold" variable.
-     */
-    public Long getJvmMemPoolThreshold() throws SnmpStatusException;
-
-    /**
-     * Setter for the "JvmMemPoolThreshold" variable.
-     */
-    public void setJvmMemPoolThreshold(Long x) throws SnmpStatusException;
-
-    /**
-     * Checker for the "JvmMemPoolThreshold" variable.
-     */
-    public void checkJvmMemPoolThreshold(Long x) throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolPeakReset" variable.
-     */
-    public Long getJvmMemPoolPeakReset() throws SnmpStatusException;
-
-    /**
-     * Setter for the "JvmMemPoolPeakReset" variable.
-     */
-    public void setJvmMemPoolPeakReset(Long x) throws SnmpStatusException;
-
-    /**
-     * Checker for the "JvmMemPoolPeakReset" variable.
-     */
-    public void checkJvmMemPoolPeakReset(Long x) throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolState" variable.
-     */
-    public EnumJvmMemPoolState getJvmMemPoolState() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolType" variable.
-     */
-    public EnumJvmMemPoolType getJvmMemPoolType() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolName" variable.
-     */
-    public String getJvmMemPoolName() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolPeakMaxSize" variable.
-     */
-    public Long getJvmMemPoolPeakMaxSize() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolIndex" variable.
-     */
-    public Integer getJvmMemPoolIndex() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolPeakCommitted" variable.
-     */
-    public Long getJvmMemPoolPeakCommitted() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemPoolPeakUsed" variable.
-     */
-    public Long getJvmMemPoolPeakUsed() throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemPoolEntryMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,584 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMibNode;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibEntry;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmMemPoolEntry" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.
- */
-public class JvmMemPoolEntryMeta extends SnmpMibEntry
-     implements Serializable, SnmpStandardMetaServer {
-
-    static final long serialVersionUID = 7220682779249102830L;
-    /**
-     * Constructor for the metadata associated to "JvmMemPoolEntry".
-     */
-    public JvmMemPoolEntryMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        objectserver = objserv;
-        varList = new int[20];
-        varList[0] = 33;
-        varList[1] = 32;
-        varList[2] = 31;
-        varList[3] = 133;
-        varList[4] = 132;
-        varList[5] = 131;
-        varList[6] = 13;
-        varList[7] = 12;
-        varList[8] = 11;
-        varList[9] = 10;
-        varList[10] = 112;
-        varList[11] = 111;
-        varList[12] = 110;
-        varList[13] = 5;
-        varList[14] = 4;
-        varList[15] = 3;
-        varList[16] = 2;
-        varList[17] = 23;
-        varList[18] = 22;
-        varList[19] = 21;
-        SnmpMibNode.sort(varList);
-    }
-
-    /**
-     * Get the value of a scalar variable
-     */
-    public SnmpValue get(long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 33:
-                return new SnmpCounter64(node.getJvmMemPoolCollectMaxSize());
-
-            case 32:
-                return new SnmpCounter64(node.getJvmMemPoolCollectCommitted());
-
-            case 31:
-                return new SnmpCounter64(node.getJvmMemPoolCollectUsed());
-
-            case 133:
-                return new SnmpInt(node.getJvmMemPoolCollectThreshdSupport());
-
-            case 132:
-                return new SnmpCounter64(node.getJvmMemPoolCollectThreshdCount());
-
-            case 131:
-                return new SnmpCounter64(node.getJvmMemPoolCollectThreshold());
-
-            case 13:
-                return new SnmpCounter64(node.getJvmMemPoolMaxSize());
-
-            case 12:
-                return new SnmpCounter64(node.getJvmMemPoolCommitted());
-
-            case 11:
-                return new SnmpCounter64(node.getJvmMemPoolUsed());
-
-            case 10:
-                return new SnmpCounter64(node.getJvmMemPoolInitSize());
-
-            case 112:
-                return new SnmpInt(node.getJvmMemPoolThreshdSupport());
-
-            case 111:
-                return new SnmpCounter64(node.getJvmMemPoolThreshdCount());
-
-            case 110:
-                return new SnmpCounter64(node.getJvmMemPoolThreshold());
-
-            case 5:
-                return new SnmpCounter64(node.getJvmMemPoolPeakReset());
-
-            case 4:
-                return new SnmpInt(node.getJvmMemPoolState());
-
-            case 3:
-                return new SnmpInt(node.getJvmMemPoolType());
-
-            case 2:
-                return new SnmpString(node.getJvmMemPoolName());
-
-            case 23:
-                return new SnmpCounter64(node.getJvmMemPoolPeakMaxSize());
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-            case 22:
-                return new SnmpCounter64(node.getJvmMemPoolPeakCommitted());
-
-            case 21:
-                return new SnmpCounter64(node.getJvmMemPoolPeakUsed());
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Set the value of a scalar variable
-     */
-    public SnmpValue set(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 33:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 32:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 31:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 133:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 132:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 131:
-                if (x instanceof SnmpCounter64) {
-                    node.setJvmMemPoolCollectThreshold(((SnmpCounter64)x).toLong());
-                    return new SnmpCounter64(node.getJvmMemPoolCollectThreshold());
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-
-            case 13:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 12:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 11:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 10:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 112:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 111:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 110:
-                if (x instanceof SnmpCounter64) {
-                    node.setJvmMemPoolThreshold(((SnmpCounter64)x).toLong());
-                    return new SnmpCounter64(node.getJvmMemPoolThreshold());
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-
-            case 5:
-                if (x instanceof SnmpCounter64) {
-                    node.setJvmMemPoolPeakReset(((SnmpCounter64)x).toLong());
-                    return new SnmpCounter64(node.getJvmMemPoolPeakReset());
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-
-            case 4:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 23:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 22:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 21:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-    }
-
-    /**
-     * Check the value of a scalar variable
-     */
-    public void check(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int) var) {
-            case 33:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 32:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 31:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 133:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 132:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 131:
-                if (x instanceof SnmpCounter64) {
-                    node.checkJvmMemPoolCollectThreshold(((SnmpCounter64)x).toLong());
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-                break;
-
-            case 13:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 12:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 11:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 10:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 112:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 111:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 110:
-                if (x instanceof SnmpCounter64) {
-                    node.checkJvmMemPoolThreshold(((SnmpCounter64)x).toLong());
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-                break;
-
-            case 5:
-                if (x instanceof SnmpCounter64) {
-                    node.checkJvmMemPoolPeakReset(((SnmpCounter64)x).toLong());
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-                break;
-
-            case 4:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 23:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 22:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 21:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-        }
-    }
-
-    /**
-     * Allow to bind the metadata description to a specific object.
-     */
-    protected void setInstance(JvmMemPoolEntryMBean var) {
-        node = var;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.get(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.set(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.check(this,req,depth);
-    }
-
-    /**
-     * Returns true if "arc" identifies a scalar object.
-     */
-    public boolean isVariable(long arc) {
-
-        switch((int)arc) {
-            case 33:
-            case 32:
-            case 31:
-            case 133:
-            case 132:
-            case 131:
-            case 13:
-            case 12:
-            case 11:
-            case 10:
-            case 112:
-            case 111:
-            case 110:
-            case 5:
-            case 4:
-            case 3:
-            case 2:
-            case 23:
-            case 1:
-            case 22:
-            case 21:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if "arc" identifies a readable scalar object.
-     */
-    public boolean isReadable(long arc) {
-
-        switch((int)arc) {
-            case 33:
-            case 32:
-            case 31:
-            case 133:
-            case 132:
-            case 131:
-            case 13:
-            case 12:
-            case 11:
-            case 10:
-            case 112:
-            case 111:
-            case 110:
-            case 5:
-            case 4:
-            case 3:
-            case 2:
-            case 23:
-            case 22:
-            case 21:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipVariable" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean  skipVariable(long var, Object data, int pduVersion) {
-        switch((int)var) {
-            case 33:
-            case 32:
-            case 31:
-            case 132:
-            case 131:
-            case 13:
-            case 12:
-            case 11:
-            case 10:
-            case 111:
-            case 110:
-            case 5:
-            case 23:
-                if (pduVersion==SnmpDefinitions.snmpVersionOne) return true;
-                break;
-            case 1:
-                return true;
-            case 22:
-            case 21:
-                if (pduVersion==SnmpDefinitions.snmpVersionOne) return true;
-                break;
-            default:
-                break;
-        }
-        return super.skipVariable(var,data,pduVersion);
-    }
-
-    /**
-     * Return the name of the attribute corresponding to the SNMP variable identified by "id".
-     */
-    public String getAttributeName(long id)
-        throws SnmpStatusException {
-        switch((int)id) {
-            case 33:
-                return "JvmMemPoolCollectMaxSize";
-
-            case 32:
-                return "JvmMemPoolCollectCommitted";
-
-            case 31:
-                return "JvmMemPoolCollectUsed";
-
-            case 133:
-                return "JvmMemPoolCollectThreshdSupport";
-
-            case 132:
-                return "JvmMemPoolCollectThreshdCount";
-
-            case 131:
-                return "JvmMemPoolCollectThreshold";
-
-            case 13:
-                return "JvmMemPoolMaxSize";
-
-            case 12:
-                return "JvmMemPoolCommitted";
-
-            case 11:
-                return "JvmMemPoolUsed";
-
-            case 10:
-                return "JvmMemPoolInitSize";
-
-            case 112:
-                return "JvmMemPoolThreshdSupport";
-
-            case 111:
-                return "JvmMemPoolThreshdCount";
-
-            case 110:
-                return "JvmMemPoolThreshold";
-
-            case 5:
-                return "JvmMemPoolPeakReset";
-
-            case 4:
-                return "JvmMemPoolState";
-
-            case 3:
-                return "JvmMemPoolType";
-
-            case 2:
-                return "JvmMemPoolName";
-
-            case 23:
-                return "JvmMemPoolPeakMaxSize";
-
-            case 1:
-                return "JvmMemPoolIndex";
-
-            case 22:
-                return "JvmMemPoolPeakCommitted";
-
-            case 21:
-                return "JvmMemPoolPeakUsed";
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    protected JvmMemPoolEntryMBean node;
-    protected SnmpStandardObjectServer objectserver = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemPoolTableMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,266 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Vector;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpIndex;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-/**
- * The class is used for implementing the "JvmMemPoolTable" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.
- */
-public class JvmMemPoolTableMeta extends SnmpMibTable implements Serializable {
-
-    static final long serialVersionUID = -2799470815264898659L;
-
-    /**
-     * Constructor for the table. Initialize metadata for "JvmMemPoolTableMeta".
-     * The reference on the MBean server is updated so the entries created through an SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmMemPoolTableMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        super(myMib);
-        objectserver = objserv;
-    }
-
-
-    /**
-     * Factory method for "JvmMemPoolEntry" entry metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param snmpEntryName Name of the SNMP Entry object (conceptual row) ("JvmMemPoolEntry")
-     * @param tableName Name of the table in which the entries are registered ("JvmMemPoolTable")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmMemPoolEntry" conceptual row (JvmMemPoolEntryMeta)
-     *
-     **/
-    protected JvmMemPoolEntryMeta createJvmMemPoolEntryMetaNode(String snmpEntryName, String tableName, SnmpMib mib, MBeanServer server)  {
-        return new JvmMemPoolEntryMeta(mib, objectserver);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "createNewEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void createNewEntry(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (factory != null)
-            factory.createNewEntry(req, rowOid, depth, this);
-        else
-            throw new SnmpStatusException(
-                SnmpStatusException.snmpRspNoAccess);
-    }
-
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "isRegistrationRequired" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean isRegistrationRequired()  {
-        return false;
-    }
-
-
-
-    public void registerEntryNode(SnmpMib mib, MBeanServer server)  {
-        node = createJvmMemPoolEntryMetaNode("JvmMemPoolEntry", "JvmMemPoolTable", mib, server);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "addEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public synchronized void addEntry(SnmpOid rowOid, ObjectName objname,
-                 Object entry)
-        throws SnmpStatusException {
-        if (! (entry instanceof JvmMemPoolEntryMBean) )
-            throw new ClassCastException("Entries for Table \"" +
-                           "JvmMemPoolTable" + "\" must implement the \"" +
-                           "JvmMemPoolEntryMBean" + "\" interface.");
-        super.addEntry(rowOid, objname, entry);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        JvmMemPoolEntryMBean entry = (JvmMemPoolEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.get(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmMemPoolEntryMBean entry = (JvmMemPoolEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.set(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmMemPoolEntryMBean entry = (JvmMemPoolEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.check(req,depth);
-        }
-    }
-
-    /**
-     * check that the given "var" identifies a columnar object.
-     */
-    public void validateVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        node.validateVarId(var, data);
-    }
-
-    /**
-     * Returns true if "var" identifies a readable scalar object.
-     */
-    public boolean isReadableEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        return node.isReadable(var);
-    }
-
-    /**
-     * Returns the arc of the next columnar object following "var".
-     */
-    public long getNextVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        long nextvar = node.getNextVarId(var, data);
-        while (!isReadableEntryId(rowOid, nextvar, data))
-            nextvar = node.getNextVarId(nextvar, data);
-        return nextvar;
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipEntryVariable" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean skipEntryVariable( SnmpOid rowOid, long var, Object data, int pduVersion) {
-        try {
-            JvmMemPoolEntryMBean entry = (JvmMemPoolEntryMBean) getEntry(rowOid);
-            synchronized (this) {
-                node.setInstance(entry);
-                return node.skipVariable(var, data, pduVersion);
-            }
-        } catch (SnmpStatusException x) {
-            return false;
-        }
-    }
-
-
-    /**
-     * Reference to the entry metadata.
-     */
-    private JvmMemPoolEntryMeta node;
-
-    /**
-     * Reference to the object server.
-     */
-    protected SnmpStandardObjectServer objectserver;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemoryMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is used for representing the remote management interface for the "JvmMemory" MBean.
- */
-public interface JvmMemoryMBean {
-
-    /**
-     * Getter for the "JvmMemoryNonHeapMaxSize" variable.
-     */
-    public Long getJvmMemoryNonHeapMaxSize() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemoryNonHeapCommitted" variable.
-     */
-    public Long getJvmMemoryNonHeapCommitted() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemoryNonHeapUsed" variable.
-     */
-    public Long getJvmMemoryNonHeapUsed() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemoryNonHeapInitSize" variable.
-     */
-    public Long getJvmMemoryNonHeapInitSize() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemoryHeapMaxSize" variable.
-     */
-    public Long getJvmMemoryHeapMaxSize() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemoryHeapCommitted" variable.
-     */
-    public Long getJvmMemoryHeapCommitted() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemoryGCCall" variable.
-     */
-    public EnumJvmMemoryGCCall getJvmMemoryGCCall() throws SnmpStatusException;
-
-    /**
-     * Setter for the "JvmMemoryGCCall" variable.
-     */
-    public void setJvmMemoryGCCall(EnumJvmMemoryGCCall x) throws SnmpStatusException;
-
-    /**
-     * Checker for the "JvmMemoryGCCall" variable.
-     */
-    public void checkJvmMemoryGCCall(EnumJvmMemoryGCCall x) throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemoryHeapUsed" variable.
-     */
-    public Long getJvmMemoryHeapUsed() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemoryGCVerboseLevel" variable.
-     */
-    public EnumJvmMemoryGCVerboseLevel getJvmMemoryGCVerboseLevel() throws SnmpStatusException;
-
-    /**
-     * Setter for the "JvmMemoryGCVerboseLevel" variable.
-     */
-    public void setJvmMemoryGCVerboseLevel(EnumJvmMemoryGCVerboseLevel x) throws SnmpStatusException;
-
-    /**
-     * Checker for the "JvmMemoryGCVerboseLevel" variable.
-     */
-    public void checkJvmMemoryGCVerboseLevel(EnumJvmMemoryGCVerboseLevel x) throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemoryHeapInitSize" variable.
-     */
-    public Long getJvmMemoryHeapInitSize() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmMemoryPendingFinalCount" variable.
-     */
-    public Long getJvmMemoryPendingFinalCount() throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemoryMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,655 +0,0 @@
-/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibGroup;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmMemory" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.2.
- */
-public class JvmMemoryMeta extends SnmpMibGroup
-     implements Serializable, SnmpStandardMetaServer {
-    private static final long serialVersionUID = 9047644262627149214L;
-
-    /**
-     * Constructor for the metadata associated to "JvmMemory".
-     */
-    public JvmMemoryMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        objectserver = objserv;
-        try {
-            registerObject(120);
-            registerObject(23);
-            registerObject(22);
-            registerObject(21);
-            registerObject(110);
-            registerObject(20);
-            registerObject(13);
-            registerObject(12);
-            registerObject(3);
-            registerObject(11);
-            registerObject(2);
-            registerObject(101);
-            registerObject(10);
-            registerObject(1);
-            registerObject(100);
-        } catch (IllegalAccessException e) {
-            throw new RuntimeException(e.getMessage());
-        }
-    }
-
-    /**
-     * Get the value of a scalar variable
-     */
-    public SnmpValue get(long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 120: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 23:
-                return new SnmpCounter64(node.getJvmMemoryNonHeapMaxSize());
-
-            case 22:
-                return new SnmpCounter64(node.getJvmMemoryNonHeapCommitted());
-
-            case 21:
-                return new SnmpCounter64(node.getJvmMemoryNonHeapUsed());
-
-            case 110: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 20:
-                return new SnmpCounter64(node.getJvmMemoryNonHeapInitSize());
-
-            case 13:
-                return new SnmpCounter64(node.getJvmMemoryHeapMaxSize());
-
-            case 12:
-                return new SnmpCounter64(node.getJvmMemoryHeapCommitted());
-
-            case 3:
-                return new SnmpInt(node.getJvmMemoryGCCall());
-
-            case 11:
-                return new SnmpCounter64(node.getJvmMemoryHeapUsed());
-
-            case 2:
-                return new SnmpInt(node.getJvmMemoryGCVerboseLevel());
-
-            case 101: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 10:
-                return new SnmpCounter64(node.getJvmMemoryHeapInitSize());
-
-            case 1:
-                return new SnmpGauge(node.getJvmMemoryPendingFinalCount());
-
-            case 100: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Set the value of a scalar variable
-     */
-    public SnmpValue set(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 120: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 23:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 22:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 21:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 110: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 20:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 13:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 12:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 3:
-                if (x instanceof SnmpInt) {
-                    try  {
-                        node.setJvmMemoryGCCall( new EnumJvmMemoryGCCall (((SnmpInt)x).toInteger()));
-                    } catch(IllegalArgumentException e)  {
-                        throw new SnmpStatusException(SnmpStatusException.snmpRspWrongValue);
-                    }
-                    return new SnmpInt(node.getJvmMemoryGCCall());
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-
-            case 11:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                if (x instanceof SnmpInt) {
-                    try  {
-                        node.setJvmMemoryGCVerboseLevel( new EnumJvmMemoryGCVerboseLevel (((SnmpInt)x).toInteger()));
-                    } catch(IllegalArgumentException e)  {
-                        throw new SnmpStatusException(SnmpStatusException.snmpRspWrongValue);
-                    }
-                    return new SnmpInt(node.getJvmMemoryGCVerboseLevel());
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-
-            case 101: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 10:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 100: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-    }
-
-    /**
-     * Check the value of a scalar variable
-     */
-    public void check(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int) var) {
-            case 120: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 23:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 22:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 21:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 110: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 20:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 13:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 12:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 3:
-                if (x instanceof SnmpInt) {
-                    try  {
-                        node.checkJvmMemoryGCCall( new EnumJvmMemoryGCCall (((SnmpInt)x).toInteger()));
-                    } catch(IllegalArgumentException e)  {
-                        throw new SnmpStatusException(SnmpStatusException.snmpRspWrongValue);
-                    }
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-                break;
-
-            case 11:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                if (x instanceof SnmpInt) {
-                    try  {
-                        node.checkJvmMemoryGCVerboseLevel( new EnumJvmMemoryGCVerboseLevel (((SnmpInt)x).toInteger()));
-                    } catch(IllegalArgumentException e)  {
-                        throw new SnmpStatusException(SnmpStatusException.snmpRspWrongValue);
-                    }
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-                break;
-
-            case 101: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 10:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 100: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            default:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-        }
-    }
-
-    /**
-     * Allow to bind the metadata description to a specific object.
-     */
-    protected void setInstance(JvmMemoryMBean var) {
-        node = var;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.get(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.set(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.check(this,req,depth);
-    }
-
-    /**
-     * Returns true if "arc" identifies a scalar object.
-     */
-    public boolean isVariable(long arc) {
-
-        switch((int)arc) {
-            case 23:
-            case 22:
-            case 21:
-            case 20:
-            case 13:
-            case 12:
-            case 3:
-            case 11:
-            case 2:
-            case 10:
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if "arc" identifies a readable scalar object.
-     */
-    public boolean isReadable(long arc) {
-
-        switch((int)arc) {
-            case 23:
-            case 22:
-            case 21:
-            case 20:
-            case 13:
-            case 12:
-            case 3:
-            case 11:
-            case 2:
-            case 10:
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipVariable" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean  skipVariable(long var, Object data, int pduVersion) {
-        switch((int)var) {
-            case 23:
-            case 22:
-            case 21:
-            case 20:
-            case 13:
-            case 12:
-            case 11:
-            case 10:
-                if (pduVersion==SnmpDefinitions.snmpVersionOne) return true;
-                break;
-            default:
-                break;
-        }
-        return super.skipVariable(var,data,pduVersion);
-    }
-
-    /**
-     * Return the name of the attribute corresponding to the SNMP variable identified by "id".
-     */
-    public String getAttributeName(long id)
-        throws SnmpStatusException {
-        switch((int)id) {
-            case 120: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 23:
-                return "JvmMemoryNonHeapMaxSize";
-
-            case 22:
-                return "JvmMemoryNonHeapCommitted";
-
-            case 21:
-                return "JvmMemoryNonHeapUsed";
-
-            case 110: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 20:
-                return "JvmMemoryNonHeapInitSize";
-
-            case 13:
-                return "JvmMemoryHeapMaxSize";
-
-            case 12:
-                return "JvmMemoryHeapCommitted";
-
-            case 3:
-                return "JvmMemoryGCCall";
-
-            case 11:
-                return "JvmMemoryHeapUsed";
-
-            case 2:
-                return "JvmMemoryGCVerboseLevel";
-
-            case 101: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 10:
-                return "JvmMemoryHeapInitSize";
-
-            case 1:
-                return "JvmMemoryPendingFinalCount";
-
-            case 100: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Returns true if "arc" identifies a table object.
-     */
-    public boolean isTable(long arc) {
-
-        switch((int)arc) {
-            case 120:
-                return true;
-            case 110:
-                return true;
-            case 101:
-                return true;
-            case 100:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns the table object identified by "arc".
-     */
-    public SnmpMibTable getTable(long arc) {
-
-        switch((int)arc) {
-            case 120:
-                return tableJvmMemMgrPoolRelTable;
-            case 110:
-                return tableJvmMemPoolTable;
-            case 101:
-                return tableJvmMemGCTable;
-            case 100:
-                return tableJvmMemManagerTable;
-        default:
-            break;
-        }
-        return null;
-    }
-
-    /**
-     * Register the group's SnmpMibTable objects with the meta-data.
-     */
-    public void registerTableNodes(SnmpMib mib, MBeanServer server) {
-        tableJvmMemMgrPoolRelTable = createJvmMemMgrPoolRelTableMetaNode("JvmMemMgrPoolRelTable", "JvmMemory", mib, server);
-        if ( tableJvmMemMgrPoolRelTable != null)  {
-            tableJvmMemMgrPoolRelTable.registerEntryNode(mib,server);
-            mib.registerTableMeta("JvmMemMgrPoolRelTable", tableJvmMemMgrPoolRelTable);
-        }
-
-        tableJvmMemPoolTable = createJvmMemPoolTableMetaNode("JvmMemPoolTable", "JvmMemory", mib, server);
-        if ( tableJvmMemPoolTable != null)  {
-            tableJvmMemPoolTable.registerEntryNode(mib,server);
-            mib.registerTableMeta("JvmMemPoolTable", tableJvmMemPoolTable);
-        }
-
-        tableJvmMemGCTable = createJvmMemGCTableMetaNode("JvmMemGCTable", "JvmMemory", mib, server);
-        if ( tableJvmMemGCTable != null)  {
-            tableJvmMemGCTable.registerEntryNode(mib,server);
-            mib.registerTableMeta("JvmMemGCTable", tableJvmMemGCTable);
-        }
-
-        tableJvmMemManagerTable = createJvmMemManagerTableMetaNode("JvmMemManagerTable", "JvmMemory", mib, server);
-        if ( tableJvmMemManagerTable != null)  {
-            tableJvmMemManagerTable.registerEntryNode(mib,server);
-            mib.registerTableMeta("JvmMemManagerTable", tableJvmMemManagerTable);
-        }
-
-    }
-
-
-    /**
-     * Factory method for "JvmMemMgrPoolRelTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmMemMgrPoolRelTable")
-     * @param groupName Name of the group to which this table belong ("JvmMemory")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmMemMgrPoolRelTable" table (JvmMemMgrPoolRelTableMeta)
-     *
-     **/
-    protected JvmMemMgrPoolRelTableMeta createJvmMemMgrPoolRelTableMetaNode(String tableName, String groupName, SnmpMib mib, MBeanServer server)  {
-        return new JvmMemMgrPoolRelTableMeta(mib, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmMemPoolTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmMemPoolTable")
-     * @param groupName Name of the group to which this table belong ("JvmMemory")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmMemPoolTable" table (JvmMemPoolTableMeta)
-     *
-     **/
-    protected JvmMemPoolTableMeta createJvmMemPoolTableMetaNode(String tableName, String groupName, SnmpMib mib, MBeanServer server)  {
-        return new JvmMemPoolTableMeta(mib, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmMemGCTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmMemGCTable")
-     * @param groupName Name of the group to which this table belong ("JvmMemory")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmMemGCTable" table (JvmMemGCTableMeta)
-     *
-     **/
-    protected JvmMemGCTableMeta createJvmMemGCTableMetaNode(String tableName, String groupName, SnmpMib mib, MBeanServer server)  {
-        return new JvmMemGCTableMeta(mib, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmMemManagerTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmMemManagerTable")
-     * @param groupName Name of the group to which this table belong ("JvmMemory")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmMemManagerTable" table (JvmMemManagerTableMeta)
-     *
-     **/
-    protected JvmMemManagerTableMeta createJvmMemManagerTableMetaNode(String tableName, String groupName, SnmpMib mib, MBeanServer server)  {
-        return new JvmMemManagerTableMeta(mib, objectserver);
-    }
-
-    protected JvmMemoryMBean node;
-    protected SnmpStandardObjectServer objectserver = null;
-    protected JvmMemMgrPoolRelTableMeta tableJvmMemMgrPoolRelTable = null;
-    protected JvmMemPoolTableMeta tableJvmMemPoolTable = null;
-    protected JvmMemGCTableMeta tableJvmMemGCTable = null;
-    protected JvmMemManagerTableMeta tableJvmMemManagerTable = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmOSMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is used for representing the remote management interface for the "JvmOS" MBean.
- */
-public interface JvmOSMBean {
-
-    /**
-     * Getter for the "JvmOSProcessorCount" variable.
-     */
-    public Integer getJvmOSProcessorCount() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmOSVersion" variable.
-     */
-    public String getJvmOSVersion() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmOSArch" variable.
-     */
-    public String getJvmOSArch() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmOSName" variable.
-     */
-    public String getJvmOSName() throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmOSMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,304 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibGroup;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmOS" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.6.
- */
-public class JvmOSMeta extends SnmpMibGroup
-     implements Serializable, SnmpStandardMetaServer {
-
-    static final long serialVersionUID = -2024138733580127133L;
-
-    /**
-     * Constructor for the metadata associated to "JvmOS".
-     */
-    public JvmOSMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        objectserver = objserv;
-        try {
-            registerObject(4);
-            registerObject(3);
-            registerObject(2);
-            registerObject(1);
-        } catch (IllegalAccessException e) {
-            throw new RuntimeException(e.getMessage());
-        }
-    }
-
-    /**
-     * Get the value of a scalar variable
-     */
-    public SnmpValue get(long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 4:
-                return new SnmpInt(node.getJvmOSProcessorCount());
-
-            case 3:
-                return new SnmpString(node.getJvmOSVersion());
-
-            case 2:
-                return new SnmpString(node.getJvmOSArch());
-
-            case 1:
-                return new SnmpString(node.getJvmOSName());
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Set the value of a scalar variable
-     */
-    public SnmpValue set(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 4:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-    }
-
-    /**
-     * Check the value of a scalar variable
-     */
-    public void check(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int) var) {
-            case 4:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-        }
-    }
-
-    /**
-     * Allow to bind the metadata description to a specific object.
-     */
-    protected void setInstance(JvmOSMBean var) {
-        node = var;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.get(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.set(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.check(this,req,depth);
-    }
-
-    /**
-     * Returns true if "arc" identifies a scalar object.
-     */
-    public boolean isVariable(long arc) {
-
-        switch((int)arc) {
-            case 4:
-            case 3:
-            case 2:
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if "arc" identifies a readable scalar object.
-     */
-    public boolean isReadable(long arc) {
-
-        switch((int)arc) {
-            case 4:
-            case 3:
-            case 2:
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipVariable" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean  skipVariable(long var, Object data, int pduVersion) {
-        return super.skipVariable(var,data,pduVersion);
-    }
-
-    /**
-     * Return the name of the attribute corresponding to the SNMP variable identified by "id".
-     */
-    public String getAttributeName(long id)
-        throws SnmpStatusException {
-        switch((int)id) {
-            case 4:
-                return "JvmOSProcessorCount";
-
-            case 3:
-                return "JvmOSVersion";
-
-            case 2:
-                return "JvmOSArch";
-
-            case 1:
-                return "JvmOSName";
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Returns true if "arc" identifies a table object.
-     */
-    public boolean isTable(long arc) {
-
-        switch((int)arc) {
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns the table object identified by "arc".
-     */
-    public SnmpMibTable getTable(long arc) {
-        return null;
-    }
-
-    /**
-     * Register the group's SnmpMibTable objects with the meta-data.
-     */
-    public void registerTableNodes(SnmpMib mib, MBeanServer server) {
-    }
-
-    protected JvmOSMBean node;
-    protected SnmpStandardObjectServer objectserver = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTBootClassPathEntryMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is used for representing the remote management interface for the "JvmRTBootClassPathEntry" MBean.
- */
-public interface JvmRTBootClassPathEntryMBean {
-
-    /**
-     * Getter for the "JvmRTBootClassPathItem" variable.
-     */
-    public String getJvmRTBootClassPathItem() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmRTBootClassPathIndex" variable.
-     */
-    public Integer getJvmRTBootClassPathIndex() throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTBootClassPathEntryMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,250 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMibNode;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibEntry;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmRTBootClassPathEntry" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.4.21.1.
- */
-public class JvmRTBootClassPathEntryMeta extends SnmpMibEntry
-     implements Serializable, SnmpStandardMetaServer {
-
-    static final long serialVersionUID = 7703840715080588941L;
-    /**
-     * Constructor for the metadata associated to "JvmRTBootClassPathEntry".
-     */
-    public JvmRTBootClassPathEntryMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        objectserver = objserv;
-        varList = new int[1];
-        varList[0] = 2;
-        SnmpMibNode.sort(varList);
-    }
-
-    /**
-     * Get the value of a scalar variable
-     */
-    public SnmpValue get(long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 2:
-                return new SnmpString(node.getJvmRTBootClassPathItem());
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Set the value of a scalar variable
-     */
-    public SnmpValue set(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-    }
-
-    /**
-     * Check the value of a scalar variable
-     */
-    public void check(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int) var) {
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-        }
-    }
-
-    /**
-     * Allow to bind the metadata description to a specific object.
-     */
-    protected void setInstance(JvmRTBootClassPathEntryMBean var) {
-        node = var;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.get(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.set(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.check(this,req,depth);
-    }
-
-    /**
-     * Returns true if "arc" identifies a scalar object.
-     */
-    public boolean isVariable(long arc) {
-
-        switch((int)arc) {
-            case 2:
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if "arc" identifies a readable scalar object.
-     */
-    public boolean isReadable(long arc) {
-
-        switch((int)arc) {
-            case 2:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipVariable" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean  skipVariable(long var, Object data, int pduVersion) {
-        switch((int)var) {
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return super.skipVariable(var,data,pduVersion);
-    }
-
-    /**
-     * Return the name of the attribute corresponding to the SNMP variable identified by "id".
-     */
-    public String getAttributeName(long id)
-        throws SnmpStatusException {
-        switch((int)id) {
-            case 2:
-                return "JvmRTBootClassPathItem";
-
-            case 1:
-                return "JvmRTBootClassPathIndex";
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    protected JvmRTBootClassPathEntryMBean node;
-    protected SnmpStandardObjectServer objectserver = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTBootClassPathTableMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Vector;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpIndex;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-/**
- * The class is used for implementing the "JvmRTBootClassPathTable" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.4.21.
- */
-public class JvmRTBootClassPathTableMeta extends SnmpMibTable implements Serializable {
-
-    static final long serialVersionUID = 42471379600792135L;
-    /**
-     * Constructor for the table. Initialize metadata for "JvmRTBootClassPathTableMeta".
-     * The reference on the MBean server is updated so the entries created through an SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmRTBootClassPathTableMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        super(myMib);
-        objectserver = objserv;
-    }
-
-
-    /**
-     * Factory method for "JvmRTBootClassPathEntry" entry metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param snmpEntryName Name of the SNMP Entry object (conceptual row) ("JvmRTBootClassPathEntry")
-     * @param tableName Name of the table in which the entries are registered ("JvmRTBootClassPathTable")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmRTBootClassPathEntry" conceptual row (JvmRTBootClassPathEntryMeta)
-     *
-     **/
-    protected JvmRTBootClassPathEntryMeta createJvmRTBootClassPathEntryMetaNode(String snmpEntryName, String tableName, SnmpMib mib, MBeanServer server)  {
-        return new JvmRTBootClassPathEntryMeta(mib, objectserver);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "createNewEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void createNewEntry(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (factory != null)
-            factory.createNewEntry(req, rowOid, depth, this);
-        else
-            throw new SnmpStatusException(
-                SnmpStatusException.snmpRspNoAccess);
-    }
-
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "isRegistrationRequired" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean isRegistrationRequired()  {
-        return false;
-    }
-
-
-
-    public void registerEntryNode(SnmpMib mib, MBeanServer server)  {
-        node = createJvmRTBootClassPathEntryMetaNode("JvmRTBootClassPathEntry", "JvmRTBootClassPathTable", mib, server);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "addEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public synchronized void addEntry(SnmpOid rowOid, ObjectName objname,
-                 Object entry)
-        throws SnmpStatusException {
-        if (! (entry instanceof JvmRTBootClassPathEntryMBean) )
-            throw new ClassCastException("Entries for Table \"" +
-                           "JvmRTBootClassPathTable" + "\" must implement the \"" +
-                           "JvmRTBootClassPathEntryMBean" + "\" interface.");
-        super.addEntry(rowOid, objname, entry);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        JvmRTBootClassPathEntryMBean entry = (JvmRTBootClassPathEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.get(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmRTBootClassPathEntryMBean entry = (JvmRTBootClassPathEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.set(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmRTBootClassPathEntryMBean entry = (JvmRTBootClassPathEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.check(req,depth);
-        }
-    }
-
-    /**
-     * check that the given "var" identifies a columnar object.
-     */
-    public void validateVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        node.validateVarId(var, data);
-    }
-
-    /**
-     * Returns true if "var" identifies a readable scalar object.
-     */
-    public boolean isReadableEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        return node.isReadable(var);
-    }
-
-    /**
-     * Returns the arc of the next columnar object following "var".
-     */
-    public long getNextVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        long nextvar = node.getNextVarId(var, data);
-        while (!isReadableEntryId(rowOid, nextvar, data))
-            nextvar = node.getNextVarId(nextvar, data);
-        return nextvar;
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipEntryVariable" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean skipEntryVariable( SnmpOid rowOid, long var, Object data, int pduVersion) {
-        try {
-            JvmRTBootClassPathEntryMBean entry = (JvmRTBootClassPathEntryMBean) getEntry(rowOid);
-            synchronized (this) {
-                node.setInstance(entry);
-                return node.skipVariable(var, data, pduVersion);
-            }
-        } catch (SnmpStatusException x) {
-            return false;
-        }
-    }
-
-
-    /**
-     * Reference to the entry metadata.
-     */
-    private JvmRTBootClassPathEntryMeta node;
-
-    /**
-     * Reference to the object server.
-     */
-    protected SnmpStandardObjectServer objectserver;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTClassPathEntryMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is used for representing the remote management interface for the "JvmRTClassPathEntry" MBean.
- */
-public interface JvmRTClassPathEntryMBean {
-
-    /**
-     * Getter for the "JvmRTClassPathItem" variable.
-     */
-    public String getJvmRTClassPathItem() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmRTClassPathIndex" variable.
-     */
-    public Integer getJvmRTClassPathIndex() throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTClassPathEntryMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,250 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMibNode;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibEntry;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmRTClassPathEntry" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.4.22.1.
- */
-public class JvmRTClassPathEntryMeta extends SnmpMibEntry
-     implements Serializable, SnmpStandardMetaServer {
-
-    static final long serialVersionUID = 3388703998226830801L;
-    /**
-     * Constructor for the metadata associated to "JvmRTClassPathEntry".
-     */
-    public JvmRTClassPathEntryMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        objectserver = objserv;
-        varList = new int[1];
-        varList[0] = 2;
-        SnmpMibNode.sort(varList);
-    }
-
-    /**
-     * Get the value of a scalar variable
-     */
-    public SnmpValue get(long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 2:
-                return new SnmpString(node.getJvmRTClassPathItem());
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Set the value of a scalar variable
-     */
-    public SnmpValue set(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-    }
-
-    /**
-     * Check the value of a scalar variable
-     */
-    public void check(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int) var) {
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-        }
-    }
-
-    /**
-     * Allow to bind the metadata description to a specific object.
-     */
-    protected void setInstance(JvmRTClassPathEntryMBean var) {
-        node = var;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.get(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.set(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.check(this,req,depth);
-    }
-
-    /**
-     * Returns true if "arc" identifies a scalar object.
-     */
-    public boolean isVariable(long arc) {
-
-        switch((int)arc) {
-            case 2:
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if "arc" identifies a readable scalar object.
-     */
-    public boolean isReadable(long arc) {
-
-        switch((int)arc) {
-            case 2:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipVariable" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean  skipVariable(long var, Object data, int pduVersion) {
-        switch((int)var) {
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return super.skipVariable(var,data,pduVersion);
-    }
-
-    /**
-     * Return the name of the attribute corresponding to the SNMP variable identified by "id".
-     */
-    public String getAttributeName(long id)
-        throws SnmpStatusException {
-        switch((int)id) {
-            case 2:
-                return "JvmRTClassPathItem";
-
-            case 1:
-                return "JvmRTClassPathIndex";
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    protected JvmRTClassPathEntryMBean node;
-    protected SnmpStandardObjectServer objectserver = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTClassPathTableMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Vector;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpIndex;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-/**
- * The class is used for implementing the "JvmRTClassPathTable" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.4.22.
- */
-public class JvmRTClassPathTableMeta extends SnmpMibTable implements Serializable {
-
-    static final long serialVersionUID = -1518727175345404443L;
-    /**
-     * Constructor for the table. Initialize metadata for "JvmRTClassPathTableMeta".
-     * The reference on the MBean server is updated so the entries created through an SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmRTClassPathTableMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        super(myMib);
-        objectserver = objserv;
-    }
-
-
-    /**
-     * Factory method for "JvmRTClassPathEntry" entry metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param snmpEntryName Name of the SNMP Entry object (conceptual row) ("JvmRTClassPathEntry")
-     * @param tableName Name of the table in which the entries are registered ("JvmRTClassPathTable")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmRTClassPathEntry" conceptual row (JvmRTClassPathEntryMeta)
-     *
-     **/
-    protected JvmRTClassPathEntryMeta createJvmRTClassPathEntryMetaNode(String snmpEntryName, String tableName, SnmpMib mib, MBeanServer server)  {
-        return new JvmRTClassPathEntryMeta(mib, objectserver);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "createNewEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void createNewEntry(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (factory != null)
-            factory.createNewEntry(req, rowOid, depth, this);
-        else
-            throw new SnmpStatusException(
-                SnmpStatusException.snmpRspNoAccess);
-    }
-
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "isRegistrationRequired" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean isRegistrationRequired()  {
-        return false;
-    }
-
-
-
-    public void registerEntryNode(SnmpMib mib, MBeanServer server)  {
-        node = createJvmRTClassPathEntryMetaNode("JvmRTClassPathEntry", "JvmRTClassPathTable", mib, server);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "addEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public synchronized void addEntry(SnmpOid rowOid, ObjectName objname,
-                 Object entry)
-        throws SnmpStatusException {
-        if (! (entry instanceof JvmRTClassPathEntryMBean) )
-            throw new ClassCastException("Entries for Table \"" +
-                           "JvmRTClassPathTable" + "\" must implement the \"" +
-                           "JvmRTClassPathEntryMBean" + "\" interface.");
-        super.addEntry(rowOid, objname, entry);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        JvmRTClassPathEntryMBean entry = (JvmRTClassPathEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.get(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmRTClassPathEntryMBean entry = (JvmRTClassPathEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.set(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmRTClassPathEntryMBean entry = (JvmRTClassPathEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.check(req,depth);
-        }
-    }
-
-    /**
-     * check that the given "var" identifies a columnar object.
-     */
-    public void validateVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        node.validateVarId(var, data);
-    }
-
-    /**
-     * Returns true if "var" identifies a readable scalar object.
-     */
-    public boolean isReadableEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        return node.isReadable(var);
-    }
-
-    /**
-     * Returns the arc of the next columnar object following "var".
-     */
-    public long getNextVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        long nextvar = node.getNextVarId(var, data);
-        while (!isReadableEntryId(rowOid, nextvar, data))
-            nextvar = node.getNextVarId(nextvar, data);
-        return nextvar;
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipEntryVariable" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean skipEntryVariable( SnmpOid rowOid, long var, Object data, int pduVersion) {
-        try {
-            JvmRTClassPathEntryMBean entry = (JvmRTClassPathEntryMBean) getEntry(rowOid);
-            synchronized (this) {
-                node.setInstance(entry);
-                return node.skipVariable(var, data, pduVersion);
-            }
-        } catch (SnmpStatusException x) {
-            return false;
-        }
-    }
-
-
-    /**
-     * Reference to the entry metadata.
-     */
-    private JvmRTClassPathEntryMeta node;
-
-    /**
-     * Reference to the object server.
-     */
-    protected SnmpStandardObjectServer objectserver;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTInputArgsEntryMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is used for representing the remote management interface for the "JvmRTInputArgsEntry" MBean.
- */
-public interface JvmRTInputArgsEntryMBean {
-
-    /**
-     * Getter for the "JvmRTInputArgsItem" variable.
-     */
-    public String getJvmRTInputArgsItem() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmRTInputArgsIndex" variable.
-     */
-    public Integer getJvmRTInputArgsIndex() throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTInputArgsEntryMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,250 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMibNode;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibEntry;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmRTInputArgsEntry" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.4.20.1.
- */
-public class JvmRTInputArgsEntryMeta extends SnmpMibEntry
-     implements Serializable, SnmpStandardMetaServer {
-
-    static final long serialVersionUID = -7729576810347358025L;
-    /**
-     * Constructor for the metadata associated to "JvmRTInputArgsEntry".
-     */
-    public JvmRTInputArgsEntryMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        objectserver = objserv;
-        varList = new int[1];
-        varList[0] = 2;
-        SnmpMibNode.sort(varList);
-    }
-
-    /**
-     * Get the value of a scalar variable
-     */
-    public SnmpValue get(long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 2:
-                return new SnmpString(node.getJvmRTInputArgsItem());
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Set the value of a scalar variable
-     */
-    public SnmpValue set(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-    }
-
-    /**
-     * Check the value of a scalar variable
-     */
-    public void check(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int) var) {
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-        }
-    }
-
-    /**
-     * Allow to bind the metadata description to a specific object.
-     */
-    protected void setInstance(JvmRTInputArgsEntryMBean var) {
-        node = var;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.get(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.set(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.check(this,req,depth);
-    }
-
-    /**
-     * Returns true if "arc" identifies a scalar object.
-     */
-    public boolean isVariable(long arc) {
-
-        switch((int)arc) {
-            case 2:
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if "arc" identifies a readable scalar object.
-     */
-    public boolean isReadable(long arc) {
-
-        switch((int)arc) {
-            case 2:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipVariable" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean  skipVariable(long var, Object data, int pduVersion) {
-        switch((int)var) {
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return super.skipVariable(var,data,pduVersion);
-    }
-
-    /**
-     * Return the name of the attribute corresponding to the SNMP variable identified by "id".
-     */
-    public String getAttributeName(long id)
-        throws SnmpStatusException {
-        switch((int)id) {
-            case 2:
-                return "JvmRTInputArgsItem";
-
-            case 1:
-                return "JvmRTInputArgsIndex";
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    protected JvmRTInputArgsEntryMBean node;
-    protected SnmpStandardObjectServer objectserver = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTInputArgsTableMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Vector;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpIndex;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-/**
- * The class is used for implementing the "JvmRTInputArgsTable" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.4.20.
- */
-public class JvmRTInputArgsTableMeta extends SnmpMibTable implements Serializable {
-
-    static final long serialVersionUID = 5395531763015738645L;
-    /**
-     * Constructor for the table. Initialize metadata for "JvmRTInputArgsTableMeta".
-     * The reference on the MBean server is updated so the entries created through an SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmRTInputArgsTableMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        super(myMib);
-        objectserver = objserv;
-    }
-
-
-    /**
-     * Factory method for "JvmRTInputArgsEntry" entry metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param snmpEntryName Name of the SNMP Entry object (conceptual row) ("JvmRTInputArgsEntry")
-     * @param tableName Name of the table in which the entries are registered ("JvmRTInputArgsTable")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmRTInputArgsEntry" conceptual row (JvmRTInputArgsEntryMeta)
-     *
-     **/
-    protected JvmRTInputArgsEntryMeta createJvmRTInputArgsEntryMetaNode(String snmpEntryName, String tableName, SnmpMib mib, MBeanServer server)  {
-        return new JvmRTInputArgsEntryMeta(mib, objectserver);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "createNewEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void createNewEntry(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (factory != null)
-            factory.createNewEntry(req, rowOid, depth, this);
-        else
-            throw new SnmpStatusException(
-                SnmpStatusException.snmpRspNoAccess);
-    }
-
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "isRegistrationRequired" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean isRegistrationRequired()  {
-        return false;
-    }
-
-
-
-    public void registerEntryNode(SnmpMib mib, MBeanServer server)  {
-        node = createJvmRTInputArgsEntryMetaNode("JvmRTInputArgsEntry", "JvmRTInputArgsTable", mib, server);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "addEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public synchronized void addEntry(SnmpOid rowOid, ObjectName objname,
-                 Object entry)
-        throws SnmpStatusException {
-        if (! (entry instanceof JvmRTInputArgsEntryMBean) )
-            throw new ClassCastException("Entries for Table \"" +
-                           "JvmRTInputArgsTable" + "\" must implement the \"" +
-                           "JvmRTInputArgsEntryMBean" + "\" interface.");
-        super.addEntry(rowOid, objname, entry);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        JvmRTInputArgsEntryMBean entry = (JvmRTInputArgsEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.get(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmRTInputArgsEntryMBean entry = (JvmRTInputArgsEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.set(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmRTInputArgsEntryMBean entry = (JvmRTInputArgsEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.check(req,depth);
-        }
-    }
-
-    /**
-     * check that the given "var" identifies a columnar object.
-     */
-    public void validateVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        node.validateVarId(var, data);
-    }
-
-    /**
-     * Returns true if "var" identifies a readable scalar object.
-     */
-    public boolean isReadableEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        return node.isReadable(var);
-    }
-
-    /**
-     * Returns the arc of the next columnar object following "var".
-     */
-    public long getNextVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        long nextvar = node.getNextVarId(var, data);
-        while (!isReadableEntryId(rowOid, nextvar, data))
-            nextvar = node.getNextVarId(nextvar, data);
-        return nextvar;
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipEntryVariable" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean skipEntryVariable( SnmpOid rowOid, long var, Object data, int pduVersion) {
-        try {
-            JvmRTInputArgsEntryMBean entry = (JvmRTInputArgsEntryMBean) getEntry(rowOid);
-            synchronized (this) {
-                node.setInstance(entry);
-                return node.skipVariable(var, data, pduVersion);
-            }
-        } catch (SnmpStatusException x) {
-            return false;
-        }
-    }
-
-
-    /**
-     * Reference to the entry metadata.
-     */
-    private JvmRTInputArgsEntryMeta node;
-
-    /**
-     * Reference to the object server.
-     */
-    protected SnmpStandardObjectServer objectserver;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTLibraryPathEntryMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is used for representing the remote management interface for the "JvmRTLibraryPathEntry" MBean.
- */
-public interface JvmRTLibraryPathEntryMBean {
-
-    /**
-     * Getter for the "JvmRTLibraryPathItem" variable.
-     */
-    public String getJvmRTLibraryPathItem() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmRTLibraryPathIndex" variable.
-     */
-    public Integer getJvmRTLibraryPathIndex() throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTLibraryPathEntryMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,250 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMibNode;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibEntry;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmRTLibraryPathEntry" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.4.23.1.
- */
-public class JvmRTLibraryPathEntryMeta extends SnmpMibEntry
-     implements Serializable, SnmpStandardMetaServer {
-
-    static final long serialVersionUID = -5851555586263475792L;
-    /**
-     * Constructor for the metadata associated to "JvmRTLibraryPathEntry".
-     */
-    public JvmRTLibraryPathEntryMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        objectserver = objserv;
-        varList = new int[1];
-        varList[0] = 2;
-        SnmpMibNode.sort(varList);
-    }
-
-    /**
-     * Get the value of a scalar variable
-     */
-    public SnmpValue get(long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 2:
-                return new SnmpString(node.getJvmRTLibraryPathItem());
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Set the value of a scalar variable
-     */
-    public SnmpValue set(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-    }
-
-    /**
-     * Check the value of a scalar variable
-     */
-    public void check(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int) var) {
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-        }
-    }
-
-    /**
-     * Allow to bind the metadata description to a specific object.
-     */
-    protected void setInstance(JvmRTLibraryPathEntryMBean var) {
-        node = var;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.get(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.set(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.check(this,req,depth);
-    }
-
-    /**
-     * Returns true if "arc" identifies a scalar object.
-     */
-    public boolean isVariable(long arc) {
-
-        switch((int)arc) {
-            case 2:
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if "arc" identifies a readable scalar object.
-     */
-    public boolean isReadable(long arc) {
-
-        switch((int)arc) {
-            case 2:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipVariable" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean  skipVariable(long var, Object data, int pduVersion) {
-        switch((int)var) {
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return super.skipVariable(var,data,pduVersion);
-    }
-
-    /**
-     * Return the name of the attribute corresponding to the SNMP variable identified by "id".
-     */
-    public String getAttributeName(long id)
-        throws SnmpStatusException {
-        switch((int)id) {
-            case 2:
-                return "JvmRTLibraryPathItem";
-
-            case 1:
-                return "JvmRTLibraryPathIndex";
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    protected JvmRTLibraryPathEntryMBean node;
-    protected SnmpStandardObjectServer objectserver = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTLibraryPathTableMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Vector;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpIndex;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-/**
- * The class is used for implementing the "JvmRTLibraryPathTable" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.4.23.
- */
-public class JvmRTLibraryPathTableMeta extends SnmpMibTable implements Serializable {
-
-    static final long serialVersionUID = -632403620113109468L;
-    /**
-     * Constructor for the table. Initialize metadata for "JvmRTLibraryPathTableMeta".
-     * The reference on the MBean server is updated so the entries created through an SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmRTLibraryPathTableMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        super(myMib);
-        objectserver = objserv;
-    }
-
-
-    /**
-     * Factory method for "JvmRTLibraryPathEntry" entry metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param snmpEntryName Name of the SNMP Entry object (conceptual row) ("JvmRTLibraryPathEntry")
-     * @param tableName Name of the table in which the entries are registered ("JvmRTLibraryPathTable")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmRTLibraryPathEntry" conceptual row (JvmRTLibraryPathEntryMeta)
-     *
-     **/
-    protected JvmRTLibraryPathEntryMeta createJvmRTLibraryPathEntryMetaNode(String snmpEntryName, String tableName, SnmpMib mib, MBeanServer server)  {
-        return new JvmRTLibraryPathEntryMeta(mib, objectserver);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "createNewEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void createNewEntry(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (factory != null)
-            factory.createNewEntry(req, rowOid, depth, this);
-        else
-            throw new SnmpStatusException(
-                SnmpStatusException.snmpRspNoAccess);
-    }
-
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "isRegistrationRequired" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean isRegistrationRequired()  {
-        return false;
-    }
-
-
-
-    public void registerEntryNode(SnmpMib mib, MBeanServer server)  {
-        node = createJvmRTLibraryPathEntryMetaNode("JvmRTLibraryPathEntry", "JvmRTLibraryPathTable", mib, server);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "addEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public synchronized void addEntry(SnmpOid rowOid, ObjectName objname,
-                 Object entry)
-        throws SnmpStatusException {
-        if (! (entry instanceof JvmRTLibraryPathEntryMBean) )
-            throw new ClassCastException("Entries for Table \"" +
-                           "JvmRTLibraryPathTable" + "\" must implement the \"" +
-                           "JvmRTLibraryPathEntryMBean" + "\" interface.");
-        super.addEntry(rowOid, objname, entry);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        JvmRTLibraryPathEntryMBean entry = (JvmRTLibraryPathEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.get(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmRTLibraryPathEntryMBean entry = (JvmRTLibraryPathEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.set(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmRTLibraryPathEntryMBean entry = (JvmRTLibraryPathEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.check(req,depth);
-        }
-    }
-
-    /**
-     * check that the given "var" identifies a columnar object.
-     */
-    public void validateVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        node.validateVarId(var, data);
-    }
-
-    /**
-     * Returns true if "var" identifies a readable scalar object.
-     */
-    public boolean isReadableEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        return node.isReadable(var);
-    }
-
-    /**
-     * Returns the arc of the next columnar object following "var".
-     */
-    public long getNextVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        long nextvar = node.getNextVarId(var, data);
-        while (!isReadableEntryId(rowOid, nextvar, data))
-            nextvar = node.getNextVarId(nextvar, data);
-        return nextvar;
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipEntryVariable" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean skipEntryVariable( SnmpOid rowOid, long var, Object data, int pduVersion) {
-        try {
-            JvmRTLibraryPathEntryMBean entry = (JvmRTLibraryPathEntryMBean) getEntry(rowOid);
-            synchronized (this) {
-                node.setInstance(entry);
-                return node.skipVariable(var, data, pduVersion);
-            }
-        } catch (SnmpStatusException x) {
-            return false;
-        }
-    }
-
-
-    /**
-     * Reference to the entry metadata.
-     */
-    private JvmRTLibraryPathEntryMeta node;
-
-    /**
-     * Reference to the object server.
-     */
-    protected SnmpStandardObjectServer objectserver;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRuntimeMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is used for representing the remote management interface for the "JvmRuntime" MBean.
- */
-public interface JvmRuntimeMBean {
-
-    /**
-     * Getter for the "JvmRTBootClassPathSupport" variable.
-     */
-    public EnumJvmRTBootClassPathSupport getJvmRTBootClassPathSupport() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmRTManagementSpecVersion" variable.
-     */
-    public String getJvmRTManagementSpecVersion() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmRTSpecVersion" variable.
-     */
-    public String getJvmRTSpecVersion() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmRTSpecVendor" variable.
-     */
-    public String getJvmRTSpecVendor() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmRTSpecName" variable.
-     */
-    public String getJvmRTSpecName() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmRTVMVersion" variable.
-     */
-    public String getJvmRTVMVersion() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmRTVMVendor" variable.
-     */
-    public String getJvmRTVMVendor() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmRTStartTimeMs" variable.
-     */
-    public Long getJvmRTStartTimeMs() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmRTUptimeMs" variable.
-     */
-    public Long getJvmRTUptimeMs() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmRTVMName" variable.
-     */
-    public String getJvmRTVMName() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmRTName" variable.
-     */
-    public String getJvmRTName() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmRTInputArgsCount" variable.
-     */
-    public Integer getJvmRTInputArgsCount() throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRuntimeMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,628 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibGroup;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmRuntime" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.4.
- */
-public class JvmRuntimeMeta extends SnmpMibGroup
-     implements Serializable, SnmpStandardMetaServer {
-
-    static final long serialVersionUID = 1994595220765880109L;
-    /**
-     * Constructor for the metadata associated to "JvmRuntime".
-     */
-    public JvmRuntimeMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        objectserver = objserv;
-        try {
-            registerObject(23);
-            registerObject(22);
-            registerObject(21);
-            registerObject(9);
-            registerObject(20);
-            registerObject(8);
-            registerObject(7);
-            registerObject(6);
-            registerObject(5);
-            registerObject(4);
-            registerObject(3);
-            registerObject(12);
-            registerObject(11);
-            registerObject(2);
-            registerObject(1);
-            registerObject(10);
-        } catch (IllegalAccessException e) {
-            throw new RuntimeException(e.getMessage());
-        }
-    }
-
-    /**
-     * Get the value of a scalar variable
-     */
-    public SnmpValue get(long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 23: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 22: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 21: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 9:
-                return new SnmpInt(node.getJvmRTBootClassPathSupport());
-
-            case 20: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 8:
-                return new SnmpString(node.getJvmRTManagementSpecVersion());
-
-            case 7:
-                return new SnmpString(node.getJvmRTSpecVersion());
-
-            case 6:
-                return new SnmpString(node.getJvmRTSpecVendor());
-
-            case 5:
-                return new SnmpString(node.getJvmRTSpecName());
-
-            case 4:
-                return new SnmpString(node.getJvmRTVMVersion());
-
-            case 3:
-                return new SnmpString(node.getJvmRTVMVendor());
-
-            case 12:
-                return new SnmpCounter64(node.getJvmRTStartTimeMs());
-
-            case 11:
-                return new SnmpCounter64(node.getJvmRTUptimeMs());
-
-            case 2:
-                return new SnmpString(node.getJvmRTVMName());
-
-            case 1:
-                return new SnmpString(node.getJvmRTName());
-
-            case 10:
-                return new SnmpInt(node.getJvmRTInputArgsCount());
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Set the value of a scalar variable
-     */
-    public SnmpValue set(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 23: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 22: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 21: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 9:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 20: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 8:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 7:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 6:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 5:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 4:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 12:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 11:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 10:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-    }
-
-    /**
-     * Check the value of a scalar variable
-     */
-    public void check(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int) var) {
-            case 23: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 22: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 21: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 9:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 20: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 8:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 7:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 6:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 5:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 4:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 12:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 11:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 10:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-        }
-    }
-
-    /**
-     * Allow to bind the metadata description to a specific object.
-     */
-    protected void setInstance(JvmRuntimeMBean var) {
-        node = var;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.get(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.set(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.check(this,req,depth);
-    }
-
-    /**
-     * Returns true if "arc" identifies a scalar object.
-     */
-    public boolean isVariable(long arc) {
-
-        switch((int)arc) {
-            case 9:
-            case 8:
-            case 7:
-            case 6:
-            case 5:
-            case 4:
-            case 3:
-            case 12:
-            case 11:
-            case 2:
-            case 1:
-            case 10:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if "arc" identifies a readable scalar object.
-     */
-    public boolean isReadable(long arc) {
-
-        switch((int)arc) {
-            case 9:
-            case 8:
-            case 7:
-            case 6:
-            case 5:
-            case 4:
-            case 3:
-            case 12:
-            case 11:
-            case 2:
-            case 1:
-            case 10:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipVariable" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean  skipVariable(long var, Object data, int pduVersion) {
-        switch((int)var) {
-            case 12:
-            case 11:
-                if (pduVersion==SnmpDefinitions.snmpVersionOne) return true;
-                break;
-            default:
-                break;
-        }
-        return super.skipVariable(var,data,pduVersion);
-    }
-
-    /**
-     * Return the name of the attribute corresponding to the SNMP variable identified by "id".
-     */
-    public String getAttributeName(long id)
-        throws SnmpStatusException {
-        switch((int)id) {
-            case 23: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 22: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 21: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 9:
-                return "JvmRTBootClassPathSupport";
-
-            case 20: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 8:
-                return "JvmRTManagementSpecVersion";
-
-            case 7:
-                return "JvmRTSpecVersion";
-
-            case 6:
-                return "JvmRTSpecVendor";
-
-            case 5:
-                return "JvmRTSpecName";
-
-            case 4:
-                return "JvmRTVMVersion";
-
-            case 3:
-                return "JvmRTVMVendor";
-
-            case 12:
-                return "JvmRTStartTimeMs";
-
-            case 11:
-                return "JvmRTUptimeMs";
-
-            case 2:
-                return "JvmRTVMName";
-
-            case 1:
-                return "JvmRTName";
-
-            case 10:
-                return "JvmRTInputArgsCount";
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Returns true if "arc" identifies a table object.
-     */
-    public boolean isTable(long arc) {
-
-        switch((int)arc) {
-            case 23:
-                return true;
-            case 22:
-                return true;
-            case 21:
-                return true;
-            case 20:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns the table object identified by "arc".
-     */
-    public SnmpMibTable getTable(long arc) {
-
-        switch((int)arc) {
-            case 23:
-                return tableJvmRTLibraryPathTable;
-            case 22:
-                return tableJvmRTClassPathTable;
-            case 21:
-                return tableJvmRTBootClassPathTable;
-            case 20:
-                return tableJvmRTInputArgsTable;
-        default:
-            break;
-        }
-        return null;
-    }
-
-    /**
-     * Register the group's SnmpMibTable objects with the meta-data.
-     */
-    public void registerTableNodes(SnmpMib mib, MBeanServer server) {
-        tableJvmRTLibraryPathTable = createJvmRTLibraryPathTableMetaNode("JvmRTLibraryPathTable", "JvmRuntime", mib, server);
-        if ( tableJvmRTLibraryPathTable != null)  {
-            tableJvmRTLibraryPathTable.registerEntryNode(mib,server);
-            mib.registerTableMeta("JvmRTLibraryPathTable", tableJvmRTLibraryPathTable);
-        }
-
-        tableJvmRTClassPathTable = createJvmRTClassPathTableMetaNode("JvmRTClassPathTable", "JvmRuntime", mib, server);
-        if ( tableJvmRTClassPathTable != null)  {
-            tableJvmRTClassPathTable.registerEntryNode(mib,server);
-            mib.registerTableMeta("JvmRTClassPathTable", tableJvmRTClassPathTable);
-        }
-
-        tableJvmRTBootClassPathTable = createJvmRTBootClassPathTableMetaNode("JvmRTBootClassPathTable", "JvmRuntime", mib, server);
-        if ( tableJvmRTBootClassPathTable != null)  {
-            tableJvmRTBootClassPathTable.registerEntryNode(mib,server);
-            mib.registerTableMeta("JvmRTBootClassPathTable", tableJvmRTBootClassPathTable);
-        }
-
-        tableJvmRTInputArgsTable = createJvmRTInputArgsTableMetaNode("JvmRTInputArgsTable", "JvmRuntime", mib, server);
-        if ( tableJvmRTInputArgsTable != null)  {
-            tableJvmRTInputArgsTable.registerEntryNode(mib,server);
-            mib.registerTableMeta("JvmRTInputArgsTable", tableJvmRTInputArgsTable);
-        }
-
-    }
-
-
-    /**
-     * Factory method for "JvmRTLibraryPathTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmRTLibraryPathTable")
-     * @param groupName Name of the group to which this table belong ("JvmRuntime")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmRTLibraryPathTable" table (JvmRTLibraryPathTableMeta)
-     *
-     **/
-    protected JvmRTLibraryPathTableMeta createJvmRTLibraryPathTableMetaNode(String tableName, String groupName, SnmpMib mib, MBeanServer server)  {
-        return new JvmRTLibraryPathTableMeta(mib, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmRTClassPathTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmRTClassPathTable")
-     * @param groupName Name of the group to which this table belong ("JvmRuntime")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmRTClassPathTable" table (JvmRTClassPathTableMeta)
-     *
-     **/
-    protected JvmRTClassPathTableMeta createJvmRTClassPathTableMetaNode(String tableName, String groupName, SnmpMib mib, MBeanServer server)  {
-        return new JvmRTClassPathTableMeta(mib, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmRTBootClassPathTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmRTBootClassPathTable")
-     * @param groupName Name of the group to which this table belong ("JvmRuntime")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmRTBootClassPathTable" table (JvmRTBootClassPathTableMeta)
-     *
-     **/
-    protected JvmRTBootClassPathTableMeta createJvmRTBootClassPathTableMetaNode(String tableName, String groupName, SnmpMib mib, MBeanServer server)  {
-        return new JvmRTBootClassPathTableMeta(mib, objectserver);
-    }
-
-
-    /**
-     * Factory method for "JvmRTInputArgsTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmRTInputArgsTable")
-     * @param groupName Name of the group to which this table belong ("JvmRuntime")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmRTInputArgsTable" table (JvmRTInputArgsTableMeta)
-     *
-     **/
-    protected JvmRTInputArgsTableMeta createJvmRTInputArgsTableMetaNode(String tableName, String groupName, SnmpMib mib, MBeanServer server)  {
-        return new JvmRTInputArgsTableMeta(mib, objectserver);
-    }
-
-    protected JvmRuntimeMBean node;
-    protected SnmpStandardObjectServer objectserver = null;
-    protected JvmRTLibraryPathTableMeta tableJvmRTLibraryPathTable = null;
-    protected JvmRTClassPathTableMeta tableJvmRTClassPathTable = null;
-    protected JvmRTBootClassPathTableMeta tableJvmRTBootClassPathTable = null;
-    protected JvmRTInputArgsTableMeta tableJvmRTInputArgsTable = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmThreadInstanceEntryMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is used for representing the remote management interface for the "JvmThreadInstanceEntry" MBean.
- */
-public interface JvmThreadInstanceEntryMBean {
-
-    /**
-     * Getter for the "JvmThreadInstName" variable.
-     */
-    public String getJvmThreadInstName() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadInstCpuTimeNs" variable.
-     */
-    public Long getJvmThreadInstCpuTimeNs() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadInstWaitTimeMs" variable.
-     */
-    public Long getJvmThreadInstWaitTimeMs() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadInstWaitCount" variable.
-     */
-    public Long getJvmThreadInstWaitCount() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadInstBlockTimeMs" variable.
-     */
-    public Long getJvmThreadInstBlockTimeMs() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadInstBlockCount" variable.
-     */
-    public Long getJvmThreadInstBlockCount() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadInstState" variable.
-     */
-    public Byte[] getJvmThreadInstState() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadInstLockOwnerPtr" variable.
-     */
-    public String getJvmThreadInstLockOwnerPtr() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadInstId" variable.
-     */
-    public Long getJvmThreadInstId() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadInstLockName" variable.
-     */
-    public String getJvmThreadInstLockName() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadInstIndex" variable.
-     */
-    public Byte[] getJvmThreadInstIndex() throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmThreadInstanceEntryMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,393 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMibNode;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibEntry;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmThreadInstanceEntry" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.3.10.1.
- */
-public class JvmThreadInstanceEntryMeta extends SnmpMibEntry
-     implements Serializable, SnmpStandardMetaServer {
-
-    static final long serialVersionUID = -2015330111801477399L;
-    /**
-     * Constructor for the metadata associated to "JvmThreadInstanceEntry".
-     */
-    public JvmThreadInstanceEntryMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        objectserver = objserv;
-        varList = new int[10];
-        varList[0] = 9;
-        varList[1] = 8;
-        varList[2] = 7;
-        varList[3] = 6;
-        varList[4] = 5;
-        varList[5] = 4;
-        varList[6] = 3;
-        varList[7] = 11;
-        varList[8] = 2;
-        varList[9] = 10;
-        SnmpMibNode.sort(varList);
-    }
-
-    /**
-     * Get the value of a scalar variable
-     */
-    public SnmpValue get(long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 9:
-                return new SnmpString(node.getJvmThreadInstName());
-
-            case 8:
-                return new SnmpCounter64(node.getJvmThreadInstCpuTimeNs());
-
-            case 7:
-                return new SnmpCounter64(node.getJvmThreadInstWaitTimeMs());
-
-            case 6:
-                return new SnmpCounter64(node.getJvmThreadInstWaitCount());
-
-            case 5:
-                return new SnmpCounter64(node.getJvmThreadInstBlockTimeMs());
-
-            case 4:
-                return new SnmpCounter64(node.getJvmThreadInstBlockCount());
-
-            case 3:
-                return new SnmpString(node.getJvmThreadInstState());
-
-            case 11:
-                return new SnmpOid(node.getJvmThreadInstLockOwnerPtr());
-
-            case 2:
-                return new SnmpCounter64(node.getJvmThreadInstId());
-
-            case 10:
-                return new SnmpString(node.getJvmThreadInstLockName());
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Set the value of a scalar variable
-     */
-    public SnmpValue set(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 9:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 8:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 7:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 6:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 5:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 4:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 11:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 10:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-    }
-
-    /**
-     * Check the value of a scalar variable
-     */
-    public void check(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int) var) {
-            case 9:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 8:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 7:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 6:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 5:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 4:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 11:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 10:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            default:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-        }
-    }
-
-    /**
-     * Allow to bind the metadata description to a specific object.
-     */
-    protected void setInstance(JvmThreadInstanceEntryMBean var) {
-        node = var;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.get(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.set(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.check(this,req,depth);
-    }
-
-    /**
-     * Returns true if "arc" identifies a scalar object.
-     */
-    public boolean isVariable(long arc) {
-
-        switch((int)arc) {
-            case 9:
-            case 8:
-            case 7:
-            case 6:
-            case 5:
-            case 4:
-            case 3:
-            case 11:
-            case 2:
-            case 10:
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if "arc" identifies a readable scalar object.
-     */
-    public boolean isReadable(long arc) {
-
-        switch((int)arc) {
-            case 9:
-            case 8:
-            case 7:
-            case 6:
-            case 5:
-            case 4:
-            case 3:
-            case 11:
-            case 2:
-            case 10:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipVariable" method defined in "SnmpMibEntry".
-    // See the "SnmpMibEntry" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean  skipVariable(long var, Object data, int pduVersion) {
-        switch((int)var) {
-            case 8:
-            case 7:
-            case 6:
-            case 5:
-            case 4:
-            case 2:
-                if (pduVersion==SnmpDefinitions.snmpVersionOne) return true;
-                break;
-            case 1:
-                return true;
-            default:
-                break;
-        }
-        return super.skipVariable(var,data,pduVersion);
-    }
-
-    /**
-     * Return the name of the attribute corresponding to the SNMP variable identified by "id".
-     */
-    public String getAttributeName(long id)
-        throws SnmpStatusException {
-        switch((int)id) {
-            case 9:
-                return "JvmThreadInstName";
-
-            case 8:
-                return "JvmThreadInstCpuTimeNs";
-
-            case 7:
-                return "JvmThreadInstWaitTimeMs";
-
-            case 6:
-                return "JvmThreadInstWaitCount";
-
-            case 5:
-                return "JvmThreadInstBlockTimeMs";
-
-            case 4:
-                return "JvmThreadInstBlockCount";
-
-            case 3:
-                return "JvmThreadInstState";
-
-            case 11:
-                return "JvmThreadInstLockOwnerPtr";
-
-            case 2:
-                return "JvmThreadInstId";
-
-            case 10:
-                return "JvmThreadInstLockName";
-
-            case 1:
-                return "JvmThreadInstIndex";
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    protected JvmThreadInstanceEntryMBean node;
-    protected SnmpStandardObjectServer objectserver = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmThreadInstanceTableMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-import java.util.Vector;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpIndex;
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-
-/**
- * The class is used for implementing the "JvmThreadInstanceTable" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.3.10.
- */
-public class JvmThreadInstanceTableMeta extends SnmpMibTable implements Serializable {
-
-    static final long serialVersionUID = 2519514732589115954L;
-    /**
-     * Constructor for the table. Initialize metadata for "JvmThreadInstanceTableMeta".
-     * The reference on the MBean server is updated so the entries created through an SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK.
-     */
-    public JvmThreadInstanceTableMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        super(myMib);
-        objectserver = objserv;
-    }
-
-
-    /**
-     * Factory method for "JvmThreadInstanceEntry" entry metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param snmpEntryName Name of the SNMP Entry object (conceptual row) ("JvmThreadInstanceEntry")
-     * @param tableName Name of the table in which the entries are registered ("JvmThreadInstanceTable")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmThreadInstanceEntry" conceptual row (JvmThreadInstanceEntryMeta)
-     *
-     **/
-    protected JvmThreadInstanceEntryMeta createJvmThreadInstanceEntryMetaNode(String snmpEntryName, String tableName, SnmpMib mib, MBeanServer server)  {
-        return new JvmThreadInstanceEntryMeta(mib, objectserver);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "createNewEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void createNewEntry(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (factory != null)
-            factory.createNewEntry(req, rowOid, depth, this);
-        else
-            throw new SnmpStatusException(
-                SnmpStatusException.snmpRspNoAccess);
-    }
-
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "isRegistrationRequired" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean isRegistrationRequired()  {
-        return false;
-    }
-
-
-
-    public void registerEntryNode(SnmpMib mib, MBeanServer server)  {
-        node = createJvmThreadInstanceEntryMetaNode("JvmThreadInstanceEntry", "JvmThreadInstanceTable", mib, server);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "addEntry" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public synchronized void addEntry(SnmpOid rowOid, ObjectName objname,
-                 Object entry)
-        throws SnmpStatusException {
-        if (! (entry instanceof JvmThreadInstanceEntryMBean) )
-            throw new ClassCastException("Entries for Table \"" +
-                           "JvmThreadInstanceTable" + "\" must implement the \"" +
-                           "JvmThreadInstanceEntryMBean" + "\" interface.");
-        super.addEntry(rowOid, objname, entry);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        JvmThreadInstanceEntryMBean entry = (JvmThreadInstanceEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.get(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmThreadInstanceEntryMBean entry = (JvmThreadInstanceEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.set(req,depth);
-        }
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
-        throws SnmpStatusException {
-        if (req.getSize() == 0) return;
-
-        JvmThreadInstanceEntryMBean entry = (JvmThreadInstanceEntryMBean) getEntry(rowOid);
-        synchronized (this) {
-            node.setInstance(entry);
-            node.check(req,depth);
-        }
-    }
-
-    /**
-     * check that the given "var" identifies a columnar object.
-     */
-    public void validateVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        node.validateVarId(var, data);
-    }
-
-    /**
-     * Returns true if "var" identifies a readable scalar object.
-     */
-    public boolean isReadableEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        return node.isReadable(var);
-    }
-
-    /**
-     * Returns the arc of the next columnar object following "var".
-     */
-    public long getNextVarEntryId( SnmpOid rowOid, long var, Object data )
-        throws SnmpStatusException {
-        long nextvar = node.getNextVarId(var, data);
-        while (!isReadableEntryId(rowOid, nextvar, data))
-            nextvar = node.getNextVarId(nextvar, data);
-        return nextvar;
-    }
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipEntryVariable" method defined in "SnmpMibTable".
-    // See the "SnmpMibTable" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean skipEntryVariable( SnmpOid rowOid, long var, Object data, int pduVersion) {
-        try {
-            JvmThreadInstanceEntryMBean entry = (JvmThreadInstanceEntryMBean) getEntry(rowOid);
-            synchronized (this) {
-                node.setInstance(entry);
-                return node.skipVariable(var, data, pduVersion);
-            }
-        } catch (SnmpStatusException x) {
-            return false;
-        }
-    }
-
-
-    /**
-     * Reference to the entry metadata.
-     */
-    private JvmThreadInstanceEntryMeta node;
-
-    /**
-     * Reference to the object server.
-     */
-    protected SnmpStandardObjectServer objectserver;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmThreadingMBean.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpStatusException;
-
-/**
- * This interface is used for representing the remote management interface for the "JvmThreading" MBean.
- */
-public interface JvmThreadingMBean {
-
-    /**
-     * Getter for the "JvmThreadCpuTimeMonitoring" variable.
-     */
-    public EnumJvmThreadCpuTimeMonitoring getJvmThreadCpuTimeMonitoring() throws SnmpStatusException;
-
-    /**
-     * Setter for the "JvmThreadCpuTimeMonitoring" variable.
-     */
-    public void setJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring x) throws SnmpStatusException;
-
-    /**
-     * Checker for the "JvmThreadCpuTimeMonitoring" variable.
-     */
-    public void checkJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring x) throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadContentionMonitoring" variable.
-     */
-    public EnumJvmThreadContentionMonitoring getJvmThreadContentionMonitoring() throws SnmpStatusException;
-
-    /**
-     * Setter for the "JvmThreadContentionMonitoring" variable.
-     */
-    public void setJvmThreadContentionMonitoring(EnumJvmThreadContentionMonitoring x) throws SnmpStatusException;
-
-    /**
-     * Checker for the "JvmThreadContentionMonitoring" variable.
-     */
-    public void checkJvmThreadContentionMonitoring(EnumJvmThreadContentionMonitoring x) throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadTotalStartedCount" variable.
-     */
-    public Long getJvmThreadTotalStartedCount() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadPeakCount" variable.
-     */
-    public Long getJvmThreadPeakCount() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadDaemonCount" variable.
-     */
-    public Long getJvmThreadDaemonCount() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadCount" variable.
-     */
-    public Long getJvmThreadCount() throws SnmpStatusException;
-
-    /**
-     * Getter for the "JvmThreadPeakCountReset" variable.
-     */
-    public Long getJvmThreadPeakCountReset() throws SnmpStatusException;
-
-    /**
-     * Setter for the "JvmThreadPeakCountReset" variable.
-     */
-    public void setJvmThreadPeakCountReset(Long x) throws SnmpStatusException;
-
-    /**
-     * Checker for the "JvmThreadPeakCountReset" variable.
-     */
-    public void checkJvmThreadPeakCountReset(Long x) throws SnmpStatusException;
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmThreadingMeta.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,455 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.management.snmp.jvmmib;
-
-//
-// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
-//
-
-// java imports
-//
-import java.io.Serializable;
-
-// jmx imports
-//
-import javax.management.MBeanServer;
-import com.sun.jmx.snmp.SnmpCounter;
-import com.sun.jmx.snmp.SnmpCounter64;
-import com.sun.jmx.snmp.SnmpGauge;
-import com.sun.jmx.snmp.SnmpInt;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
-import com.sun.jmx.snmp.SnmpIpAddress;
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpOpaque;
-import com.sun.jmx.snmp.SnmpString;
-import com.sun.jmx.snmp.SnmpStringFixed;
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpNull;
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpVarBind;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-// jdmk imports
-//
-import com.sun.jmx.snmp.agent.SnmpMib;
-import com.sun.jmx.snmp.agent.SnmpMibGroup;
-import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
-import com.sun.jmx.snmp.agent.SnmpStandardMetaServer;
-import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
-import com.sun.jmx.snmp.agent.SnmpMibTable;
-import com.sun.jmx.snmp.EnumRowStatus;
-import com.sun.jmx.snmp.SnmpDefinitions;
-
-/**
- * The class is used for representing SNMP metadata for the "JvmThreading" group.
- * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.3.
- */
-public class JvmThreadingMeta extends SnmpMibGroup
-     implements Serializable, SnmpStandardMetaServer {
-
-    static final long serialVersionUID = 5223833578005322854L;
-    /**
-     * Constructor for the metadata associated to "JvmThreading".
-     */
-    public JvmThreadingMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) {
-        objectserver = objserv;
-        try {
-            registerObject(6);
-            registerObject(5);
-            registerObject(4);
-            registerObject(3);
-            registerObject(2);
-            registerObject(1);
-            registerObject(10);
-            registerObject(7);
-        } catch (IllegalAccessException e) {
-            throw new RuntimeException(e.getMessage());
-        }
-    }
-
-    /**
-     * Get the value of a scalar variable
-     */
-    public SnmpValue get(long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 6:
-                return new SnmpInt(node.getJvmThreadCpuTimeMonitoring());
-
-            case 5:
-                return new SnmpInt(node.getJvmThreadContentionMonitoring());
-
-            case 4:
-                return new SnmpCounter64(node.getJvmThreadTotalStartedCount());
-
-            case 3:
-                return new SnmpCounter(node.getJvmThreadPeakCount());
-
-            case 2:
-                return new SnmpGauge(node.getJvmThreadDaemonCount());
-
-            case 1:
-                return new SnmpGauge(node.getJvmThreadCount());
-
-            case 10: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 7:
-                return new SnmpCounter64(node.getJvmThreadPeakCountReset());
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Set the value of a scalar variable
-     */
-    public SnmpValue set(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int)var) {
-            case 6:
-                if (x instanceof SnmpInt) {
-                    try  {
-                        node.setJvmThreadCpuTimeMonitoring( new EnumJvmThreadCpuTimeMonitoring (((SnmpInt)x).toInteger()));
-                    } catch(IllegalArgumentException e)  {
-                        throw new SnmpStatusException(SnmpStatusException.snmpRspWrongValue);
-                    }
-                    return new SnmpInt(node.getJvmThreadCpuTimeMonitoring());
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-
-            case 5:
-                if (x instanceof SnmpInt) {
-                    try  {
-                        node.setJvmThreadContentionMonitoring( new EnumJvmThreadContentionMonitoring (((SnmpInt)x).toInteger()));
-                    } catch(IllegalArgumentException e)  {
-                        throw new SnmpStatusException(SnmpStatusException.snmpRspWrongValue);
-                    }
-                    return new SnmpInt(node.getJvmThreadContentionMonitoring());
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-
-            case 4:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 10: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 7:
-                if (x instanceof SnmpCounter64) {
-                    node.setJvmThreadPeakCountReset(((SnmpCounter64)x).toLong());
-                    return new SnmpCounter64(node.getJvmThreadPeakCountReset());
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-    }
-
-    /**
-     * Check the value of a scalar variable
-     */
-    public void check(SnmpValue x, long var, Object data)
-        throws SnmpStatusException {
-        switch((int) var) {
-            case 6:
-                if (x instanceof SnmpInt) {
-                    try  {
-                        node.checkJvmThreadCpuTimeMonitoring( new EnumJvmThreadCpuTimeMonitoring (((SnmpInt)x).toInteger()));
-                    } catch(IllegalArgumentException e)  {
-                        throw new SnmpStatusException(SnmpStatusException.snmpRspWrongValue);
-                    }
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-                break;
-
-            case 5:
-                if (x instanceof SnmpInt) {
-                    try  {
-                        node.checkJvmThreadContentionMonitoring( new EnumJvmThreadContentionMonitoring (((SnmpInt)x).toInteger()));
-                    } catch(IllegalArgumentException e)  {
-                        throw new SnmpStatusException(SnmpStatusException.snmpRspWrongValue);
-                    }
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-                break;
-
-            case 4:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 3:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 2:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 1:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-
-            case 10: {
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-                }
-
-            case 7:
-                if (x instanceof SnmpCounter64) {
-                    node.checkJvmThreadPeakCountReset(((SnmpCounter64)x).toLong());
-                } else {
-                    throw new SnmpStatusException(SnmpStatusException.snmpRspWrongType);
-                }
-                break;
-
-            default:
-                throw new SnmpStatusException(SnmpStatusException.snmpRspNotWritable);
-        }
-    }
-
-    /**
-     * Allow to bind the metadata description to a specific object.
-     */
-    protected void setInstance(JvmThreadingMBean var) {
-        node = var;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "get" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void get(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.get(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "set" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void set(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.set(this,req,depth);
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "check" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public void check(SnmpMibSubRequest req, int depth)
-        throws SnmpStatusException {
-        objectserver.check(this,req,depth);
-    }
-
-    /**
-     * Returns true if "arc" identifies a scalar object.
-     */
-    public boolean isVariable(long arc) {
-
-        switch((int)arc) {
-            case 6:
-            case 5:
-            case 4:
-            case 3:
-            case 2:
-            case 1:
-            case 7:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if "arc" identifies a readable scalar object.
-     */
-    public boolean isReadable(long arc) {
-
-        switch((int)arc) {
-            case 6:
-            case 5:
-            case 4:
-            case 3:
-            case 2:
-            case 1:
-            case 7:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-
-    // ------------------------------------------------------------
-    //
-    // Implements the "skipVariable" method defined in "SnmpMibGroup".
-    // See the "SnmpMibGroup" Javadoc API for more details.
-    //
-    // ------------------------------------------------------------
-
-    public boolean  skipVariable(long var, Object data, int pduVersion) {
-        switch((int)var) {
-            case 4:
-            case 7:
-                if (pduVersion==SnmpDefinitions.snmpVersionOne) return true;
-                break;
-            default:
-                break;
-        }
-        return super.skipVariable(var,data,pduVersion);
-    }
-
-    /**
-     * Return the name of the attribute corresponding to the SNMP variable identified by "id".
-     */
-    public String getAttributeName(long id)
-        throws SnmpStatusException {
-        switch((int)id) {
-            case 6:
-                return "JvmThreadCpuTimeMonitoring";
-
-            case 5:
-                return "JvmThreadContentionMonitoring";
-
-            case 4:
-                return "JvmThreadTotalStartedCount";
-
-            case 3:
-                return "JvmThreadPeakCount";
-
-            case 2:
-                return "JvmThreadDaemonCount";
-
-            case 1:
-                return "JvmThreadCount";
-
-            case 10: {
-                throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
-                }
-
-            case 7:
-                return "JvmThreadPeakCountReset";
-
-            default:
-                break;
-        }
-        throw new SnmpStatusException(SnmpStatusException.noSuchObject);
-    }
-
-    /**
-     * Returns true if "arc" identifies a table object.
-     */
-    public boolean isTable(long arc) {
-
-        switch((int)arc) {
-            case 10:
-                return true;
-            default:
-                break;
-        }
-        return false;
-    }
-
-    /**
-     * Returns the table object identified by "arc".
-     */
-    public SnmpMibTable getTable(long arc) {
-
-        switch((int)arc) {
-            case 10:
-                return tableJvmThreadInstanceTable;
-        default:
-            break;
-        }
-        return null;
-    }
-
-    /**
-     * Register the group's SnmpMibTable objects with the meta-data.
-     */
-    public void registerTableNodes(SnmpMib mib, MBeanServer server) {
-        tableJvmThreadInstanceTable = createJvmThreadInstanceTableMetaNode("JvmThreadInstanceTable", "JvmThreading", mib, server);
-        if ( tableJvmThreadInstanceTable != null)  {
-            tableJvmThreadInstanceTable.registerEntryNode(mib,server);
-            mib.registerTableMeta("JvmThreadInstanceTable", tableJvmThreadInstanceTable);
-        }
-
-    }
-
-
-    /**
-     * Factory method for "JvmThreadInstanceTable" table metadata class.
-     *
-     * You can redefine this method if you need to replace the default
-     * generated metadata class with your own customized class.
-     *
-     * @param tableName Name of the table object ("JvmThreadInstanceTable")
-     * @param groupName Name of the group to which this table belong ("JvmThreading")
-     * @param mib The SnmpMib object in which this table is registered
-     * @param server MBeanServer for this table entries (may be null)
-     *
-     * @return An instance of the metadata class generated for the
-     *         "JvmThreadInstanceTable" table (JvmThreadInstanceTableMeta)
-     *
-     **/
-    protected JvmThreadInstanceTableMeta createJvmThreadInstanceTableMetaNode(String tableName, String groupName, SnmpMib mib, MBeanServer server)  {
-        return new JvmThreadInstanceTableMeta(mib, objectserver);
-    }
-
-    protected JvmThreadingMBean node;
-    protected SnmpStandardObjectServer objectserver = null;
-    protected JvmThreadInstanceTableMeta tableJvmThreadInstanceTable = null;
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/package.html	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-  <head>
-<!--
- 
- Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
-
--->
-  </head>
-
-  <body>
-    SNMP Classes for JSR 163 MIB, generated for Tiger SNMP Runtime.
-    <p><b>This API is a Sun Microsystems internal API  and is subject 
-          to change without notice.</b></p>
-  </body>
-</html>
-
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/package.html	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-<html>
-  <head>
-<!--
- 
- Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
-
--->
-  </head>
-
-  <body>
-    This package is the root package for the JSR 163 JVM Management MIB 
-    instrumentation.
-    <ul>
-    <li>{@link sun.management.snmp.jvmmib}: SNMP Classes for JSR 163 MIB,
-        generated for Tiger SNMP Runtime.</li> 
-    <li>{@link sun.management.snmp.jvminstr}: Instrumented Classes for JSR 163 MIB</li> 
-    <li>{@link sun.management.snmp.util}: Generic utility classes used for intsrumenting the MIB</li> 
-    </ul>
-    <p><b>This API is a Sun Microsystems internal API  and is subject 
-          to change without notice.</b></p>
-  </body>
-</html>
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/util/JvmContextFactory.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.util;
-
-import com.sun.jmx.mbeanserver.Util;
-import com.sun.jmx.snmp.agent.SnmpUserDataFactory;
-import com.sun.jmx.snmp.SnmpPdu;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-
-public class JvmContextFactory implements SnmpUserDataFactory {
-
-    /**
-     * Called by the <CODE>SnmpAdaptorServer</CODE> adaptor.
-     * Allocate a contextual object containing some user data. This method
-     * is called once for each incoming SNMP request. The scope
-     * of this object will be the whole request. Since the request can be
-     * handled in several threads, the user should make sure that this
-     * object can be accessed in a thread-safe manner. The SNMP framework
-     * will never access this object directly - it will simply pass
-     * it to the <code>SnmpMibAgent</code> within
-     * <code>SnmpMibRequest</code> objects - from where it can be retrieved
-     * through the {@link com.sun.jmx.snmp.agent.SnmpMibRequest#getUserData() getUserData()} accessor.
-     * <code>null</code> is considered to be a valid return value.
-     *
-     * This method is called just after the SnmpPduPacket has been
-     * decoded.
-     *
-     * @param requestPdu The SnmpPduPacket received from the SNMP manager.
-     *        <b>This parameter is owned by the SNMP framework and must be
-     *        considered as transient.</b> If you wish to keep some of its
-     *        content after this method returns (by storing it in the
-     *        returned object for instance) you should clone that
-     *        information.
-     *
-     * @return A newly allocated user-data contextual object, or
-     *         <code>null</code>
-     * @exception SnmpStatusException If an SnmpStatusException is thrown,
-     *            the request will be aborted.
-     *
-     * @since Java DMK 5.0
-     **/
-    public Object allocateUserData(SnmpPdu requestPdu)
-        throws SnmpStatusException {
-        return Collections.synchronizedMap(new HashMap<Object, Object>());
-    }
-
-    /**
-     * Called by the <CODE>SnmpAdaptorServer</CODE> adaptor.
-     * Release a previously allocated contextual object containing user-data.
-     * This method is called just before the responsePdu is sent back to the
-     * manager. It gives the user a chance to alter the responsePdu packet
-     * before it is encoded, and to free any resources that might have
-     * been allocated when creating the contextual object.
-     *
-     * @param userData The contextual object being released.
-     * @param responsePdu The SnmpPduPacket that will be sent back to the
-     *        SNMP manager.
-     *        <b>This parameter is owned by the SNMP framework and must be
-     *        considered as transient.</b> If you wish to keep some of its
-     *        content after this method returns you should clone that
-     *        information.
-     *
-     * @exception SnmpStatusException If an SnmpStatusException is thrown,
-     *            the responsePdu is dropped and nothing is returned to
-     *            to the manager.
-     *
-     * @since Java DMK 5.0
-     **/
-    public void releaseUserData(Object userData, SnmpPdu responsePdu)
-        throws SnmpStatusException {
-        ((Map<?, ?>)userData).clear();
-    }
-
-
-    public static Map<Object, Object> getUserData() {
-        final Object userData =
-            com.sun.jmx.snmp.ThreadContext.get("SnmpUserData");
-
-        if (userData instanceof Map<?, ?>) return Util.cast(userData);
-        else return null;
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/util/MibLogger.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.util;
-
-import java.util.logging.Logger;
-import java.util.logging.Level;
-
-public class MibLogger {
-
-    final Logger logger;
-    final String className;
-
-    static String getClassName(Class<?> clazz) {
-        if (clazz == null) return null;
-        if (clazz.isArray())
-            return getClassName(clazz.getComponentType()) + "[]";
-        final String fullname = clazz.getName();
-        final int lastpoint   = fullname.lastIndexOf('.');
-        final int len         = fullname.length();
-        if ((lastpoint < 0) || (lastpoint >= len))
-            return fullname;
-        else return fullname.substring(lastpoint+1,len);
-    }
-
-    static String getLoggerName(Class<?> clazz) {
-        if (clazz == null) return "sun.management.snmp.jvminstr";
-        Package p = clazz.getPackage();
-        if (p == null) return "sun.management.snmp.jvminstr";
-        final String pname = p.getName();
-        if (pname == null) return "sun.management.snmp.jvminstr";
-        else return pname;
-    }
-
-    public MibLogger(Class<?> clazz) {
-        this(getLoggerName(clazz),getClassName(clazz));
-    }
-
-    public MibLogger(Class<?> clazz, String postfix) {
-        this(getLoggerName(clazz)+((postfix==null)?"":"."+postfix),
-             getClassName(clazz));
-    }
-
-    public MibLogger(String className) {
-        this("sun.management.snmp.jvminstr",className);
-    }
-
-    public MibLogger(String loggerName, String className) {
-        Logger l = null;
-        try {
-            l = Logger.getLogger(loggerName);
-        } catch (Exception x) {
-            // OK. Should not happen
-        }
-        logger = l;
-        this.className=className;
-    }
-
-    protected Logger getLogger() {
-        return logger;
-    }
-
-    public boolean isTraceOn() {
-        final Logger l = getLogger();
-        if (l==null) return false;
-        return l.isLoggable(Level.FINE);
-    }
-
-    public boolean isDebugOn() {
-        final Logger l = getLogger();
-        if (l==null) return false;
-        return l.isLoggable(Level.FINEST);
-    }
-
-    public boolean isInfoOn() {
-        final Logger l = getLogger();
-        if (l==null) return false;
-        return l.isLoggable(Level.INFO);
-    }
-
-    public boolean isConfigOn() {
-        final Logger l = getLogger();
-        if (l==null) return false;
-        return l.isLoggable(Level.CONFIG);
-    }
-
-    public void config(String func, String msg) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.CONFIG,className,
-                        func,msg);
-    }
-
-    public void config(String func, Throwable t) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.CONFIG,className,
-                        func,t.toString(),t);
-    }
-
-    public void config(String func, String msg, Throwable t) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.CONFIG,className,
-                        func,msg,t);
-    }
-
-    public void error(String func, String msg) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.SEVERE,className,
-                        func,msg);
-    }
-
-    public void info(String func, String msg) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.INFO,className,
-                        func,msg);
-    }
-
-    public void info(String func, Throwable t) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.INFO,className,
-                        func,t.toString(),t);
-    }
-
-    public void info(String func, String msg, Throwable t) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.INFO,className,
-                        func,msg,t);
-    }
-
-    public void warning(String func, String msg) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.WARNING,className,
-                        func,msg);
-    }
-
-    public void warning(String func, Throwable t) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.WARNING,className,
-                        func,t.toString(),t);
-    }
-
-    public void warning(String func, String msg, Throwable t) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.WARNING,className,
-                        func,msg,t);
-    }
-
-    public void trace(String func, String msg) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.FINE,className,
-                        func,msg);
-    }
-
-    public void trace(String func, Throwable t) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.FINE,className,
-                        func,t.toString(),t);
-    }
-
-    public void trace(String func, String msg, Throwable t) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.FINE,className,
-                        func,msg,t);
-    }
-
-    public void debug(String func, String msg) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.FINEST,className,
-                        func,msg);
-    }
-
-    public void debug(String func, Throwable t) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.FINEST,className,
-                        func,t.toString(),t);
-    }
-
-    public void debug(String func, String msg, Throwable t) {
-        final Logger l = getLogger();
-        if (l!=null) l.logp(Level.FINEST,className,
-                        func,msg,t);
-    }
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/util/SnmpCachedData.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.util;
-
-import com.sun.jmx.snmp.SnmpOid;
-
-import java.io.Serializable;
-
-import java.util.Comparator;
-import java.util.Arrays;
-import java.util.TreeMap;
-import java.util.List;
-import java.util.Iterator;
-
-import java.lang.ref.WeakReference;
-
-/**
- * This class is used to cache table data.
- **/
-public class SnmpCachedData implements SnmpTableHandler {
-
-    /**
-     * Compares two SnmpOid.
-     **/
-    public static final Comparator<SnmpOid> oidComparator =
-        new Comparator<SnmpOid>() {
-            public int compare(SnmpOid o1, SnmpOid o2) {
-                return o1.compareTo(o2);
-            }
-            public boolean equals(Object o1, Object o2) {
-                if (o1 == o2) return true;
-                else return o1.equals(o2);
-            }
-        };
-
-    /**
-     * Constructs a new instance of SnmpCachedData. Instances are
-     * immutable.
-     * @param lastUpdated Time stamp as returned by
-     *        {@link System#currentTimeMillis System.currentTimeMillis()}
-     * @param indexes The table entry indexes, sorted in ascending order.
-     * @param datas   The table datas, sorted according to the
-     *                order in <code>indexes</code>: <code>datas[i]</code>
-     *                is the data that corresponds to
-     *                <code>indexes[i]</code>
-     **/
-    public SnmpCachedData(long lastUpdated, SnmpOid indexes[],
-                          Object  datas[]) {
-        this.lastUpdated = lastUpdated;
-        this.indexes     = indexes;
-        this.datas       = datas;
-    }
-
-    /**
-     * Constructs a new instance of SnmpCachedData. Instances are
-     * immutable.
-     * @param lastUpdated Time stamp as returned by
-     *        {@link System#currentTimeMillis System.currentTimeMillis()}
-     * @param indexMap The table indexed table data, sorted in ascending
-     *                 order by {@link #oidComparator}. The keys must be
-     *                 instances of {@link SnmpOid}.
-     **/
-    public SnmpCachedData(long lastUpdated, TreeMap<SnmpOid, Object> indexMap) {
-        this(lastUpdated, indexMap, true);
-    }
-    /**
-     * Constructs a new instance of SnmpCachedData. Instances are
-     * immutable.
-     * @param lastUpdated Time stamp as returned by
-     *        {@link System#currentTimeMillis System.currentTimeMillis()}
-     * @param indexMap The table indexed table data, sorted in ascending
-     *                 order by {@link #oidComparator}. The keys must be
-     *                 instances of {@link SnmpOid}.
-     **/
-    public SnmpCachedData(long lastUpdated, TreeMap<SnmpOid, Object> indexMap,
-                          boolean b) {
-
-        final int size = indexMap.size();
-        this.lastUpdated = lastUpdated;
-        this.indexes     = new SnmpOid[size];
-        this.datas       = new Object[size];
-
-        if(b) {
-            indexMap.keySet().toArray(this.indexes);
-            indexMap.values().toArray(this.datas);
-        } else
-            indexMap.values().toArray(this.datas);
-    }
-
-    /**
-     * Time stamp as returned by
-     * {@link System#currentTimeMillis System.currentTimeMillis()}
-     **/
-    public final long    lastUpdated;
-
-    /**
-     * The table entry indexes, sorted in ascending order.
-     **/
-    public final SnmpOid indexes[];
-
-    /**
-     * The table datas, sorted according to the
-     * order in <code>indexes</code>: <code>datas[i]</code>
-     * is the data that corresponds to <code>indexes[i]</code>
-     **/
-    public final Object  datas[];
-
-    /**
-     * The position of the given <var>index</var>, as returned by
-     * <code>java.util.Arrays.binarySearch()</code>
-     **/
-    public final int find(SnmpOid index) {
-        return Arrays.binarySearch(indexes,index,oidComparator);
-    }
-
-    // SnmpTableHandler.getData()
-    public  Object getData(SnmpOid index) {
-        final int pos = find(index);
-        if ((pos < 0)||(pos >= datas.length)) return null;
-        return datas[pos];
-    }
-
-    // SnmpTableHandler.getNext()
-    public  SnmpOid getNext(SnmpOid index) {
-        if (index == null) {
-            if (indexes.length>0) return indexes[0];
-            else return null;
-        }
-        final int pos = find(index);
-        if (pos > -1) {
-            if (pos < (indexes.length -1) ) return indexes[pos+1];
-            else return null;
-        }
-        final int insertion = -pos -1;
-        if ((insertion > -1) && (insertion < indexes.length))
-            return indexes[insertion];
-        else return null;
-    }
-
-    // SnmpTableHandler.contains()
-    public  boolean contains(SnmpOid index) {
-        final int pos = find(index);
-        return ((pos > -1)&&(pos < indexes.length));
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/util/SnmpListTableCache.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.util;
-
-import com.sun.jmx.snmp.SnmpOid;
-
-import java.io.Serializable;
-
-import java.util.Comparator;
-import java.util.Arrays;
-import java.util.TreeMap;
-import java.util.List;
-import java.util.Iterator;
-
-import java.lang.ref.WeakReference;
-
-/**
- * This abstract class implements a weak cache for a table whose data
- * is obtained from a {@link  List}.
- *
- * <p><b>NOTE: This class is not synchronized, subclasses must implement
- *          the appropriate synchronization whwn needed.</b></p>
- **/
-@SuppressWarnings("serial") // JDK implementation class
-public abstract class SnmpListTableCache extends SnmpTableCache {
-
-
-    /**
-     * The index of the entry corresponding to the given <var>item</var>.
-     * <br>This method is called by {@link #updateCachedDatas(Object,List)}.
-     * The given <var>item</var> is expected to be always associated with
-     * the same index.
-     * @param context The context passed to
-     *        {@link #updateCachedDatas(Object,List)}.
-     * @param rawDatas Raw table datas passed to
-     *        {@link #updateCachedDatas(Object,List)}.
-     * @param rank Rank of the given <var>item</var> in the
-     *        <var>rawDatas</var> list iterator.
-     * @param item The raw data object for which an index must be determined.
-     **/
-    protected abstract SnmpOid getIndex(Object context, List<?> rawDatas,
-                                        int rank, Object item);
-
-    /**
-     * The data for the entry corresponding to the given <var>item</var>.
-     * <br>This method is called by {@link #updateCachedDatas(Object,List)}.
-     * @param context The context passed to
-     *        {@link #updateCachedDatas(Object,List)}.
-     * @param rawDatas Raw table datas passed to
-     *        {@link #updateCachedDatas(Object,List)}.
-     * @param rank Rank of the given <var>item</var> in the
-     *        <var>rawDatas</var> list iterator.
-     * @param item The raw data object from which the entry data must be
-     *        extracted.
-     * @return By default <var>item</var> is returned.
-     **/
-    protected Object getData(Object context, List<?> rawDatas,
-                             int rank, Object item) {
-        return item;
-    }
-
-    /**
-     * Recompute cached data.
-     * @param context A context object, valid during the duration of
-     *        of the call to this method, and that will be passed to
-     *        {@link #getIndex} and {@link #getData}. <br>
-     *        This method is intended to be called by
-     *        {@link #updateCachedDatas(Object)}. It is assumed that
-     *        the context is be allocated by  before this method is called,
-     *        and released just after this method has returned.<br>
-     *        This class does not use the context object: it is a simple
-     *        hook for subclassed.
-     * @param rawDatas The table datas from which the cached data will be
-     *        computed.
-     * @return the computed cached data.
-     **/
-    protected SnmpCachedData updateCachedDatas(Object context, List<?> rawDatas) {
-        final int size = ((rawDatas == null)?0:rawDatas.size());
-        if (size == 0) return  null;
-
-        final long time = System.currentTimeMillis();
-        final Iterator<?> it  = rawDatas.iterator();
-        final TreeMap<SnmpOid, Object> map =
-                new TreeMap<>(SnmpCachedData.oidComparator);
-        for (int rank=0; it.hasNext() ; rank++) {
-            final Object  item  = it.next();
-            final SnmpOid index = getIndex(context, rawDatas, rank, item);
-            final Object  data  = getData(context, rawDatas, rank, item);
-            if (index == null) continue;
-            map.put(index,data);
-        }
-
-        return new SnmpCachedData(time,map);
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/util/SnmpLoadedClassData.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.util;
-
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpStatusException;
-
-import java.io.Serializable;
-
-import java.util.Comparator;
-import java.util.Arrays;
-import java.util.TreeMap;
-import java.util.List;
-import java.util.Iterator;
-
-import java.lang.ref.WeakReference;
-
-/**
- * This class is used to cache LoadedClass table data.
- * WARNING : MUST IMPLEMENT THE SnmpTableHandler directly. Some changes in daniel classes.
- **/
-public final class SnmpLoadedClassData extends SnmpCachedData {
-
-    /**
-     * Constructs a new instance of SnmpLoadedClassData. Instances are
-     * immutable.
-     * @param lastUpdated Time stamp as returned by
-     *        {@link System#currentTimeMillis System.currentTimeMillis()}
-     * @param indexMap The table indexed table data, sorted in ascending
-     *                 order by {@link #oidComparator}. The keys must be
-     *                 instances of {@link SnmpOid}.
-     **/
-    public SnmpLoadedClassData(long lastUpdated, TreeMap<SnmpOid, Object> indexMap) {
-        super(lastUpdated, indexMap, false);
-    }
-
-
-    // SnmpTableHandler.getData()
-    public final Object getData(SnmpOid index) {
-        int pos = 0;
-
-        try {
-            pos = (int) index.getOidArc(0);
-        }catch(SnmpStatusException e) {
-            return null;
-        }
-
-        if (pos >= datas.length) return null;
-        return datas[pos];
-    }
-
-    // SnmpTableHandler.getNext()
-    public final SnmpOid getNext(SnmpOid index) {
-        int pos = 0;
-        if (index == null) {
-            if( (datas!= null) && (datas.length >= 1) )
-                return new SnmpOid(0);
-        }
-        try {
-            pos = (int) index.getOidArc(0);
-        }catch(SnmpStatusException e) {
-            return null;
-        }
-
-        if(pos < (datas.length - 1))
-            return new SnmpOid(pos+1);
-        else
-            return null;
-    }
-
-    // SnmpTableHandler.contains()
-    public final boolean contains(SnmpOid index) {
-        int pos = 0;
-
-        try {
-            pos = (int) index.getOidArc(0);
-        }catch(SnmpStatusException e) {
-            return false;
-        }
-
-        return (pos < datas.length);
-    }
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/util/SnmpNamedListTableCache.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,267 +0,0 @@
-/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.util;
-
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.mbeanserver.Util;
-
-import java.io.Serializable;
-
-import java.util.Comparator;
-import java.util.Arrays;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.List;
-import java.util.Iterator;
-
-import java.lang.ref.WeakReference;
-
-
-/**
- * This abstract class implements a weak cache that holds table data, for
- * a table whose data is obtained from a list  where a name can be obtained
- * for each item in the list.
- * <p>This object maintains a map between an entry name and its associated
- * SnmpOid index, so that a given entry is always associated to the same
- * index.</p>
- * <p><b>NOTE: This class is not synchronized, subclasses must implement
- *          the appropriate synchronization whwn needed.</b></p>
- **/
-@SuppressWarnings("serial") // JDK implementation class
-public abstract class SnmpNamedListTableCache extends SnmpListTableCache {
-
-    /**
-     * This map associate an entry name with the SnmpOid index that's
-     * been allocated for it.
-     **/
-    protected TreeMap<String, SnmpOid> names = new TreeMap<>();
-
-    /**
-     * The last allocate index.
-     **/
-    protected long last = 0;
-
-    /**
-     * true if the index has wrapped.
-     **/
-    boolean   wrapped = false;
-
-    /**
-     * Returns the key to use as name for the given <var>item</var>.
-     * <br>This method is called by {@link #getIndex(Object,List,int,Object)}.
-     * The given <var>item</var> is expected to be always associated with
-     * the same name.
-     * @param context The context passed to
-     *        {@link #updateCachedDatas(Object,List)}.
-     * @param rawDatas Raw table datas passed to
-     *        {@link #updateCachedDatas(Object,List)}.
-     * @param rank Rank of the given <var>item</var> in the
-     *        <var>rawDatas</var> list iterator.
-     * @param item The raw data object for which a key name must be determined.
-     **/
-    protected abstract String getKey(Object context, List<?> rawDatas,
-                                     int rank, Object item);
-
-    /**
-     * Find a new index for the entry corresponding to the
-     * given <var>item</var>.
-     * <br>This method is called by {@link #getIndex(Object,List,int,Object)}
-     * when a new index needs to be allocated for an <var>item</var>. The
-     * index returned must not be already in used.
-     * @param context The context passed to
-     *        {@link #updateCachedDatas(Object,List)}.
-     * @param rawDatas Raw table datas passed to
-     *        {@link #updateCachedDatas(Object,List)}.
-     * @param rank Rank of the given <var>item</var> in the
-     *        <var>rawDatas</var> list iterator.
-     * @param item The raw data object for which an index must be determined.
-     **/
-    protected SnmpOid makeIndex(Object context, List<?> rawDatas,
-                                int rank, Object item) {
-
-        // check we are in the limits of an unsigned32.
-        if (++last > 0x00000000FFFFFFFFL) {
-            // we just wrapped.
-            log.debug("makeIndex", "Index wrapping...");
-            last = 0;
-            wrapped=true;
-        }
-
-        // If we never wrapped, we can safely return last as new index.
-        if (!wrapped) return new SnmpOid(last);
-
-        // We wrapped. We must look for an unused index.
-        for (int i=1;i < 0x00000000FFFFFFFFL;i++) {
-            if (++last >  0x00000000FFFFFFFFL) last = 1;
-            final SnmpOid testOid = new SnmpOid(last);
-
-            // Was this index already in use?
-            if (names == null) return testOid;
-            if (names.containsValue(testOid)) continue;
-
-            // Have we just used it in a previous iteration?
-            if (context == null) return testOid;
-            if (((Map)context).containsValue(testOid)) continue;
-
-            // Ok, not in use.
-            return testOid;
-        }
-        // all indexes are in use! we're stuck.
-        // // throw new IndexOutOfBoundsException("No index available.");
-        // better to return null and log an error.
-        return null;
-    }
-
-    /**
-     * Call {@link #getKey(Object,List,int,Object)} in order to get
-     * the item name. Then check whether an index was already allocated
-     * for the entry by that name. If yes return it. Otherwise, call
-     * {@link #makeIndex(Object,List,int,Object)} to compute a new
-     * index for that entry.
-     * Finally store the association between
-     * the name and index in the context TreeMap.
-     * @param context The context passed to
-     *        {@link #updateCachedDatas(Object,List)}.
-     *        It is expected to
-     *        be an instance of  {@link TreeMap}.
-     * @param rawDatas Raw table datas passed to
-     *        {@link #updateCachedDatas(Object,List)}.
-     * @param rank Rank of the given <var>item</var> in the
-     *        <var>rawDatas</var> list iterator.
-     * @param item The raw data object for which an index must be determined.
-     **/
-    protected SnmpOid getIndex(Object context, List<?> rawDatas,
-                               int rank, Object item) {
-        final String key   = getKey(context,rawDatas,rank,item);
-        final Object index = (names==null||key==null)?null:names.get(key);
-        final SnmpOid result =
-            ((index != null)?((SnmpOid)index):makeIndex(context,rawDatas,
-                                                      rank,item));
-        if ((context != null) && (key != null) && (result != null)) {
-            Map<Object, Object> map = Util.cast(context);
-            map.put(key,result);
-        }
-        log.debug("getIndex","key="+key+", index="+result);
-        return result;
-    }
-
-    /**
-     * Allocate a new {@link TreeMap} to serve as context, then
-     * call {@link SnmpListTableCache#updateCachedDatas(Object,List)}, and
-     * finally replace the {@link #names} TreeMap by the new allocated
-     * TreeMap.
-     * @param rawDatas The table datas from which the cached data will be
-     *        computed.
-     **/
-    protected SnmpCachedData updateCachedDatas(Object context, List<?> rawDatas) {
-        TreeMap<String,SnmpOid> ctxt = new TreeMap<>();
-        final SnmpCachedData result =
-            super.updateCachedDatas(context,rawDatas);
-        names = ctxt;
-        return result;
-    }
-
-
-    /**
-     * Load a list of raw data from which to build the cached data.
-     * This method is called when nothing is found in the request
-     * contextual cache.
-     * @param userData The request contextual cache allocated by
-     *        the {@link JvmContextFactory}.
-     *
-     **/
-    protected abstract List<?>  loadRawDatas(Map<Object,Object> userData);
-
-    /**
-     *The name under which the raw data is to be found/put in
-     *        the request contextual cache.
-     **/
-    protected abstract String getRawDatasKey();
-
-    /**
-     * Get a list of raw data from which to build the cached data.
-     * Obtains a list of raw data by first looking it up in the
-     * request contextual cache <var>userData</var> under the given
-     * <var>key</var>. If nothing is found in the cache, calls
-     * {@link #loadRawDatas(Map)} to obtain a new rawData list,
-     * and cache the result in <var>userData</var> under <var>key</var>.
-     * @param userData The request contextual cache allocated by
-     *        the {@link JvmContextFactory}.
-     * @param key The name under which the raw data is to be found/put in
-     *        the request contextual cache.
-     *
-     **/
-    protected List<?> getRawDatas(Map<Object, Object> userData, String key) {
-        List<?> rawDatas = null;
-
-        // Look for memory manager list in request contextual cache.
-        if (userData != null)
-            rawDatas =  (List<?>)userData.get(key);
-
-        if (rawDatas == null) {
-            // No list in contextual cache, get it from API
-            rawDatas = loadRawDatas(userData);
-
-
-            // Put list in cache...
-            if (rawDatas != null && userData != null)
-                userData.put(key, rawDatas);
-        }
-
-        return rawDatas;
-    }
-
-    /**
-     * Update cahed datas.
-     * Obtains a {@link List} of raw datas by calling
-     * {@link #getRawDatas(Map,String) getRawDatas((Map)context,getRawDatasKey())}.<br>
-     * Then allocate a new {@link TreeMap} to serve as temporary map between
-     * names and indexes, and call {@link #updateCachedDatas(Object,List)}
-     * with that temporary map as context.<br>
-     * Finally replaces the {@link #names} TreeMap by the temporary
-     * TreeMap.
-     * @param context The request contextual cache allocated by the
-     *        {@link JvmContextFactory}.
-     **/
-    protected SnmpCachedData updateCachedDatas(Object context) {
-
-        final Map<Object, Object> userData =
-            (context instanceof Map)?Util.<Map<Object, Object>>cast(context):null;
-
-        // Look for memory manager list in request contextual cache.
-        final List<?> rawDatas = getRawDatas(userData,getRawDatasKey());
-
-        log.debug("updateCachedDatas","rawDatas.size()=" +
-              ((rawDatas==null)?"<no data>":""+rawDatas.size()));
-
-        TreeMap<String,SnmpOid> ctxt = new TreeMap<>();
-        final SnmpCachedData result =
-            super.updateCachedDatas(ctxt,rawDatas);
-        names = ctxt;
-        return result;
-    }
-
-    static final MibLogger log = new MibLogger(SnmpNamedListTableCache.class);
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/util/SnmpTableCache.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.util;
-
-import com.sun.jmx.snmp.SnmpOid;
-
-import java.io.Serializable;
-
-import java.util.Comparator;
-import java.util.Arrays;
-import java.util.TreeMap;
-import java.util.List;
-import java.util.Iterator;
-
-import java.lang.ref.WeakReference;
-
-/**
- * This abstract class implements a weak cache that holds table data.
- * <p>The table data is stored in an instance of
- * {@link SnmpCachedData}, which is kept in a {@link WeakReference}.
- * If the WeakReference is null or empty, the cached data is recomputed.</p>
- *
- * <p><b>NOTE: This class is not synchronized, subclasses must implement
- *          the appropriate synchronization when needed.</b></p>
- **/
-@SuppressWarnings("serial") // JDK implementation class
-public abstract class SnmpTableCache implements Serializable {
-
-    /**
-     * Interval of time in ms during which the cached table data
-     * is considered valid.
-     **/
-    protected long validity;
-
-    /**
-     * A weak refernce holding cached table data.
-     **/
-    protected transient WeakReference<SnmpCachedData> datas;
-
-    /**
-     * true if the given cached table data is obsolete.
-     **/
-    protected boolean isObsolete(SnmpCachedData cached) {
-        if (cached   == null) return true;
-        if (validity < 0)     return false;
-        return ((System.currentTimeMillis() - cached.lastUpdated) > validity);
-    }
-
-    /**
-     * Returns the cached table data.
-     * Returns null if the cached data is obsolete, or if there is no
-     * cached data, or if the cached data was garbage collected.
-     * @return a still valid cached data or null.
-     **/
-    protected SnmpCachedData getCachedDatas() {
-        if (datas == null) return null;
-        final SnmpCachedData cached = datas.get();
-        if ((cached == null) || isObsolete(cached)) return null;
-        return cached;
-    }
-
-    /**
-     * Returns the cached table data, if it is still valid,
-     * or recompute it if it is obsolete.
-     * <p>
-     * When cache data is recomputed, store it in the weak reference,
-     * unless {@link #validity} is 0: then the data will not be stored
-     * at all.<br>
-     * This method calls {@link #isObsolete(SnmpCachedData)} to determine
-     * whether the cached data is obsolete, and {
-     * {@link #updateCachedDatas(Object)} to recompute it.
-     * </p>
-     * @param context A context object.
-     * @return the valid cached data, or the recomputed table data.
-     **/
-    protected synchronized SnmpCachedData getTableDatas(Object context) {
-        final SnmpCachedData cached   = getCachedDatas();
-        if (cached != null) return cached;
-        final SnmpCachedData computedDatas = updateCachedDatas(context);
-        if (validity != 0) datas = new WeakReference<>(computedDatas);
-        return computedDatas;
-    }
-
-    /**
-     * Recompute cached data.
-     * @param context A context object, as passed to
-     *        {@link #getTableDatas(Object)}
-     **/
-    protected abstract SnmpCachedData updateCachedDatas(Object context);
-
-    /**
-     * Return a table handler that holds the table data.
-     * This method should return the cached table data if it is still
-     * valid, recompute it and cache the new value if it's not.
-     **/
-    public abstract SnmpTableHandler getTableHandler();
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/util/SnmpTableHandler.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management.snmp.util;
-
-import com.sun.jmx.snmp.SnmpOid;
-
-/**
- * Defines the interface implemented by an object that holds
- * table data.
- **/
-public interface SnmpTableHandler {
-
-    /**
-     * Returns the data associated with the given index.
-     * If the given index is not found, null is returned.
-     * Note that returning null does not necessarily means that
-     * the index was not found.
-     **/
-    public Object  getData(SnmpOid index);
-
-    /**
-     * Returns the index that immediately follows the given
-     * <var>index</var>. The returned index is strictly greater
-     * than the given <var>index</var>, and is contained in the table.
-     * <br>If the given <var>index</var> is null, returns the first
-     * index in the table.
-     * <br>If there are no index after the given <var>index</var>,
-     * returns null.
-     **/
-    public SnmpOid getNext(SnmpOid index);
-
-    /**
-     * Returns true if the given <var>index</var> is present.
-     **/
-    public boolean contains(SnmpOid index);
-
-}
--- a/jdk/src/jdk.snmp/share/classes/sun/management/snmp/util/package.html	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-  <head>
-<!--
- 
- Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
-
--->
-  </head>
-
-  <body>
-    Generic utility classes used for intsrumenting the MIB.
-    <p><b>This API is a Sun Microsystems internal API  and is subject 
-          to change without notice.</b></p>
-  </body>
-</html>
--- a/jdk/src/linux/doc/man/extcheck.1	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-'\" t
-.\"  Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-.\"
-.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-.\"
-.\" This code is free software; you can redistribute it and/or modify it
-.\" under the terms of the GNU General Public License version 2 only, as
-.\" published by the Free Software Foundation.
-.\"
-.\" This code is distributed in the hope that it will be useful, but WITHOUT
-.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-.\" version 2 for more details (a copy is included in the LICENSE file that
-.\" accompanied this code).
-.\"
-.\" You should have received a copy of the GNU General Public License version
-.\" 2 along with this work; if not, write to the Free Software Foundation,
-.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-.\"
-.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-.\" or visit www.oracle.com if you need additional information or have any
-.\" questions.
-.\"
-.\"     Arch: generic
-.\"     Software: JDK 8
-.\"     Date: 21 November 2013
-.\"     SectDesc: Basic Tools
-.\"     Title: extcheck.1
-.\"
-.if n .pl 99999
-.TH extcheck 1 "21 November 2013" "JDK 8" "Basic Tools"
-.\" -----------------------------------------------------------------
-.\" * Define some portability stuff
-.\" -----------------------------------------------------------------
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" http://bugs.debian.org/507673
-.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.ie \n(.g .ds Aq \(aq
-.el       .ds Aq '
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
-
-.SH NAME    
-extcheck \- Detects version conflicts between a target Java Archive (JAR) file and currently installed extension JAR files\&.
-.SH SYNOPSIS    
-.sp     
-.nf     
-
-\fBextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
-.fi     
-.sp     
-.TP     
-\fIoptions\fR
-The command-line options\&. See Options\&.
-.TP     
-\fItargetfile\&.jar\fR
-The target JAR file against which the currently installed extension JAR files are compared to detect version conflicts\&.
-.SH DESCRIPTION    
-The \f3extcheck\fR command checks a specified JAR file for title and version conflicts with any extensions installed in the Java SE SDK\&. Before installing an extension, you can use this utility to see whether the same or a more recent version of the extension is already installed\&.
-.PP
-The \f3extcheck\fR command compares the Specification-title and Specification-version headers in the manifest of the \f3targetfile\&.jar\fR file against the corresponding headers in all JAR files currently installed in the extension directory\&. By default, the extension directory is \f3jre/lib/ext\fR on Oracle Solaris and \f3\ejre\elib\eext\fR on Windows\&. The \f3extcheck\fR command compares version numbers in the same way as the \f3java\&.lang\&.Package\&.isCompatibleWith\fR method\&.
-.PP
-If no conflict is detected, then the return code is 0\&.
-.PP
-If the manifest of any JAR file in the extensions directory has the same \f3Specification-title\fR and the same or a newer \f3Specification-version\fR number, then a non-zero error code is returned\&. A non-zero error code is also returned when \f3targetfile\&.jar\fR does not have the \f3Specification-title\fR or \f3Specification-version\fR attributes in its manifest file\&.
-.SH OPTIONS    
-.TP
--verbose
-.br
-Lists JAR files in the extension directory as they are checked\&. Additionally, manifest attributes of the target JAR file and any conflicting JAR files are also reported\&.
-.TP
--J\fIoption\fR
-.br
-Passes \fIoption\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
-.SH SEE\ ALSO    
-.TP 0.2i    
-\(bu
-jar(1)
-.RE
-.br
-'pl 8.5i
-'bp
--- a/jdk/src/linux/doc/man/ja/extcheck.1	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-'\" t
-.\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-.\" Title: extcheck
-.\" Language: English
-.\" Date: 2013ǯ11·î21Æü
-.\" SectDesc: ´ðËܥġ¼¥ë
-.\" Software: JDK 8
-.\" Arch: ÈÆÍÑ
-.\"
-.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-.\"
-.\" This code is free software; you can redistribute it and/or modify it
-.\" under the terms of the GNU General Public License version 2 only, as
-.\" published by the Free Software Foundation.
-.\"
-.\" This code is distributed in the hope that it will be useful, but WITHOUT
-.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-.\" version 2 for more details (a copy is included in the LICENSE file that
-.\" accompanied this code).
-.\"
-.\" You should have received a copy of the GNU General Public License version
-.\" 2 along with this work; if not, write to the Free Software Foundation,
-.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-.\"
-.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-.\" or visit www.oracle.com if you need additional information or have any
-.\" questions.
-.\"
-.pl 99999
-.TH "extcheck" "1" "2013ǯ11·î21Æü" "JDK 8" "´ðËܥġ¼¥ë"
-.\" -----------------------------------------------------------------
-.\" * Define some portability stuff
-.\" -----------------------------------------------------------------
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" http://bugs.debian.org/507673
-.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.ie \n(.g .ds Aq \(aq
-.el       .ds Aq '
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
-.SH "NAME"
-extcheck \- ¥¿¡¼¥²¥Ã¥È¤ÎJava¥¢¡¼¥«¥¤¥Ö(JAR)¥Õ¥¡¥¤¥ë¤È¸½ºß¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë³ÈÄ¥µ¡Ç½¤ÎJAR¥Õ¥¡¥¤¥ë´Ö¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¶¥¹ç¤ò¸¡½Ð¤·¤Þ¤¹¡£
-.SH "³µÍ×"
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-\fIextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
-.fi
-.if n \{\
-.RE
-.\}
-.PP
-\fIoptions\fR
-.RS 4
-¥³¥Þ¥ó¥É¥é¥¤¥ó¡¦¥ª¥×¥·¥ç¥ó¡£¥ª¥×¥·¥ç¥ó¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-.RE
-.PP
-\fItargetfile\&.jar\fR
-.RS 4
-¥Ð¡¼¥¸¥ç¥ó¤Î¶¥¹ç¤ò¸¡½Ð¤¹¤ë¤¿¤á¤Ë¡¢¸½ºß¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë³ÈÄ¥µ¡Ç½JAR¥Õ¥¡¥¤¥ë¤ÈÈæ³Ó¤¹¤ë¥¿¡¼¥²¥Ã¥ÈJAR¥Õ¥¡¥¤¥ë¡£
-.RE
-.SH "ÀâÌÀ"
-.PP
-\fIextcheck\fR¥³¥Þ¥ó¥É¤Ï¡¢»ØÄꤵ¤ì¤¿JAR¥Õ¥¡¥¤¥ë¤Î¥¿¥¤¥È¥ë¤ª¤è¤Ó¥Ð¡¼¥¸¥ç¥ó¤¬Java SE SDK¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë³ÈÄ¥µ¡Ç½¤È¶¥¹ç¤·¤Æ¤¤¤Ê¤¤¤«¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£³ÈÄ¥µ¡Ç½¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ëÁ°¤Ë¡¢¤³¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ò»ÈÍѤ·¤Æ¡¢Æ±¤¸¥Ð¡¼¥¸¥ç¥ó¤Þ¤¿¤Ï¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î³ÈÄ¥µ¡Ç½¤¬¤¹¤Ç¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-.PP
-\fIextcheck\fR¥³¥Þ¥ó¥É¤Ï¡¢\fItargetfile\&.jar\fR¥Õ¥¡¥¤¥ë¤Î¥Þ¥Ë¥Õ¥§¥¹¥ÈÆâ¤Î¥Ø¥Ã¥À¡¼Specification\-title¤ª¤è¤ÓSpecification\-version¤ò¡¢³ÈÄ¥µ¡Ç½¥Ç¥£¥ì¥¯¥È¥êÆâ¤Ë¸½ºß¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¤¹¤Ù¤Æ¤ÎJAR¥Õ¥¡¥¤¥ëÆâ¤ÎÂбþ¤¹¤ë¥Ø¥Ã¥À¡¼¤ÈÈæ³Ó¤·¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢³ÈÄ¥µ¡Ç½¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢Oracle Solaris¤Î¾ì¹ç¤Ï\fIjre/lib/ext\fR¡¢Windows¤Î¾ì¹ç¤Ï\fI\ejre\elib\eext\fR¤Ç¤¹¡£\fIextcheck\fR¥³¥Þ¥ó¥É¤Ï¡¢\fIjava\&.lang\&.Package\&.isCompatibleWith\fR¥á¥½¥Ã¥É¤ÈƱÍͤÎÊýË¡¤Ç¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òÈæ³Ó¤·¤Þ¤¹¡£
-.PP
-¶¥¹ç¤¬¸¡½Ð¤µ¤ì¤Ê¤¤¾ì¹ç¡¢¥ê¥¿¡¼¥ó¡¦¥³¡¼¥É¤Ï0¤Ç¤¹¡£
-.PP
-³ÈÄ¥µ¡Ç½¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¤¤¤º¤ì¤«¤ÎJAR¥Õ¥¡¥¤¥ë¤Î¥Þ¥Ë¥Õ¥§¥¹¥È¤Ë¡¢Æ±°ì¤Î\fISpecification\-title\fR¡¢¤ª¤è¤ÓƱ°ì¤Þ¤¿¤Ï¤è¤ê¿·¤·¤¤\fISpecification\-version\fRÈֹ椬¤¢¤ë¾ì¹ç¤Ï¡¢¥¼¥í¤Ç¤Ê¤¤¥¨¥é¡¼¡¦¥³¡¼¥É¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£\fItargetfile\&.jar\fR¤Î¥Þ¥Ë¥Õ¥§¥¹¥È¡¦¥Õ¥¡¥¤¥ë¤Ë\fISpecification\-title\fR¤Þ¤¿¤Ï\fISpecification\-version\fR°À­¤¬¤Ê¤¤¾ì¹ç¤â¡¢¥¼¥í¤Ç¤Ê¤¤¥¨¥é¡¼¡¦¥³¡¼¥É¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£
-.SH "¥ª¥×¥·¥ç¥ó"
-.PP
-\-verbose
-.RS 4
-³ÈÄ¥µ¡Ç½¥Ç¥£¥ì¥¯¥È¥êÆâ¤ÎJAR¥Õ¥¡¥¤¥ë¤ò¡¢¥Á¥§¥Ã¥¯»þ¤Ë°ìÍ÷ɽ¼¨¤·¤Þ¤¹¡£¤Þ¤¿¡¢¥¿¡¼¥²¥Ã¥ÈJAR¥Õ¥¡¥¤¥ë¤Î¥Þ¥Ë¥Õ¥§¥¹¥È¤Î°À­¡¢¤ª¤è¤Ó¶¥¹ç¤¹¤ëJAR¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤âÊó¹ð¤·¤Þ¤¹¡£
-.RE
-.PP
-\-J\fIoption\fR
-.RS 4
-Java²¾ÁÛ¥Þ¥·¥ó(JVM)¤Ë\fIoption\fR¤òÅϤ·¤Þ¤¹¡£option¤Ë¤Ï¡¢Javaµ¯Æ°¥Ä¡¼¥ë¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¡¦¥Ú¡¼¥¸¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¥ª¥×¥·¥ç¥ó¤ò1¤Ä»ØÄꤷ¤Þ¤¹¡£¤¿¤È¤¨¤Ð¡¢\fI\-J\-Xms48m\fR¤È»ØÄꤹ¤ë¤È¡¢¥¹¥¿¡¼¥È¥¢¥Ã¥×¡¦¥á¥â¥ê¡¼¤Ï48MB¤ËÀßÄꤵ¤ì¤Þ¤¹¡£java(1)¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-.RE
-.SH "´ØÏ¢¹àÌÜ"
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-jar(1)
-.RE
-.br
-'pl 8.5i
-'bp
--- a/jdk/src/solaris/doc/sun/man/man1/extcheck.1	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-'\" t
-.\"  Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-.\"
-.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-.\"
-.\" This code is free software; you can redistribute it and/or modify it
-.\" under the terms of the GNU General Public License version 2 only, as
-.\" published by the Free Software Foundation.
-.\"
-.\" This code is distributed in the hope that it will be useful, but WITHOUT
-.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-.\" version 2 for more details (a copy is included in the LICENSE file that
-.\" accompanied this code).
-.\"
-.\" You should have received a copy of the GNU General Public License version
-.\" 2 along with this work; if not, write to the Free Software Foundation,
-.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-.\"
-.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-.\" or visit www.oracle.com if you need additional information or have any
-.\" questions.
-.\"
-.\"     Arch: generic
-.\"     Software: JDK 8
-.\"     Date: 21 November 2013
-.\"     SectDesc: Basic Tools
-.\"     Title: extcheck.1
-.\"
-.if n .pl 99999
-.TH extcheck 1 "21 November 2013" "JDK 8" "Basic Tools"
-.\" -----------------------------------------------------------------
-.\" * Define some portability stuff
-.\" -----------------------------------------------------------------
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" http://bugs.debian.org/507673
-.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.ie \n(.g .ds Aq \(aq
-.el       .ds Aq '
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
-
-.SH NAME    
-extcheck \- Detects version conflicts between a target Java Archive (JAR) file and currently installed extension JAR files\&.
-.SH SYNOPSIS    
-.sp     
-.nf     
-
-\fBextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
-.fi     
-.sp     
-.TP     
-\fIoptions\fR
-The command-line options\&. See Options\&.
-.TP     
-\fItargetfile\&.jar\fR
-The target JAR file against which the currently installed extension JAR files are compared to detect version conflicts\&.
-.SH DESCRIPTION    
-The \f3extcheck\fR command checks a specified JAR file for title and version conflicts with any extensions installed in the Java SE SDK\&. Before installing an extension, you can use this utility to see whether the same or a more recent version of the extension is already installed\&.
-.PP
-The \f3extcheck\fR command compares the Specification-title and Specification-version headers in the manifest of the \f3targetfile\&.jar\fR file against the corresponding headers in all JAR files currently installed in the extension directory\&. By default, the extension directory is \f3jre/lib/ext\fR on Oracle Solaris and \f3\ejre\elib\eext\fR on Windows\&. The \f3extcheck\fR command compares version numbers in the same way as the \f3java\&.lang\&.Package\&.isCompatibleWith\fR method\&.
-.PP
-If no conflict is detected, then the return code is 0\&.
-.PP
-If the manifest of any JAR file in the extensions directory has the same \f3Specification-title\fR and the same or a newer \f3Specification-version\fR number, then a non-zero error code is returned\&. A non-zero error code is also returned when \f3targetfile\&.jar\fR does not have the \f3Specification-title\fR or \f3Specification-version\fR attributes in its manifest file\&.
-.SH OPTIONS    
-.TP
--verbose
-.br
-Lists JAR files in the extension directory as they are checked\&. Additionally, manifest attributes of the target JAR file and any conflicting JAR files are also reported\&.
-.TP
--J\fIoption\fR
-.br
-Passes \fIoption\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
-.SH SEE\ ALSO    
-.TP 0.2i    
-\(bu
-jar(1)
-.RE
-.br
-'pl 8.5i
-'bp
--- a/jdk/src/solaris/doc/sun/man/man1/ja/extcheck.1	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-'\" t
-.\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-.\" Title: extcheck
-.\" Language: English
-.\" Date: 2013ǯ11·î21Æü
-.\" SectDesc: ´ðËܥġ¼¥ë
-.\" Software: JDK 8
-.\" Arch: ÈÆÍÑ
-.\"
-.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-.\"
-.\" This code is free software; you can redistribute it and/or modify it
-.\" under the terms of the GNU General Public License version 2 only, as
-.\" published by the Free Software Foundation.
-.\"
-.\" This code is distributed in the hope that it will be useful, but WITHOUT
-.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-.\" version 2 for more details (a copy is included in the LICENSE file that
-.\" accompanied this code).
-.\"
-.\" You should have received a copy of the GNU General Public License version
-.\" 2 along with this work; if not, write to the Free Software Foundation,
-.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-.\"
-.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-.\" or visit www.oracle.com if you need additional information or have any
-.\" questions.
-.\"
-.pl 99999
-.TH "extcheck" "1" "2013ǯ11·î21Æü" "JDK 8" "´ðËܥġ¼¥ë"
-.\" -----------------------------------------------------------------
-.\" * Define some portability stuff
-.\" -----------------------------------------------------------------
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" http://bugs.debian.org/507673
-.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.ie \n(.g .ds Aq \(aq
-.el       .ds Aq '
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
-.SH "NAME"
-extcheck \- ¥¿¡¼¥²¥Ã¥È¤ÎJava¥¢¡¼¥«¥¤¥Ö(JAR)¥Õ¥¡¥¤¥ë¤È¸½ºß¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë³ÈÄ¥µ¡Ç½¤ÎJAR¥Õ¥¡¥¤¥ë´Ö¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¶¥¹ç¤ò¸¡½Ð¤·¤Þ¤¹¡£
-.SH "³µÍ×"
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-\fIextcheck\fR [\fIoptions\fR] \fItargetfile\&.jar\fR
-.fi
-.if n \{\
-.RE
-.\}
-.PP
-\fIoptions\fR
-.RS 4
-¥³¥Þ¥ó¥É¥é¥¤¥ó¡¦¥ª¥×¥·¥ç¥ó¡£¥ª¥×¥·¥ç¥ó¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-.RE
-.PP
-\fItargetfile\&.jar\fR
-.RS 4
-¥Ð¡¼¥¸¥ç¥ó¤Î¶¥¹ç¤ò¸¡½Ð¤¹¤ë¤¿¤á¤Ë¡¢¸½ºß¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë³ÈÄ¥µ¡Ç½JAR¥Õ¥¡¥¤¥ë¤ÈÈæ³Ó¤¹¤ë¥¿¡¼¥²¥Ã¥ÈJAR¥Õ¥¡¥¤¥ë¡£
-.RE
-.SH "ÀâÌÀ"
-.PP
-\fIextcheck\fR¥³¥Þ¥ó¥É¤Ï¡¢»ØÄꤵ¤ì¤¿JAR¥Õ¥¡¥¤¥ë¤Î¥¿¥¤¥È¥ë¤ª¤è¤Ó¥Ð¡¼¥¸¥ç¥ó¤¬Java SE SDK¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë³ÈÄ¥µ¡Ç½¤È¶¥¹ç¤·¤Æ¤¤¤Ê¤¤¤«¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£³ÈÄ¥µ¡Ç½¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ëÁ°¤Ë¡¢¤³¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ò»ÈÍѤ·¤Æ¡¢Æ±¤¸¥Ð¡¼¥¸¥ç¥ó¤Þ¤¿¤Ï¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î³ÈÄ¥µ¡Ç½¤¬¤¹¤Ç¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-.PP
-\fIextcheck\fR¥³¥Þ¥ó¥É¤Ï¡¢\fItargetfile\&.jar\fR¥Õ¥¡¥¤¥ë¤Î¥Þ¥Ë¥Õ¥§¥¹¥ÈÆâ¤Î¥Ø¥Ã¥À¡¼Specification\-title¤ª¤è¤ÓSpecification\-version¤ò¡¢³ÈÄ¥µ¡Ç½¥Ç¥£¥ì¥¯¥È¥êÆâ¤Ë¸½ºß¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¤¹¤Ù¤Æ¤ÎJAR¥Õ¥¡¥¤¥ëÆâ¤ÎÂбþ¤¹¤ë¥Ø¥Ã¥À¡¼¤ÈÈæ³Ó¤·¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢³ÈÄ¥µ¡Ç½¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢Oracle Solaris¤Î¾ì¹ç¤Ï\fIjre/lib/ext\fR¡¢Windows¤Î¾ì¹ç¤Ï\fI\ejre\elib\eext\fR¤Ç¤¹¡£\fIextcheck\fR¥³¥Þ¥ó¥É¤Ï¡¢\fIjava\&.lang\&.Package\&.isCompatibleWith\fR¥á¥½¥Ã¥É¤ÈƱÍͤÎÊýË¡¤Ç¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òÈæ³Ó¤·¤Þ¤¹¡£
-.PP
-¶¥¹ç¤¬¸¡½Ð¤µ¤ì¤Ê¤¤¾ì¹ç¡¢¥ê¥¿¡¼¥ó¡¦¥³¡¼¥É¤Ï0¤Ç¤¹¡£
-.PP
-³ÈÄ¥µ¡Ç½¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¤¤¤º¤ì¤«¤ÎJAR¥Õ¥¡¥¤¥ë¤Î¥Þ¥Ë¥Õ¥§¥¹¥È¤Ë¡¢Æ±°ì¤Î\fISpecification\-title\fR¡¢¤ª¤è¤ÓƱ°ì¤Þ¤¿¤Ï¤è¤ê¿·¤·¤¤\fISpecification\-version\fRÈֹ椬¤¢¤ë¾ì¹ç¤Ï¡¢¥¼¥í¤Ç¤Ê¤¤¥¨¥é¡¼¡¦¥³¡¼¥É¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£\fItargetfile\&.jar\fR¤Î¥Þ¥Ë¥Õ¥§¥¹¥È¡¦¥Õ¥¡¥¤¥ë¤Ë\fISpecification\-title\fR¤Þ¤¿¤Ï\fISpecification\-version\fR°À­¤¬¤Ê¤¤¾ì¹ç¤â¡¢¥¼¥í¤Ç¤Ê¤¤¥¨¥é¡¼¡¦¥³¡¼¥É¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£
-.SH "¥ª¥×¥·¥ç¥ó"
-.PP
-\-verbose
-.RS 4
-³ÈÄ¥µ¡Ç½¥Ç¥£¥ì¥¯¥È¥êÆâ¤ÎJAR¥Õ¥¡¥¤¥ë¤ò¡¢¥Á¥§¥Ã¥¯»þ¤Ë°ìÍ÷ɽ¼¨¤·¤Þ¤¹¡£¤Þ¤¿¡¢¥¿¡¼¥²¥Ã¥ÈJAR¥Õ¥¡¥¤¥ë¤Î¥Þ¥Ë¥Õ¥§¥¹¥È¤Î°À­¡¢¤ª¤è¤Ó¶¥¹ç¤¹¤ëJAR¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤âÊó¹ð¤·¤Þ¤¹¡£
-.RE
-.PP
-\-J\fIoption\fR
-.RS 4
-Java²¾ÁÛ¥Þ¥·¥ó(JVM)¤Ë\fIoption\fR¤òÅϤ·¤Þ¤¹¡£option¤Ë¤Ï¡¢Javaµ¯Æ°¥Ä¡¼¥ë¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¡¦¥Ú¡¼¥¸¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¥ª¥×¥·¥ç¥ó¤ò1¤Ä»ØÄꤷ¤Þ¤¹¡£¤¿¤È¤¨¤Ð¡¢\fI\-J\-Xms48m\fR¤È»ØÄꤹ¤ë¤È¡¢¥¹¥¿¡¼¥È¥¢¥Ã¥×¡¦¥á¥â¥ê¡¼¤Ï48MB¤ËÀßÄꤵ¤ì¤Þ¤¹¡£java(1)¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-.RE
-.SH "´ØÏ¢¹àÌÜ"
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
-jar(1)
-.RE
-.br
-'pl 8.5i
-'bp
--- a/jdk/test/ProblemList.txt	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/ProblemList.txt	Wed Jul 05 20:05:30 2017 +0200
@@ -134,8 +134,6 @@
 # 8044591
 com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationContentTest.java   generic-all
 com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationTest.java          generic-all
-# 8056143
-java/lang/management/MemoryMXBean/LowMemoryTest.java                                      generic-all
 
 # 8058492
 java/lang/management/ThreadMXBean/FindDeadlocks.java                                      generic-all
@@ -308,7 +306,7 @@
 sun/tools/jstatd/TestJstatdPort.java                    generic-all
 sun/tools/jstatd/TestJstatdPortAndServer.java                    generic-all
 
-# 8046285 8027668 
+# 8046285 8027668
 sun/tools/jstatd/TestJstatdExternalRegistry.java                generic-all
 
 # 6456333
--- a/jdk/test/TEST.groups	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/TEST.groups	Wed Jul 05 20:05:30 2017 +0200
@@ -120,6 +120,7 @@
 jdk_security2 = \
     javax/crypto \
     javax/xml/crypto \
+    com/oracle/security/ucrypto \
     com/sun/crypto
 
 jdk_security3 = \
@@ -181,7 +182,6 @@
 #
 core_tools = \
     tools \
-    com/sun/tools/extcheck \
     sun/tools/java \
     sun/tools/native2ascii \
     sun/tools/jrunscript
@@ -390,6 +390,10 @@
   :jdk_desktop \
   com/sun/corba \
   com/sun/jndi/cosnaming \
+  com/oracle/security/ucrypto/Test8004873.java \
+  com/oracle/security/ucrypto/TestAES.java \
+  com/oracle/security/ucrypto/TestDigest.java \
+  com/oracle/security/ucrypto/TestRSA.java \
   sun/net/ftp \
   sun/net/www/protocol/ftp \
   sun/security/tools/policytool \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/oracle/security/ucrypto/CipherSignNotSupported.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8029849
+ * @summary Make sure signing via encrypt and verifying via decrypt are not
+ * supported by OracleUcrypto provider.
+ * @author Anthony Scarpino
+ */
+
+import java.util.Random;
+import java.security.KeyPairGenerator;
+import java.security.KeyPair;
+import javax.crypto.Cipher;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.security.Provider;
+
+public class CipherSignNotSupported extends UcryptoTest {
+
+    public static void main(String[] args) throws Exception {
+        main(new CipherSignNotSupported(), null);
+    }
+
+    public void doTest(Provider p) throws Exception {
+        Cipher c = null;
+        Random random = new Random();
+        byte[] pt = new byte[117];
+        byte[] ct = new byte[200];
+        random.nextBytes(pt);
+
+        try {
+            c = Cipher.getInstance("RSA/ECB/PKCS1Padding", p);
+        } catch (NoSuchAlgorithmException e) {
+            if (System.getProperty("os.version").compareTo("5.10") == 0) {
+                System.out.println("RSA not supported in S10");
+                return;
+            }
+            throw e;
+        }
+
+        KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
+        kpg.initialize(1024);
+        KeyPair kp = kpg.generateKeyPair();
+
+        // Encryption
+        c.init(Cipher.ENCRYPT_MODE, kp.getPublic());
+        ct = c.doFinal(pt);
+        // Decryption
+        c.init(Cipher.DECRYPT_MODE, kp.getPrivate());
+        c.doFinal(ct);
+        // Sign
+        try {
+            c.init(Cipher.ENCRYPT_MODE, kp.getPrivate());
+            ct = c.doFinal(pt);
+            throw new RuntimeException("Encrypt operation should have failed.");
+        } catch (InvalidKeyException e) {
+            if (e.getMessage().compareTo("RSAPublicKey required for " +
+                    "encryption") != 0) {
+                System.out.println("Wrong exception thrown.");
+                throw e;
+            }
+        }
+        // Verify
+        try {
+            c.init(Cipher.DECRYPT_MODE, kp.getPublic());
+            c.doFinal(ct);
+            throw new RuntimeException("Decrypt operation should have failed.");
+        } catch (InvalidKeyException e) {
+            if (e.getMessage().compareTo("RSAPrivateCrtKey required for " +
+                    "decryption") != 0) {
+                System.out.println("Wrong exception thrown.");
+                throw e;
+            }
+        }
+
+        System.out.println("Pass");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/oracle/security/ucrypto/Test8004873.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug     8004873
+ * @summary Need to include data buffered by Padding impl when calculating
+ * output buffer sizes.
+ */
+
+import java.io.*;
+import java.security.*;
+import java.security.spec.*;
+import java.util.*;
+import javax.crypto.*;
+import javax.crypto.spec.*;
+
+public class Test8004873 extends UcryptoTest {
+
+    private static final String[] PADDEDCIPHER_ALGOS = {
+        "AES/ECB/PKCS5Padding",
+        "AES/CBC/PKCS5Padding",
+        "AES/CFB128/PKCS5Padding"
+    };
+
+    private static final SecretKey AES_KEY;
+
+    static {
+        byte[] keyValue = {
+            62, 124, -2, -15, 86, -25, 18, -112, 110, 31, 96, 59,
+            89, 70, 60, 103};
+        AES_KEY = new SecretKeySpec(keyValue, "AES");
+    }
+
+    public static void main(String[] args) throws Exception {
+        main(new Test8004873(), null);
+    }
+
+    public void doTest(Provider prov) throws Exception {
+        boolean result = true;
+        for (String algo : PADDEDCIPHER_ALGOS) {
+            if (!testOOS(algo, prov)) {
+                result = false;
+                System.out.println(algo + " Test Failed!");
+            }
+        }
+        if (!result) {
+            throw new Exception("One or more test failed!");
+        }
+    }
+
+    private boolean testOOS(String algo, Provider prov)
+        throws Exception {
+
+        String password = "abcd1234";
+        Cipher c;
+        try {
+            c = Cipher.getInstance(algo, prov);
+        } catch(NoSuchAlgorithmException nsae) {
+            System.out.println("Skipping Unsupported algo: " + algo);
+            return true;
+        }
+        c.init(Cipher.ENCRYPT_MODE, AES_KEY);
+        AlgorithmParameters params = c.getParameters();
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        CipherOutputStream cos = new CipherOutputStream(baos, c);
+        ObjectOutputStream oos = new ObjectOutputStream(cos);
+        oos.writeObject(password);
+        oos.flush();
+        oos.close();
+        byte[] encrypted = baos.toByteArray();
+
+        c.init(Cipher.DECRYPT_MODE, AES_KEY, params);
+
+        ByteArrayInputStream bais = new ByteArrayInputStream(encrypted);
+        CipherInputStream cis = new CipherInputStream(bais, c);
+        ObjectInputStream ois = new ObjectInputStream(cis);
+
+        String recovered = (String) ois.readObject();
+        return recovered.equals(password);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/oracle/security/ucrypto/TestAES.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,343 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7088989 8014374
+ * @summary Ensure the AES ciphers of OracleUcrypto provider works correctly
+ */
+
+import java.io.*;
+import java.security.*;
+import java.security.spec.*;
+import java.util.*;
+import javax.crypto.*;
+import javax.crypto.spec.*;
+
+public class TestAES extends UcryptoTest {
+
+    private static final String[] PADDEDCIPHER_ALGOS = {
+        "AES/ECB/PKCS5Padding",
+        "AES/CBC/PKCS5Padding",
+        "AES/CFB128/PKCS5Padding"
+    };
+
+    private static final String[] CIPHER_ALGOS = {
+        "AES/ECB/NoPadding",
+        "AES/CBC/NoPadding",
+        "AES/CFB128/NoPadding",
+        "AES/CTR/NoPadding",
+    };
+
+    private static final SecretKey CIPHER_KEY =
+        new SecretKeySpec(new byte[16], "AES");
+
+    public static void main(String[] args) throws Exception {
+        main(new TestAES(), null);
+    }
+
+    public void doTest(Provider prov) throws Exception {
+        // Provider for testing Interoperability
+        Provider sunJCEProv = Security.getProvider("SunJCE");
+
+        testCipherInterop(CIPHER_ALGOS, CIPHER_KEY, prov, sunJCEProv);
+        testCipherInterop(PADDEDCIPHER_ALGOS, CIPHER_KEY, prov, sunJCEProv);
+
+        testCipherOffset(CIPHER_ALGOS, CIPHER_KEY, prov);
+        testCipherOffset(PADDEDCIPHER_ALGOS, CIPHER_KEY, prov);
+
+        testCipherKeyWrapping(PADDEDCIPHER_ALGOS, CIPHER_KEY, prov, sunJCEProv);
+        testCipherGCM(CIPHER_KEY, prov);
+    }
+
+    private static void testCipherInterop(String[] algos, SecretKey key,
+                                          Provider p,
+                                          Provider interopP) {
+        boolean testPassed = true;
+        byte[] in = new byte[32];
+        (new SecureRandom()).nextBytes(in);
+
+        for (String algo : algos) {
+            try {
+                // check ENC
+                Cipher c;
+                try {
+                    c = Cipher.getInstance(algo, p);
+                } catch (NoSuchAlgorithmException nsae) {
+                    System.out.println("Skipping Unsupported CIP algo: " + algo);
+                    continue;
+                }
+                c.init(Cipher.ENCRYPT_MODE, key, (AlgorithmParameters)null, null);
+                byte[] eout = c.doFinal(in, 0, in.length);
+
+                AlgorithmParameters params = c.getParameters();
+                Cipher c2 = Cipher.getInstance(algo, interopP);
+                c2.init(Cipher.ENCRYPT_MODE, key, params, null);
+                byte[] eout2 = c2.doFinal(in, 0, in.length);
+
+                if (!Arrays.equals(eout, eout2)) {
+                    System.out.println(algo + ": DIFF FAILED");
+                    testPassed = false;
+                } else {
+                    System.out.println(algo + ": ENC Passed");
+                }
+
+                // check DEC
+                c.init(Cipher.DECRYPT_MODE, key, params, null);
+                byte[] dout = c.doFinal(eout);
+                c2.init(Cipher.DECRYPT_MODE, key, params, null);
+                byte[] dout2 = c2.doFinal(eout2);
+
+                if (!Arrays.equals(dout, dout2)) {
+                    System.out.println(algo + ": DIFF FAILED");
+                    testPassed = false;
+                } else {
+                    System.out.println(algo + ": DEC Passed");
+                }
+            } catch(Exception ex) {
+                System.out.println("Unexpected Exception: " + algo);
+                ex.printStackTrace();
+                testPassed = false;
+            }
+        }
+
+        if (!testPassed) {
+            throw new RuntimeException("One or more CIPHER test failed!");
+        } else {
+            System.out.println("CIPHER Interop Tests Passed");
+        }
+    }
+
+    private static void testCipherOffset(String[] algos, SecretKey key,
+                                         Provider p) {
+        boolean testPassed = true;
+        byte[] in = new byte[16];
+        (new SecureRandom()).nextBytes(in);
+        int blockSize = 16;
+
+        for (int j = 1; j < (in.length - 1); j++) {
+            System.out.println("Input offset size: " + j);
+            for (int i = 0; i < algos.length; i++) {
+                try {
+                    // check ENC
+                    Cipher c;
+                    try {
+                        c = Cipher.getInstance(algos[i], p);
+                    } catch (NoSuchAlgorithmException nsae) {
+                        System.out.println("Skip Unsupported CIP algo: " + algos[i]);
+                        continue;
+                    }
+                    c.init(Cipher.ENCRYPT_MODE, key, (AlgorithmParameters)null, null);
+                    byte[] eout = new byte[c.getOutputSize(in.length)];
+                    int firstPartLen = in.length - j - 1;
+                    //System.out.print("1st UPDATE: " + firstPartLen);
+                    int k = c.update(in, 0, firstPartLen, eout, 0);
+                    k += c.update(in, firstPartLen, 1, eout, k);
+                    k += c.doFinal(in, firstPartLen+1, j, eout, k);
+
+                    AlgorithmParameters params = c.getParameters();
+
+                    Cipher c2 = Cipher.getInstance(algos[i], p);
+                    c2.init(Cipher.ENCRYPT_MODE, key, params, null);
+                    byte[] eout2 = new byte[c2.getOutputSize(in.length)];
+                    int k2 = c2.update(in, 0, j, eout2, 0);
+                    k2 += c2.update(in, j, 1, eout2, k2);
+                    k2 += c2.doFinal(in, j+1, firstPartLen, eout2, k2);
+
+                    if (!checkArrays(eout, k, eout2, k2)) testPassed = false;
+
+                    // check DEC
+                    c.init(Cipher.DECRYPT_MODE, key, params, null);
+                    byte[] dout = new byte[c.getOutputSize(eout.length)];
+                    k = c.update(eout, 0, firstPartLen, dout, 0);
+                    k += c.update(eout, firstPartLen, 1, dout, k);
+                    k += c.doFinal(eout, firstPartLen+1, eout.length - firstPartLen - 1, dout, k);
+                    if (!checkArrays(in, in.length, dout, k)) testPassed = false;
+                } catch(Exception ex) {
+                    System.out.println("Unexpected Exception: " + algos[i]);
+                    ex.printStackTrace();
+                    testPassed = false;
+                }
+            }
+        }
+        if (!testPassed) {
+            throw new RuntimeException("One or more CIPHER test failed!");
+        } else {
+            System.out.println("CIPHER Offset Tests Passed");
+        }
+    }
+
+    private static void testCipherKeyWrapping(String[] algos, SecretKey key,
+                                              Provider p, Provider interopP)
+        throws NoSuchAlgorithmException {
+        boolean testPassed = true;
+
+        // Test SecretKey, PrivateKey and PublicKey
+        Key[] tbwKeys = new Key[3];
+        int[] tbwKeyTypes = { Cipher.SECRET_KEY, Cipher.PRIVATE_KEY, Cipher.PUBLIC_KEY };
+        tbwKeys[0] = new SecretKeySpec(new byte[20], "Blowfish");
+        KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
+        kpg.initialize(1024);
+        KeyPair kp = kpg.generateKeyPair();
+        tbwKeys[1] = kp.getPrivate();
+        tbwKeys[2] = kp.getPublic();
+
+        for (int i = 0; i < algos.length; i++) {
+            try {
+                System.out.println(algos[i] + " - Native WRAP/Java UNWRAP");
+
+                Cipher c1;
+                try {
+                    c1 = Cipher.getInstance(algos[i], p);
+                } catch (NoSuchAlgorithmException nsae) {
+                    System.out.println("Skipping Unsupported CIP algo: " + algos[i]);
+                    continue;
+                }
+                c1.init(Cipher.WRAP_MODE, key, (AlgorithmParameters)null, null);
+                AlgorithmParameters params = c1.getParameters();
+                Cipher c2 = Cipher.getInstance(algos[i], interopP);
+                c2.init(Cipher.UNWRAP_MODE, key, params, null);
+
+                for (int j = 0; j < tbwKeys.length ; j++) {
+                    byte[] wrappedKey = c1.wrap(tbwKeys[j]);
+                    Key recovered = c2.unwrap(wrappedKey,
+                                              tbwKeys[j].getAlgorithm(), tbwKeyTypes[j]);
+                    if (!checkKeys(tbwKeys[j], recovered)) testPassed = false;
+                }
+
+                System.out.println(algos[i] + " - Java WRAP/Native UNWRAP");
+                c1 = Cipher.getInstance(algos[i], interopP);
+                c1.init(Cipher.WRAP_MODE, key, (AlgorithmParameters)null, null);
+                params = c1.getParameters();
+                c2 = Cipher.getInstance(algos[i], p);
+                c2.init(Cipher.UNWRAP_MODE, key, params, null);
+
+                for (int j = 0; j < tbwKeys.length ; j++) {
+                    byte[] wrappedKey = c1.wrap(tbwKeys[j]);
+                    Key recovered = c2.unwrap(wrappedKey,
+                                              tbwKeys[j].getAlgorithm(), tbwKeyTypes[j]);
+                    if (!checkKeys(tbwKeys[j], recovered)) testPassed = false;
+                }
+
+            } catch(Exception ex) {
+                System.out.println("Unexpected Exception: " + algos[i]);
+                ex.printStackTrace();
+                testPassed = false;
+            }
+        }
+        if (!testPassed) {
+            throw new RuntimeException("One or more CIPHER test failed!");
+        } else {
+            System.out.println("CIPHER KeyWrapping Tests Passed");
+        }
+    }
+
+
+    private static void testCipherGCM(SecretKey key,
+                                      Provider p) {
+        boolean testPassed = true;
+        byte[] in = new byte[16];
+        (new SecureRandom()).nextBytes(in);
+
+        byte[] iv = new byte[16];
+        (new SecureRandom()).nextBytes(iv);
+
+
+        String algo = "AES/GCM/NoPadding";
+        int tagLen[] = { 128, 120, 112, 104, 96, 64, 32 };
+
+        try {
+            Cipher c;
+            try {
+                c = Cipher.getInstance(algo, p);
+            } catch (NoSuchAlgorithmException nsae) {
+                System.out.println("Skipping Unsupported CIP algo: " + algo);
+                return;
+            }
+            for (int i = 0; i < tagLen.length; i++) {
+                // change iv value to pass the key+iv uniqueness cehck for
+                // GCM encryption
+                iv[0] += 1;
+                AlgorithmParameterSpec paramSpec = new GCMParameterSpec(tagLen[i], iv);
+                // check ENC
+                c.init(Cipher.ENCRYPT_MODE, key, paramSpec, null);
+                c.updateAAD(iv);
+                byte[] eout = c.doFinal(in, 0, in.length);
+
+                AlgorithmParameters param = c.getParameters();
+                // check DEC
+                c.init(Cipher.DECRYPT_MODE, key, param, null);
+                c.updateAAD(iv);
+                byte[] dout = c.doFinal(eout, 0, eout.length);
+
+                if (!Arrays.equals(dout, in)) {
+                    System.out.println(algo + ": PT and RT DIFF FAILED");
+                    testPassed = false;
+                } else {
+                    System.out.println(algo + ": tagLen " + tagLen[i] + " done");
+                }
+            }
+        } catch(Exception ex) {
+            System.out.println("Unexpected Exception: " + algo);
+            ex.printStackTrace();
+            testPassed = false;
+        }
+        if (!testPassed) {
+            throw new RuntimeException("One or more CIPHER test failed!");
+        } else {
+            System.out.println("CIPHER GCM Tests Passed");
+        }
+    }
+
+    private static boolean checkArrays(byte[] a1, int a1Len, byte[] a2, int a2Len) {
+        boolean equal = true;
+        if (a1Len != a2Len) {
+            System.out.println("DIFFERENT OUT LENGTH");
+            equal = false;
+        } else {
+            for (int p = 0; p < a1Len; p++) {
+                if (a1[p] != a2[p]) {
+                    System.out.println("DIFF FAILED");
+                    equal = false;
+                    break;
+                }
+            }
+        }
+        return equal;
+    }
+
+    private static boolean checkKeys(Key k1, Key k2) {
+        boolean equal = true;
+        if (!k1.getAlgorithm().equalsIgnoreCase(k2.getAlgorithm())) {
+            System.out.println("DIFFERENT Key Algorithm");
+            equal = false;
+        } else if (!k1.getFormat().equalsIgnoreCase(k2.getFormat())) {
+            System.out.println("DIFFERENT Key Format");
+            equal = false;
+        } else if (!Arrays.equals(k1.getEncoded(), k2.getEncoded())) {
+            System.out.println("DIFFERENT Key Encoding");
+            equal = false;
+        }
+        return equal;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/oracle/security/ucrypto/TestCICOWithGCM.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8014374
+ * @summary Test basic CipherInputStream/OutputStream func w/ GCM mode.
+ * @author Valerie Peng
+ */
+
+import java.security.*;
+import javax.crypto.*;
+import javax.crypto.spec.*;
+import java.math.*;
+import java.io.*;
+import com.sun.crypto.provider.*;
+
+import java.util.*;
+
+public class TestCICOWithGCM extends UcryptoTest {
+    public static void main(String[] args) throws Exception {
+        main(new TestCICOWithGCM(), null);
+    }
+
+    public void doTest(Provider p) throws Exception {
+        // check if GCM support exists
+        try {
+            Cipher.getInstance("AES/GCM/NoPadding", p);
+        } catch (NoSuchAlgorithmException nsae) {
+            System.out.println("Skipping Test due to no GCM support");
+            return;
+        }
+
+        Random rdm = new Random();
+
+        //init Secret Key
+        byte[] keyValue = new byte[16];
+        rdm.nextBytes(keyValue);
+        SecretKey key = new SecretKeySpec(keyValue, "AES");
+
+        //do initialization of the plainText
+        byte[] plainText = new byte[800];
+        rdm.nextBytes(plainText);
+
+        //init ciphers
+        Cipher encCipher = Cipher.getInstance("AES/GCM/NoPadding", p);
+        encCipher.init(Cipher.ENCRYPT_MODE, key);
+        Cipher decCipher = Cipher.getInstance("AES/GCM/NoPadding", p);
+        decCipher.init(Cipher.DECRYPT_MODE, key, encCipher.getParameters());
+
+        //init cipher streams
+        ByteArrayInputStream baInput = new ByteArrayInputStream(plainText);
+        CipherInputStream ciInput = new CipherInputStream(baInput, encCipher);
+        ByteArrayOutputStream baOutput = new ByteArrayOutputStream();
+        CipherOutputStream ciOutput = new CipherOutputStream(baOutput, decCipher);
+
+        //do test
+        byte[] buffer = new byte[800];
+        int len = ciInput.read(buffer);
+        System.out.println("read " + len + " bytes from input buffer");
+
+        while (len != -1) {
+            ciOutput.write(buffer, 0, len);
+            System.out.println("wite " + len + " bytes to output buffer");
+            len = ciInput.read(buffer);
+            if (len != -1) {
+                System.out.println("read " + len + " bytes from input buffer");
+            } else {
+                System.out.println("finished reading");
+            }
+        }
+
+        ciOutput.flush();
+        ciInput.close();
+        ciOutput.close();
+        byte[] recovered = baOutput.toByteArray();
+        System.out.println("recovered " + recovered.length + " bytes");
+        if (!Arrays.equals(plainText, recovered)) {
+            throw new RuntimeException("diff check failed!");
+        } else {
+            System.out.println("diff check passed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/oracle/security/ucrypto/TestCICOWithGCMAndAAD.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8014374
+ * @summary Test CipherInputStream/OutputStream func w/ GCM mode and AAD.
+ * @author Valerie Peng
+ */
+
+import java.io.*;
+import java.security.*;
+import java.util.*;
+import javax.crypto.*;
+import javax.crypto.spec.*;
+
+public class TestCICOWithGCMAndAAD extends UcryptoTest {
+    public static void main(String[] args) throws Exception {
+        main(new TestCICOWithGCMAndAAD(), null);
+    }
+
+    public void doTest(Provider p) throws Exception {
+        // check if GCM support exists
+        try {
+            Cipher.getInstance("AES/GCM/NoPadding", p);
+        } catch (NoSuchAlgorithmException nsae) {
+            System.out.println("Skipping Test due to no GCM support");
+            return;
+        }
+
+        Random rdm = new Random();
+
+        //init Secret Key
+        byte[] keyValue = new byte[16];
+        rdm.nextBytes(keyValue);
+        SecretKey key = new SecretKeySpec(keyValue, "AES");
+
+        //Do initialization of the plainText
+        byte[] plainText = new byte[400];
+        rdm.nextBytes(plainText);
+
+        byte[] aad = new byte[128];
+        rdm.nextBytes(aad);
+        byte[] aad2 = aad.clone();
+        aad2[50]++;
+
+        GCMParameterSpec spec = new GCMParameterSpec(128, new byte[16]);
+        Cipher encCipher = Cipher.getInstance("AES/GCM/NoPadding", p);
+        encCipher.init(Cipher.ENCRYPT_MODE, key, spec);
+        encCipher.updateAAD(aad);
+        Cipher decCipher = Cipher.getInstance("AES/GCM/NoPadding", p);
+        decCipher.init(Cipher.DECRYPT_MODE, key, spec);  //encCipher.getParameters());
+        decCipher.updateAAD(aad);
+
+        byte[] recovered = test(encCipher, decCipher, plainText);
+        if (!Arrays.equals(plainText, recovered)) {
+            throw new Exception("sameAAD: diff check failed!");
+        } else System.out.println("sameAAD: passed");
+
+        encCipher.init(Cipher.ENCRYPT_MODE, key);
+        encCipher.updateAAD(aad2);
+        recovered = test(encCipher, decCipher, plainText);
+        if (recovered != null && recovered.length != 0) {
+            throw new Exception("diffAAD: no data should be returned!");
+        } else System.out.println("diffAAD: passed");
+   }
+
+   private static byte[] test(Cipher encCipher, Cipher decCipher, byte[] plainText)
+            throws Exception {
+        //init cipher streams
+        ByteArrayInputStream baInput = new ByteArrayInputStream(plainText);
+        CipherInputStream ciInput = new CipherInputStream(baInput, encCipher);
+        ByteArrayOutputStream baOutput = new ByteArrayOutputStream();
+        CipherOutputStream ciOutput = new CipherOutputStream(baOutput, decCipher);
+
+        //do test
+        byte[] buffer = new byte[200];
+        int len = ciInput.read(buffer);
+        System.out.println("read " + len + " bytes from input buffer");
+
+        while (len != -1) {
+            ciOutput.write(buffer, 0, len);
+            System.out.println("wite " + len + " bytes to output buffer");
+            len = ciInput.read(buffer);
+            if (len != -1) {
+                System.out.println("read " + len + " bytes from input buffer");
+            } else {
+                System.out.println("finished reading");
+            }
+        }
+
+        ciOutput.flush();
+        ciInput.close();
+        ciOutput.close();
+
+        return baOutput.toByteArray();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/oracle/security/ucrypto/TestDigest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug     7088989
+ * @summary Ensure the various message digests works correctly
+ */
+
+import java.io.*;
+import java.security.*;
+import java.security.spec.*;
+import java.util.*;
+import javax.crypto.*;
+import javax.crypto.spec.*;
+
+public class TestDigest extends UcryptoTest {
+
+    private static final String[] MD_ALGOS = {
+        "MD5",
+        "SHA",
+        "SHA-256",
+        "SHA-384",
+        "SHA-512"
+    };
+
+    public static void main(String[] args) throws Exception {
+        main(new TestDigest(), null);
+    }
+
+    public void doTest(Provider p) {
+        boolean testPassed = true;
+        byte[] msg = new byte[200];
+        (new SecureRandom()).nextBytes(msg);
+        String interopProvName = "SUN";
+
+        for (String a : MD_ALGOS) {
+            try {
+                MessageDigest md, md2;
+                try {
+                    md = MessageDigest.getInstance(a, p);
+                } catch (NoSuchAlgorithmException nsae) {
+                    System.out.println("Skipping Unsupported MD algo: " + a);
+                    continue;
+                }
+                md2 = MessageDigest.getInstance(a, interopProvName);
+                // Test Interoperability for update+digest calls
+                for (int i = 0; i < 3; i++) {
+                    md.update(msg);
+                    byte[] digest = md.digest();
+                    md2.update(msg);
+                    byte[] digest2 = md2.digest();
+                    if (!Arrays.equals(digest, digest2)) {
+                        System.out.println("DIFF1 FAILED for: " + a + " at iter " + i);
+                        testPassed = false;
+                    }
+                }
+
+                // Test Interoperability for digest calls
+                md = MessageDigest.getInstance(a, p);
+                md2 = MessageDigest.getInstance(a, interopProvName);
+
+                for (int i = 0; i < 3; i++) {
+                    byte[] digest = md.digest();
+                    byte[] digest2 = md2.digest();
+                    if (!Arrays.equals(digest, digest2)) {
+                        System.out.println("DIFF2 FAILED for: " + a + " at iter " + i);
+                        testPassed = false;
+                    }
+                }
+
+                // Test Cloning functionality
+                md = MessageDigest.getInstance(a, p);
+                md2 = (MessageDigest) md.clone(); // clone right after construction
+                byte[] digest = md.digest();
+                byte[] digest2 = md2.digest();
+                if (!Arrays.equals(digest, digest2)) {
+                    System.out.println("DIFF-3.1 FAILED for: " + a);
+                    testPassed = false;
+                }
+                md.update(msg);
+                md2 = (MessageDigest) md.clone(); // clone again after update call
+                digest = md.digest();
+                digest2 = md2.digest();
+                if (!Arrays.equals(digest, digest2)) {
+                    System.out.println("DIFF-3.2 FAILED for: " + a);
+                    testPassed = false;
+                }
+                md2 = (MessageDigest) md.clone(); // clone after digest
+                digest = md.digest();
+                digest2 = md2.digest();
+                if (!Arrays.equals(digest, digest2)) {
+                    System.out.println("DIFF-3.3 FAILED for: " + a);
+                    testPassed = false;
+                }
+            } catch(Exception ex) {
+                System.out.println("Unexpected Exception: " + a);
+                ex.printStackTrace();
+                testPassed = false;
+            }
+        }
+        if (!testPassed) {
+            throw new RuntimeException("One or more MD test failed!");
+        } else {
+            System.out.println("MD Tests Passed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/oracle/security/ucrypto/TestGCMKeyAndIvCheck.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8014374
+ * @summary Ensure that same key+iv can't be repeatedly used for encryption.
+ * @author Valerie Peng
+ */
+
+import java.security.*;
+import javax.crypto.*;
+import javax.crypto.spec.*;
+import java.math.*;
+import com.sun.crypto.provider.*;
+
+import java.util.*;
+
+public class TestGCMKeyAndIvCheck extends UcryptoTest {
+
+    private static final byte[] AAD = new byte[5];
+    private static final byte[] PT = new byte[33];
+
+    private static void checkISE(Cipher c) throws Exception {
+        // Subsequent encryptions should fail
+        try {
+            c.updateAAD(AAD);
+            throw new Exception("Should throw ISE for updateAAD()");
+        } catch (IllegalStateException ise) {
+            // expected
+        }
+
+        try {
+            c.update(PT);
+            throw new Exception("Should throw ISE for update()");
+        } catch (IllegalStateException ise) {
+            // expected
+        }
+        try {
+            c.doFinal(PT);
+            throw new Exception("Should throw ISE for doFinal()");
+        } catch (IllegalStateException ise) {
+            // expected
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        main(new TestGCMKeyAndIvCheck(), null);
+    }
+
+    public void doTest(Provider p) throws Exception {
+        Cipher c;
+        try {
+            c = Cipher.getInstance("AES/GCM/NoPadding", p);
+        } catch (NoSuchAlgorithmException nsae) {
+            System.out.println("Skipping Test due to No GCM support");
+            return;
+        }
+
+        SecretKey key = new SecretKeySpec(new byte[16], "AES");
+        // First try parameter-less init.
+        c.init(Cipher.ENCRYPT_MODE, key);
+        c.updateAAD(AAD);
+        byte[] ctPlusTag = c.doFinal(PT);
+
+        // subsequent encryption should fail unless re-init w/ different key+iv
+        checkISE(c);
+
+        // Validate the retrieved parameters against the IV and tag length.
+        AlgorithmParameters params = c.getParameters();
+        if (params == null) {
+            throw new Exception("getParameters() should not return null");
+        }
+        GCMParameterSpec spec = params.getParameterSpec(GCMParameterSpec.class);
+        if (spec.getTLen() != (ctPlusTag.length - PT.length)*8) {
+            throw new Exception("Parameters contains incorrect TLen value");
+        }
+        if (!Arrays.equals(spec.getIV(), c.getIV())) {
+            throw new Exception("Parameters contains incorrect IV value");
+        }
+
+        // Should be ok to use the same key+iv for decryption
+        c.init(Cipher.DECRYPT_MODE, key, params);
+        c.updateAAD(AAD);
+        byte[] recovered = c.doFinal(ctPlusTag);
+        if (!Arrays.equals(recovered, PT)) {
+            throw new Exception("decryption result mismatch");
+        }
+
+        // Now try to encrypt again using the same key+iv; should fail also
+        try {
+            c.init(Cipher.ENCRYPT_MODE, key, params);
+            throw new Exception("Should throw exception when same key+iv is used");
+        } catch (InvalidAlgorithmParameterException iape) {
+            // expected
+        }
+
+        // Now try to encrypt again using parameter-less init; should work
+        c.init(Cipher.ENCRYPT_MODE, key);
+        c.doFinal(PT);
+
+        // make sure a different iv is used
+        byte[] iv = c.getIV();
+        if (Arrays.equals(spec.getIV(), iv)) {
+            throw new Exception("IV should be different now");
+        }
+
+        // Now try to encrypt again using a different parameter; should work
+        c.init(Cipher.ENCRYPT_MODE, key, new GCMParameterSpec(128, new byte[30]));
+        c.updateAAD(AAD);
+        c.doFinal(PT);
+        // subsequent encryption should fail unless re-init w/ different key+iv
+        checkISE(c);
+
+        // Now try decryption twice in a row; no re-init required and
+        // same parameters is used.
+        c.init(Cipher.DECRYPT_MODE, key, params);
+        c.updateAAD(AAD);
+        recovered = c.doFinal(ctPlusTag);
+
+        c.updateAAD(AAD);
+        recovered = c.doFinal(ctPlusTag);
+        if (!Arrays.equals(recovered, PT)) {
+            throw new Exception("decryption result mismatch");
+        }
+
+        // Now try decryption again and re-init using the same parameters
+        c.init(Cipher.DECRYPT_MODE, key, params);
+        c.updateAAD(AAD);
+        recovered = c.doFinal(ctPlusTag);
+
+        // init to decrypt w/o parameters; should fail with IKE as
+        // javadoc specified
+        try {
+            c.init(Cipher.DECRYPT_MODE, key);
+            throw new Exception("Should throw IKE for dec w/o params");
+        } catch (InvalidKeyException ike) {
+            // expected
+        }
+
+        // Lastly, try encryption AND decryption w/ wrong type of parameters,
+        // e.g. IvParameterSpec
+        try {
+            c.init(Cipher.ENCRYPT_MODE, key, new IvParameterSpec(iv));
+            throw new Exception("Should throw IAPE");
+        } catch (InvalidAlgorithmParameterException iape) {
+            // expected
+        }
+        try {
+            c.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(iv));
+            throw new Exception("Should throw IAPE");
+        } catch (InvalidAlgorithmParameterException iape) {
+            // expected
+        }
+
+        System.out.println("Test Passed!");
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/oracle/security/ucrypto/TestGCMKeyWrap.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8014374
+ * @summary Ensure key wrap/unwrap works using AES/GCM/NoPadding
+ */
+
+import java.io.*;
+import java.security.*;
+import java.security.spec.*;
+import java.util.*;
+import javax.crypto.*;
+import javax.crypto.spec.*;
+
+public class TestGCMKeyWrap extends UcryptoTest {
+
+    public static void main(String[] args) throws Exception {
+        main(new TestGCMKeyWrap(), null);
+    }
+
+    public void doTest(Provider p) throws Exception {
+        // check if GCM support exists
+        try {
+            Cipher.getInstance("AES/GCM/NoPadding", p);
+        } catch (NoSuchAlgorithmException nsae) {
+            System.out.println("Skipping Test due to no GCM support");
+            return;
+        }
+
+        Random rdm = new Random();
+
+        //init Secret Key
+        byte[] keyValue = new byte[16];
+        rdm.nextBytes(keyValue);
+        SecretKey key = new SecretKeySpec(keyValue, "AES");
+
+        Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding", p);
+        cipher.init(Cipher.WRAP_MODE, key);
+
+        byte[] wrappedKey = cipher.wrap(key);
+
+        try { // make sure ISE is thrown if re-using the same key/IV
+            wrappedKey = cipher.wrap(key);
+            throw new Exception("FAIL: expected ISE not thrown");
+        } catch(IllegalStateException ise){
+            System.out.println("Expected ISE thrown for re-wrapping");
+        }
+
+        //unwrap the key
+        AlgorithmParameters params = cipher.getParameters();
+        cipher.init(Cipher.UNWRAP_MODE, key, params);
+        Key unwrappedKey = cipher.unwrap(wrappedKey, "AES", Cipher.SECRET_KEY);
+
+        //check if we can unwrap second time
+        unwrappedKey = cipher.unwrap(wrappedKey, "AES", Cipher.SECRET_KEY);
+
+        // Comparison
+        if (!Arrays.equals(key.getEncoded(), unwrappedKey.getEncoded())) {
+            throw new Exception("FAIL: keys are not equal");
+        } else {
+            System.out.println("Passed key equality check");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/oracle/security/ucrypto/TestGCMWithSBE.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8036970
+ * @summary Ensure that Cipher object is still usable after SBE.
+ * @author Valerie Peng
+ */
+
+import java.security.*;
+import javax.crypto.*;
+import javax.crypto.spec.*;
+import java.math.*;
+import com.sun.crypto.provider.*;
+
+import java.util.*;
+
+public class TestGCMWithSBE extends UcryptoTest {
+
+    private static final byte[] PT = new byte[32];
+    private static final byte[] ONE_BYTE = new byte[1];
+
+    public static void main(String[] args) throws Exception {
+        main(new TestGCMWithSBE(), null);
+    }
+
+    public void doTest(Provider p) throws Exception {
+        Cipher c;
+        try {
+            c = Cipher.getInstance("AES/GCM/NoPadding", p);
+        } catch (NoSuchAlgorithmException nsae) {
+            System.out.println("Skipping Test due to No GCM support");
+            return;
+        }
+
+        SecretKey key = new SecretKeySpec(new byte[16], "AES");
+        c.init(Cipher.ENCRYPT_MODE, key);
+
+        // test SBE with update calls
+        byte[] ct1 = null;
+        try {
+            c.update(PT, 0, PT.length, ONE_BYTE);
+        } catch (ShortBufferException sbe) {
+            // retry should work
+            ct1 = c.update(PT, 0, PT.length);
+        }
+
+        byte[] ct2PlusTag = null;
+        // test SBE with doFinal calls
+        try {
+            c.doFinal(ONE_BYTE, 0);
+        } catch (ShortBufferException sbe) {
+            // retry should work
+            ct2PlusTag = c.doFinal();
+        }
+
+        // Validate the retrieved parameters against the IV and tag length.
+        AlgorithmParameters params = c.getParameters();
+        if (params == null) {
+            throw new Exception("getParameters() should not return null");
+        }
+        GCMParameterSpec spec = params.getParameterSpec(GCMParameterSpec.class);
+        if (spec.getTLen() != (ct1.length + ct2PlusTag.length - PT.length)*8) {
+            throw new Exception("Parameters contains incorrect TLen value");
+        }
+        if (!Arrays.equals(spec.getIV(), c.getIV())) {
+            throw new Exception("Parameters contains incorrect IV value");
+        }
+
+        // Should be ok to use the same key+iv for decryption
+        c.init(Cipher.DECRYPT_MODE, key, params);
+        byte[] pt1 = c.update(ct1);
+        if (pt1 != null && pt1.length != 0) {
+            throw new Exception("Recovered text should not be returned "
+                + "to caller before tag verification");
+        }
+
+        byte[] pt2 = null;
+        try {
+            c.doFinal(ct2PlusTag, 0, ct2PlusTag.length, ONE_BYTE);
+        } catch (ShortBufferException sbe) {
+            // retry should work
+            pt2 = c.doFinal(ct2PlusTag);
+        }
+        if (!Arrays.equals(pt2, PT)) {
+            throw new Exception("decryption result mismatch");
+        }
+
+        System.out.println("Test Passed!");
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/oracle/security/ucrypto/TestKATForGCM.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,304 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8014374
+ * @summary Known Answer Test for AES cipher with GCM mode
+ * @author Valerie Peng
+ */
+
+import java.security.*;
+import javax.crypto.*;
+import javax.crypto.spec.*;
+import java.math.*;
+
+import java.util.*;
+
+public class TestKATForGCM extends UcryptoTest {
+    public static void main(String[] args) throws Exception {
+        main(new TestKATForGCM(), null);
+    }
+
+    // Utility methods
+    private static byte[] HexToBytes(String hexVal) {
+        if (hexVal == null) return new byte[0];
+        byte[] result = new byte[hexVal.length()/2];
+        for (int i = 0; i < result.length; i++) {
+            // 2 characters at a time
+            String byteVal = hexVal.substring(2*i, 2*i +2);
+            result[i] = Integer.valueOf(byteVal, 16).byteValue();
+        }
+        return result;
+    }
+
+    private static class TestVector {
+        SecretKey key;
+        byte[] plainText;
+        byte[] aad;
+        byte[] cipherText;
+        byte[] tag;
+        GCMParameterSpec spec;
+        String info;
+
+        TestVector(String key, String iv, String pt, String aad,
+                   String ct, String tag) {
+            this.key = new SecretKeySpec(HexToBytes(key), "AES");
+            this.plainText = HexToBytes(pt);
+            this.aad = HexToBytes(aad);
+            this.cipherText = HexToBytes(ct);
+            this.tag = HexToBytes(tag);
+            this.spec = new GCMParameterSpec(this.tag.length * 8, HexToBytes(iv));
+            this.info = "key=" + key + ", iv=" + iv + ", pt=" + pt +
+                ",aad=" + aad + ", ct=" + ct + ", tag=" + tag;
+        }
+
+        public String toString() {
+            return info;
+        }
+    }
+
+    // These test vectors are found off NIST's CAVP page
+    // http://csrc.nist.gov/groups/STM/cavp/index.html
+    // inside the link named "GCM Test Vectors", i.e.
+    // http://csrc.nist.gov/groups/STM/cavp/documents/mac/gcmtestvectors.zip
+    // CAVS 14.0, set of test vectors w/ count = 0, keysize = 128
+    private static TestVector[] testValues = {
+        // 96-bit iv w/ 128/120/112/104/96-bit tags
+        // no plain text, no aad
+        new TestVector("11754cd72aec309bf52f7687212e8957",
+                       "3c819d9a9bed087615030b65",
+                       null, null, null,
+                       "250327c674aaf477aef2675748cf6971"),
+        new TestVector("272f16edb81a7abbea887357a58c1917",
+                       "794ec588176c703d3d2a7a07",
+                       null, null, null,
+                       "b6e6f197168f5049aeda32dafbdaeb"),
+        new TestVector("81b6844aab6a568c4556a2eb7eae752f",
+                       "ce600f59618315a6829bef4d",
+                       null, null, null,
+                       "89b43e9dbc1b4f597dbbc7655bb5"),
+        new TestVector("cde2f9a9b1a004165ef9dc981f18651b",
+                       "29512c29566c7322e1e33e8e",
+                       null, null, null,
+                       "2e58ce7dabd107c82759c66a75"),
+        new TestVector("b01e45cc3088aaba9fa43d81d481823f",
+                       "5a2c4a66468713456a4bd5e1",
+                       null, null, null,
+                       "014280f944f53c681164b2ff"),
+        // 96-bit iv w/ 128/120/112/104/96-bit tags
+        // no plain text, 16-byte aad
+        new TestVector("77be63708971c4e240d1cb79e8d77feb",
+                       "e0e00f19fed7ba0136a797f3",
+                       null,
+                       "7a43ec1d9c0a5a78a0b16533a6213cab",
+                       null,
+                       "209fcc8d3675ed938e9c7166709dd946"),
+        new TestVector("da0b615656135194ba6d3c851099bc48",
+                       "d39d4b4d3cc927885090e6c3",
+                       null,
+                       "e7e5e6f8dac913036cb2ff29e8625e0e",
+                       null,
+                       "ab967711a5770461724460b07237e2"),
+        new TestVector("7e0986937a88eef894235aba4a2f43b2",
+                       "92c4a631695907166b422d60",
+                       null,
+                       "85c185f8518f9f2cd597a8f9208fc76b",
+                       null,
+                       "3bb916b728df94fe9d1916736be1"),
+        new TestVector("c3db570d7f0c21e86b028f11465d1dc9",
+                       "f86970f58ceef89fc7cb679e",
+                       null,
+                       "c095240708c0f57c288d86090ae34ee1",
+                       null,
+                       "e043c52160d652e82c7262fcf4"),
+        new TestVector("bea48ae4980d27f357611014d4486625",
+                       "32bddb5c3aa998a08556454c",
+                       null,
+                       "8a50b0b8c7654bced884f7f3afda2ead",
+                       null,
+                       "8e0f6d8bf05ffebe6f500eb1"),
+        // 96-bit iv w/ 128/120/112/104/96-bit tags
+        // no plain text, 20-byte aad
+        new TestVector("2fb45e5b8f993a2bfebc4b15b533e0b4",
+                       "5b05755f984d2b90f94b8027",
+                       null,
+                       "e85491b2202caf1d7dce03b97e09331c32473941",
+                       null,
+                       "c75b7832b2a2d9bd827412b6ef5769db"),
+        new TestVector("9bf406339fcef9675bbcf156aa1a0661",
+                       "8be4a9543d40f542abacac95",
+                       null,
+                       "7167cbf56971793186333a6685bbd58d47d379b3",
+                       null,
+                       "5e7968d7bbd5ba58cfcc750e2ef8f1"),
+        new TestVector("a2e962fff70fd0f4d63be728b80556fc",
+                       "1fa7103483de43d09bc23db4",
+                       null,
+                       "2a58edf1d53f46e4e7ee5e77ee7aeb60fc360658",
+                       null,
+                       "fa37f2dbbefab1451eae1d0d74ca"),
+        new TestVector("6bf4fdce82926dcdfc52616ed5f23695",
+                       "cc0f5899a10615567e1193ed",
+                       null,
+                       "3340655592374c1da2f05aac3ee111014986107f",
+                       null,
+                       "8ad3385cce3b5e7c985908192c"),
+        new TestVector("4df7a13e43c3d7b66b1a72fac5ba398e",
+                       "97179a3a2d417908dcf0fb28",
+                       null,
+                       "cbb7fc0010c255661e23b07dbd804b1e06ae70ac",
+                       null,
+                       "37791edae6c137ea946cfb40"),
+        // 96-bit iv w/ 128-bit tags, 13/16/32/51-byte plain text, no aad
+        new TestVector("fe9bb47deb3a61e423c2231841cfd1fb",
+                       "4d328eb776f500a2f7fb47aa",
+                       "f1cc3818e421876bb6b8bbd6c9",
+                       null,
+                       "b88c5c1977b35b517b0aeae967",
+                       "43fd4727fe5cdb4b5b42818dea7ef8c9"),
+        new TestVector("7fddb57453c241d03efbed3ac44e371c",
+                       "ee283a3fc75575e33efd4887",
+                       "d5de42b461646c255c87bd2962d3b9a2",
+                       null,
+                       "2ccda4a5415cb91e135c2a0f78c9b2fd",
+                       "b36d1df9b9d5e596f83e8b7f52971cb3"),
+        new TestVector("9971071059abc009e4f2bd69869db338",
+                       "07a9a95ea3821e9c13c63251",
+                       "f54bc3501fed4f6f6dfb5ea80106df0bd836e6826225b75c0222f6e859b35983",
+                       null,
+                       "0556c159f84ef36cb1602b4526b12009c775611bffb64dc0d9ca9297cd2c6a01",
+                       "7870d9117f54811a346970f1de090c41"),
+        new TestVector("594157ec4693202b030f33798b07176d",
+                       "49b12054082660803a1df3df",
+
+"3feef98a976a1bd634f364ac428bb59cd51fb159ec1789946918dbd50ea6c9d594a3a31a5269b0da6936c29d063a5fa2cc8a1c",
+                      null,
+
+"c1b7a46a335f23d65b8db4008a49796906e225474f4fe7d39e55bf2efd97fd82d4167de082ae30fa01e465a601235d8d68bc69",
+                      "ba92d3661ce8b04687e8788d55417dc2"),
+        // 96-bit iv w/ 128-bit tags, 16-byte plain text, 16/20/48/90-byte aad
+        new TestVector("c939cc13397c1d37de6ae0e1cb7c423c",
+                       "b3d8cc017cbb89b39e0f67e2",
+                       "c3b3c41f113a31b73d9a5cd432103069",
+                       "24825602bd12a984e0092d3e448eda5f",
+                       "93fe7d9e9bfd10348a5606e5cafa7354",
+                       "0032a1dc85f1c9786925a2e71d8272dd"),
+        new TestVector("d4a22488f8dd1d5c6c19a7d6ca17964c",
+                       "f3d5837f22ac1a0425e0d1d5",
+                       "7b43016a16896497fb457be6d2a54122",
+                       "f1c5d424b83f96c6ad8cb28ca0d20e475e023b5a",
+                       "c2bd67eef5e95cac27e3b06e3031d0a8",
+                       "f23eacf9d1cdf8737726c58648826e9c"),
+        new TestVector("89850dd398e1f1e28443a33d40162664",
+                       "e462c58482fe8264aeeb7231",
+                       "2805cdefb3ef6cc35cd1f169f98da81a",
+"d74e99d1bdaa712864eec422ac507bddbe2b0d4633cd3dff29ce5059b49fe868526c59a2a3a604457bc2afea866e7606",
+                       "ba80e244b7fc9025cd031d0f63677e06",
+                       "d84a8c3eac57d1bb0e890a8f461d1065"),
+        new TestVector("bd7c5c63b7542b56a00ebe71336a1588",
+                       "87721f23ba9c3c8ea5571abc",
+                       "de15ddbb1e202161e8a79af6a55ac6f3",
+"a6ec8075a0d3370eb7598918f3b93e48444751624997b899a87fa6a9939f844e008aa8b70e9f4c3b1a19d3286bf543e7127bfecba1ad17a5ec53fccc26faecacc4c75369498eaa7d706aef634d0009279b11e4ba6c993e5e9ed9",
+                       "41eb28c0fee4d762de972361c863bc80",
+                       "9cb567220d0b252eb97bff46e4b00ff8"),
+        // 8/1024-bit iv w/ 128-bit tag, no plain text, no aad
+        new TestVector("1672c3537afa82004c6b8a46f6f0d026",
+                       "05",
+                       null, null, null,
+                       "8e2ad721f9455f74d8b53d3141f27e8e"),
+        new TestVector("d0f1f4defa1e8c08b4b26d576392027c",
+"42b4f01eb9f5a1ea5b1eb73b0fb0baed54f387ecaa0393c7d7dffc6af50146ecc021abf7eb9038d4303d91f8d741a11743166c0860208bcc02c6258fd9511a2fa626f96d60b72fcff773af4e88e7a923506e4916ecbd814651e9f445adef4ad6a6b6c7290cc13b956130eef5b837c939fcac0cbbcc9656cd75b13823ee5acdac",
+                       null, null, null,
+                       "7ab49b57ddf5f62c427950111c5c4f0d"),
+        // 8-bit iv w/ 128-bit tag, 13-byte plain text, 90-byte aad
+        new TestVector("9f79239f0904eace50784b863e723f6b",
+                       "d9",
+                       "bdb0bb10c87965acd34d146171",
+"44db436089327726c5f01139e1f339735c9e85514ccc2f167bad728010fb34a9072a9794c8a5e7361b1d0dbcdc9ac4091e354bb2896561f0486645252e9c78c86beece91bfa4f7cc4a8794ce1f305b1b735efdbf1ed1563c0be0",
+                       "7e5a7c8dadb3f0c7335b4d9d8d",
+                       "6b6ef1f53723a89f3bb7c6d043840717"),
+        // 1024-bit iv w/ 128-bit tag, 51-byte plain text, 48-byte aad
+        new TestVector("141f1ce91989b07e7eb6ae1dbd81ea5e",
+
+"49451da24bd6074509d3cebc2c0394c972e6934b45a1d91f3ce1d3ca69e194aa1958a7c21b6f21d530ce6d2cc5256a3f846b6f9d2f38df0102c4791e57df038f6e69085646007df999751e248e06c47245f4cd3b8004585a7470dee1690e9d2d63169a58d243c0b57b3e5b4a481a3e4e8c60007094ef3adea2e8f05dd3a1396f",
+"d384305af2388699aa302f510913fed0f2cb63ba42efa8c5c9de2922a2ec2fe87719dadf1eb0aef212b51e74c9c5b934104a43",
+"630cf18a91cc5a6481ac9eefd65c24b1a3c93396bd7294d6b8ba323951727666c947a21894a079ef061ee159c05beeb4",
+"f4c34e5fbe74c0297313268296cd561d59ccc95bbfcdfcdc71b0097dbd83240446b28dc088abd42b0fc687f208190ff24c0548",
+                      "dbb93bbb56d0439cd09f620a57687f5d"),
+    };
+
+    public void doTest(Provider p) throws Exception {
+        boolean testFailed = false;
+        Cipher c = null;
+        try {
+            c = Cipher.getInstance("AES/GCM/NoPadding", p);
+        } catch (NoSuchAlgorithmException nsae) {
+            System.out.println("Skipping Test due to no GCM support");
+            return;
+        }
+
+        for (int i = 0; i < testValues.length; i++) {
+            try {
+                c.init(Cipher.ENCRYPT_MODE, testValues[i].key, testValues[i].spec);
+                c.updateAAD(testValues[i].aad);
+                byte[] ctPlusTag = c.doFinal(testValues[i].plainText);
+
+                c.init(Cipher.DECRYPT_MODE, testValues[i].key, testValues[i].spec);
+                c.updateAAD(testValues[i].aad);
+                byte[] pt = c.doFinal(ctPlusTag); // should fail if tag mismatched
+
+                // check encryption/decryption results just to be sure
+                if (!Arrays.equals(testValues[i].plainText, pt)) {
+                    System.out.println("PlainText diff failed for test# " + i);
+                    testFailed = true;
+                }
+                int ctLen = testValues[i].cipherText.length;
+                if (!Arrays.equals(testValues[i].cipherText,
+                                   Arrays.copyOf(ctPlusTag, ctLen))) {
+                    System.out.println("CipherText diff failed for test# " + i);
+                    testFailed = true;
+                }
+                int tagLen = testValues[i].tag.length;
+                if (!Arrays.equals
+                    (testValues[i].tag,
+                     Arrays.copyOfRange(ctPlusTag, ctLen, ctLen+tagLen))) {
+                    System.out.println("Tag diff failed for test# " + i);
+                    testFailed = true;
+                }
+            } catch (Exception ex) {
+                // continue testing other test vectors
+                System.out.println("Failed Test Vector: " + testValues[i]);
+                ex.printStackTrace();
+                testFailed = true;
+                continue;
+            }
+        }
+        if (testFailed) {
+            throw new Exception("Test Failed");
+        }
+        // passed all tests...hooray!
+        System.out.println("Test Passed");
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/oracle/security/ucrypto/TestMalformedRSA.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,257 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8024606
+ * @summary NegativeArraySizeException in NativeRSACipher
+ */
+
+import java.io.*;
+import java.security.*;
+import java.security.spec.*;
+import java.util.*;
+import java.math.*;
+import javax.crypto.*;
+
+public class TestMalformedRSA extends UcryptoTest {
+
+    // KAT
+    private static final byte PLAINTEXT[] = Arrays.copyOf
+        (new String("Known plaintext message utilized" +
+                    "for RSA Encryption &  Decryption" +
+                    "block, SHA1, SHA256, SHA384  and" +
+                    "SHA512 RSA Signature KAT tests.").getBytes(), 128);
+
+    private static final byte MOD[] = {
+        (byte)0xd5, (byte)0x84, (byte)0x95, (byte)0x07, (byte)0xf4, (byte)0xd0,
+        (byte)0x1f, (byte)0x82, (byte)0xf3, (byte)0x79, (byte)0xf4, (byte)0x99,
+        (byte)0x48, (byte)0x10, (byte)0xe1, (byte)0x71, (byte)0xa5, (byte)0x62,
+        (byte)0x22, (byte)0xa3, (byte)0x4b, (byte)0x00, (byte)0xe3, (byte)0x5b,
+        (byte)0x3a, (byte)0xcc, (byte)0x10, (byte)0x83, (byte)0xe0, (byte)0xaf,
+        (byte)0x61, (byte)0x13, (byte)0x54, (byte)0x6a, (byte)0xa2, (byte)0x6a,
+        (byte)0x2c, (byte)0x5e, (byte)0xb3, (byte)0xcc, (byte)0xa3, (byte)0x71,
+        (byte)0x9a, (byte)0xb2, (byte)0x3e, (byte)0x78, (byte)0xec, (byte)0xb5,
+        (byte)0x0e, (byte)0x6e, (byte)0x31, (byte)0x3b, (byte)0x77, (byte)0x1f,
+        (byte)0x6e, (byte)0x94, (byte)0x41, (byte)0x60, (byte)0xd5, (byte)0x6e,
+        (byte)0xd9, (byte)0xc6, (byte)0xf9, (byte)0x29, (byte)0xc3, (byte)0x40,
+        (byte)0x36, (byte)0x25, (byte)0xdb, (byte)0xea, (byte)0x0b, (byte)0x07,
+        (byte)0xae, (byte)0x76, (byte)0xfd, (byte)0x99, (byte)0x29, (byte)0xf4,
+        (byte)0x22, (byte)0xc1, (byte)0x1a, (byte)0x8f, (byte)0x05, (byte)0xfe,
+        (byte)0x98, (byte)0x09, (byte)0x07, (byte)0x05, (byte)0xc2, (byte)0x0f,
+        (byte)0x0b, (byte)0x11, (byte)0x83, (byte)0x39, (byte)0xca, (byte)0xc7,
+        (byte)0x43, (byte)0x63, (byte)0xff, (byte)0x33, (byte)0x80, (byte)0xe7,
+        (byte)0xc3, (byte)0x78, (byte)0xae, (byte)0xf1, (byte)0x73, (byte)0x52,
+        (byte)0x98, (byte)0x1d, (byte)0xde, (byte)0x5c, (byte)0x53, (byte)0x6e,
+        (byte)0x01, (byte)0x73, (byte)0x0d, (byte)0x12, (byte)0x7e, (byte)0x77,
+        (byte)0x03, (byte)0xf1, (byte)0xef, (byte)0x1b, (byte)0xc8, (byte)0xa8,
+        (byte)0x0f, (byte)0x97
+    };
+
+    private static final byte PUB_EXP[] = {(byte)0x01, (byte)0x00, (byte)0x01};
+
+    private static final byte PRIV_EXP[] = {
+        (byte)0x85, (byte)0x27, (byte)0x47, (byte)0x61, (byte)0x4c, (byte)0xd4,
+        (byte)0xb5, (byte)0xb2, (byte)0x0e, (byte)0x70, (byte)0x91, (byte)0x8f,
+        (byte)0x3d, (byte)0x97, (byte)0xf9, (byte)0x5f, (byte)0xcc, (byte)0x09,
+        (byte)0x65, (byte)0x1c, (byte)0x7c, (byte)0x5b, (byte)0xb3, (byte)0x6d,
+        (byte)0x63, (byte)0x3f, (byte)0x7b, (byte)0x55, (byte)0x22, (byte)0xbb,
+        (byte)0x7c, (byte)0x48, (byte)0x77, (byte)0xae, (byte)0x80, (byte)0x56,
+        (byte)0xc2, (byte)0x10, (byte)0xd5, (byte)0x03, (byte)0xdb, (byte)0x31,
+        (byte)0xaf, (byte)0x8d, (byte)0x54, (byte)0xd4, (byte)0x48, (byte)0x99,
+        (byte)0xa8, (byte)0xc4, (byte)0x23, (byte)0x43, (byte)0xb8, (byte)0x48,
+        (byte)0x0b, (byte)0xc7, (byte)0xbc, (byte)0xf5, (byte)0xcc, (byte)0x64,
+        (byte)0x72, (byte)0xbf, (byte)0x59, (byte)0x06, (byte)0x04, (byte)0x1c,
+        (byte)0x32, (byte)0xf5, (byte)0x14, (byte)0x2e, (byte)0x6e, (byte)0xe2,
+        (byte)0x0f, (byte)0x5c, (byte)0xde, (byte)0x36, (byte)0x3c, (byte)0x6e,
+        (byte)0x7c, (byte)0x4d, (byte)0xcc, (byte)0xd3, (byte)0x00, (byte)0x6e,
+        (byte)0xe5, (byte)0x45, (byte)0x46, (byte)0xef, (byte)0x4d, (byte)0x25,
+        (byte)0x46, (byte)0x6d, (byte)0x7f, (byte)0xed, (byte)0xbb, (byte)0x4f,
+        (byte)0x4d, (byte)0x9f, (byte)0xda, (byte)0x87, (byte)0x47, (byte)0x8f,
+        (byte)0x74, (byte)0x44, (byte)0xb7, (byte)0xbe, (byte)0x9d, (byte)0xf5,
+        (byte)0xdd, (byte)0xd2, (byte)0x4c, (byte)0xa5, (byte)0xab, (byte)0x74,
+        (byte)0xe5, (byte)0x29, (byte)0xa1, (byte)0xd2, (byte)0x45, (byte)0x3b,
+        (byte)0x33, (byte)0xde, (byte)0xd5, (byte)0xae, (byte)0xf7, (byte)0x03,
+        (byte)0x10, (byte)0x21
+    };
+
+    private static final byte PRIME_P[] = {
+        (byte)0xf9, (byte)0x74, (byte)0x8f, (byte)0x16, (byte)0x02, (byte)0x6b,
+        (byte)0xa0, (byte)0xee, (byte)0x7f, (byte)0x28, (byte)0x97, (byte)0x91,
+        (byte)0xdc, (byte)0xec, (byte)0xc0, (byte)0x7c, (byte)0x49, (byte)0xc2,
+        (byte)0x85, (byte)0x76, (byte)0xee, (byte)0x66, (byte)0x74, (byte)0x2d,
+        (byte)0x1a, (byte)0xb8, (byte)0xf7, (byte)0x2f, (byte)0x11, (byte)0x5b,
+        (byte)0x36, (byte)0xd8, (byte)0x46, (byte)0x33, (byte)0x3b, (byte)0xd8,
+        (byte)0xf3, (byte)0x2d, (byte)0xa1, (byte)0x03, (byte)0x83, (byte)0x2b,
+        (byte)0xec, (byte)0x35, (byte)0x43, (byte)0x32, (byte)0xff, (byte)0xdd,
+        (byte)0x81, (byte)0x7c, (byte)0xfd, (byte)0x65, (byte)0x13, (byte)0x04,
+        (byte)0x7c, (byte)0xfc, (byte)0x03, (byte)0x97, (byte)0xf0, (byte)0xd5,
+        (byte)0x62, (byte)0xdc, (byte)0x0d, (byte)0xbf
+    };
+
+    private static final byte PRIME_Q[] = {
+        (byte)0xdb, (byte)0x1e, (byte)0xa7, (byte)0x3d, (byte)0xe7, (byte)0xfa,
+        (byte)0x8b, (byte)0x04, (byte)0x83, (byte)0x48, (byte)0xf3, (byte)0xa5,
+        (byte)0x31, (byte)0x9d, (byte)0x35, (byte)0x5e, (byte)0x4d, (byte)0x54,
+        (byte)0x77, (byte)0xcc, (byte)0x84, (byte)0x09, (byte)0xf3, (byte)0x11,
+        (byte)0x0d, (byte)0x54, (byte)0xed, (byte)0x85, (byte)0x39, (byte)0xa9,
+        (byte)0xca, (byte)0xa8, (byte)0xea, (byte)0xae, (byte)0x19, (byte)0x9c,
+        (byte)0x75, (byte)0xdb, (byte)0x88, (byte)0xb8, (byte)0x04, (byte)0x8d,
+        (byte)0x54, (byte)0xc6, (byte)0xa4, (byte)0x80, (byte)0xf8, (byte)0x93,
+        (byte)0xf0, (byte)0xdb, (byte)0x19, (byte)0xef, (byte)0xd7, (byte)0x87,
+        (byte)0x8a, (byte)0x8f, (byte)0x5a, (byte)0x09, (byte)0x2e, (byte)0x54,
+        (byte)0xf3, (byte)0x45, (byte)0x24, (byte)0x29
+    };
+
+    private static final byte EXP_P[] = {
+        (byte)0x6a, (byte)0xd1, (byte)0x25, (byte)0x80, (byte)0x18, (byte)0x33,
+        (byte)0x3c, (byte)0x2b, (byte)0x44, (byte)0x19, (byte)0xfe, (byte)0xa5,
+        (byte)0x40, (byte)0x03, (byte)0xc4, (byte)0xfc, (byte)0xb3, (byte)0x9c,
+        (byte)0xef, (byte)0x07, (byte)0x99, (byte)0x58, (byte)0x17, (byte)0xc1,
+        (byte)0x44, (byte)0xa3, (byte)0x15, (byte)0x7d, (byte)0x7b, (byte)0x22,
+        (byte)0x22, (byte)0xdf, (byte)0x03, (byte)0x58, (byte)0x66, (byte)0xf5,
+        (byte)0x24, (byte)0x54, (byte)0x52, (byte)0x91, (byte)0x2d, (byte)0x76,
+        (byte)0xfe, (byte)0x63, (byte)0x64, (byte)0x4e, (byte)0x0f, (byte)0x50,
+        (byte)0x2b, (byte)0x65, (byte)0x79, (byte)0x1f, (byte)0xf1, (byte)0xbf,
+        (byte)0xc7, (byte)0x41, (byte)0x26, (byte)0xcc, (byte)0xc6, (byte)0x1c,
+        (byte)0xa9, (byte)0x83, (byte)0x6f, (byte)0x03
+    };
+
+    private static final byte EXP_Q[] = {
+        (byte)0x12, (byte)0x84, (byte)0x1a, (byte)0x99, (byte)0xce, (byte)0x9a,
+        (byte)0x8b, (byte)0x58, (byte)0xcc, (byte)0x47, (byte)0x43, (byte)0xdf,
+        (byte)0x77, (byte)0xbb, (byte)0xd3, (byte)0x20, (byte)0xae, (byte)0xe4,
+        (byte)0x2e, (byte)0x63, (byte)0x67, (byte)0xdc, (byte)0xf7, (byte)0x5f,
+        (byte)0x3f, (byte)0x83, (byte)0x27, (byte)0xb7, (byte)0x14, (byte)0x52,
+        (byte)0x56, (byte)0xbf, (byte)0xc3, (byte)0x65, (byte)0x06, (byte)0xe1,
+        (byte)0x03, (byte)0xcc, (byte)0x93, (byte)0x57, (byte)0x09, (byte)0x7b,
+        (byte)0x6f, (byte)0xe8, (byte)0x81, (byte)0x4a, (byte)0x2c, (byte)0xb7,
+        (byte)0x43, (byte)0xa9, (byte)0x20, (byte)0x1d, (byte)0xf6, (byte)0x56,
+        (byte)0x8b, (byte)0xcc, (byte)0xe5, (byte)0x4c, (byte)0xd5, (byte)0x4f,
+        (byte)0x74, (byte)0x67, (byte)0x29, (byte)0x51
+    };
+
+    private static final byte CRT_COEFF[] = {
+        (byte)0x23, (byte)0xab, (byte)0xf4, (byte)0x03, (byte)0x2f, (byte)0x29,
+        (byte)0x95, (byte)0x74, (byte)0xac, (byte)0x1a, (byte)0x33, (byte)0x96,
+        (byte)0x62, (byte)0xed, (byte)0xf7, (byte)0xf6, (byte)0xae, (byte)0x07,
+        (byte)0x2a, (byte)0x2e, (byte)0xe8, (byte)0xab, (byte)0xfb, (byte)0x1e,
+        (byte)0xb9, (byte)0xb2, (byte)0x88, (byte)0x1e, (byte)0x85, (byte)0x05,
+        (byte)0x42, (byte)0x64, (byte)0x03, (byte)0xb2, (byte)0x8b, (byte)0xc1,
+        (byte)0x81, (byte)0x75, (byte)0xd7, (byte)0xba, (byte)0xaa, (byte)0xd4,
+        (byte)0x31, (byte)0x3c, (byte)0x8a, (byte)0x96, (byte)0x23, (byte)0x9d,
+        (byte)0x3f, (byte)0x06, (byte)0x3e, (byte)0x44, (byte)0xa9, (byte)0x62,
+        (byte)0x2f, (byte)0x61, (byte)0x5a, (byte)0x51, (byte)0x82, (byte)0x2c,
+        (byte)0x04, (byte)0x85, (byte)0x73, (byte)0xd1
+    };
+
+    private static KeyPair genPredefinedRSAKeyPair() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        BigInteger mod = new BigInteger(MOD);
+        BigInteger pub = new BigInteger(PUB_EXP);
+
+        PrivateKey privKey = kf.generatePrivate
+            (new RSAPrivateCrtKeySpec
+             (mod, pub, new BigInteger(PRIV_EXP),
+              new BigInteger(PRIME_P), new BigInteger(PRIME_Q),
+              new BigInteger(EXP_P), new BigInteger(EXP_Q),
+              new BigInteger(CRT_COEFF)));
+        PublicKey pubKey = kf.generatePublic(new RSAPublicKeySpec(mod, pub));
+        return new KeyPair(pubKey, privKey);
+    }
+
+    private static final String CIP_ALGOS[] = {
+        "RSA/ECB/NoPadding",
+        "RSA/ECB/PKCS1Padding"
+    };
+    private static final int INPUT_SIZE_REDUCTION[] = {
+        0,
+        11,
+    };
+
+    private static KeyPair kp[] = null;
+
+    public static void main(String argv[]) throws Exception {
+        main(new TestMalformedRSA(), null);
+    }
+
+    public void doTest(Provider prov) throws Exception {
+        // first test w/ predefine KeyPair
+        KeyPair pkp = genPredefinedRSAKeyPair();
+        System.out.println("Test against Predefined RSA Key Pair");
+        testCipher(pkp, 128, false, prov);
+    }
+
+
+    private static void testCipher(KeyPair kp, int inputSizeInBytes,
+                                   boolean checkInterop, Provider prov)
+        throws Exception {
+        Cipher c1, c2;
+        for (int i = 0; i < CIP_ALGOS.length; i++) {
+            String algo = CIP_ALGOS[i];
+            try {
+                c1 = Cipher.getInstance(algo, prov);
+            } catch (NoSuchAlgorithmException nsae) {
+                System.out.println("Skip unsupported Cipher algo: " + algo);
+                continue;
+            }
+
+            if (checkInterop) {
+                c2 = Cipher.getInstance(algo, "SunJCE");
+            } else {
+                c2 = Cipher.getInstance(algo, prov);
+            }
+            byte[] data = Arrays.copyOf
+                 (PLAINTEXT, inputSizeInBytes - INPUT_SIZE_REDUCTION[i]);
+
+            testEncryption(c1, c2, kp, data);
+        }
+    }
+
+    private static void testEncryption(Cipher c1, Cipher c2,
+            KeyPair kp, byte[] data) throws Exception {
+
+        // C1 Encrypt + C2 Decrypt
+        byte[] out1 = null;
+        byte[] recoveredText = null;
+        try {
+            c1.init(Cipher.ENCRYPT_MODE, kp.getPublic());
+            out1 = c1.doFinal(data);
+
+            // damage the cipher text
+            out1[out1.length - 1] = (byte)(out1[out1.length - 1] ^ 0xFF);
+
+            c2.init(Cipher.DECRYPT_MODE, kp.getPrivate());
+            recoveredText = c2.doFinal(out1);
+
+            // Note that decryption of "RSA/ECB/NoPadding" don't throw
+            // BadPaddingException
+            System.out.println("\t=> PASS: " + c2.getAlgorithm());
+        } catch (BadPaddingException ex) {
+            System.out.println("\tDEC ERROR: " + c2.getAlgorithm());
+            System.out.println("\t=> PASS: expected BadPaddingException");
+            ex.printStackTrace();
+        }
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/oracle/security/ucrypto/TestRSA.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,422 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug     7088989
+ * @summary Ensure the RSA ciphers and signatures works correctly
+ */
+
+import java.io.*;
+import java.security.*;
+import java.security.spec.*;
+import java.util.*;
+import java.math.*;
+import javax.crypto.*;
+
+public class TestRSA extends UcryptoTest {
+
+    // KAT
+    private static final byte PLAINTEXT[] = Arrays.copyOf
+        (new String("Known plaintext message utilized" +
+                    "for RSA Encryption &  Decryption" +
+                    "block, SHA1, SHA256, SHA384  and" +
+                    "SHA512 RSA Signature KAT tests.").getBytes(), 128);
+
+    private static final byte MOD[] = {
+        (byte)0xd5, (byte)0x84, (byte)0x95, (byte)0x07, (byte)0xf4, (byte)0xd0,
+        (byte)0x1f, (byte)0x82, (byte)0xf3, (byte)0x79, (byte)0xf4, (byte)0x99,
+        (byte)0x48, (byte)0x10, (byte)0xe1, (byte)0x71, (byte)0xa5, (byte)0x62,
+        (byte)0x22, (byte)0xa3, (byte)0x4b, (byte)0x00, (byte)0xe3, (byte)0x5b,
+        (byte)0x3a, (byte)0xcc, (byte)0x10, (byte)0x83, (byte)0xe0, (byte)0xaf,
+        (byte)0x61, (byte)0x13, (byte)0x54, (byte)0x6a, (byte)0xa2, (byte)0x6a,
+        (byte)0x2c, (byte)0x5e, (byte)0xb3, (byte)0xcc, (byte)0xa3, (byte)0x71,
+        (byte)0x9a, (byte)0xb2, (byte)0x3e, (byte)0x78, (byte)0xec, (byte)0xb5,
+        (byte)0x0e, (byte)0x6e, (byte)0x31, (byte)0x3b, (byte)0x77, (byte)0x1f,
+        (byte)0x6e, (byte)0x94, (byte)0x41, (byte)0x60, (byte)0xd5, (byte)0x6e,
+        (byte)0xd9, (byte)0xc6, (byte)0xf9, (byte)0x29, (byte)0xc3, (byte)0x40,
+        (byte)0x36, (byte)0x25, (byte)0xdb, (byte)0xea, (byte)0x0b, (byte)0x07,
+        (byte)0xae, (byte)0x76, (byte)0xfd, (byte)0x99, (byte)0x29, (byte)0xf4,
+        (byte)0x22, (byte)0xc1, (byte)0x1a, (byte)0x8f, (byte)0x05, (byte)0xfe,
+        (byte)0x98, (byte)0x09, (byte)0x07, (byte)0x05, (byte)0xc2, (byte)0x0f,
+        (byte)0x0b, (byte)0x11, (byte)0x83, (byte)0x39, (byte)0xca, (byte)0xc7,
+        (byte)0x43, (byte)0x63, (byte)0xff, (byte)0x33, (byte)0x80, (byte)0xe7,
+        (byte)0xc3, (byte)0x78, (byte)0xae, (byte)0xf1, (byte)0x73, (byte)0x52,
+        (byte)0x98, (byte)0x1d, (byte)0xde, (byte)0x5c, (byte)0x53, (byte)0x6e,
+        (byte)0x01, (byte)0x73, (byte)0x0d, (byte)0x12, (byte)0x7e, (byte)0x77,
+        (byte)0x03, (byte)0xf1, (byte)0xef, (byte)0x1b, (byte)0xc8, (byte)0xa8,
+        (byte)0x0f, (byte)0x97
+    };
+
+    private static final byte PUB_EXP[] = {(byte)0x01, (byte)0x00, (byte)0x01};
+
+    private static final byte PRIV_EXP[] = {
+        (byte)0x85, (byte)0x27, (byte)0x47, (byte)0x61, (byte)0x4c, (byte)0xd4,
+        (byte)0xb5, (byte)0xb2, (byte)0x0e, (byte)0x70, (byte)0x91, (byte)0x8f,
+        (byte)0x3d, (byte)0x97, (byte)0xf9, (byte)0x5f, (byte)0xcc, (byte)0x09,
+        (byte)0x65, (byte)0x1c, (byte)0x7c, (byte)0x5b, (byte)0xb3, (byte)0x6d,
+        (byte)0x63, (byte)0x3f, (byte)0x7b, (byte)0x55, (byte)0x22, (byte)0xbb,
+        (byte)0x7c, (byte)0x48, (byte)0x77, (byte)0xae, (byte)0x80, (byte)0x56,
+        (byte)0xc2, (byte)0x10, (byte)0xd5, (byte)0x03, (byte)0xdb, (byte)0x31,
+        (byte)0xaf, (byte)0x8d, (byte)0x54, (byte)0xd4, (byte)0x48, (byte)0x99,
+        (byte)0xa8, (byte)0xc4, (byte)0x23, (byte)0x43, (byte)0xb8, (byte)0x48,
+        (byte)0x0b, (byte)0xc7, (byte)0xbc, (byte)0xf5, (byte)0xcc, (byte)0x64,
+        (byte)0x72, (byte)0xbf, (byte)0x59, (byte)0x06, (byte)0x04, (byte)0x1c,
+        (byte)0x32, (byte)0xf5, (byte)0x14, (byte)0x2e, (byte)0x6e, (byte)0xe2,
+        (byte)0x0f, (byte)0x5c, (byte)0xde, (byte)0x36, (byte)0x3c, (byte)0x6e,
+        (byte)0x7c, (byte)0x4d, (byte)0xcc, (byte)0xd3, (byte)0x00, (byte)0x6e,
+        (byte)0xe5, (byte)0x45, (byte)0x46, (byte)0xef, (byte)0x4d, (byte)0x25,
+        (byte)0x46, (byte)0x6d, (byte)0x7f, (byte)0xed, (byte)0xbb, (byte)0x4f,
+        (byte)0x4d, (byte)0x9f, (byte)0xda, (byte)0x87, (byte)0x47, (byte)0x8f,
+        (byte)0x74, (byte)0x44, (byte)0xb7, (byte)0xbe, (byte)0x9d, (byte)0xf5,
+        (byte)0xdd, (byte)0xd2, (byte)0x4c, (byte)0xa5, (byte)0xab, (byte)0x74,
+        (byte)0xe5, (byte)0x29, (byte)0xa1, (byte)0xd2, (byte)0x45, (byte)0x3b,
+        (byte)0x33, (byte)0xde, (byte)0xd5, (byte)0xae, (byte)0xf7, (byte)0x03,
+        (byte)0x10, (byte)0x21
+    };
+
+    private static final byte PRIME_P[] = {
+        (byte)0xf9, (byte)0x74, (byte)0x8f, (byte)0x16, (byte)0x02, (byte)0x6b,
+        (byte)0xa0, (byte)0xee, (byte)0x7f, (byte)0x28, (byte)0x97, (byte)0x91,
+        (byte)0xdc, (byte)0xec, (byte)0xc0, (byte)0x7c, (byte)0x49, (byte)0xc2,
+        (byte)0x85, (byte)0x76, (byte)0xee, (byte)0x66, (byte)0x74, (byte)0x2d,
+        (byte)0x1a, (byte)0xb8, (byte)0xf7, (byte)0x2f, (byte)0x11, (byte)0x5b,
+        (byte)0x36, (byte)0xd8, (byte)0x46, (byte)0x33, (byte)0x3b, (byte)0xd8,
+        (byte)0xf3, (byte)0x2d, (byte)0xa1, (byte)0x03, (byte)0x83, (byte)0x2b,
+        (byte)0xec, (byte)0x35, (byte)0x43, (byte)0x32, (byte)0xff, (byte)0xdd,
+        (byte)0x81, (byte)0x7c, (byte)0xfd, (byte)0x65, (byte)0x13, (byte)0x04,
+        (byte)0x7c, (byte)0xfc, (byte)0x03, (byte)0x97, (byte)0xf0, (byte)0xd5,
+        (byte)0x62, (byte)0xdc, (byte)0x0d, (byte)0xbf
+    };
+
+    private static final byte PRIME_Q[] = {
+        (byte)0xdb, (byte)0x1e, (byte)0xa7, (byte)0x3d, (byte)0xe7, (byte)0xfa,
+        (byte)0x8b, (byte)0x04, (byte)0x83, (byte)0x48, (byte)0xf3, (byte)0xa5,
+        (byte)0x31, (byte)0x9d, (byte)0x35, (byte)0x5e, (byte)0x4d, (byte)0x54,
+        (byte)0x77, (byte)0xcc, (byte)0x84, (byte)0x09, (byte)0xf3, (byte)0x11,
+        (byte)0x0d, (byte)0x54, (byte)0xed, (byte)0x85, (byte)0x39, (byte)0xa9,
+        (byte)0xca, (byte)0xa8, (byte)0xea, (byte)0xae, (byte)0x19, (byte)0x9c,
+        (byte)0x75, (byte)0xdb, (byte)0x88, (byte)0xb8, (byte)0x04, (byte)0x8d,
+        (byte)0x54, (byte)0xc6, (byte)0xa4, (byte)0x80, (byte)0xf8, (byte)0x93,
+        (byte)0xf0, (byte)0xdb, (byte)0x19, (byte)0xef, (byte)0xd7, (byte)0x87,
+        (byte)0x8a, (byte)0x8f, (byte)0x5a, (byte)0x09, (byte)0x2e, (byte)0x54,
+        (byte)0xf3, (byte)0x45, (byte)0x24, (byte)0x29
+    };
+
+    private static final byte EXP_P[] = {
+        (byte)0x6a, (byte)0xd1, (byte)0x25, (byte)0x80, (byte)0x18, (byte)0x33,
+        (byte)0x3c, (byte)0x2b, (byte)0x44, (byte)0x19, (byte)0xfe, (byte)0xa5,
+        (byte)0x40, (byte)0x03, (byte)0xc4, (byte)0xfc, (byte)0xb3, (byte)0x9c,
+        (byte)0xef, (byte)0x07, (byte)0x99, (byte)0x58, (byte)0x17, (byte)0xc1,
+        (byte)0x44, (byte)0xa3, (byte)0x15, (byte)0x7d, (byte)0x7b, (byte)0x22,
+        (byte)0x22, (byte)0xdf, (byte)0x03, (byte)0x58, (byte)0x66, (byte)0xf5,
+        (byte)0x24, (byte)0x54, (byte)0x52, (byte)0x91, (byte)0x2d, (byte)0x76,
+        (byte)0xfe, (byte)0x63, (byte)0x64, (byte)0x4e, (byte)0x0f, (byte)0x50,
+        (byte)0x2b, (byte)0x65, (byte)0x79, (byte)0x1f, (byte)0xf1, (byte)0xbf,
+        (byte)0xc7, (byte)0x41, (byte)0x26, (byte)0xcc, (byte)0xc6, (byte)0x1c,
+        (byte)0xa9, (byte)0x83, (byte)0x6f, (byte)0x03
+    };
+
+    private static final byte EXP_Q[] = {
+        (byte)0x12, (byte)0x84, (byte)0x1a, (byte)0x99, (byte)0xce, (byte)0x9a,
+        (byte)0x8b, (byte)0x58, (byte)0xcc, (byte)0x47, (byte)0x43, (byte)0xdf,
+        (byte)0x77, (byte)0xbb, (byte)0xd3, (byte)0x20, (byte)0xae, (byte)0xe4,
+        (byte)0x2e, (byte)0x63, (byte)0x67, (byte)0xdc, (byte)0xf7, (byte)0x5f,
+        (byte)0x3f, (byte)0x83, (byte)0x27, (byte)0xb7, (byte)0x14, (byte)0x52,
+        (byte)0x56, (byte)0xbf, (byte)0xc3, (byte)0x65, (byte)0x06, (byte)0xe1,
+        (byte)0x03, (byte)0xcc, (byte)0x93, (byte)0x57, (byte)0x09, (byte)0x7b,
+        (byte)0x6f, (byte)0xe8, (byte)0x81, (byte)0x4a, (byte)0x2c, (byte)0xb7,
+        (byte)0x43, (byte)0xa9, (byte)0x20, (byte)0x1d, (byte)0xf6, (byte)0x56,
+        (byte)0x8b, (byte)0xcc, (byte)0xe5, (byte)0x4c, (byte)0xd5, (byte)0x4f,
+        (byte)0x74, (byte)0x67, (byte)0x29, (byte)0x51
+    };
+
+    private static final byte CRT_COEFF[] = {
+        (byte)0x23, (byte)0xab, (byte)0xf4, (byte)0x03, (byte)0x2f, (byte)0x29,
+        (byte)0x95, (byte)0x74, (byte)0xac, (byte)0x1a, (byte)0x33, (byte)0x96,
+        (byte)0x62, (byte)0xed, (byte)0xf7, (byte)0xf6, (byte)0xae, (byte)0x07,
+        (byte)0x2a, (byte)0x2e, (byte)0xe8, (byte)0xab, (byte)0xfb, (byte)0x1e,
+        (byte)0xb9, (byte)0xb2, (byte)0x88, (byte)0x1e, (byte)0x85, (byte)0x05,
+        (byte)0x42, (byte)0x64, (byte)0x03, (byte)0xb2, (byte)0x8b, (byte)0xc1,
+        (byte)0x81, (byte)0x75, (byte)0xd7, (byte)0xba, (byte)0xaa, (byte)0xd4,
+        (byte)0x31, (byte)0x3c, (byte)0x8a, (byte)0x96, (byte)0x23, (byte)0x9d,
+        (byte)0x3f, (byte)0x06, (byte)0x3e, (byte)0x44, (byte)0xa9, (byte)0x62,
+        (byte)0x2f, (byte)0x61, (byte)0x5a, (byte)0x51, (byte)0x82, (byte)0x2c,
+        (byte)0x04, (byte)0x85, (byte)0x73, (byte)0xd1
+    };
+
+    private static KeyPair genRSAKey(int keyLength) throws Exception {
+        KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
+        kpg.initialize(keyLength);
+        return kpg.generateKeyPair();
+    }
+
+    private static KeyPair genPredefinedRSAKeyPair() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        BigInteger mod = new BigInteger(MOD);
+        BigInteger pub = new BigInteger(PUB_EXP);
+
+        PrivateKey privKey = kf.generatePrivate
+            (new RSAPrivateCrtKeySpec
+             (mod, pub, new BigInteger(PRIV_EXP),
+              new BigInteger(PRIME_P), new BigInteger(PRIME_Q),
+              new BigInteger(EXP_P), new BigInteger(EXP_Q),
+              new BigInteger(CRT_COEFF)));
+        PublicKey pubKey = kf.generatePublic(new RSAPublicKeySpec(mod, pub));
+        return new KeyPair(pubKey, privKey);
+    }
+
+    private static final String CIP_ALGOS[] = {
+        "RSA/ECB/NoPadding",
+        "RSA/ECB/PKCS1Padding"
+    };
+    private static final int INPUT_SIZE_REDUCTION[] = {
+        0,
+        11,
+    };
+    private static final String SIG_ALGOS[] = {
+        "MD5WithRSA",
+        "SHA1WithRSA",
+        "SHA256WithRSA",
+        "SHA384WithRSA",
+        "SHA512WithRSA"
+    };
+
+    private static KeyPair kp[] = null;
+
+    public static void main(String argv[]) throws Exception {
+        main(new TestRSA(), null);
+    }
+
+    public void doTest(Provider prov) throws Exception {
+        // first test w/ predefine KeyPair
+        KeyPair pkp = genPredefinedRSAKeyPair();
+        System.out.println("Test against Predefined RSA Key Pair");
+        testCipher(pkp, 128, true, prov);
+        testSignature(pkp, true, prov);
+
+        for (int i = 0; i < 10; i++) {
+            // then test w/ various key lengths
+            int keyLens[] = { 1024, 2048 };
+            kp = new KeyPair[keyLens.length];
+
+            testCipher(keyLens, false, prov);
+            testSignature(keyLens, false, prov);
+        }
+    }
+
+
+    private static void testCipher(KeyPair kp, int inputSizeInBytes,
+                                   boolean checkInterop, Provider prov)
+        throws Exception {
+        Cipher c1, c2;
+        for (int i = 0; i < CIP_ALGOS.length; i++) {
+            String algo = CIP_ALGOS[i];
+            try {
+                c1 = Cipher.getInstance(algo, prov);
+            } catch (NoSuchAlgorithmException nsae) {
+                System.out.println("Skip unsupported Cipher algo: " + algo);
+                continue;
+            }
+
+            if (checkInterop) {
+                c2 = Cipher.getInstance(algo, "SunJCE");
+            } else {
+                c2 = Cipher.getInstance(algo, prov);
+            }
+            byte[] data = Arrays.copyOf
+                 (PLAINTEXT, inputSizeInBytes - INPUT_SIZE_REDUCTION[i]);
+
+            testEncryption(c1, c2, kp, data);
+        }
+    }
+
+    private static void testCipher(int keyLens[], boolean checkInterop,
+                                   Provider prov)
+        throws Exception {
+        // RSA CipherText will always differ due to the random nonce in padding
+        // so we check whether both
+        // 1) Java Encrypt/C Decrypt
+        // 2) C Encrypt/Java Decrypt
+        // works
+        Cipher c1, c2;
+        for (int i = 0; i < CIP_ALGOS.length; i++) {
+            String algo = CIP_ALGOS[i];
+            try {
+                c1 = Cipher.getInstance(algo, prov);
+            } catch (NoSuchAlgorithmException nsae) {
+                System.out.println("Skip unsupported Cipher algo: " + algo);
+                continue;
+            }
+
+            if (checkInterop) {
+                c2 = Cipher.getInstance(algo, "SunJCE");
+            } else {
+                c2 = Cipher.getInstance(algo, prov);
+            }
+
+            for (int h = 0; h < keyLens.length; h++) {
+                // Defer key pair generation until now when it'll soon be used.
+                if (kp[h] == null) {
+                    kp[h] = genRSAKey(keyLens[h]);
+                }
+                System.out.println("\tTesting Cipher " + algo + " w/ KeySize " + keyLens[h]);
+                byte[] data = Arrays.copyOf
+                    (PLAINTEXT, keyLens[h]/8 - INPUT_SIZE_REDUCTION[i]);
+                testEncryption(c1, c2, kp[h], data);
+            }
+        }
+    }
+
+    private static void testEncryption(Cipher c1, Cipher c2, KeyPair kp, byte[] data)
+        throws Exception {
+        // C1 Encrypt + C2 Decrypt
+        byte[] out1 = null;
+        byte[] recoveredText = null;
+        try {
+            c1.init(Cipher.ENCRYPT_MODE, kp.getPublic());
+            out1 = c1.doFinal(data);
+            c2.init(Cipher.DECRYPT_MODE, kp.getPrivate());
+            recoveredText = c2.doFinal(out1);
+        } catch (Exception ex) {
+            System.out.println("\tDEC ERROR: unexpected exception");
+            ex.printStackTrace();
+            throw ex;
+        }
+        if(!Arrays.equals(recoveredText, data)) {
+            throw new RuntimeException("\tDEC ERROR: different PT bytes!");
+        }
+        // C2 Encrypt + C1 Decrypt
+        byte[] cipherText = null;
+        try {
+            c2.init(Cipher.ENCRYPT_MODE, kp.getPublic());
+            cipherText = c2.doFinal(data);
+            c1.init(Cipher.DECRYPT_MODE, kp.getPrivate());
+            try {
+                out1 = c1.doFinal(cipherText);
+            } catch (Exception ex) {
+                System.out.println("\tENC ERROR: invalid encrypted output");
+                ex.printStackTrace();
+                throw ex;
+            }
+        } catch (Exception ex) {
+            System.out.println("\tENC ERROR: unexpected exception");
+            ex.printStackTrace();
+            throw ex;
+        }
+        if (!Arrays.equals(out1, data)) {
+            throw new RuntimeException("\tENC ERROR: Decrypted result DIFF!");
+        }
+        System.out.println("\t=> PASS");
+    }
+
+    private static void testSignature(KeyPair kp, boolean checkInterop,
+                                      Provider prov) throws Exception {
+        byte[] data = PLAINTEXT;
+        Signature sig1, sig2;
+        for (int i = 0; i < SIG_ALGOS.length; i++) {
+            String algo = SIG_ALGOS[i];
+            try {
+                sig1 = Signature.getInstance(algo, prov);
+            } catch (NoSuchAlgorithmException nsae) {
+                System.out.println("Skip unsupported Signature algo: " + algo);
+                continue;
+            }
+
+            if (checkInterop) {
+                sig2 = Signature.getInstance(algo, "SunRsaSign");
+            } else {
+                sig2 = Signature.getInstance(algo, prov);
+            }
+            testSigning(sig1, sig2, kp, data);
+        }
+    }
+
+    private static void testSignature(int keyLens[], boolean checkInterop,
+                                      Provider prov) throws Exception {
+        byte[] data = PLAINTEXT;
+        Signature sig1, sig2;
+        for (int i = 0; i < SIG_ALGOS.length; i++) {
+            String algo = SIG_ALGOS[i];
+            try {
+                sig1 = Signature.getInstance(algo, prov);
+            } catch (NoSuchAlgorithmException nsae) {
+                System.out.println("Skip unsupported Signature algo: " + algo);
+                continue;
+            }
+
+            if (checkInterop) {
+                sig2 = Signature.getInstance(algo, "SunRsaSign");
+            } else {
+                sig2 = Signature.getInstance(algo, prov);
+            }
+
+            for (int h = 0; h < keyLens.length; h++) {
+                // Defer key pair generation until now when it'll soon be used.
+                if (kp[h] == null) {
+                    kp[h] = genRSAKey(keyLens[h]);
+                }
+                System.out.println("\tTesting Signature " + algo + " w/ KeySize " + keyLens[h]);
+
+                testSigning(sig1, sig2, kp[h], data);
+            }
+        }
+    }
+
+    private static void testSigning(Signature sig1, Signature sig2, KeyPair kp, byte[] data)
+            throws Exception {
+        boolean sameSig = false;
+        byte[] out = null;
+        try {
+            sig1.initSign(kp.getPrivate());
+            sig1.update(data);
+            out = sig1.sign();
+        } catch (Exception ex) {
+            System.out.println("\tSIGN ERROR: unexpected exception!");
+            ex.printStackTrace();
+        }
+
+        sig2.initSign(kp.getPrivate());
+        sig2.update(data);
+        byte[] out2 = sig2.sign();
+        if (!Arrays.equals(out2, out)) {
+            throw new RuntimeException("\tSIGN ERROR: Signature DIFF!");
+        }
+
+        boolean verify = false;
+        try {
+            System.out.println("\tVERIFY1 using native out");
+            sig1.initVerify(kp.getPublic());
+            sig1.update(data);
+            verify = sig1.verify(out);
+            if (!verify) {
+                throw new RuntimeException("VERIFY1 FAIL!");
+            }
+        } catch (Exception ex) {
+            System.out.println("\tVERIFY1 ERROR: unexpected exception!");
+            ex.printStackTrace();
+            throw ex;
+        }
+        System.out.println("\t=> PASS");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/oracle/security/ucrypto/UcryptoTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.io.*;
+import java.util.*;
+import java.lang.reflect.*;
+import java.security.*;
+
+// common infrastructure for OracleUcrypto provider tests
+public abstract class UcryptoTest {
+
+    protected static final boolean hasUcrypto;
+    static {
+        hasUcrypto = (Security.getProvider("OracleUcrypto") != null);
+    }
+
+    private static Provider getCustomizedUcrypto(String config) throws Exception {
+        Class clazz = Class.forName("com.oracle.security.ucrypto.OracleUcrypto");
+        Constructor cons = clazz.getConstructor(new Class[] {String.class});
+        Object obj = cons.newInstance(new Object[] {config});
+        return (Provider)obj;
+    }
+
+    public abstract void doTest(Provider p) throws Exception;
+
+    public static void main(UcryptoTest test, String config) throws Exception {
+        Provider prov = null;
+        if (hasUcrypto) {
+            if (config != null) {
+                prov = getCustomizedUcrypto(config);
+            } else {
+                prov = Security.getProvider("OracleUcrypto");
+            }
+        }
+        if (prov == null) {
+            // un-available, skip testing...
+            System.out.println("No OracleUcrypto provider found, skipping test");
+            return;
+        }
+        test.doTest(prov);
+    }
+}
--- a/jdk/test/com/sun/jmx/snmp/SnmpOidHashCode.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary Test that SnmpOid hashCode is consistent with equals.
- * @bug     4955105
- * @build   SnmpOidHashCode
- * @run     main SnmpOidHashCode
- */
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-
-public class SnmpOidHashCode {
-    public static final String[] oids = {
-        "1.1.1.1.1.1.1.1.1",
-        "1.1.1.1.1.1.1.1",
-        "1.1.1.1.2.1.1.1.1",
-        "1.1.1.1.1.2.1.1.1",
-        "1.3.2",
-        "2.3.1",
-        "1.2.67."+Integer.MAX_VALUE+"."+Integer.MAX_VALUE+
-        "."+Integer.MAX_VALUE+"."+Integer.MAX_VALUE+"."+Integer.MAX_VALUE+
-        "1",
-        "1.2."+0xFFFFFFFFL+".3."+0xFFFFFFFFL+".4."+0xFFFFFFFFL+
-        ".5."+0xFFFFFFFFL+".6."+0xFFFFFFFFL+".7."+0xFFFFFFFFL+
-        ".8."+0xFFFFFFFFL+".9."+0xFFFFFFFFL+".10."+0xFFFFFFFFL+
-        ".11."+0xFFFFFFFFL+".12."+0xFFFFFFFFL+".13."+0xFFFFFFFFL+
-        ".14."+0xFFFFFFFFL+".15."+0xFFFFFFFFL+".16."+0xFFFFFFFFL+
-        ".17."+0xFFFFFFFFL+".18."+0xFFFFFFFFL+".19."+0xFFFFFFFFL+
-        ".20."+0xFFFFFFFFL+".21."+0xFFFFFFFFL+".22."+0xFFFFFFFFL+
-        ".23."+0xFFFFFFFFL+".24."+0xFFFFFFFFL+".25."+0xFFFFFFFFL+
-        ".26."+0xFFFFFFFFL+".27."+0xFFFFFFFFL+".28."+0xFFFFFFFFL+
-        ".29."+0xFFFFFFFFL+
-        ".30."+0xFFFFFFFFL+".31."+0xFFFFFFFFL+".32."+0xFFFFFFFFL+
-        ".33."+0xFFFFFFFFL+".34."+0xFFFFFFFFL+".35."+0xFFFFFFFFL+
-        ".36."+0xFFFFFFFFL+".37."+0xFFFFFFFFL+".38."+0xFFFFFFFFL+
-        ".39."+0xFFFFFFFFL
-    };
-
-    // We use an SnmpOidBuilder in order to adapt this test case to a
-    // configuration where the SNMP packages are not present in rt.jar.
-    //
-    public static final class SnmpOidBuilder {
-        public static final String SNMP_OID_CLASS_NAME =
-            "com.sun.jmx.snmp.SnmpOid";
-        private static final Class<?> SNMP_OID_CLASS;
-        private static final Constructor<?> SNMP_OID_CTOR;
-        static {
-            Class<?> snmpOidClass;
-            try {
-                snmpOidClass =
-                    Class.forName(SNMP_OID_CLASS_NAME, true, null);
-            } catch (ClassNotFoundException x) {
-                snmpOidClass = null;
-                System.err.println("WARNING: can't load "+SNMP_OID_CLASS_NAME);
-            } catch (NoClassDefFoundError x) {
-                snmpOidClass = null;
-                System.err.println("WARNING: can't load "+SNMP_OID_CLASS_NAME);
-            }
-            SNMP_OID_CLASS = snmpOidClass;
-            if (SNMP_OID_CLASS != null) {
-                try {
-                  SNMP_OID_CTOR = snmpOidClass.getConstructor(String.class);
-                } catch (Exception x) {
-                    throw new ExceptionInInitializerError(x);
-                }
-            } else {
-                SNMP_OID_CTOR = null;
-            }
-        }
-
-        public static boolean isSnmpPresent() {
-            System.out.println(SnmpOidHashCode.class.getName()+
-                    ": Testing for SNMP Packages...");
-            return SNMP_OID_CLASS != null;
-        }
-
-        public static Object newSnmpOid(String oid)
-            throws InstantiationException,
-                   IllegalAccessException,
-                   InvocationTargetException {
-            return SNMP_OID_CTOR.newInstance(oid);
-        }
-
-    }
-
-    private static Object newSnmpOid(String oid) throws Exception {
-        try {
-            return SnmpOidBuilder.newSnmpOid(oid);
-        } catch (InvocationTargetException x) {
-            final Throwable cause = x.getCause();
-            if (cause instanceof Exception) throw (Exception)cause;
-            if (cause instanceof Error) throw (Error)cause;
-            throw x;
-        }
-    }
-
-    public static void main(String args[]) {
-        if (!SnmpOidBuilder.isSnmpPresent()) {
-            System.err.println("WARNING: "+
-                    SnmpOidBuilder.SNMP_OID_CLASS_NAME+" not present.");
-            System.err.println(SnmpOidHashCode.class.getName()+
-                    ": test skipped.");
-            return;
-        }
-        try {
-            int errCount=0;
-            int collisions=0;
-            for (int i=0;i<oids.length;i++) {
-                System.out.println("Testing " + oids[i]);
-                final Object o1 = newSnmpOid(oids[i]);
-                final int startCount=errCount;
-                for (int j=0;j<oids.length;j++) {
-                    final Object o2 = newSnmpOid(oids[j]);
-                    if (o1.equals(o2)) {
-                        if (!(oids[i].equals(oids[j]))) {
-                            System.err.println("OIDs differ but " +
-                                               "equals yields true: " +
-                                               "\n\to1="+oids[i]+
-                                               "\n\to2="+oids[j]);
-                            errCount++;
-                        }
-                        if (o1.hashCode() != o2.hashCode()) {
-                            System.err.println("OIDs are equal but " +
-                                               "hashCode differ:" +
-                                               "\n\thashCode("+o1+")="+
-                                               o1.hashCode()+", "+
-                                               "\n\thashCode("+o2+")="+
-                                               o2.hashCode());
-                            errCount++;
-                        }
-                    } else {
-                        if (oids[i].equals(oids[j])) {
-                            System.err.println("OIDs are equal but " +
-                                               "equals yields false: " +
-                                               "\n\to1="+oids[i]+
-                                               "\n\to2="+oids[j]);
-                            errCount++;
-                        }
-                        if (o1.hashCode() == o2.hashCode()) collisions++;
-                    }
-                }
-                if (errCount == startCount)
-                    System.out.println("*** Test Passed for: " + o1);
-                else
-                    System.out.println("*** Test Failed (" +
-                                       (errCount - startCount) + ") for: "
-                                       + o1);
-            }
-
-            if (errCount == 0) {
-                System.out.println("*** -----------------------------------");
-                System.out.println("*** Test SnmpOidHashCode " +
-                                   "succesfully passed (" + collisions +
-                                   " collisions).");
-                System.out.println("*** -----------------------------------");
-            } else {
-                System.err.println("*** -----------------------------------");
-                System.err.println("*** Test SnmpOidHashCode failed: " +
-                                   errCount + " failures (" + collisions +
-                                   " collisions).");
-                System.err.println("*** -----------------------------------");
-                System.exit(1);
-            }
-        } catch(Exception x) {
-            x.printStackTrace();
-            System.exit(2);
-        }
-    }
-}
--- a/jdk/test/com/sun/jmx/snmp/TimeTicksWrapping.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,241 +0,0 @@
-/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary Test that SnmpTimeTicks wraps around when it is passed a long
- *          value
- * @bug     4955105
- * @build   TimeTicksWrapping
- * @run     main TimeTicksWrapping
- */
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-public class TimeTicksWrapping {
-    // We use an SnmpTimeticksBuilder in order to adapt this test case to a
-    // configuration where the SNMP packages are not present in rt.jar.
-    //
-    public static final class SnmpTimeticksBuilder {
-        public static final long   MAX_VALUE = 0x0ffffffffL;
-        public static final String SNMP_TIME_TICKS_CLASS_NAME =
-            "com.sun.jmx.snmp.SnmpTimeticks";
-        private static final Class<?> SNMP_TIME_TICKS_CLASS;
-        private static final Constructor<?> SNMP_long_CTOR;
-        private static final Constructor<?> SNMP_LONG_CTOR;
-        private static final Method SNMP_LONG_VALUE;
-        static {
-            Class<?> snmpTimeTicksClass;
-            try {
-                snmpTimeTicksClass =
-                    Class.forName(SNMP_TIME_TICKS_CLASS_NAME, true, null);
-            } catch (ClassNotFoundException x) {
-                snmpTimeTicksClass = null;
-                System.err.println("WARNING: can't load "+
-                        SNMP_TIME_TICKS_CLASS_NAME);
-            } catch (NoClassDefFoundError x) {
-                snmpTimeTicksClass = null;
-                System.err.println("WARNING: can't load "+
-                        SNMP_TIME_TICKS_CLASS_NAME);
-            }
-            SNMP_TIME_TICKS_CLASS = snmpTimeTicksClass;
-            if (SNMP_TIME_TICKS_CLASS != null) {
-                try {
-                  SNMP_long_CTOR =
-                          SNMP_TIME_TICKS_CLASS.getConstructor(long.class);
-                } catch (Exception x) {
-                    throw new ExceptionInInitializerError(x);
-                }
-            } else {
-                SNMP_long_CTOR = null;
-            }
-            if (SNMP_TIME_TICKS_CLASS != null) {
-                try {
-                  SNMP_LONG_CTOR =
-                          SNMP_TIME_TICKS_CLASS.getConstructor(Long.class);
-                } catch (Exception x) {
-                    throw new ExceptionInInitializerError(x);
-                }
-            } else {
-                SNMP_LONG_CTOR = null;
-            }
-            if (SNMP_TIME_TICKS_CLASS != null) {
-                try {
-                  SNMP_LONG_VALUE =
-                          SNMP_TIME_TICKS_CLASS.getMethod("longValue");
-                } catch (Exception x) {
-                    throw new ExceptionInInitializerError(x);
-                }
-            } else {
-                SNMP_LONG_VALUE = null;
-            }
-
-        }
-
-        private final Object timeticks;
-
-        public SnmpTimeticksBuilder(long ticks) throws Exception {
-            timeticks = newSnmpTimeticks(ticks);
-        }
-        public SnmpTimeticksBuilder(Long ticks) throws Exception {
-            timeticks = newSnmpTimeticks(ticks);
-        }
-        public long longValue() throws Exception {
-            return longValue(timeticks);
-        }
-
-        public static boolean isSnmpPresent() {
-            System.out.println(TimeTicksWrapping.class.getName()+
-                    ": Testing for SNMP Packages...");
-            return SNMP_TIME_TICKS_CLASS != null;
-        }
-
-        private static Object newSnmpTimeticks(long time)
-                throws Exception {
-            try {
-                return SNMP_long_CTOR.newInstance(time);
-            } catch (InvocationTargetException x) {
-                final Throwable cause = x.getCause();
-                if (cause instanceof Exception) throw (Exception) cause;
-                if (cause instanceof Error) throw (Error) cause;
-                throw x;
-            }
-        }
-
-        private static Object newSnmpTimeticks(Long time)
-            throws Exception {
-            try {
-                return SNMP_LONG_CTOR.newInstance(time);
-            } catch (InvocationTargetException x) {
-                final Throwable cause = x.getCause();
-                if (cause instanceof Exception) throw (Exception) cause;
-                if (cause instanceof Error) throw (Error) cause;
-                throw x;
-            }
-        }
-
-        private static long longValue(Object o)
-                throws Exception {
-            try {
-                return ((Long)SNMP_LONG_VALUE.invoke(o)).longValue();
-            } catch (InvocationTargetException x) {
-                final Throwable cause = x.getCause();
-                if (cause instanceof Exception) throw (Exception) cause;
-                if (cause instanceof Error) throw (Error) cause;
-                throw x;
-            }
-        }
-
-    }
-
-    public static final long[] oks = {
-        0L, 1L, (long)Integer.MAX_VALUE, (long)Integer.MAX_VALUE*2,
-        (long)Integer.MAX_VALUE*2+1L, (long)Integer.MAX_VALUE*2+2L,
-        (long)Integer.MAX_VALUE*3,
-        SnmpTimeticksBuilder.MAX_VALUE, SnmpTimeticksBuilder.MAX_VALUE+1L,
-        SnmpTimeticksBuilder.MAX_VALUE*3-1L, Long.MAX_VALUE
-    };
-
-    public static final long[] kos = {
-        -1L, (long)Integer.MIN_VALUE, (long)Integer.MIN_VALUE*2,
-        (long)Integer.MIN_VALUE*2-1L, (long)Integer.MIN_VALUE*3,
-        -SnmpTimeticksBuilder.MAX_VALUE, -(SnmpTimeticksBuilder.MAX_VALUE+1L),
-        -(SnmpTimeticksBuilder.MAX_VALUE*3-1L), Long.MIN_VALUE
-    };
-
-
-    public static void main(String args[]) {
-        if (!SnmpTimeticksBuilder.isSnmpPresent()) {
-            System.err.println("WARNING: "+
-                    SnmpTimeticksBuilder.SNMP_TIME_TICKS_CLASS_NAME+
-                    " not present.");
-            System.err.println(TimeTicksWrapping.class.getName()+
-                    ": test skipped.");
-            return;
-        }
-        try {
-            SnmpTimeticksBuilder t = null;
-
-            for (int i=0;i<oks.length;i++) {
-                final long t1,t2,t3;
-                t1 = (new SnmpTimeticksBuilder(oks[i])).longValue();
-                t2 = (new SnmpTimeticksBuilder(new Long(oks[i]))).longValue();
-                t3 = oks[i]%0x0100000000L;
-                if (t1 != t3)
-                    throw new Exception("Value should have wrapped: " +
-                                        oks[i] + " expected: " + t3);
-                if (t2 != t3)
-                    throw new Exception("Value should have wrapped: " +
-                                        "Long("+oks[i]+") expected: " + t3);
-
-                if (t1 > SnmpTimeticksBuilder.MAX_VALUE)
-                    throw new Exception("Value should have wrapped " +
-                                        "for " + oks[i] + ": " +
-                                        t1 + " exceeds max: " +
-                                        SnmpTimeticksBuilder.MAX_VALUE);
-                if (t2 > SnmpTimeticksBuilder.MAX_VALUE)
-                    throw new Exception("Value should have wrapped " +
-                                        "for " + oks[i] + ": " +
-                                        t2 + " exceeds max: " +
-                                        SnmpTimeticksBuilder.MAX_VALUE);
-
-                if (t1 < 0)
-                    throw new Exception("Value should have wrapped: " +
-                                        "for " + oks[i] + ": " +
-                                        t1 + " is negative");
-                if (t2 < 0)
-                    throw new Exception("Value should have wrapped: " +
-                                        "for " + oks[i] + ": " +
-                                        t2 + " is negative");
-
-                System.out.println("TimeTicks[" + oks[i] +
-                                   "] rightfully accepted: " + t3);
-            }
-
-            for (int i=0;i<kos.length;i++) {
-                try {
-                    t = new SnmpTimeticksBuilder(kos[i]);
-                    throw new Exception("Value should have been rejected: " +
-                                        kos[i]);
-                } catch (IllegalArgumentException x) {
-                    // OK!
-                }
-                try {
-                    t = new SnmpTimeticksBuilder(new Long(kos[i]));
-                    throw new Exception("Value should have been rejected: " +
-                                        "Long("+kos[i]+")");
-                } catch (IllegalArgumentException x) {
-                    // OK!
-                }
-
-                System.out.println("TimeTicks[" + kos[i] +
-                                   "] rightfully rejected.");
-            }
-
-        } catch(Exception x) {
-            x.printStackTrace();
-            System.exit(1);
-        }
-    }
-}
--- a/jdk/test/com/sun/tools/attach/StartManagementAgent.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/com/sun/tools/attach/StartManagementAgent.java	Wed Jul 05 20:05:30 2017 +0200
@@ -100,6 +100,7 @@
             ex.printStackTrace(System.err);
         } catch (Throwable t) {
             t.printStackTrace(System.err);
+            throw t;
         }
     }
 
@@ -124,6 +125,7 @@
                 try {
                     System.err.println("Trying remote agent. Try #" + i);
                     testRemoteAgent(vm);
+                    System.err.println("Successfully connected to remote agent");
                     success = true;
                 } catch(Exception ex) {
                     System.err.println("testRemoteAgent failed with exception:");
@@ -136,7 +138,9 @@
                 throw new Exception("testRemoteAgent failed after " + MAX_RETRIES + " tries");
             }
         } finally {
+            System.err.println("Detaching from VM ...");
             vm.detach();
+            System.err.println("Detached");
         }
     }
 
@@ -176,7 +180,10 @@
         mgmtProps.put("com.sun.management.jmxremote.port", port);
         mgmtProps.put("com.sun.management.jmxremote.authenticate", "false");
         mgmtProps.put("com.sun.management.jmxremote.ssl", "false");
+
+        System.err.println("Starting management agent ...");
         vm.startManagementAgent(mgmtProps);
+        System.err.println("Started");
 
         // try to connect - should work
         tryConnect(port, true);
@@ -184,9 +191,12 @@
         // try to start again - should fail
         boolean exception = false;
         try {
+            System.err.println("Starting management agent second time ...");
             vm.startManagementAgent(mgmtProps);
+            System.err.println("Started");
         } catch(AttachOperationFailedException ex) {
             // expected
+            System.err.println("Got expected exception: " + ex.getMessage());
             exception = true;
         }
         if (!exception) {
@@ -204,10 +214,14 @@
 
         boolean succeeded;
         try {
+            System.err.println("Trying to connect to " + jmxUrlStr);
             JMXConnector c = JMXConnectorFactory.connect(url, env);
+            System.err.println("Connected, getting MBeanServerConnection");
             c.getMBeanServerConnection();
+            System.err.println("Success");
             succeeded = true;
         } catch(Exception ex) {
+            ex.printStackTrace(System.err);
             succeeded = false;
         }
         if (succeeded && !shouldSucceed) {
--- a/jdk/test/com/sun/tools/extcheck/TestExtcheckArgs.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * @test
- * @bug 6356642
- * @summary Verify that extcheck exits appropriately when invalid args are given.
- * @run shell TestExtcheckArgs.sh
- * @author Dave Bristor
- */
-
-import java.io.File;
-import com.sun.tools.extcheck.Main;
-
-/*
- * Test extcheck by using Runtime.exec instead of invoking
- * com.sun.tools.extcheck.Main.main, since the latter does its own
- * System.exit under the conditions checked here.
- */
-public class TestExtcheckArgs {
-    public static void realMain(String[] args) throws Throwable {
-        String testJar = System.getenv("TESTJAVA") + File.separator
-            + "lib" + File.separator + "jconsole.jar";
-
-        verify(new String[] {
-               }, Main.INSUFFICIENT);
-        verify(new String[] {
-                   "-verbose"
-               }, Main.MISSING);
-        verify(new String[] {
-                   "-verbose",
-                   "foo"
-               }, Main.DOES_NOT_EXIST);
-        verify(new String[] {
-                   testJar,
-                   "bar"
-               }, Main.EXTRA);
-        verify(new String[] {
-                   "-verbose",
-                   testJar,
-                   "bar"
-               }, Main.EXTRA);
-    }
-
-    static void verify(String[] args, String expected) throws Throwable {
-        try {
-            Main.realMain(args);
-            fail();
-        } catch (Exception ex) {
-            if (ex.getMessage().startsWith(expected)) {
-                pass();
-            } else {
-                fail("Unexpected message: " + ex.getMessage());
-            }
-        }
-    }
-
-    //--------------------- Infrastructure ---------------------------
-    static volatile int passed = 0, failed = 0;
-    static boolean pass() {passed++; return true;}
-    static boolean fail() {failed++; Thread.dumpStack(); return false;}
-    static boolean fail(String msg) {System.out.println(msg); return fail();}
-    static void unexpected(Throwable t) {failed++; t.printStackTrace();}
-    static boolean check(boolean cond) {if (cond) pass(); else fail(); return cond;}
-    static boolean equal(Object x, Object y) {
-        if (x == null ? y == null : x.equals(y)) return pass();
-        else return fail(x + " not equal to " + y);}
-    public static void main(String[] args) throws Throwable {
-        try {realMain(args);} catch (Throwable t) {unexpected(t);}
-        System.out.println("\nPassed = " + passed + " failed = " + failed);
-        if (failed > 0) throw new AssertionError("Some tests failed");}
-}
--- a/jdk/test/com/sun/tools/extcheck/TestExtcheckArgs.sh	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-#! /bin/sh
-
-#
-# Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-if [ "x$TESTJAVA" = x ]; then
-  TESTJAVA=$1; shift
-  TESTCLASSES=.
-  TESTSRC=.
-fi
-export TESTJAVA
-
-case "`uname`" in Windows*|CYGWIN* ) PS=';';; *) PS=':';; esac
-
-${TESTJAVA}/bin/javac -d ${TESTCLASSES} -classpath ${TESTJAVA}/lib/tools.jar${PS}${TESTCLASSES} ${TESTSRC}/TestExtcheckArgs.java
-rc=$?
-if [ $rc != 0 ]; then
-    echo Compilation failure with exit status $rc
-    exit $rc
-fi
-
-${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTJAVA}/lib/tools.jar${PS}${TESTCLASSES} TestExtcheckArgs
-rc=$?
-if [ $rc != 0 ]; then
-    echo Execution failure with exit status $rc
-    exit $rc
-fi
--- a/jdk/test/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java	Wed Jul 05 20:05:30 2017 +0200
@@ -23,21 +23,14 @@
  */
 
 
-import jdk.testlibrary.JDKToolLauncher;
 import jdk.testlibrary.OutputAnalyzer;
 import jdk.testlibrary.ProcessTools;
 
-import java.io.IOException;
-import java.nio.file.Path;
-
 public class TestDaemonThreadLauncher {
-
-    private static ProcessBuilder processBuilder = new ProcessBuilder();
-
     public static void main(String args[]) throws Exception {
         for(int i=0; i<50; i++) {
             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-javaagent:DummyAgent.jar", "TestDaemonThread", ".");
-            OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
+            OutputAnalyzer analyzer = ProcessTools.executeProcess(pb);
             analyzer.shouldNotContain("ASSERTION FAILED");
         }
     }
--- a/jdk/test/java/lang/instrument/PremainClass/NoPremainAgentTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/java/lang/instrument/PremainClass/NoPremainAgentTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,7 @@
                 Utils.addTestJavaOpts(testArgs.split("\\s+")));
         System.out.println("testjvm.cmd:" + Utils.getCommandLine(pb));
 
-        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        OutputAnalyzer output = ProcessTools.executeProcess(pb);
         System.out.println("testjvm.stdout:" + output.getStdout());
         System.out.println("testjvm.stderr:" + output.getStderr());
 
--- a/jdk/test/java/lang/instrument/PremainClass/PremainClassTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/java/lang/instrument/PremainClass/PremainClassTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
                 Utils.addTestJavaOpts(testArgs.split("\\s+")));
         System.out.println("testjvm.cmd:" + Utils.getCommandLine(pb));
 
-        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        OutputAnalyzer output = ProcessTools.executeProcess(pb);
         System.out.println("testjvm.stdout:" + output.getStdout());
         System.out.println("testjvm.stderr:" + output.getStderr());
 
--- a/jdk/test/java/lang/instrument/PremainClass/ZeroArgPremainAgentTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/java/lang/instrument/PremainClass/ZeroArgPremainAgentTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,7 @@
                 Utils.addTestJavaOpts(testArgs.split("\\s+")));
         System.out.println("testjvm.cmd:" + Utils.getCommandLine(pb));
 
-        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        OutputAnalyzer output = ProcessTools.executeProcess(pb);
         System.out.println("testjvm.stdout:" + output.getStdout());
         System.out.println("testjvm.stderr:" + output.getStderr());
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/invoke/ExplicitCastArgumentsTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang.invoke;
+
+import sun.invoke.util.Wrapper;
+
+/* @test
+ * @summary unit tests for MethodHandles.explicitCastArguments()
+ *
+ * @run main/bootclasspath java.lang.invoke.ExplicitCastArgumentsTest
+ */
+public class ExplicitCastArgumentsTest {
+    private static final boolean VERBOSE = Boolean.getBoolean("verbose");
+
+    public static void main(String[] args) throws Throwable {
+        for (Wrapper from : Wrapper.values()) {
+            for (Wrapper to : Wrapper.values()) {
+                if (from == Wrapper.VOID || to == Wrapper.VOID) continue;
+                testRef2Prim (from, to);
+            }
+        }
+        System.out.println("TEST PASSED");
+    }
+
+    public static void testRef2Prim(Wrapper from, Wrapper to) throws Throwable {
+        // MHs.eCA javadoc:
+        //    If T0 is a reference and T1 a primitive, and if the reference is null at runtime, a zero value is introduced.
+        test(from.wrapperType(), to.primitiveType(),        null, false);
+    }
+
+    public static void test(Class<?> from, Class<?> to, Object param, boolean failureExpected) throws Throwable {
+        if (VERBOSE) System.out.printf("%-10s => %-10s: %5s: ", from.getSimpleName(), to.getSimpleName(), param);
+
+        MethodHandle original = MethodHandles.identity(from);
+        MethodType newType = original.type().changeReturnType(to);
+
+        try {
+            MethodHandle target = MethodHandles.explicitCastArguments(original, newType);
+            Object result = target.invokeWithArguments(param);
+
+            if (VERBOSE) {
+                String resultStr;
+                if (result != null) {
+                    resultStr = String.format("%10s (%10s)", "'"+result+"'", result.getClass().getSimpleName());
+                } else {
+                    resultStr = String.format("%10s", result);
+                }
+                System.out.println(resultStr);
+            }
+
+            if (failureExpected) {
+                String msg = String.format("No exception thrown: %s => %s; parameter: %s", from, to, param);
+                throw new AssertionError(msg);
+            }
+        } catch (AssertionError e) {
+            throw e; // report test failure
+        } catch (Throwable e) {
+            if (VERBOSE) System.out.printf("%s: %s\n", e.getClass(), e.getMessage());
+            if (!failureExpected) {
+                String msg = String.format("Unexpected exception was thrown: %s => %s; parameter: %s", from, to, param);
+                throw new AssertionError(msg, e);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/ResponseCache/Test2.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8042622
+ * @summary Check for CRL results in IllegalArgumentException "white space not allowed"
+ * @run main/othervm Test2
+ */
+
+import com.sun.net.httpserver.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+import java.io.*;
+import java.net.*;
+import java.security.*;
+import javax.security.auth.callback.*;
+import javax.net.ssl.*;
+
+public class Test2 {
+
+    static volatile boolean failed = false;
+
+    static class Cache extends ResponseCache {
+        public CacheResponse get(URI uri, String method, Map<String,List<String>> headers) {
+            Set<String> keys = headers.keySet();
+            for (String key : keys) {
+                if (key.indexOf(' ') != -1 || key.indexOf('\t') != -1
+                        || key.indexOf(':') != -1)
+                {
+                    failed = true;
+                }
+            }
+            return null;
+        }
+
+        public CacheRequest put(URI uri, URLConnection c) throws IOException {
+            return null;
+        }
+    }
+
+    static int port;
+
+    static String urlstring, redirstring;
+
+    public static void main (String[] args) throws Exception {
+        Handler handler = new Handler();
+        InetSocketAddress addr = new InetSocketAddress (0);
+        HttpServer server = HttpServer.create (addr, 0);
+        port = server.getAddress().getPort();
+        HttpContext ctx = server.createContext ("/test", handler);
+        System.out.println ("Server: " + server.getAddress().getPort());
+        ResponseCache.setDefault(new Cache());
+
+        ExecutorService executor = Executors.newCachedThreadPool();
+        server.setExecutor (executor);
+        server.start ();
+
+        urlstring = "http://127.0.0.1:" + Integer.toString(port)+"/test/foo";
+        redirstring = urlstring + "/redirect/bar";
+
+        URL url = new URL (urlstring);
+        HttpURLConnection urlc = (HttpURLConnection)url.openConnection();
+        urlc.addRequestProperty("X-Foo", "bar");
+        urlc.setInstanceFollowRedirects(true);
+        System.out.println(urlc.getResponseCode());
+        InputStream i = urlc.getInputStream();
+        int count=0;
+        for (int c=i.read(); c!=-1; c=i.read()) {
+            //System.out.write(c);
+            count++;
+        }
+        System.out.println("Read " + count);
+        System.out.println("FINISHED");
+        server.stop(0);
+        executor.shutdownNow();
+        if (failed) {
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    public static boolean error = false;
+    public static int count = 0;
+
+    static class Handler implements HttpHandler {
+        int invocation = 0;
+        public void handle (HttpExchange t)
+            throws IOException
+        {
+            InputStream is = t.getRequestBody();
+            Headers map = t.getRequestHeaders();
+            Headers rmap = t.getResponseHeaders();
+            invocation ++;
+            if (invocation == 1) {
+                rmap.add("Location", redirstring);
+                while (is.read () != -1) ;
+                is.close();
+                System.out.println ("sending response");
+                t.sendResponseHeaders (301, 0);
+            } else {
+                byte[] buf = "Hello world".getBytes();
+                t.sendResponseHeaders (200, buf.length);
+                OutputStream os = t.getResponseBody();
+                try {
+                        os.write(buf);
+                } catch (IOException e) {
+                        System.out.println ("EX 1 " + e);
+                }
+            }
+            System.out.println ("Closing");
+            t.close();
+        }
+    }
+}
--- a/jdk/test/java/nio/channels/AsynchronousSocketChannel/StressLoopback.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/java/nio/channels/AsynchronousSocketChannel/StressLoopback.java	Wed Jul 05 20:05:30 2017 +0200
@@ -24,6 +24,8 @@
 /* @test
  * @bug 6834246 6842687
  * @summary Stress test connections through the loopback interface
+ * @run main StressLoopback
+ * @run main/othervm -Djdk.net.useFastTcpLoopback StressLoopback
  */
 
 import java.nio.ByteBuffer;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/FileHandlerLongLimit.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,504 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FilePermission;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.Field;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.CodeSource;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+import java.util.UUID;
+import java.util.concurrent.Callable;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.logging.FileHandler;
+import java.util.logging.Level;
+import java.util.logging.LogManager;
+import java.util.logging.LogRecord;
+import java.util.logging.LoggingPermission;
+
+/**
+ * @test
+ * @bug 8059767
+ * @summary tests that FileHandler can accept a long limit.
+ * @run main/othervm FileHandlerLongLimit UNSECURE
+ * @run main/othervm FileHandlerLongLimit SECURE
+ * @author danielfuchs
+ */
+public class FileHandlerLongLimit {
+
+    /**
+     * We will test handling of limit and overflow of MeteredStream.written in
+     * two configurations.
+     * UNSECURE: No security manager.
+     * SECURE: With the security manager present - and the required
+     *         permissions granted.
+     */
+    public static enum TestCase {
+        UNSECURE, SECURE;
+        public void run(Properties propertyFile) throws Exception {
+            System.out.println("Running test case: " + name());
+            Configure.setUp(this, propertyFile);
+            test(this.name() + " " + propertyFile.getProperty("test.name"), propertyFile,
+                    Long.parseLong(propertyFile.getProperty(FileHandler.class.getName()+".limit")));
+        }
+    }
+
+
+    private static final String PREFIX =
+            "FileHandler-" + UUID.randomUUID() + ".log";
+    private static final String userDir = System.getProperty("user.dir", ".");
+    private static final boolean userDirWritable = Files.isWritable(Paths.get(userDir));
+    private static final Field limitField;
+    private static final Field meterField;
+    private static final Field writtenField;
+    private static final Field outField;
+
+    private static final List<Properties> properties;
+    static {
+        Properties props1 = new Properties();
+        Properties props2 = new Properties();
+        Properties props3 = new Properties();
+        props1.setProperty("test.name", "with limit=Integer.MAX_VALUE");
+        props1.setProperty(FileHandler.class.getName() + ".pattern", PREFIX);
+        props1.setProperty(FileHandler.class.getName() + ".limit", String.valueOf(Integer.MAX_VALUE));
+        props2.setProperty("test.name", "with limit=Integer.MAX_VALUE*4");
+        props2.setProperty(FileHandler.class.getName() + ".pattern", PREFIX);
+        props2.setProperty(FileHandler.class.getName() + ".limit", String.valueOf(((long)Integer.MAX_VALUE)*4));
+        props3.setProperty("test.name", "with limit=Long.MAX_VALUE - 1024");
+        props3.setProperty(FileHandler.class.getName() + ".pattern", PREFIX);
+        props3.setProperty(FileHandler.class.getName() + ".limit", String.valueOf(Long.MAX_VALUE - 1024));
+        properties = Collections.unmodifiableList(Arrays.asList(
+                    props1,
+                    props2,
+                    props3));
+        try {
+            Class<?> metteredStreamClass = Class.forName(FileHandler.class.getName()+"$MeteredStream");
+            limitField = FileHandler.class.getDeclaredField("limit");
+            limitField.setAccessible(true);
+            meterField = FileHandler.class.getDeclaredField("meter");
+            meterField.setAccessible(true);
+            writtenField = metteredStreamClass.getDeclaredField("written");
+            writtenField.setAccessible(true);
+            outField = metteredStreamClass.getDeclaredField("out");
+            outField.setAccessible(true);
+
+        } catch (NoSuchFieldException | ClassNotFoundException x) {
+            throw new ExceptionInInitializerError(x);
+         }
+    }
+
+    private static class TestOutputStream extends OutputStream {
+        final OutputStream delegate;
+        TestOutputStream(OutputStream delegate) {
+            this.delegate = delegate;
+        }
+        @Override
+        public void write(int b) throws IOException {
+            // do nothing - we only pretend to write something...
+        }
+        @Override
+        public void close() throws IOException {
+            delegate.close();
+        }
+
+        @Override
+        public void flush() throws IOException {
+            delegate.flush();
+        }
+
+    }
+
+    public static void main(String... args) throws Exception {
+
+
+        if (args == null || args.length == 0) {
+            args = new String[] {
+                TestCase.UNSECURE.name(),
+                TestCase.SECURE.name(),
+            };
+        }
+
+        try {
+            for (String testName : args) {
+                for (Properties propertyFile : properties) {
+                    TestCase test = TestCase.valueOf(testName);
+                    test.run(propertyFile);
+                }
+            }
+        } finally {
+            if (userDirWritable) {
+                Configure.doPrivileged(() -> {
+                    // cleanup - delete files that have been created
+                    try {
+                        Files.list(Paths.get(userDir))
+                            .filter((f) -> f.toString().contains(PREFIX))
+                            .forEach((f) -> {
+                                try {
+                                    System.out.println("deleting " + f);
+                                    Files.delete(f);
+                                } catch(Throwable t) {
+                                    System.err.println("Failed to delete " + f + ": " + t);
+                                }
+                            });
+                    } catch(Throwable t) {
+                        System.err.println("Cleanup failed to list files: " + t);
+                        t.printStackTrace();
+                    }
+                });
+            }
+        }
+    }
+
+    static class Configure {
+        static Policy policy = null;
+        static final AtomicBoolean allowAll = new AtomicBoolean(false);
+        static void setUp(TestCase test, Properties propertyFile) {
+            switch (test) {
+                case SECURE:
+                    if (policy == null && System.getSecurityManager() != null) {
+                        throw new IllegalStateException("SecurityManager already set");
+                    } else if (policy == null) {
+                        policy = new SimplePolicy(TestCase.SECURE, allowAll);
+                        Policy.setPolicy(policy);
+                        System.setSecurityManager(new SecurityManager());
+                    }
+                    if (System.getSecurityManager() == null) {
+                        throw new IllegalStateException("No SecurityManager.");
+                    }
+                    if (policy == null) {
+                        throw new IllegalStateException("policy not configured");
+                    }
+                    break;
+                case UNSECURE:
+                    if (System.getSecurityManager() != null) {
+                        throw new IllegalStateException("SecurityManager already set");
+                    }
+                    break;
+                default:
+                    new InternalError("No such testcase: " + test);
+            }
+            doPrivileged(() -> {
+                try {
+                    ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+                    propertyFile.store(bytes, propertyFile.getProperty("test.name"));
+                    ByteArrayInputStream bais = new ByteArrayInputStream(bytes.toByteArray());
+                    LogManager.getLogManager().readConfiguration(bais);
+                } catch (IOException ex) {
+                    throw new RuntimeException(ex);
+                }
+            });
+        }
+        static void doPrivileged(Runnable run) {
+            allowAll.set(true);
+            try {
+                run.run();
+            } finally {
+                allowAll.set(false);
+            }
+        }
+        static <T> T callPrivileged(Callable<T> call) throws Exception {
+            allowAll.set(true);
+            try {
+                return call.call();
+            } finally {
+                allowAll.set(false);
+            }
+        }
+    }
+
+    @FunctionalInterface
+    public static interface FileHandlerSupplier {
+        public FileHandler test() throws Exception;
+    }
+
+    private static void checkException(Class<? extends Exception> type, FileHandlerSupplier test) {
+        Throwable t = null;
+        FileHandler f = null;
+        try {
+            f = test.test();
+        } catch (Throwable x) {
+            t = x;
+        }
+        try {
+            if (type != null && t == null) {
+                throw new RuntimeException("Expected " + type.getName() + " not thrown");
+            } else if (type != null && t != null) {
+                if (type.isInstance(t)) {
+                    System.out.println("Recieved expected exception: " + t);
+                } else {
+                    throw new RuntimeException("Exception type mismatch: "
+                        + type.getName() + " expected, "
+                        + t.getClass().getName() + " received.", t);
+                }
+            } else if (t != null) {
+                throw new RuntimeException("Unexpected exception received: " + t, t);
+            }
+        } finally {
+            if (f != null) {
+                // f should always be null when an exception is expected,
+                // but in case the test doesn't behave as expected we will
+                // want to close f.
+                try { f.close(); } catch (Throwable x) {};
+            }
+        }
+    }
+
+    static final class TestAssertException extends RuntimeException {
+        TestAssertException(String msg) {
+            super(msg);
+        }
+    }
+
+    private static void assertEquals(long expected, long received, String msg) {
+        if (expected != received) {
+            throw new TestAssertException("Unexpected result for " + msg
+                    + ".\n\texpected: " + expected
+                    +  "\n\tactual:   " + received);
+        } else {
+            System.out.println("Got expected " + msg + ": " + received);
+        }
+    }
+
+    private static long getLimit(FileHandler handler) throws Exception {
+        return Configure.callPrivileged((Callable<Long>)() -> {
+            return limitField.getLong(handler);
+        });
+    }
+    private static OutputStream getMeteredOutput(FileHandler handler) throws Exception {
+        return Configure.callPrivileged((Callable<OutputStream>)() -> {
+            final OutputStream metered = OutputStream.class.cast(meterField.get(handler));
+            return metered;
+        });
+    }
+    private static TestOutputStream setTestOutputStream(OutputStream metered) throws Exception {
+        return Configure.callPrivileged((Callable<TestOutputStream>)() -> {
+            outField.set(metered, new TestOutputStream(OutputStream.class.cast(outField.get(metered))));
+            return TestOutputStream.class.cast(outField.get(metered));
+        });
+    }
+    private static long getWritten(OutputStream metered) throws Exception {
+        return Configure.callPrivileged((Callable<Long>)() -> {
+            return writtenField.getLong(metered);
+        });
+    }
+
+    private static long setWritten(OutputStream metered, long newValue) throws Exception {
+        return Configure.callPrivileged((Callable<Long>)() -> {
+            writtenField.setLong(metered, newValue);
+            return writtenField.getLong(metered);
+        });
+    }
+
+    public static FileHandler testFileHandlerLimit(FileHandlerSupplier supplier,
+            long limit) throws Exception {
+        Configure.doPrivileged(() -> {
+            try {
+                Files.deleteIfExists(Paths.get(PREFIX));
+            } catch (IOException x) {
+                throw new RuntimeException(x);
+            }
+        });
+        final FileHandler fh = supplier.test();
+        try {
+            // verify we have the expected limit
+            assertEquals(limit, getLimit(fh), "limit");
+
+            // get the metered output stream
+            OutputStream metered = getMeteredOutput(fh);
+
+            // we don't want to actually write to the file, so let's
+            // redirect the metered to our own TestOutputStream.
+            setTestOutputStream(metered);
+
+            // check that fh.meter.written is 0
+            assertEquals(0, getWritten(metered), "written");
+
+            // now we're going to publish a series of log records
+            String msg = "this is at least 10 chars long";
+            fh.publish(new LogRecord(Level.SEVERE, msg));
+            fh.flush();
+            long w = getWritten(metered);
+            long offset = getWritten(metered);
+            System.out.println("first offset is:  " + offset);
+
+            fh.publish(new LogRecord(Level.SEVERE, msg));
+            fh.flush();
+            offset = getWritten(metered) - w;
+            w = getWritten(metered);
+            System.out.println("second offset is: " + offset);
+
+            fh.publish(new LogRecord(Level.SEVERE, msg));
+            fh.flush();
+            offset = getWritten(metered) - w;
+            w = getWritten(metered);
+            System.out.println("third offset is:  " + offset);
+
+            fh.publish(new LogRecord(Level.SEVERE, msg));
+            fh.flush();
+            offset = getWritten(metered) - w;
+            System.out.println("fourth offset is: " + offset);
+
+            // Now set fh.meter.written to something close to the limit,
+            // so that we can trigger log file rotation.
+            assertEquals(limit-2*offset+10, setWritten(metered, limit-2*offset+10), "written");
+            w = getWritten(metered);
+
+            // publish one more log record. we should still be just beneath
+            // the limit
+            fh.publish(new LogRecord(Level.SEVERE, msg));
+            fh.flush();
+            assertEquals(w+offset, getWritten(metered), "written");
+
+            // check that fh still has the same MeteredStream - indicating
+            // that the file hasn't rotated.
+            if (getMeteredOutput(fh) != metered) {
+                throw new RuntimeException("Log should not have rotated");
+            }
+
+            // Now publish two log record. The spec is a bit vague about when
+            // exactly the log will be rotated - it could happen just after
+            // writing the first log record or just before writing the next
+            // one. We publich two - so we're sure that the log must have
+            // rotated.
+            fh.publish(new LogRecord(Level.SEVERE, msg));
+            fh.flush();
+            fh.publish(new LogRecord(Level.SEVERE, msg));
+            fh.flush();
+
+            // Check that fh.meter is a different instance of MeteredStream.
+            if (getMeteredOutput(fh) == metered) {
+                throw new RuntimeException("Log should have rotated");
+            }
+            // success!
+            return fh;
+        } catch (Error | Exception x) {
+            // if we get an exception we need to close fh.
+            // if we don't get an exception, fh will be closed by the caller.
+            // (and that's why we dont use try-with-resources/finally here).
+            try { fh.close(); } catch(Throwable t) {t.printStackTrace();}
+            throw x;
+        }
+    }
+
+    public static void test(String name, Properties props, long limit) throws Exception {
+        System.out.println("Testing: " + name);
+        Class<? extends Exception> expectedException = null;
+
+        if (userDirWritable || expectedException != null) {
+            // These calls will create files in user.dir.
+            // The file name contain a random UUID (PREFIX) which identifies them
+            // and allow us to remove them cleanly at the end (see finally block
+            // in main()).
+            checkException(expectedException, () -> new FileHandler());
+            checkException(expectedException, () -> {
+                final FileHandler fh = new FileHandler();
+                assertEquals(limit, getLimit(fh), "limit");
+                return fh;
+            });
+            checkException(expectedException, () -> testFileHandlerLimit(
+                    () -> new FileHandler(),
+                    limit));
+            checkException(expectedException, () -> testFileHandlerLimit(
+                    () -> new FileHandler(PREFIX, Long.MAX_VALUE, 1, true),
+                    Long.MAX_VALUE));
+        }
+    }
+
+
+    final static class PermissionsBuilder {
+        final Permissions perms;
+        public PermissionsBuilder() {
+            this(new Permissions());
+        }
+        public PermissionsBuilder(Permissions perms) {
+            this.perms = perms;
+        }
+        public PermissionsBuilder add(Permission p) {
+            perms.add(p);
+            return this;
+        }
+        public PermissionsBuilder addAll(PermissionCollection col) {
+            if (col != null) {
+                for (Enumeration<Permission> e = col.elements(); e.hasMoreElements(); ) {
+                    perms.add(e.nextElement());
+                }
+            }
+            return this;
+        }
+        public Permissions toPermissions() {
+            final PermissionsBuilder builder = new PermissionsBuilder();
+            builder.addAll(perms);
+            return builder.perms;
+        }
+    }
+
+    public static class SimplePolicy extends Policy {
+
+        final Permissions permissions;
+        final Permissions allPermissions;
+        final AtomicBoolean allowAll;
+        public SimplePolicy(TestCase test, AtomicBoolean allowAll) {
+            this.allowAll = allowAll;
+            permissions = new Permissions();
+            permissions.add(new LoggingPermission("control", null));
+            permissions.add(new FilePermission(PREFIX+".lck", "read,write,delete"));
+            permissions.add(new FilePermission(PREFIX, "read,write"));
+
+            // these are used for configuring the test itself...
+            allPermissions = new Permissions();
+            allPermissions.add(new java.security.AllPermission());
+
+        }
+
+        @Override
+        public boolean implies(ProtectionDomain domain, Permission permission) {
+            if (allowAll.get()) return allPermissions.implies(permission);
+            return permissions.implies(permission);
+        }
+
+        @Override
+        public PermissionCollection getPermissions(CodeSource codesource) {
+            return new PermissionsBuilder().addAll(allowAll.get()
+                    ? allPermissions : permissions).toPermissions();
+        }
+
+        @Override
+        public PermissionCollection getPermissions(ProtectionDomain domain) {
+            return new PermissionsBuilder().addAll(allowAll.get()
+                    ? allPermissions : permissions).toPermissions();
+        }
+    }
+
+}
--- a/jdk/test/javax/net/ssl/TLS/CipherTestUtils.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/javax/net/ssl/TLS/CipherTestUtils.java	Wed Jul 05 20:05:30 2017 +0200
@@ -261,20 +261,20 @@
         }
     }
 
-    private static volatile CipherTestUtils instnace = null;
+    private static volatile CipherTestUtils instance = null;
 
     public static CipherTestUtils getInstance() throws IOException,
             FileNotFoundException, KeyStoreException,
             NoSuchAlgorithmException, CertificateException,
             UnrecoverableKeyException, InvalidKeySpecException {
-        if (instnace == null) {
+        if (instance == null) {
             synchronized (CipherTestUtils.class) {
-                if (instnace == null) {
-                    instnace = new CipherTestUtils();
+                if (instance == null) {
+                    instance = new CipherTestUtils();
                 }
             }
         }
-        return instnace;
+        return instance;
     }
 
     public static void setTestedArguments(String testedProtocol,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sql/testng/test/rowset/RowSetWarningTests.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,238 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.rowset;
+
+import java.sql.SQLException;
+import javax.sql.rowset.RowSetWarning;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class RowSetWarningTests extends BaseTest {
+
+    private final String[] warnings = {"Warning 1", "cause 1", "Warning 2",
+        "Warning 3", "cause 2"};
+
+    /*
+     * Create RowSetWarning and setting all objects to null
+     */
+    @Test
+    public void test() {
+        RowSetWarning e = new RowSetWarning(null, null, errorCode);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /*
+     * Create RowSetWarning with no-arg constructor
+     */
+    @Test
+    public void test01() {
+        RowSetWarning ex = new RowSetWarning();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /*
+     * Create RowSetWarning with message
+     */
+    @Test
+    public void test02() {
+        RowSetWarning ex = new RowSetWarning(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /*
+     * Create RowSetWarning with message, and SQLState
+     */
+    @Test
+    public void test03() {
+
+        RowSetWarning ex = new RowSetWarning(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /*
+     * Create RowSetWarning with message, SQLState, and error code
+     */
+    @Test
+    public void test04() {
+        RowSetWarning ex = new RowSetWarning(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /*
+     * Serialize a RowSetWarning and make sure you can read it back properly
+     */
+    @Test
+    public void test05() throws Exception {
+        RowSetWarning e = new RowSetWarning(reason, state, errorCode);
+        e.initCause(t);
+        RowSetWarning ex1 = createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /*
+     * Validate that the ordering of the returned Exceptions is correct using
+     * for-each loop
+     */
+    @Test
+    public void test06() {
+        RowSetWarning ex = new RowSetWarning("Exception 1");
+        ex.initCause(t1);
+        RowSetWarning ex1 = new RowSetWarning("Exception 2");
+        RowSetWarning ex2 = new RowSetWarning("Exception 3");
+        ex2.initCause(t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /*
+     * Validate that the ordering of the returned Exceptions is correct using
+     * traditional while loop
+     */
+    @Test
+    public void test07() {
+        RowSetWarning ex = new RowSetWarning("Exception 1");
+        ex.initCause(t1);
+        RowSetWarning ex1 = new RowSetWarning("Exception 2");
+        RowSetWarning ex2 = new RowSetWarning("Exception 3");
+        ex2.initCause(t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /*
+     * Validate that the ordering of the returned RowSetWarning is correct using
+     * for-each loop
+     */
+    @Test
+    public void test08() {
+        RowSetWarning ex = new RowSetWarning("Warning 1");
+        ex.initCause(t1);
+        RowSetWarning ex1 = new RowSetWarning("Warning 2");
+        RowSetWarning ex2 = new RowSetWarning("Warning 3");
+        ex2.initCause(t2);
+        ex.setNextWarning(ex1);
+        ex.setNextWarning(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(warnings[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned RowSetWarning is correct using
+     * traditional while loop
+     */
+    @Test
+    public void test09() {
+        RowSetWarning ex = new RowSetWarning("Warning 1");
+        ex.initCause(t1);
+        RowSetWarning ex1 = new RowSetWarning("Warning 2");
+        RowSetWarning ex2 = new RowSetWarning("Warning 3");
+        ex2.initCause(t2);
+        ex.setNextWarning(ex1);
+        ex.setNextWarning(ex2);
+        int num = 0;
+        RowSetWarning sqe = ex;
+        while (sqe != null) {
+            assertTrue(warnings[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextWarning();
+        }
+    }
+
+    /*
+     * Serialize a RowSetWarning and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        RowSetWarning e = new RowSetWarning(reason, state, errorCode);
+        RowSetWarning ex1 = createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && ex1.getCause() == null
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /*
+     *  Serialize a RowSetWarning and make sure you can read it back properly.
+     * Validate that the ordering of the returned RowSetWarning is correct using
+     * traditional while loop
+     */
+    @Test
+    public void test11() throws Exception {
+        RowSetWarning ex = new RowSetWarning("Warning 1");
+        ex.initCause(t1);
+        RowSetWarning ex1 = new RowSetWarning("Warning 2");
+        RowSetWarning ex2 = new RowSetWarning("Warning 3");
+        ex2.initCause(t2);
+        ex.setNextWarning(ex1);
+        ex.setNextWarning(ex2);
+        int num = 0;
+        RowSetWarning sqe = createSerializedException(ex);
+        while (sqe != null) {
+            assertTrue(warnings[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextWarning();
+        }
+    }
+}
--- a/jdk/test/lib/testlibrary/OutputAnalyzerReportingTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/lib/testlibrary/OutputAnalyzerReportingTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,6 +21,7 @@
  * questions.
  */
 
+package jdk.testlibrary;
 
 /*
  * @test
@@ -28,13 +29,13 @@
  *     such as printing additional diagnostic info
  *     (exit code, stdout, stderr, command line, etc.)
  * @library /testlibrary
+ * @build jdk.testlibrary.*
+ * @run main jdk.testlibrary.OutputAnalyzerReportingTest
  */
 
 import java.io.ByteArrayOutputStream;
 import java.io.PrintStream;
 
-import jdk.testlibrary.OutputAnalyzer;
-
 public class OutputAnalyzerReportingTest {
 
     public static void main(String[] args) throws Exception {
--- a/jdk/test/lib/testlibrary/OutputAnalyzerTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/lib/testlibrary/OutputAnalyzerTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -20,15 +20,16 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+package jdk.testlibrary;
 
 /*
  * @test
  * @summary Test the OutputAnalyzer utility class
  * @library /testlibrary
+ * @build jdk.testlibrary.*
+ * @run main jdk.testlibrary.OutputAnalyzerTest
  */
 
-import jdk.testlibrary.OutputAnalyzer;
-
 public class OutputAnalyzerTest {
 
     public static void main(String args[]) throws Exception {
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/JcmdBase.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/JcmdBase.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -108,7 +108,7 @@
         }
         processBuilder.command(launcher.getCommand());
         System.out.println(Arrays.toString(processBuilder.command().toArray()).replace(",", ""));
-        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);
         System.out.println(output.getOutput());
 
         return output;
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,13 @@
 
 import static jdk.testlibrary.Asserts.*;
 
+import java.io.ByteArrayOutputStream;
+
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -35,34 +39,37 @@
  * Utility class for verifying output and exit value from a {@code Process}.
  */
 public final class OutputAnalyzer {
-
+    private final OutputBuffer output;
     private final String stdout;
     private final String stderr;
     private final int exitValue;
 
     /**
      * Create an OutputAnalyzer, a utility class for verifying output and exit
-     * value from a Process
+     * value from a Process.
+     * <p>
+     * OutputAnalyzer should never be instantiated directly -
+     * use {@linkplain ProcessTools#executeProcess(p)} instead
      *
      * @param process
      *            Process to analyze
      * @throws IOException
      *             If an I/O error occurs.
      */
-    public OutputAnalyzer(Process process) throws IOException {
-        OutputBuffer output = ProcessTools.getOutput(process);
-        exitValue = process.exitValue();
-        this.stdout = output.getStdout();
-        this.stderr = output.getStderr();
+    OutputAnalyzer(Process process) throws IOException {
+        output = new OutputBuffer(process);
+        exitValue = -1;
+        this.stdout = null;
+        this.stderr = null;
     }
 
     /**
-     * Create an OutputAnalyzer, a utility class for verifying output
+     * Create an OutputAnalyzer, a utility class for verifying output.
      *
      * @param buf
      *            String buffer to analyze
      */
-    public OutputAnalyzer(String buf) {
+    OutputAnalyzer(String buf) {
         this(buf, buf);
     }
 
@@ -74,7 +81,8 @@
      * @param stderr
      *            stderr buffer to analyze
      */
-    public OutputAnalyzer(String stdout, String stderr) {
+    OutputAnalyzer(String stdout, String stderr) {
+        this.output = null;
         this.stdout = stdout;
         this.stderr = stderr;
         exitValue = -1;
@@ -90,8 +98,8 @@
      *             If the string was not found
      */
     public void shouldContain(String expectedString) {
-        if (!stdout.contains(expectedString)
-                && !stderr.contains(expectedString)) {
+        if (!getStdout().contains(expectedString)
+                && !getStderr().contains(expectedString)) {
             reportDiagnosticSummary();
             throw new RuntimeException("'" + expectedString
                     + "' missing from stdout/stderr \n");
@@ -107,7 +115,7 @@
      *             If the string was not found
      */
     public void stdoutShouldContain(String expectedString) {
-        if (!stdout.contains(expectedString)) {
+        if (!getStdout().contains(expectedString)) {
             reportDiagnosticSummary();
             throw new RuntimeException("'" + expectedString
                     + "' missing from stdout \n");
@@ -123,7 +131,7 @@
      *             If the string was not found
      */
     public void stderrShouldContain(String expectedString) {
-        if (!stderr.contains(expectedString)) {
+        if (!getStderr().contains(expectedString)) {
             reportDiagnosticSummary();
             throw new RuntimeException("'" + expectedString
                     + "' missing from stderr \n");
@@ -140,12 +148,12 @@
      *             If the string was found
      */
     public void shouldNotContain(String notExpectedString) {
-        if (stdout.contains(notExpectedString)) {
+        if (getStdout().contains(notExpectedString)) {
             reportDiagnosticSummary();
             throw new RuntimeException("'" + notExpectedString
                     + "' found in stdout \n");
         }
-        if (stderr.contains(notExpectedString)) {
+        if (getStderr().contains(notExpectedString)) {
             reportDiagnosticSummary();
             throw new RuntimeException("'" + notExpectedString
                     + "' found in stderr \n");
@@ -162,7 +170,7 @@
      *             If the string was found
      */
     public void stdoutShouldNotContain(String notExpectedString) {
-        if (stdout.contains(notExpectedString)) {
+        if (getStdout().contains(notExpectedString)) {
             reportDiagnosticSummary();
             throw new RuntimeException("'" + notExpectedString
                     + "' found in stdout \n");
@@ -179,7 +187,7 @@
      *             If the string was found
      */
     public void stderrShouldNotContain(String notExpectedString) {
-        if (stderr.contains(notExpectedString)) {
+        if (getStderr().contains(notExpectedString)) {
             reportDiagnosticSummary();
             throw new RuntimeException("'" + notExpectedString
                     + "' found in stderr \n");
@@ -196,9 +204,9 @@
      */
     public void shouldMatch(String pattern) {
         Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE)
-                .matcher(stdout);
+                .matcher(getStdout());
         Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE)
-                .matcher(stderr);
+                .matcher(getStderr());
         if (!stdoutMatcher.find() && !stderrMatcher.find()) {
             reportDiagnosticSummary();
             throw new RuntimeException("'" + pattern
@@ -215,7 +223,7 @@
      */
     public void stdoutShouldMatch(String pattern) {
         Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(
-                stdout);
+                getStdout());
         if (!matcher.find()) {
             reportDiagnosticSummary();
             throw new RuntimeException("'" + pattern
@@ -232,7 +240,7 @@
      */
     public void stderrShouldMatch(String pattern) {
         Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(
-                stderr);
+                getStderr());
         if (!matcher.find()) {
             reportDiagnosticSummary();
             throw new RuntimeException("'" + pattern
@@ -250,13 +258,13 @@
      */
     public void shouldNotMatch(String pattern) {
         Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(
-                stdout);
+                getStdout());
         if (matcher.find()) {
             reportDiagnosticSummary();
             throw new RuntimeException("'" + pattern + "' found in stdout: '"
                     + matcher.group() + "' \n");
         }
-        matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
+        matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(getStderr());
         if (matcher.find()) {
             reportDiagnosticSummary();
             throw new RuntimeException("'" + pattern + "' found in stderr: '"
@@ -274,7 +282,7 @@
      */
     public void stdoutShouldNotMatch(String pattern) {
         Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(
-                stdout);
+                getStdout());
         if (matcher.find()) {
             reportDiagnosticSummary();
             throw new RuntimeException("'" + pattern + "' found in stdout \n");
@@ -291,7 +299,7 @@
      */
     public void stderrShouldNotMatch(String pattern) {
         Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(
-                stderr);
+                getStderr());
         if (matcher.find()) {
             reportDiagnosticSummary();
             throw new RuntimeException("'" + pattern + "' found in stderr \n");
@@ -310,9 +318,9 @@
      */
     public String firstMatch(String pattern, int group) {
         Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE)
-                .matcher(stderr);
+                .matcher(getStderr());
         Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE)
-                .matcher(stdout);
+                .matcher(getStdout());
         if (stderrMatcher.find()) {
             return stderrMatcher.group(group);
         }
@@ -357,7 +365,7 @@
      * exit code Note: the command line is printed by the ProcessTools
      */
     private void reportDiagnosticSummary() {
-        String msg = " stdout: [" + stdout + "];\n" + " stderr: [" + stderr
+        String msg = " stdout: [" + getStdout() + "];\n" + " stderr: [" + getStderr()
                 + "]\n" + " exitValue = " + getExitValue() + "\n";
 
         System.err.println(msg);
@@ -369,7 +377,7 @@
      * @return Content of the output buffer
      */
     public String getOutput() {
-        return stdout + stderr;
+        return getStdout() + getStderr();
     }
 
     /**
@@ -378,7 +386,7 @@
      * @return Content of the stdout buffer
      */
     public String getStdout() {
-        return stdout;
+        return output == null ? stdout : output.getStdout();
     }
 
     /**
@@ -387,7 +395,7 @@
      * @return Content of the stderr buffer
      */
     public String getStderr() {
-        return stderr;
+        return output == null ? stderr : output.getStderr();
     }
 
     /**
@@ -396,7 +404,7 @@
      * @return Process exit value
      */
     public int getExitValue() {
-        return exitValue;
+        return output == null ? exitValue : output.getExitValue();
     }
 
     /**
@@ -492,5 +500,4 @@
 
         return matchedCount;
     }
-
 }
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/OutputBuffer.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/OutputBuffer.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,23 @@
 
 package jdk.testlibrary;
 
-public class OutputBuffer {
-    private final String stdout;
-    private final String stderr;
+import java.io.ByteArrayOutputStream;
+import java.util.concurrent.CancellationException;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+
+class OutputBuffer {
+    private static class OutputBufferException extends RuntimeException {
+        public OutputBufferException(Throwable cause) {
+            super(cause);
+        }
+    }
+
+    private final Process p;
+    private final Future<Void> outTask;
+    private final Future<Void> errTask;
+    private final ByteArrayOutputStream stderrBuffer = new ByteArrayOutputStream();
+    private final ByteArrayOutputStream stdoutBuffer = new ByteArrayOutputStream();
 
     /**
      * Create an OutputBuffer, a class for storing and managing stdout and
@@ -36,9 +50,15 @@
      * @param stderr
      *            stderr result
      */
-    public OutputBuffer(String stdout, String stderr) {
-        this.stdout = stdout;
-        this.stderr = stderr;
+    OutputBuffer(Process p) {
+        this.p = p;
+        StreamPumper outPumper = new StreamPumper(p.getInputStream(),
+                stdoutBuffer);
+        StreamPumper errPumper = new StreamPumper(p.getErrorStream(),
+                stderrBuffer);
+
+        outTask = outPumper.process();
+        errTask = errPumper.process();
     }
 
     /**
@@ -47,7 +67,15 @@
      * @return stdout result
      */
     public String getStdout() {
-        return stdout;
+        try {
+            outTask.get();
+            return stdoutBuffer.toString();
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new OutputBufferException(e);
+        } catch (ExecutionException | CancellationException e) {
+            throw new OutputBufferException(e);
+        }
     }
 
     /**
@@ -56,6 +84,23 @@
      * @return stderr result
      */
     public String getStderr() {
-        return stderr;
+        try {
+            errTask.get();
+            return stderrBuffer.toString();
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new OutputBufferException(e);
+        } catch (ExecutionException | CancellationException e) {
+            throw new OutputBufferException(e);
+        }
+    }
+
+    public int getExitValue() {
+        try {
+            return p.waitFor();
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new OutputBufferException(e);
+        }
     }
 }
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -154,12 +154,14 @@
 
             // Will block...
             try {
+                this.process.waitFor();
                 output = new OutputAnalyzer(this.process);
             } catch (Throwable t) {
                 String name = Thread.currentThread().getName();
                 System.out.println(String.format("ProcessThread[%s] failed: %s", name, t.toString()));
                 throw t;
             } finally {
+                this.process.destroyForcibly().waitFor();
                 String logMsg = ProcessTools.getProcessLog(processBuilder, output);
                 System.out.println(logMsg);
             }
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,6 @@
 
 package jdk.testlibrary;
 
-import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.lang.management.ManagementFactory;
@@ -34,7 +33,6 @@
 import java.util.Collections;
 import java.util.concurrent.CountDownLatch;
 import java.util.Map;
-import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
@@ -214,55 +212,6 @@
     }
 
     /**
-     * Pumps stdout and stderr from running the process into a String.
-     *
-     * @param processBuilder
-     *            ProcessHandler to run.
-     * @return Output from process.
-     * @throws IOException
-     *             If an I/O error occurs.
-     */
-    public static OutputBuffer getOutput(ProcessBuilder processBuilder)
-            throws IOException {
-        return getOutput(processBuilder.start());
-    }
-
-    /**
-     * Pumps stdout and stderr the running process into a String.
-     *
-     * @param process
-     *            Process to pump.
-     * @return Output from process.
-     * @throws IOException
-     *             If an I/O error occurs.
-     */
-    public static OutputBuffer getOutput(Process process) throws IOException {
-        ByteArrayOutputStream stderrBuffer = new ByteArrayOutputStream();
-        ByteArrayOutputStream stdoutBuffer = new ByteArrayOutputStream();
-        StreamPumper outPumper = new StreamPumper(process.getInputStream(),
-                stdoutBuffer);
-        StreamPumper errPumper = new StreamPumper(process.getErrorStream(),
-                stderrBuffer);
-
-        Future<Void> outTask = outPumper.process();
-        Future<Void> errTask = errPumper.process();
-
-        try {
-            process.waitFor();
-            outTask.get();
-            errTask.get();
-        } catch (InterruptedException e) {
-            Thread.currentThread().interrupt();
-            return null;
-        } catch (ExecutionException e) {
-            throw new IOException(e);
-        }
-
-        return new OutputBuffer(stdoutBuffer.toString(),
-                stderrBuffer.toString());
-    }
-
-    /**
      * Get the process id of the current running Java process
      *
      * @return Process id
@@ -343,34 +292,51 @@
      * The command line will be like:
      * {test.jdk}/bin/java {test.vm.opts} {test.java.opts} cmds
      *
+     * The jvm process will have exited before this method returns.
+     *
      * @param cmds User specifed arguments.
      * @return The output from the process.
      */
-    public static OutputAnalyzer executeTestJvm(String... cmds) throws Throwable {
+    public static OutputAnalyzer executeTestJvm(String... cmds) throws Exception {
         ProcessBuilder pb = createJavaProcessBuilder(Utils.addTestJavaOpts(cmds));
         return executeProcess(pb);
     }
 
     /**
      * Executes a process, waits for it to finish and returns the process output.
+     * The process will have exited before this method returns.
      * @param pb The ProcessBuilder to execute.
-     * @return The output from the process.
+     * @return The {@linkplain OutputAnalyzer} instance wrapping the process.
      */
-    public static OutputAnalyzer executeProcess(ProcessBuilder pb) throws Throwable {
+    public static OutputAnalyzer executeProcess(ProcessBuilder pb) throws Exception {
         OutputAnalyzer output = null;
+        Process p = null;
+        boolean failed = false;
         try {
-            output = new OutputAnalyzer(pb.start());
+            p = pb.start();
+            output = new OutputAnalyzer(p);
+            p.waitFor();
+
             return output;
         } catch (Throwable t) {
+            failed = true;
             System.out.println("executeProcess() failed: " + t);
             throw t;
         } finally {
-            System.out.println(getProcessLog(pb, output));
+            if (p != null) {
+                p.destroyForcibly().waitFor();
+            }
+            if (failed) {
+                System.err.println(getProcessLog(pb, output));
+            }
         }
     }
 
     /**
      * Executes a process, waits for it to finish and returns the process output.
+     *
+     * The process will have exited before this method returns.
+     *
      * @param cmds The command line to execute.
      * @return The output from the process.
      */
@@ -394,6 +360,7 @@
         logMsg.append("exitvalue: " + exitValue + nl);
         logMsg.append("stderr: " + stderr + nl);
         logMsg.append("stdout: " + stdout + nl);
+
         return logMsg.toString();
     }
 
--- a/jdk/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java	Wed Jul 05 20:05:30 2017 +0200
@@ -34,7 +34,7 @@
 import java.util.UUID;
 import java.util.concurrent.Semaphore;
 
-import jdk.testlibrary.OutputBuffer;
+import jdk.testlibrary.OutputAnalyzer;
 import jdk.testlibrary.ProcessTools;
 import sun.jvmstat.monitor.MonitorException;
 import sun.jvmstat.monitor.MonitoredHost;
@@ -305,13 +305,13 @@
             Runtime.getRuntime().removeShutdownHook(shutdownHook);
         }
 
-        private void executeJava() throws Exception, IOException {
+        private void executeJava() throws Throwable {
             String className = JavaProcess.class.getName();
             String classPath = System.getProperty("test.classes");
             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
                 "-Dtest.timeout.factor=" + System.getProperty("test.timeout.factor", "1.0"),
                 "-cp", classPath, className, mainArgsIdentifier);
-            OutputBuffer ob = ProcessTools.getOutput(pb.start());
+            OutputAnalyzer ob = ProcessTools.executeProcess(pb);
             System.out.println("Java Process " + getMainArgsIdentifier() + " stderr:"
                     + ob.getStderr());
             System.err.println("Java Process " + getMainArgsIdentifier() + " stdout:"
--- a/jdk/test/sun/management/jdp/DynamicLauncher.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/sun/management/jdp/DynamicLauncher.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -63,7 +63,7 @@
     protected OutputAnalyzer runVM() throws Exception {
         String[] options = this.options();
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(options);
-        OutputAnalyzer out = new OutputAnalyzer(pb.start());
+        OutputAnalyzer out = ProcessTools.executeProcess(pb);
         System.out.println(out.getStdout());
         System.err.println(out.getStderr());
         return out;
--- a/jdk/test/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -176,16 +176,15 @@
                     command.toArray(new String[command.size()]));
 
             System.out.println("test cmdline: " + Arrays.toString(processBuilder.command().toArray()).replace(",", ""));
-            Process p = processBuilder.start();
-            OutputAnalyzer output = new OutputAnalyzer(p);
+            OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);
 
             System.out.println("test output:");
             System.out.println(output.getOutput());
 
-            if ((p.exitValue() == 0)  ||
+            if ((output.getExitValue() == 0)  ||
                 !output.getOutput().contains("Exception thrown by the agent : " +
                         "java.rmi.server.ExportException: Port already in use")) {
-                return p.exitValue();
+                return output.getExitValue();
             }
         }
 
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -188,15 +188,14 @@
 
             ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(command.toArray(new String[command.size()]));
 
-            Process p = processBuilder.start();
-            OutputAnalyzer output = new OutputAnalyzer(p);
+            OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);
 
             System.out.println("test output:");
             System.out.println(output.getOutput());
 
             if (!output.getOutput().contains("Exception thrown by the agent : " +
                     "java.rmi.server.ExportException: Port already in use")) {
-                return p.exitValue();
+                return output.getExitValue();
             }
         }
         throw new Error("Cannot find free port");
--- a/jdk/test/sun/tools/jhat/HatHeapDump1Test.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/sun/tools/jhat/HatHeapDump1Test.java	Wed Jul 05 20:05:30 2017 +0200
@@ -52,7 +52,7 @@
                 "-Xverify:all",
                 "-agentlib:hprof=heap=dump,format=b,file=" + dumpFile.getAbsolutePath(),
                 className);
-        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);
         System.out.println(output.getOutput());
         output.shouldHaveExitValue(0);
         output.shouldContain("Dumping Java heap ... done");
@@ -79,7 +79,7 @@
         ProcessBuilder processBuilder = new ProcessBuilder();
         processBuilder.command(launcher.getCommand());
         System.out.println(Arrays.toString(processBuilder.command().toArray()).replace(",", ""));
-        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);
         System.out.println(output.getOutput());
 
         return output;
--- a/jdk/test/sun/tools/jmap/BasicJMapTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/sun/tools/jmap/BasicJMapTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -91,7 +91,7 @@
 
         processBuilder.command(launcher.getCommand());
         System.out.println(Arrays.toString(processBuilder.command().toArray()).replace(",", ""));
-        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);
         System.out.println(output.getOutput());
 
         return output;
--- a/jdk/test/sun/tools/jps/JpsHelper.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/sun/tools/jps/JpsHelper.java	Wed Jul 05 20:05:30 2017 +0200
@@ -36,6 +36,7 @@
 import jdk.testlibrary.JDKToolLauncher;
 import jdk.testlibrary.OutputAnalyzer;
 import jdk.testlibrary.Utils;
+import jdk.testlibrary.ProcessTools;
 
 /**
  * The helper class for running jps utility and verifying output from it
@@ -160,7 +161,7 @@
 
         ProcessBuilder processBuilder = new ProcessBuilder(launcher.getCommand());
         System.out.println(Arrays.toString(processBuilder.command().toArray()).replace(",", ""));
-        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);
         System.out.println(output.getOutput());
 
         return output;
--- a/jdk/test/sun/tools/jps/TestJpsClass.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/sun/tools/jps/TestJpsClass.java	Wed Jul 05 20:05:30 2017 +0200
@@ -55,7 +55,7 @@
         cmd.add("monkey");
 
         ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(cmd.toArray(new String[cmd.size()]));
-        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);
         System.out.println(output.getOutput());
         output.shouldHaveExitValue(0);
     }
--- a/jdk/test/sun/tools/jps/TestJpsJar.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/sun/tools/jps/TestJpsJar.java	Wed Jul 05 20:05:30 2017 +0200
@@ -55,7 +55,7 @@
         cmd.add("monkey");
 
         ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(cmd.toArray(new String[cmd.size()]));
-        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);
         System.out.println(output.getOutput());
         output.shouldHaveExitValue(0);
     }
--- a/jdk/test/sun/tools/jps/TestJpsJarRelative.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/sun/tools/jps/TestJpsJarRelative.java	Wed Jul 05 20:05:30 2017 +0200
@@ -55,7 +55,7 @@
         cmd.add("monkey");
 
         ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(cmd.toArray(new String[cmd.size()]));
-        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);
         System.out.println(output.getOutput());
         output.shouldHaveExitValue(0);
     }
--- a/jdk/test/sun/tools/jstack/BasicJStackTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/sun/tools/jstack/BasicJStackTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -66,7 +66,7 @@
 
         processBuilder.command(launcher.getCommand());
         System.out.println(Arrays.toString(processBuilder.command().toArray()).replace(",", ""));
-        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);
         System.out.println(output.getOutput());
 
         return output;
--- a/jdk/test/sun/tools/jstatd/JstatdTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/sun/tools/jstatd/JstatdTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
 import jdk.testlibrary.JDKToolLauncher;
 import jdk.testlibrary.OutputAnalyzer;
 import jdk.testlibrary.ProcessThread;
-import jdk.testlibrary.TestThread;
 import jdk.testlibrary.Utils;
 import jdk.testlibrary.ProcessTools;
 
@@ -145,8 +144,8 @@
         return output;
     }
 
-    private OutputAnalyzer waitForJstatdRMI(ProcessBuilder pb) throws IOException, InterruptedException {
-        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+    private OutputAnalyzer waitForJstatdRMI(ProcessBuilder pb) throws Exception {
+        OutputAnalyzer output = ProcessTools.executeProcess(pb);
 
         String remoteHost = (serverName != null) ? serverName : "JStatRemoteHost";
         while (output.getExitValue() != 0) {
@@ -155,7 +154,7 @@
             if (out.contains("RMI Registry not available") ||
                 out.contains("RMI Server " + remoteHost + " not available")) {
                 Thread.sleep(100);
-                output = new OutputAnalyzer(pb.start());
+                output = ProcessTools.executeProcess(pb);
             } else {
                 output.shouldHaveExitValue(0);
             }
--- a/jdk/test/sun/tools/jstatd/TestJstatdUsage.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/sun/tools/jstatd/TestJstatdUsage.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
 
 import jdk.testlibrary.JDKToolLauncher;
 import jdk.testlibrary.OutputAnalyzer;
+import jdk.testlibrary.ProcessTools;
 
 /*
  * @test
@@ -42,7 +43,7 @@
         JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jstatd");
         launcher.addToolArg(option);
         ProcessBuilder processBuilder = new ProcessBuilder(launcher.getCommand());
-        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);
 
         output.shouldContain("usage: jstatd [-nr] [-p port] [-n rminame]");
         output.shouldHaveExitValue(1);
--- a/jdk/test/tools/launcher/VersionCheck.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/tools/launcher/VersionCheck.java	Wed Jul 05 20:05:30 2017 +0200
@@ -61,7 +61,6 @@
     static final String[] BLACKLIST_VERSION = {
         "appletviewer",
         "controlpanel",
-        "extcheck",
         "jar",
         "jarsigner",
         "java-rmi",
--- a/jdk/test/tools/pack200/TestNormal.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/jdk/test/tools/pack200/TestNormal.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,23 +42,15 @@
     public static void main(String args[]) throws Exception {
         Properties p = System.getProperties();
         String java_home = p.getProperty("test.jdk");
-        File testJar = new File("test.jar");
-        Utils.jar("cvf", testJar.getName(), Utils.TEST_CLS_DIR.getAbsolutePath());
-
-        File folder = new File("testdir");
-        if (folder.exists()) {
-            delete(folder);
-        }
-        folder.mkdir();
+        String testdir = Utils.TEST_CLS_DIR.getAbsolutePath();
 
         try {
-            extractJar(new JarFile(testJar), folder);
-            execJavaCommand(java_home, "jar cnf normalized.jar -C testdir .");
-            execJavaCommand(java_home, "jar cf original.jar -C testdir .");
+            execJavaCommand(java_home, "jar cnf normalized.jar -C " + testdir + " .");
+            execJavaCommand(java_home, "jar cf original.jar -C " + testdir + " .");
             execJavaCommand(java_home, "pack200 -r repacked.jar original.jar");
             compareJars(new JarFile("normalized.jar"), new JarFile("repacked.jar"));
         } finally {
-            String[] cleanupList = {"testdir", "normalized.jar", "original.jar", "repacked.jar"};
+            String[] cleanupList = {"normalized.jar", "original.jar", "repacked.jar"};
             for (String s : cleanupList) {
                 delete(new File(s));
             }
@@ -101,36 +93,6 @@
         }
     }
 
-    public static void extractJar(JarFile jf, File where) throws Exception {
-        for (JarEntry file : Collections.list(jf.entries())) {
-            File out = new File(where, file.getName());
-            if (file.isDirectory()) {
-                out.mkdirs();
-                continue;
-            }
-            File parent = out.getParentFile();
-            if (parent != null && !parent.exists()) {
-                parent.mkdirs();
-            }
-            InputStream is = null;
-            OutputStream os = null;
-            try {
-                is = jf.getInputStream(file);
-                os = new FileOutputStream(out);
-                while (is.available() > 0) {
-                    os.write(is.read());
-                }
-            } finally {
-                if (is != null) {
-                    is.close();
-                }
-                if (os != null) {
-                    os.close();
-                }
-            }
-        }
-    }
-
     static void delete(File f) throws IOException {
         if (!f.exists()) {
             return;
--- a/langtools/.hgtags	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/.hgtags	Wed Jul 05 20:05:30 2017 +0200
@@ -278,3 +278,4 @@
 e891e0c4edc5174a4da6d19dc2d59697b79f1916 jdk9-b33
 e18407fcede818b30709913784cb6b904030531d jdk9-b34
 b8e7bbdd806465a916e64413c283075ceb0a782c jdk9-b35
+c536541235e566701ff772700c15de14b75e2979 jdk9-b36
--- a/langtools/make/build.properties	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/make/build.properties	Wed Jul 05 20:05:30 2017 +0200
@@ -32,8 +32,8 @@
 # boot.java.home = /opt/jdk/1.7.0
 boot.java = ${boot.java.home}/bin/java
 boot.javac = ${boot.java.home}/bin/javac
-boot.javac.source = 7
-boot.javac.target = 7
+boot.javac.source = 8
+boot.javac.target = 8
 
 # This is the JDK used to run the product version of the tools,
 # for example, for testing. If you're building a complete JDK, specify that.
--- a/langtools/make/tools/crules/MutableFieldsAnalyzer.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/make/tools/crules/MutableFieldsAnalyzer.java	Wed Jul 05 20:05:30 2017 +0200
@@ -30,7 +30,6 @@
 
 import com.sun.source.util.JavacTask;
 import com.sun.source.util.TaskEvent.Kind;
-import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
 import com.sun.tools.javac.tree.TreeScanner;
 
@@ -38,6 +37,7 @@
 import static com.sun.tools.javac.code.Flags.FINAL;
 import static com.sun.tools.javac.code.Flags.STATIC;
 import static com.sun.tools.javac.code.Flags.SYNTHETIC;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 
 public class MutableFieldsAnalyzer extends AbstractCodingRulesAnalyzer {
 
@@ -68,7 +68,7 @@
                     .contains(packageToCheck);
             if (isJavacPack &&
                 (tree.sym.flags() & SYNTHETIC) == 0 &&
-                tree.sym.owner.kind == Kinds.TYP) {
+                tree.sym.owner.kind == TYP) {
                 if (!ignoreField(tree.sym.owner.flatName().toString(),
                         tree.getName().toString())) {
                     boolean enumClass = (tree.sym.owner.flags() & ENUM) != 0;
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java	Wed Jul 05 20:05:30 2017 +0200
@@ -56,7 +56,6 @@
 import com.sun.source.util.JavacTask;
 import com.sun.source.util.TreePath;
 import com.sun.tools.javac.code.Flags;
-import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.code.Symbol;
 import com.sun.tools.javac.code.Symbol.ClassSymbol;
 import com.sun.tools.javac.code.Symbol.MethodSymbol;
@@ -106,6 +105,7 @@
 import com.sun.tools.javac.util.Names;
 import com.sun.tools.javac.util.Pair;
 import com.sun.tools.javac.util.Position;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.TypeTag.*;
 
 /**
@@ -474,7 +474,7 @@
         searched.add(tsym);
 
         for (Symbol sym : tsym.members().getSymbolsByName(fieldName)) {
-            if (sym.kind == Kinds.VAR) {
+            if (sym.kind == VAR) {
                 return (VarSymbol)sym;
             }
         }
@@ -516,7 +516,7 @@
     /** @see com.sun.tools.javadoc.ClassDocImpl#findConstructor */
     MethodSymbol findConstructor(ClassSymbol tsym, List<Type> paramTypes) {
         for (Symbol sym : tsym.members().getSymbolsByName(names.init)) {
-            if (sym.kind == Kinds.MTH) {
+            if (sym.kind == MTH) {
                 if (hasParameterTypes((MethodSymbol) sym, paramTypes)) {
                     return (MethodSymbol) sym;
                 }
@@ -557,7 +557,7 @@
             // attempt to emulate the old behavior.
             MethodSymbol lastFound = null;
             for (Symbol sym : tsym.members().getSymbolsByName(methodName)) {
-                if (sym.kind == Kinds.MTH) {
+                if (sym.kind == MTH) {
                     if (sym.name == methodName) {
                         lastFound = (MethodSymbol)sym;
                     }
@@ -569,7 +569,7 @@
         } else {
             for (Symbol sym : tsym.members().getSymbolsByName(methodName)) {
                 if (sym != null &&
-                    sym.kind == Kinds.MTH) {
+                    sym.kind == MTH) {
                     if (hasParameterTypes((MethodSymbol) sym, paramTypes)) {
                         return (MethodSymbol) sym;
                     }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java	Wed Jul 05 20:05:30 2017 +0200
@@ -43,7 +43,7 @@
 import com.sun.tools.javac.util.*;
 
 import static com.sun.tools.javac.code.Flags.*;
-import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 
 import static com.sun.tools.javac.main.Option.*;
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Kinds.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Kinds.java	Wed Jul 05 20:05:30 2017 +0200
@@ -26,11 +26,13 @@
 package com.sun.tools.javac.code;
 
 import java.util.EnumSet;
+import java.util.Set;
 import java.util.Locale;
 
 import com.sun.source.tree.MemberReferenceTree;
 import com.sun.tools.javac.api.Formattable;
 import com.sun.tools.javac.api.Messages;
+
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.code.TypeTag.PACKAGE;
@@ -49,55 +51,166 @@
 
     private Kinds() {} // uninstantiable
 
-    /** The empty set of kinds.
-     */
-    public final static int NIL = 0;
-
-    /** The kind of package symbols.
+    /**
+     * Kind of symbols.
+     *
+     * IMPORTANT: This is an ordered type.  The ordering of
+     * declarations in this enum matters.  Be careful when changing
+     * it.
      */
-    public final static int PCK = 1 << 0;
+    public enum Kind {
+        NIL(Category.BASIC, KindSelector.NIL),
+        PCK(Category.BASIC, KindName.PACKAGE, KindSelector.PCK),
+        TYP(Category.BASIC, KindName.CLASS, KindSelector.TYP),
+        VAR(Category.BASIC, KindName.VAR, KindSelector.VAR),
+        MTH(Category.BASIC, KindName.METHOD, KindSelector.MTH),
+        POLY(Category.BASIC, KindSelector.POLY),
+        ERR(Category.ERROR, KindSelector.ERR),
+        AMBIGUOUS(Category.OVERLOAD),
+        HIDDEN(Category.OVERLOAD),
+        STATICERR(Category.OVERLOAD),
+        MISSING_ENCL(Category.OVERLOAD),
+        ABSENT_VAR(Category.OVERLOAD, KindName.VAR),
+        WRONG_MTHS(Category.OVERLOAD, KindName.METHOD),
+        WRONG_MTH(Category.OVERLOAD, KindName.METHOD),
+        ABSENT_MTH(Category.OVERLOAD, KindName.METHOD),
+        ABSENT_TYP(Category.OVERLOAD, KindName.CLASS),
+        WRONG_STATICNESS(Category.OVERLOAD, KindName.METHOD);
 
-    /** The kind of type symbols (classes, interfaces and type variables).
-     */
-    public final static int TYP = 1 << 1;
+        // There are essentially two "levels" to the Kind datatype.
+        // The first is a totally-ordered set of categories of
+        // solutions.  Within each category, we have more
+        // possibilities.
+        private enum Category {
+            BASIC, ERROR, OVERLOAD;
+        }
 
-    /** The kind of variable symbols.
-     */
-    public final static int VAR = 1 << 2;
+        private final KindName kindName;
+        private final KindName absentKind;
+        private final KindSelector selector;
+        private final Category category;
+
+        private Kind(Category category) {
+            this(category, null, null, null);
+        }
+
+        private Kind(Category category,
+                     KindSelector selector) {
+            this(category, null, null, selector);
+        }
+
+        private Kind(Category category,
+                     KindName absentKind) {
+            this(category, null, absentKind, null);
+        }
 
-    /** The kind of values (variables or non-variable expressions), includes VAR.
-     */
-    public final static int VAL = (1 << 3) | VAR;
+        private Kind(Category category,
+                     KindName kindName,
+                     KindSelector selector) {
+            this(category, kindName, null, selector);
+        }
 
-    /** The kind of methods.
-     */
-    public final static int MTH = 1 << 4;
+        private Kind(Category category,
+                     KindName kindName,
+                     KindName absentKind,
+                     KindSelector selector) {
+            this.category = category;
+            this.kindName = kindName;
+            this.absentKind = absentKind;
+            this.selector = selector;
+        }
+
+        public KindSelector toSelector() {
+            return selector;
+        }
+
+        public boolean matches(KindSelector kindSelectors) {
+            return selector.contains(kindSelectors);
+        }
 
-    /** Poly kind, for deferred types.
-     */
-    public final static int POLY = 1 << 5;
+        public boolean isOverloadError() {
+            return category == Category.OVERLOAD;
+        }
+
+        public boolean isValid() {
+            return category == Category.BASIC;
+        }
+
+        public boolean betterThan(Kind other) {
+            return ordinal() < other.ordinal();
+        }
+
+        public KindName kindName() {
+            if (kindName == null) {
+                throw new AssertionError("Unexpected kind: " + this);
+            } else {
+                return kindName;
+            }
+        }
 
-    /** The error kind, which includes all other kinds.
-     */
-    public final static int ERR = (1 << 6) - 1;
+        public KindName absentKind() {
+            if (absentKind == null) {
+                throw new AssertionError("Unexpected kind: " + this);
+            } else {
+                return absentKind;
+            }
+        }
+    }
 
-    /** The set of all kinds.
-     */
-    public final static int AllKinds = ERR;
+    public static class KindSelector {
+
+        //basic selectors
+        public static final KindSelector NIL = new KindSelector(0);
+        public static final KindSelector PCK = new KindSelector(0x01);
+        public static final KindSelector TYP = new KindSelector(0x02);
+        public static final KindSelector VAR = new KindSelector(0x04);
+        public static final KindSelector VAL = new KindSelector(0x0c);
+        public static final KindSelector MTH = new KindSelector(0x10);
+        public static final KindSelector ERR = new KindSelector(0x3f);
+        public static final KindSelector POLY = new KindSelector(0x20);
 
-    /** Kinds for erroneous symbols that complement the above
-     */
-    public static final int ERRONEOUS           = 1 << 7;
-    public static final int AMBIGUOUS           = ERRONEOUS + 1;  // ambiguous reference
-    public static final int HIDDEN              = ERRONEOUS + 2;  // hidden method or field
-    public static final int STATICERR           = ERRONEOUS + 3;  // nonstatic member from static context
-    public static final int MISSING_ENCL        = ERRONEOUS + 4;  // missing enclosing class
-    public static final int ABSENT_VAR          = ERRONEOUS + 5;  // missing variable
-    public static final int WRONG_MTHS          = ERRONEOUS + 6;  // methods with wrong arguments
-    public static final int WRONG_MTH           = ERRONEOUS + 7;  // one method with wrong arguments
-    public static final int ABSENT_MTH          = ERRONEOUS + 8;  // missing method
-    public static final int ABSENT_TYP          = ERRONEOUS + 9;  // missing type
-    public static final int WRONG_STATICNESS    = ERRONEOUS + 10; // wrong staticness for method references
+        //common derived selectors
+        public static final KindSelector TYP_PCK = of(TYP, PCK);
+        public static final KindSelector VAL_MTH = of(VAL, MTH);
+        public static final KindSelector VAL_POLY = of(VAL, POLY);
+        public static final KindSelector VAL_TYP = of(VAL, TYP);
+        public static final KindSelector VAL_TYP_PCK = of(VAL, TYP, PCK);
+
+        private final byte data;
+
+        private KindSelector(int data) {
+            this.data = (byte) data;
+        }
+
+        public static KindSelector of(KindSelector... kindSelectors) {
+            byte newData = 0;
+            for (KindSelector kindSel : kindSelectors) {
+                newData |= kindSel.data;
+            }
+            return new KindSelector(newData);
+        }
+
+        public boolean subset(KindSelector other) {
+            return (data & ~other.data) == 0;
+        }
+
+        public boolean contains(KindSelector other) {
+            return (data & other.data) != 0;
+        }
+
+        /** A set of KindName(s) representing a set of symbol's kinds. */
+        public Set<KindName> kindNames() {
+            EnumSet<KindName> kinds = EnumSet.noneOf(KindName.class);
+            if ((data & VAL.data) != 0) {
+                if ((data & VAL.data) == VAR.data) kinds.add(KindName.VAR);
+                else kinds.add(KindName.VAL);
+            }
+            if ((data & MTH.data) != 0) kinds.add(KindName.METHOD);
+            if ((data & TYP.data) != 0) kinds.add(KindName.CLASS);
+            if ((data & PCK.data) != 0) kinds.add(KindName.PACKAGE);
+            return kinds;
+        }
+    }
 
     public enum KindName implements Formattable {
         ANNOTATION("kindname.annotation"),
@@ -135,19 +248,6 @@
         }
     }
 
-    /** A KindName representing a given symbol kind
-     */
-    public static KindName kindName(int kind) {
-        switch (kind) {
-        case PCK: return KindName.PACKAGE;
-        case TYP: return KindName.CLASS;
-        case VAR: return KindName.VAR;
-        case VAL: return KindName.VAL;
-        case MTH: return KindName.METHOD;
-            default : throw new AssertionError("Unexpected kind: "+kind);
-        }
-    }
-
     public static KindName kindName(MemberReferenceTree.ReferenceMode mode) {
         switch (mode) {
             case INVOKE: return KindName.METHOD;
@@ -195,27 +295,10 @@
             return KindName.INSTANCE_INIT;
 
         default:
-            if (sym.kind == VAL)
-                // I don't think this can happen but it can't harm
-                // playing it safe --ahe
-                return KindName.VAL;
-            else
                 throw new AssertionError("Unexpected kind: "+sym.getKind());
         }
     }
 
-    /** A set of KindName(s) representing a set of symbol's kinds.
-     */
-    public static EnumSet<KindName> kindNames(int kind) {
-        EnumSet<KindName> kinds = EnumSet.noneOf(KindName.class);
-        if ((kind & VAL) != 0)
-            kinds.add(((kind & VAL) == VAR) ? KindName.VAR : KindName.VAL);
-        if ((kind & MTH) != 0) kinds.add(KindName.METHOD);
-        if ((kind & TYP) != 0) kinds.add(KindName.CLASS);
-        if ((kind & PCK) != 0) kinds.add(KindName.PACKAGE);
-        return kinds;
-    }
-
     /** A KindName representing the kind of a given class/interface type.
      */
     public static KindName typeKindName(Type t) {
@@ -232,19 +315,4 @@
             return KindName.CLASS;
     }
 
-    /** A KindName representing the kind of a missing symbol, given an
-     *  error kind.
-     * */
-    public static KindName absentKind(int kind) {
-        switch (kind) {
-        case ABSENT_VAR:
-            return KindName.VAR;
-        case WRONG_MTHS: case WRONG_MTH: case ABSENT_MTH: case WRONG_STATICNESS:
-            return KindName.METHOD;
-        case ABSENT_TYP:
-            return KindName.CLASS;
-        default:
-            throw new AssertionError("Unexpected kind: "+kind);
-        }
-    }
 }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Printer.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Printer.java	Wed Jul 05 20:05:30 2017 +0200
@@ -36,6 +36,7 @@
 
 import static com.sun.tools.javac.code.BoundKind.*;
 import static com.sun.tools.javac.code.Flags.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.code.TypeTag.FORALL;
 
@@ -224,7 +225,7 @@
     @Override
     public String visitClassType(ClassType t, Locale locale) {
         StringBuilder buf = new StringBuilder();
-        if (t.getEnclosingType().hasTag(CLASS) && t.tsym.owner.kind == Kinds.TYP) {
+        if (t.getEnclosingType().hasTag(CLASS) && t.tsym.owner.kind == TYP) {
             buf.append(visit(t.getEnclosingType(), locale));
             buf.append('.');
             buf.append(printAnnotations(t));
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java	Wed Jul 05 20:05:30 2017 +0200
@@ -45,6 +45,7 @@
 import com.sun.tools.javac.util.Name;
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.code.TypeTag.FORALL;
@@ -65,7 +66,7 @@
     /** The kind of this symbol.
      *  @see Kinds
      */
-    public int kind;
+    public Kind kind;
 
     /** The flags of this symbol.
      */
@@ -232,7 +233,7 @@
 
     /** Construct a symbol with given kind, flags, name, type and owner.
      */
-    public Symbol(int kind, long flags, Name name, Type type, Symbol owner) {
+    public Symbol(Kind kind, long flags, Name name, Type type, Symbol owner) {
         this.kind = kind;
         this.flags_field = flags;
         this.type = type;
@@ -268,7 +269,9 @@
      */
     public Symbol location() {
         if (owner.name == null || (owner.name.isEmpty() &&
-                (owner.flags() & BLOCK) == 0 && owner.kind != PCK && owner.kind != TYP)) {
+                                   (owner.flags() & BLOCK) == 0 &&
+                                   owner.kind != PCK &&
+                                   owner.kind != TYP)) {
             return null;
         }
         return owner;
@@ -344,8 +347,8 @@
      */
     public boolean isLocal() {
         return
-            (owner.kind & (VAR | MTH)) != 0 ||
-            (owner.kind == TYP && owner.isLocal());
+            (owner.kind.matches(KindSelector.VAL_MTH) ||
+             (owner.kind == TYP && owner.isLocal()));
     }
 
     /** Has this symbol an empty name? This includes anonymous
@@ -407,7 +410,7 @@
     public ClassSymbol enclClass() {
         Symbol c = this;
         while (c != null &&
-               ((c.kind & TYP) == 0 || !c.type.hasTag(CLASS))) {
+               (!c.kind.matches(KindSelector.TYP) || !c.type.hasTag(CLASS))) {
             c = c.owner;
         }
         return (ClassSymbol)c;
@@ -669,16 +672,16 @@
     /** A base class for Symbols representing types.
      */
     public static abstract class TypeSymbol extends Symbol {
-        public TypeSymbol(int kind, long flags, Name name, Type type, Symbol owner) {
+        public TypeSymbol(Kind kind, long flags, Name name, Type type, Symbol owner) {
             super(kind, flags, name, type, owner);
         }
         /** form a fully qualified name from a name and an owner
          */
         static public Name formFullName(Name name, Symbol owner) {
             if (owner == null) return name;
-            if (((owner.kind != ERR)) &&
-                ((owner.kind & (VAR | MTH)) != 0
-                 || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
+            if ((owner.kind != ERR) &&
+                (owner.kind.matches(KindSelector.VAL_MTH) ||
+                 (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
                  )) return name;
             Name prefix = owner.getQualifiedName();
             if (prefix == null || prefix == prefix.table.names.empty)
@@ -690,9 +693,8 @@
          *  converting to flat representation
          */
         static public Name formFlatName(Name name, Symbol owner) {
-            if (owner == null ||
-                (owner.kind & (VAR | MTH)) != 0
-                || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
+            if (owner == null || owner.kind.matches(KindSelector.VAL_MTH) ||
+                (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
                 ) return name;
             char sep = owner.kind == TYP ? '$' : '.';
             Name prefix = owner.flatName();
@@ -1558,7 +1560,7 @@
         // where
             public static final Filter<Symbol> implementation_filter = new Filter<Symbol>() {
                 public boolean accepts(Symbol s) {
-                    return s.kind == Kinds.MTH &&
+                    return s.kind == MTH &&
                             (s.flags() & SYNTHETIC) == 0;
                 }
             };
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java	Wed Jul 05 20:05:30 2017 +0200
@@ -64,8 +64,7 @@
 import com.sun.tools.javac.util.Names;
 
 import static com.sun.tools.javac.code.Flags.*;
-import static com.sun.tools.javac.code.Kinds.PCK;
-import static com.sun.tools.javac.code.Kinds.TYP;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.jvm.ByteCodes.*;
 import static com.sun.tools.javac.code.TypeTag.*;
 
@@ -426,7 +425,7 @@
                     return messages.getLocalizedString("compiler.misc.unnamed.package");
                 }
             };
-        noSymbol = new TypeSymbol(Kinds.NIL, 0, names.empty, Type.noType, rootPackage) {
+        noSymbol = new TypeSymbol(NIL, 0, names.empty, Type.noType, rootPackage) {
             @DefinedBy(Api.LANGUAGE_MODEL)
             public <R, P> R accept(ElementVisitor<R, P> v, P p) {
                 return v.visitUnknown(this, p);
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java	Wed Jul 05 20:05:30 2017 +0200
@@ -39,7 +39,7 @@
 import com.sun.tools.javac.util.DefinedBy.Api;
 import static com.sun.tools.javac.code.BoundKind.*;
 import static com.sun.tools.javac.code.Flags.*;
-import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.TypeTag.*;
 
 /** This class represents Java types. The class itself defines the behavior of
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotations.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotations.java	Wed Jul 05 20:05:30 2017 +0200
@@ -73,6 +73,8 @@
 import com.sun.tools.javac.util.Names;
 import com.sun.tools.javac.util.Options;
 
+import static com.sun.tools.javac.code.Kinds.Kind.*;
+
 /**
  * Contains operations specific to processing type annotations.
  * This class has two functions:
@@ -182,43 +184,43 @@
             }
             Attribute.Enum e = (Attribute.Enum) app;
             if (e.value.name == names.TYPE) {
-                if (s.kind == Kinds.TYP)
+                if (s.kind == TYP)
                     isDecl = true;
             } else if (e.value.name == names.FIELD) {
-                if (s.kind == Kinds.VAR &&
-                        s.owner.kind != Kinds.MTH)
+                if (s.kind == VAR &&
+                        s.owner.kind != MTH)
                     isDecl = true;
             } else if (e.value.name == names.METHOD) {
-                if (s.kind == Kinds.MTH &&
+                if (s.kind == MTH &&
                         !s.isConstructor())
                     isDecl = true;
             } else if (e.value.name == names.PARAMETER) {
-                if (s.kind == Kinds.VAR &&
-                        s.owner.kind == Kinds.MTH &&
+                if (s.kind == VAR &&
+                        s.owner.kind == MTH &&
                         (s.flags() & Flags.PARAMETER) != 0)
                     isDecl = true;
             } else if (e.value.name == names.CONSTRUCTOR) {
-                if (s.kind == Kinds.MTH &&
+                if (s.kind == MTH &&
                         s.isConstructor())
                     isDecl = true;
             } else if (e.value.name == names.LOCAL_VARIABLE) {
-                if (s.kind == Kinds.VAR &&
-                        s.owner.kind == Kinds.MTH &&
+                if (s.kind == VAR &&
+                        s.owner.kind == MTH &&
                         (s.flags() & Flags.PARAMETER) == 0)
                     isDecl = true;
             } else if (e.value.name == names.ANNOTATION_TYPE) {
-                if (s.kind == Kinds.TYP &&
+                if (s.kind == TYP &&
                         (s.flags() & Flags.ANNOTATION) != 0)
                     isDecl = true;
             } else if (e.value.name == names.PACKAGE) {
-                if (s.kind == Kinds.PCK)
+                if (s.kind == PCK)
                     isDecl = true;
             } else if (e.value.name == names.TYPE_USE) {
-                if (s.kind == Kinds.TYP ||
-                        s.kind == Kinds.VAR ||
-                        (s.kind == Kinds.MTH && !s.isConstructor() &&
+                if (s.kind == TYP ||
+                        s.kind == VAR ||
+                        (s.kind == MTH && !s.isConstructor() &&
                         !s.type.getReturnType().hasTag(TypeTag.VOID)) ||
-                        (s.kind == Kinds.MTH && s.isConstructor()))
+                        (s.kind == MTH && s.isConstructor()))
                     isType = true;
             } else if (e.value.name == names.TYPE_PARAMETER) {
                 /* Irrelevant in this case */
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Wed Jul 05 20:05:30 2017 +0200
@@ -46,6 +46,7 @@
 
 import static com.sun.tools.javac.code.BoundKind.*;
 import static com.sun.tools.javac.code.Flags.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.Scope.*;
 import static com.sun.tools.javac.code.Symbol.*;
 import static com.sun.tools.javac.code.Type.*;
@@ -667,7 +668,7 @@
     //where
         private Filter<Symbol> bridgeFilter = new Filter<Symbol>() {
             public boolean accepts(Symbol t) {
-                return t.kind == Kinds.MTH &&
+                return t.kind == MTH &&
                         t.name != names.init &&
                         t.name != names.clinit &&
                         (t.flags() & SYNTHETIC) == 0;
@@ -708,7 +709,7 @@
 
        @Override
        public boolean accepts(Symbol sym) {
-           return sym.kind == Kinds.MTH &&
+           return sym.kind == MTH &&
                    (sym.flags() & (ABSTRACT | DEFAULT)) == ABSTRACT &&
                    !overridesObjectMethod(origin, sym) &&
                    (interfaceCandidates(origin.type, (MethodSymbol)sym).head.flags() & DEFAULT) == 0;
@@ -793,7 +794,6 @@
     public boolean isSubtype(Type t, Type s, boolean capture) {
         if (t == s)
             return true;
-
         if (s.isPartial())
             return isSuperType(s, t);
 
@@ -2809,7 +2809,7 @@
                 }
 
                 public boolean accepts(Symbol s) {
-                    return s.kind == Kinds.MTH &&
+                    return s.kind == MTH &&
                             s.name == msym.name &&
                             (s.flags() & SYNTHETIC) == 0 &&
                             s.isInheritedIn(site.tsym, Types.this) &&
@@ -3634,7 +3634,8 @@
             for (Type erasedSupertype : mec) {
                 List<Type> lci = List.of(asSuper(ts[startIdx], erasedSupertype.tsym));
                 for (int i = startIdx + 1 ; i < ts.length ; i++) {
-                    lci = intersect(lci, List.of(asSuper(ts[i], erasedSupertype.tsym)));
+                    Type superType = asSuper(ts[i], erasedSupertype.tsym);
+                    lci = intersect(lci, superType != null ? List.of(superType) : List.<Type>nil());
                 }
                 candidates = candidates.appendList(lci);
             }
@@ -4714,7 +4715,7 @@
             Type outer = ct.getEnclosingType();
             if (outer.allparams().nonEmpty()) {
                 boolean rawOuter =
-                        c.owner.kind == Kinds.MTH || // either a local class
+                        c.owner.kind == MTH || // either a local class
                         c.name == types.names.empty; // or anonymous
                 assembleClassSig(rawOuter
                         ? types.erasure(outer)
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java	Wed Jul 05 20:05:30 2017 +0200
@@ -39,7 +39,7 @@
 import com.sun.tools.javac.tree.*;
 import com.sun.tools.javac.tree.JCTree.*;
 
-import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.TypeTag.ARRAY;
 import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
@@ -458,7 +458,7 @@
             Symbol sym = TreeInfo.symbol(tree);
             if (sym == null ||
                 TreeInfo.nonstaticSelect(tree) ||
-                sym.kind != Kinds.VAR ||
+                sym.kind != VAR ||
                 (sym.flags() & Flags.ENUM) == 0) {
                 log.error(tree.pos(), "enum.annotation.must.be.enum.constant");
                 return new Attribute.Error(result.getOriginalType());
@@ -657,7 +657,7 @@
             nr_value_elems++;
 
             if (nr_value_elems == 1 &&
-                elm.kind == Kinds.MTH) {
+                elm.kind == MTH) {
                 containerValueSymbol = (MethodSymbol)elm;
             } else {
                 error = true;
@@ -678,7 +678,7 @@
 
         // validate that the 'value' element is a method
         // probably "impossible" to fail this
-        if (containerValueSymbol.kind != Kinds.MTH) {
+        if (containerValueSymbol.kind != MTH) {
             log.error(pos,
                       "invalid.repeatable.annotation.invalid.value",
                       targetContainerType);
@@ -909,7 +909,7 @@
                             annotations.nonEmpty())
                             log.error(annotations.head.pos,
                                       "already.annotated",
-                                      kindName(s), s);
+                                      Kinds.kindName(s), s);
                         actualEnterAnnotations(annotations, localEnv, s);
                     } finally {
                         if (prevLint != null)
@@ -1066,7 +1066,7 @@
             DiagnosticPosition prevPos = deferPos;
             deferPos = tree.pos();
             try {
-                if (sym != null && sym.kind == Kinds.VAR) {
+                if (sym != null && sym.kind == VAR) {
                     // Don't visit a parameter once when the sym is the method
                     // and once when the sym is the parameter.
                     scan(tree.mods);
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Jul 05 20:05:30 2017 +0200
@@ -57,7 +57,7 @@
 import static com.sun.tools.javac.code.Flags.ANNOTATION;
 import static com.sun.tools.javac.code.Flags.BLOCK;
 import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.Kinds.ERRONEOUS;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.code.TypeTag.WILDCARD;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
@@ -147,12 +147,12 @@
         useBeforeDeclarationWarning = options.isSet("useBeforeDeclarationWarning");
         identifyLambdaCandidate = options.getBoolean("identifyLambdaCandidate", false);
 
-        statInfo = new ResultInfo(NIL, Type.noType);
-        varInfo = new ResultInfo(VAR, Type.noType);
-        unknownExprInfo = new ResultInfo(VAL, Type.noType);
-        unknownAnyPolyInfo = new ResultInfo(VAL, Infer.anyPoly);
-        unknownTypeInfo = new ResultInfo(TYP, Type.noType);
-        unknownTypeExprInfo = new ResultInfo(Kinds.TYP | Kinds.VAL, Type.noType);
+        statInfo = new ResultInfo(KindSelector.NIL, Type.noType);
+        varInfo = new ResultInfo(KindSelector.VAR, Type.noType);
+        unknownExprInfo = new ResultInfo(KindSelector.VAL, Type.noType);
+        unknownAnyPolyInfo = new ResultInfo(KindSelector.VAL, Infer.anyPoly);
+        unknownTypeInfo = new ResultInfo(KindSelector.TYP, Type.noType);
+        unknownTypeExprInfo = new ResultInfo(KindSelector.VAL_TYP, Type.noType);
         recoveryInfo = new RecoveryInfo(deferredAttr.emptyDeferredAttrContext);
     }
 
@@ -223,14 +223,17 @@
      *  @param ownkind  The computed kind of the tree
      *  @param resultInfo  The expected result of the tree
      */
-    Type check(final JCTree tree, final Type found, final int ownkind, final ResultInfo resultInfo) {
+    Type check(final JCTree tree,
+               final Type found,
+               final KindSelector ownkind,
+               final ResultInfo resultInfo) {
         InferenceContext inferenceContext = resultInfo.checkContext.inferenceContext();
         Type owntype;
         if (!found.hasTag(ERROR) && !resultInfo.pt.hasTag(METHOD) && !resultInfo.pt.hasTag(FORALL)) {
-            if ((ownkind & ~resultInfo.pkind) != 0) {
+            if (!ownkind.subset(resultInfo.pkind)) {
                 log.error(tree.pos(), "unexpected.type",
-                        kindNames(resultInfo.pkind),
-                        kindName(ownkind));
+                        resultInfo.pkind.kindNames(),
+                        ownkind.kindNames());
                 owntype = types.createErrorType(found);
             } else if (allowPoly && inferenceContext.free(found)) {
                 //delay the check if there are inference variables in the found type
@@ -348,7 +351,8 @@
                 Name name = (Name)node.getIdentifier();
                 if (site.kind == PCK) {
                     env.toplevel.packge = (PackageSymbol)site;
-                    return rs.findIdentInPackage(env, (TypeSymbol)site, name, TYP | PCK);
+                    return rs.findIdentInPackage(env, (TypeSymbol)site, name,
+                            KindSelector.TYP_PCK);
                 } else {
                     env.enclClass.sym = (ClassSymbol)site;
                     return rs.findMemberType(env, site.asType(), name, (TypeSymbol)site);
@@ -357,7 +361,7 @@
 
             @Override @DefinedBy(Api.COMPILER_TREE)
             public Symbol visitIdentifier(IdentifierTree node, Env<AttrContext> env) {
-                return rs.findIdent(env, (Name)node.getName(), TYP | PCK);
+                return rs.findIdent(env, (Name)node.getName(), KindSelector.TYP_PCK);
             }
         }
 
@@ -374,9 +378,9 @@
     public Type attribImportQualifier(JCImport tree, Env<AttrContext> env) {
         // Attribute qualifying package or class.
         JCFieldAccess s = (JCFieldAccess)tree.qualid;
-        return attribTree(s.selected,
-                       env,
-                       new ResultInfo(tree.staticImport ? TYP : (TYP | PCK),
+        return attribTree(s.selected, env,
+                          new ResultInfo(tree.staticImport ?
+                                         KindSelector.TYP : KindSelector.TYP_PCK,
                        Type.noType));
     }
 
@@ -431,15 +435,16 @@
     }
 
     class ResultInfo {
-        final int pkind;
+        final KindSelector pkind;
         final Type pt;
         final CheckContext checkContext;
 
-        ResultInfo(int pkind, Type pt) {
+        ResultInfo(KindSelector pkind, Type pt) {
             this(pkind, pt, chk.basicHandler);
         }
 
-        protected ResultInfo(int pkind, Type pt, CheckContext checkContext) {
+        protected ResultInfo(KindSelector pkind,
+                             Type pt, CheckContext checkContext) {
             this.pkind = pkind;
             this.pt = pt;
             this.checkContext = checkContext;
@@ -474,7 +479,8 @@
     class RecoveryInfo extends ResultInfo {
 
         public RecoveryInfo(final DeferredAttr.DeferredAttrContext deferredAttrContext) {
-            super(Kinds.VAL, Type.recoveryType, new Check.NestedCheckContext(chk.basicHandler) {
+            super(KindSelector.VAL, Type.recoveryType,
+                  new Check.NestedCheckContext(chk.basicHandler) {
                 @Override
                 public DeferredAttr.DeferredAttrContext deferredAttrContext() {
                     return deferredAttrContext;
@@ -503,7 +509,7 @@
         return resultInfo.pt;
     }
 
-    int pkind() {
+    KindSelector pkind() {
         return resultInfo.pkind;
     }
 
@@ -575,7 +581,7 @@
     /** Derived visitor method: attribute an expression tree.
      */
     public Type attribExpr(JCTree tree, Env<AttrContext> env, Type pt) {
-        return attribTree(tree, env, new ResultInfo(VAL, !pt.hasTag(ERROR) ? pt : Type.noType));
+        return attribTree(tree, env, new ResultInfo(KindSelector.VAL, !pt.hasTag(ERROR) ? pt : Type.noType));
     }
 
     /** Derived visitor method: attribute an expression tree with
@@ -595,7 +601,7 @@
     /** Derived visitor method: attribute a type tree.
      */
     Type attribType(JCTree tree, Env<AttrContext> env, Type pt) {
-        Type result = attribTree(tree, env, new ResultInfo(TYP, pt));
+        Type result = attribTree(tree, env, new ResultInfo(KindSelector.TYP, pt));
         return result;
     }
 
@@ -623,19 +629,19 @@
 
     /** Attribute the arguments in a method call, returning the method kind.
      */
-    int attribArgs(List<JCExpression> trees, Env<AttrContext> env, ListBuffer<Type> argtypes) {
-        int kind = VAL;
+    KindSelector attribArgs(List<JCExpression> trees, Env<AttrContext> env, ListBuffer<Type> argtypes) {
+        boolean polykind = false;
         for (JCExpression arg : trees) {
             Type argtype;
             if (allowPoly && deferredAttr.isDeferred(env, arg)) {
                 argtype = deferredAttr.new DeferredType(arg, env);
-                kind |= POLY;
+                polykind = true;
             } else {
                 argtype = chk.checkNonVoid(arg, attribTree(arg, env, unknownAnyPolyInfo));
             }
             argtypes.append(argtype);
         }
-        return kind;
+        return polykind ? KindSelector.VAL_POLY : KindSelector.VAL;
     }
 
     /** Attribute a type argument list, returning a list of types.
@@ -792,7 +798,7 @@
     public void visitClassDef(JCClassDecl tree) {
         // Local and anonymous classes have not been entered yet, so we need to
         // do it now.
-        if ((env.info.scope.owner.kind & (VAR | MTH)) != 0) {
+        if (env.info.scope.owner.kind.matches(KindSelector.VAL_MTH)) {
             enter.classEnter(tree, env);
         } else {
             // If this class declaration is part of a class level annotation,
@@ -983,8 +989,12 @@
                 // parameters have already been entered
                 env.info.scope.enter(tree.sym);
             } else {
-                memberEnter.memberEnter(tree, env);
-                annotate.flush();
+                try {
+                    annotate.enterStart();
+                    memberEnter.memberEnter(tree, env);
+                } finally {
+                    annotate.enterDone();
+                }
             }
         } else {
             if (tree.init != null) {
@@ -1282,7 +1292,10 @@
                             chk.basicHandler.report(pos, diags.fragment("try.not.applicable.to.type", details));
                         }
                     };
-                    ResultInfo twrResult = new ResultInfo(VAL, syms.autoCloseableType, twrContext);
+                    ResultInfo twrResult =
+                        new ResultInfo(KindSelector.VAL,
+                                       syms.autoCloseableType,
+                                       twrContext);
                     if (resource.hasTag(VARDEF)) {
                         attribStat(resource, tryEnv);
                         twrResult.check(resource, resource.type);
@@ -1314,7 +1327,7 @@
                         //multi-catch parameter is implicitly marked as final
                         c.param.sym.flags_field |= FINAL | UNION;
                     }
-                    if (c.param.sym.kind == Kinds.VAR) {
+                    if (c.param.sym.kind == VAR) {
                         c.param.sym.setData(ElementKind.EXCEPTION_PARAMETER);
                     }
                     chk.checkType(c.param.vartype.pos(),
@@ -1399,7 +1412,7 @@
             //constant folding
             owntype = cfolder.coerce(condtype.isTrue() ? truetype : falsetype, owntype);
         }
-        result = check(tree, owntype, VAL, resultInfo);
+        result = check(tree, owntype, KindSelector.VAL, resultInfo);
     }
     //where
         private boolean isBooleanOrNumeric(Env<AttrContext> env, JCExpression tree) {
@@ -1749,7 +1762,8 @@
                     // ...and check that it is legal in the current context.
                     // (this will also set the tree's type)
                     Type mpt = newMethodTemplate(resultInfo.pt, argtypes, typeargtypes);
-                    checkId(tree.meth, site, sym, localEnv, new ResultInfo(MTH, mpt));
+                    checkId(tree.meth, site, sym, localEnv,
+                            new ResultInfo(KindSelector.MTH, mpt));
                 }
                 // Otherwise, `site' is an error type and we do nothing
             }
@@ -1757,7 +1771,7 @@
         } else {
             // Otherwise, we are seeing a regular method call.
             // Attribute the arguments, yielding list of argument types, ...
-            int kind = attribArgs(tree.args, localEnv, argtypesBuf);
+            KindSelector kind = attribArgs(tree.args, localEnv, argtypesBuf);
             argtypes = argtypesBuf.toList();
             typeargtypes = attribAnyTypes(tree.typeargs, localEnv);
 
@@ -1782,7 +1796,7 @@
 
             // Check that value of resulting type is admissible in the
             // current context.  Also, capture the return type
-            result = check(tree, capture(restype), VAL, resultInfo);
+            result = check(tree, capture(restype), KindSelector.VAL, resultInfo);
         }
         chk.validate(tree.typeargs, localEnv);
     }
@@ -1936,7 +1950,8 @@
 
         // Attribute constructor arguments.
         ListBuffer<Type> argtypesBuf = new ListBuffer<>();
-        int pkind = attribArgs(tree.args, localEnv, argtypesBuf);
+        final KindSelector pkind =
+            attribArgs(tree.args, localEnv, argtypesBuf);
         List<Type> argtypes = argtypesBuf.toList();
         List<Type> typeargtypes = attribTypes(tree.typeargs, localEnv);
 
@@ -2096,7 +2111,7 @@
                 clazztype = cdef.sym.type;
                 Symbol sym = tree.constructor = rs.resolveConstructor(
                     tree.pos(), localEnv, clazztype, argtypes, typeargtypes);
-                Assert.check(sym.kind < AMBIGUOUS);
+                Assert.check(!sym.kind.isOverloadError());
                 tree.constructor = sym;
                 tree.constructorType = checkId(tree,
                     clazztype,
@@ -2108,7 +2123,7 @@
             if (tree.constructor != null && tree.constructor.kind == MTH)
                 owntype = clazztype;
         }
-        result = check(tree, owntype, VAL, resultInfo);
+        result = check(tree, owntype, KindSelector.VAL, resultInfo);
         chk.validate(tree.typeargs, localEnv);
     }
     //where
@@ -2118,7 +2133,7 @@
             try {
                 //create a 'fake' diamond AST node by removing type-argument trees
                 ta.arguments = List.nil();
-                ResultInfo findDiamondResult = new ResultInfo(VAL,
+                ResultInfo findDiamondResult = new ResultInfo(KindSelector.VAL,
                         resultInfo.checkContext.inferenceContext().free(resultInfo.pt) ? Type.noType : pt());
                 Type inferred = deferredAttr.attribSpeculative(tree, env, findDiamondResult).type;
                 Type polyPt = allowPoly ?
@@ -2209,7 +2224,7 @@
         }
         if (!types.isReifiable(elemtype))
             log.error(tree.pos(), "generic.array.creation");
-        result = check(tree, owntype, VAL, resultInfo);
+        result = check(tree, owntype, KindSelector.VAL, resultInfo);
     }
 
     /*
@@ -2318,7 +2333,8 @@
 
             ResultInfo bodyResultInfo = lambdaType.getReturnType() == Type.recoveryType ?
                 recoveryInfo :
-                new ResultInfo(VAL, lambdaType.getReturnType(), funcContext);
+                new ResultInfo(KindSelector.VAL,
+                               lambdaType.getReturnType(), funcContext);
             localEnv.info.returnResult = bodyResultInfo;
 
             if (that.getBodyKind() == JCLambda.BodyKind.EXPRESSION) {
@@ -2328,7 +2344,7 @@
                 attribStats(body.stats, localEnv);
             }
 
-            result = check(that, currentTarget, VAL, resultInfo);
+            result = check(that, currentTarget, KindSelector.VAL, resultInfo);
 
             boolean isSpeculativeRound =
                     resultInfo.checkContext.deferredAttrContext().mode == DeferredAttr.AttrMode.SPECULATIVE;
@@ -2349,7 +2365,7 @@
 
                 checkAccessibleTypes(that, localEnv, resultInfo.checkContext.inferenceContext(), lambdaType, currentTarget);
             }
-            result = check(that, currentTarget, VAL, resultInfo);
+            result = check(that, currentTarget, KindSelector.VAL, resultInfo);
         } catch (Types.FunctionDescriptorLookupError ex) {
             JCDiagnostic cause = ex.getDiagnostic();
             resultInfo.checkContext.report(that, cause);
@@ -2802,7 +2818,7 @@
             if (!isSpeculativeRound) {
                 checkAccessibleTypes(that, localEnv, resultInfo.checkContext.inferenceContext(), desc, currentTarget);
             }
-            result = check(that, currentTarget, VAL, resultInfo);
+            result = check(that, currentTarget, KindSelector.VAL, resultInfo);
         } catch (Types.FunctionDescriptorLookupError ex) {
             JCDiagnostic cause = ex.getDiagnostic();
             resultInfo.checkContext.report(that, cause);
@@ -2813,7 +2829,9 @@
     //where
         ResultInfo memberReferenceQualifierResult(JCMemberReference tree) {
             //if this is a constructor reference, the expected kind must be a type
-            return new ResultInfo(tree.getMode() == ReferenceMode.INVOKE ? VAL | TYP : TYP, Type.noType);
+            return new ResultInfo(tree.getMode() == ReferenceMode.INVOKE ?
+                                  KindSelector.VAL_TYP : KindSelector.TYP,
+                                  Type.noType);
         }
 
 
@@ -2912,7 +2930,7 @@
         Type owntype = attribTree(tree.expr, env, resultInfo);
         result = check(tree, owntype, pkind(), resultInfo);
         Symbol sym = TreeInfo.symbol(tree);
-        if (sym != null && (sym.kind&(TYP|PCK)) != 0)
+        if (sym != null && sym.kind.matches(KindSelector.TYP_PCK))
             log.error(tree.pos(), "illegal.start.of.type");
     }
 
@@ -2920,7 +2938,7 @@
         Type owntype = attribTree(tree.lhs, env.dup(tree), varInfo);
         Type capturedType = capture(owntype);
         attribExpr(tree.rhs, env, owntype);
-        result = check(tree, capturedType, VAL, resultInfo);
+        result = check(tree, capturedType, KindSelector.VAL, resultInfo);
     }
 
     public void visitAssignop(JCAssignOp tree) {
@@ -2945,7 +2963,7 @@
                               operator.type.getReturnType(),
                               owntype);
         }
-        result = check(tree, owntype, VAL, resultInfo);
+        result = check(tree, owntype, KindSelector.VAL, resultInfo);
     }
 
     public void visitUnary(JCUnary tree) {
@@ -2974,14 +2992,13 @@
                 }
             }
         }
-        result = check(tree, owntype, VAL, resultInfo);
+        result = check(tree, owntype, KindSelector.VAL, resultInfo);
     }
 
     public void visitBinary(JCBinary tree) {
         // Attribute arguments.
         Type left = chk.checkNonVoid(tree.lhs.pos(), attribExpr(tree.lhs, env));
         Type right = chk.checkNonVoid(tree.lhs.pos(), attribExpr(tree.rhs, env));
-
         // Find operator.
         Symbol operator = tree.operator =
             rs.resolveBinaryOperator(tree.pos(), tree.getTag(), env, left, right);
@@ -3019,7 +3036,7 @@
 
             chk.checkDivZero(tree.rhs.pos(), operator, right);
         }
-        result = check(tree, owntype, VAL, resultInfo);
+        result = check(tree, owntype, KindSelector.VAL, resultInfo);
     }
 
     public void visitTypeCast(final JCTypeCast tree) {
@@ -3034,7 +3051,8 @@
         boolean isPoly = allowPoly && (expr.hasTag(LAMBDA) || expr.hasTag(REFERENCE));
         if (isPoly) {
             //expression is a poly - we need to propagate target type info
-            castInfo = new ResultInfo(VAL, clazztype, new Check.NestedCheckContext(resultInfo.checkContext) {
+            castInfo = new ResultInfo(KindSelector.VAL, clazztype,
+                                      new Check.NestedCheckContext(resultInfo.checkContext) {
                 @Override
                 public boolean compatible(Type found, Type req, Warner warn) {
                     return types.isCastable(found, req, warn);
@@ -3048,14 +3066,14 @@
         Type owntype = isPoly ? clazztype : chk.checkCastable(tree.expr.pos(), exprtype, clazztype);
         if (exprtype.constValue() != null)
             owntype = cfolder.coerce(exprtype, owntype);
-        result = check(tree, capture(owntype), VAL, resultInfo);
+        result = check(tree, capture(owntype), KindSelector.VAL, resultInfo);
         if (!isPoly)
             chk.checkRedundantCast(localEnv, tree);
     }
 
     public void visitTypeTest(JCInstanceOf tree) {
         Type exprtype = chk.checkNullOrRefType(
-            tree.expr.pos(), attribExpr(tree.expr, env));
+                tree.expr.pos(), attribExpr(tree.expr, env));
         Type clazztype = attribType(tree.clazz, env);
         if (!clazztype.hasTag(TYPEVAR)) {
             clazztype = chk.checkClassOrArrayType(tree.clazz.pos(), clazztype);
@@ -3066,7 +3084,7 @@
         }
         chk.validate(tree.clazz, env, false);
         chk.checkCastable(tree.expr.pos(), exprtype, clazztype);
-        result = check(tree, syms.booleanType, VAL, resultInfo);
+        result = check(tree, syms.booleanType, KindSelector.VAL, resultInfo);
     }
 
     public void visitIndexed(JCArrayAccess tree) {
@@ -3077,8 +3095,9 @@
             owntype = types.elemtype(atype);
         else if (!atype.hasTag(ERROR))
             log.error(tree.pos(), "array.req.but.found", atype);
-        if ((pkind() & VAR) == 0) owntype = capture(owntype);
-        result = check(tree, owntype, VAR, resultInfo);
+        if (!pkind().contains(KindSelector.VAL))
+            owntype = capture(owntype);
+        result = check(tree, owntype, KindSelector.VAR, resultInfo);
     }
 
     public void visitIdent(JCIdent tree) {
@@ -3107,7 +3126,7 @@
         Env<AttrContext> symEnv = env;
         boolean noOuterThisPath = false;
         if (env.enclClass.sym.owner.kind != PCK && // we are in an inner class
-            (sym.kind & (VAR | MTH | TYP)) != 0 &&
+            sym.kind.matches(KindSelector.VAL_MTH) &&
             sym.owner.kind == TYP &&
             tree.name != names._this && tree.name != names._super) {
 
@@ -3130,7 +3149,7 @@
 
             // If we are expecting a variable (as opposed to a value), check
             // that the variable is assignable in the current environment.
-            if (pkind() == VAR)
+            if (pkind() == KindSelector.VAR)
                 checkAssignable(tree.pos(), v, null, env);
         }
 
@@ -3138,13 +3157,15 @@
         // if symbol is a field or instance method, check that it is
         // not accessed before the supertype constructor is called.
         if ((symEnv.info.isSelfCall || noOuterThisPath) &&
-            (sym.kind & (VAR | MTH)) != 0 &&
+            sym.kind.matches(KindSelector.VAL_MTH) &&
             sym.owner.kind == TYP &&
             (sym.flags() & STATIC) == 0) {
-            chk.earlyRefError(tree.pos(), sym.kind == VAR ? sym : thisSym(tree.pos(), env));
+            chk.earlyRefError(tree.pos(), sym.kind == VAR ?
+                                          sym : thisSym(tree.pos(), env));
         }
         Env<AttrContext> env1 = env;
-        if (sym.kind != ERR && sym.kind != TYP && sym.owner != null && sym.owner != env1.enclClass.sym) {
+        if (sym.kind != ERR && sym.kind != TYP &&
+            sym.owner != null && sym.owner != env1.enclClass.sym) {
             // If the found symbol is inaccessible, then it is
             // accessed through an enclosing instance.  Locate this
             // enclosing instance:
@@ -3161,24 +3182,27 @@
 
     public void visitSelect(JCFieldAccess tree) {
         // Determine the expected kind of the qualifier expression.
-        int skind = 0;
+        KindSelector skind = KindSelector.NIL;
         if (tree.name == names._this || tree.name == names._super ||
-            tree.name == names._class)
+                tree.name == names._class)
         {
-            skind = TYP;
+            skind = KindSelector.TYP;
         } else {
-            if ((pkind() & PCK) != 0) skind = skind | PCK;
-            if ((pkind() & TYP) != 0) skind = skind | TYP | PCK;
-            if ((pkind() & (VAL | MTH)) != 0) skind = skind | VAL | TYP;
+            if (pkind().contains(KindSelector.PCK))
+                skind = KindSelector.of(skind, KindSelector.PCK);
+            if (pkind().contains(KindSelector.TYP))
+                skind = KindSelector.of(skind, KindSelector.TYP, KindSelector.PCK);
+            if (pkind().contains(KindSelector.VAL_MTH))
+                skind = KindSelector.of(skind, KindSelector.VAL, KindSelector.TYP);
         }
 
         // Attribute the qualifier expression, and determine its symbol (if any).
         Type site = attribTree(tree.selected, env, new ResultInfo(skind, Infer.anyPoly));
-        if ((pkind() & (PCK | TYP)) == 0)
+        if (!pkind().contains(KindSelector.TYP_PCK))
             site = capture(site); // Capture field access
 
         // don't allow T.class T[].class, etc
-        if (skind == TYP) {
+        if (skind == KindSelector.TYP) {
             Type elt = site;
             while (elt.hasTag(ARRAY))
                 elt = ((ArrayType)elt).elemtype;
@@ -3202,7 +3226,7 @@
         // Determine the symbol represented by the selection.
         env.info.pendingResolutionPhase = null;
         Symbol sym = selectSym(tree, sitesym, site, env, resultInfo);
-        if (sym.exists() && !isType(sym) && (pkind() & (PCK | TYP)) != 0) {
+        if (sym.exists() && !isType(sym) && pkind().contains(KindSelector.TYP_PCK)) {
             site = capture(site);
             sym = selectSym(tree, sitesym, site, env, resultInfo);
         }
@@ -3224,7 +3248,7 @@
 
             // If we are expecting a variable (as opposed to a value), check
             // that the variable is assignable in the current environment.
-            if (pkind() == VAR)
+            if (pkind() == KindSelector.VAR)
                 checkAssignable(tree.pos(), v, tree.selected, env);
         }
 
@@ -3239,9 +3263,11 @@
         }
 
         // Disallow selecting a type from an expression
-        if (isType(sym) && (sitesym==null || (sitesym.kind&(TYP|PCK)) == 0)) {
+        if (isType(sym) && (sitesym == null || !sitesym.kind.matches(KindSelector.TYP_PCK))) {
             tree.type = check(tree.selected, pt(),
-                              sitesym == null ? VAL : sitesym.kind, new ResultInfo(TYP|PCK, pt()));
+                              sitesym == null ?
+                                      KindSelector.VAL : sitesym.kind.toSelector(),
+                              new ResultInfo(KindSelector.TYP_PCK, pt()));
         }
 
         if (isType(sitesym)) {
@@ -3266,10 +3292,13 @@
                     sym.isStatic() && sym.kind == MTH) {
                 log.error(tree.pos(), "static.intf.method.invoke.not.supported.in.source", sourceName);
             }
-        } else if (sym.kind != ERR && (sym.flags() & STATIC) != 0 && sym.name != names._class) {
+        } else if (sym.kind != ERR &&
+                   (sym.flags() & STATIC) != 0 &&
+                   sym.name != names._class) {
             // If the qualified item is not a type and the selected item is static, report
             // a warning. Make allowance for the class of an array type e.g. Object[].class)
-            chk.warnStatic(tree, "static.not.qualified.by.type", Kinds.kindName(sym.kind), sym.owner);
+            chk.warnStatic(tree, "static.not.qualified.by.type",
+                           sym.kind.kindName(), sym.owner);
         }
 
         // If we are selecting an instance member via a `super', ...
@@ -3330,7 +3359,6 @@
                 } else {
                     // We are seeing a plain identifier as selector.
                     Symbol sym = rs.findIdentInType(env, site, name, resultInfo.pkind);
-                    if ((resultInfo.pkind & ERRONEOUS) == 0)
                         sym = rs.accessBase(sym, pos, location, site, name, true);
                     return sym;
                 }
@@ -3438,7 +3466,7 @@
                      Symbol sym,
                      Env<AttrContext> env,
                      ResultInfo resultInfo) {
-            if ((resultInfo.pkind & POLY) != 0) {
+            if (resultInfo.pkind.contains(KindSelector.POLY)) {
                 Type pt = resultInfo.pt.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, sym, env.info.pendingResolutionPhase));
                 Type owntype = checkIdInternal(tree, site, sym, pt, env, resultInfo);
                 resultInfo.pt.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.CHECK, sym, env.info.pendingResolutionPhase));
@@ -3503,7 +3531,7 @@
                 // Test (4): if symbol is an instance field of a raw type,
                 // which is being assigned to, issue an unchecked warning if
                 // its type changes under erasure.
-                if (resultInfo.pkind == VAR &&
+                if (resultInfo.pkind == KindSelector.VAR &&
                     v.owner.kind == TYP &&
                     (v.flags() & STATIC) == 0 &&
                     (site.hasTag(CLASS) || site.hasTag(TYPEVAR))) {
@@ -3528,7 +3556,7 @@
                 if (v.getConstValue() != null && isStaticReference(tree))
                     owntype = owntype.constType(v.getConstValue());
 
-                if (resultInfo.pkind == VAL) {
+                if (resultInfo.pkind == KindSelector.VAL) {
                     owntype = capture(owntype); // capture "names as expressions"
                 }
                 break;
@@ -3559,7 +3587,7 @@
 
             // Test (3): if symbol is a variable, check that its type and
             // kind are compatible with the prototype and protokind.
-            return check(tree, owntype, sym.kind, resultInfo);
+            return check(tree, owntype, sym.kind.toSelector(), resultInfo);
         }
 
         /** Check that variable is initialized and evaluate the variable's
@@ -3799,8 +3827,8 @@
     }
 
     public void visitLiteral(JCLiteral tree) {
-        result = check(
-            tree, litType(tree.typetag).constType(tree.value), VAL, resultInfo);
+        result = check(tree, litType(tree.typetag).constType(tree.value),
+                KindSelector.VAL, resultInfo);
     }
     //where
     /** Return the type of a literal with given type tag.
@@ -3810,13 +3838,13 @@
     }
 
     public void visitTypeIdent(JCPrimitiveTypeTree tree) {
-        result = check(tree, syms.typeOfTag[tree.typetag.ordinal()], TYP, resultInfo);
+        result = check(tree, syms.typeOfTag[tree.typetag.ordinal()], KindSelector.TYP, resultInfo);
     }
 
     public void visitTypeArray(JCArrayTypeTree tree) {
         Type etype = attribType(tree.elemtype, env);
         Type type = new ArrayType(etype, syms.arrayClass);
-        result = check(tree, type, TYP, resultInfo);
+        result = check(tree, type, KindSelector.TYP, resultInfo);
     }
 
     /** Visitor method for parameterized types.
@@ -3875,7 +3903,7 @@
                 owntype = types.createErrorType(tree.type);
             }
         }
-        result = check(tree, owntype, TYP, resultInfo);
+        result = check(tree, owntype, KindSelector.TYP, resultInfo);
     }
 
     public void visitTypeUnion(JCTypeUnion tree) {
@@ -3912,7 +3940,8 @@
                 all_multicatchTypes.append(ctype);
             }
         }
-        Type t = check(tree, types.lub(multicatchTypes.toList()), TYP, resultInfo);
+        Type t = check(tree, types.lub(multicatchTypes.toList()),
+                KindSelector.TYP, resultInfo);
         if (t.hasTag(CLASS)) {
             List<Type> alternatives =
                 ((all_multicatchTypes == null) ? multicatchTypes : all_multicatchTypes).toList();
@@ -4016,7 +4045,7 @@
         result = check(tree, new WildcardType(chk.checkRefType(tree.pos(), type),
                                               tree.kind.kind,
                                               syms.boundClass),
-                       TYP, resultInfo);
+                KindSelector.TYP, resultInfo);
     }
 
     public void visitAnnotation(JCAnnotation tree) {
@@ -4064,7 +4093,7 @@
     public void visitErroneous(JCErroneous tree) {
         if (tree.errs != null)
             for (JCTree err : tree.errs)
-                attribTree(err, env, new ResultInfo(ERR, pt()));
+                attribTree(err, env, new ResultInfo(KindSelector.ERR, pt()));
         result = tree.type = syms.errType;
     }
 
@@ -4315,7 +4344,7 @@
         public static final Filter<Symbol> anyNonAbstractOrDefaultMethod = new Filter<Symbol>() {
             @Override
             public boolean accepts(Symbol s) {
-                return s.kind == Kinds.MTH &&
+                return s.kind == MTH &&
                        (s.flags() & (DEFAULT | ABSTRACT)) != ABSTRACT;
             }
         };
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Wed Jul 05 20:05:30 2017 +0200
@@ -54,6 +54,7 @@
 import static com.sun.tools.javac.code.Flags.ANNOTATION;
 import static com.sun.tools.javac.code.Flags.SYNCHRONIZED;
 import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.code.TypeTag.WILDCARD;
@@ -349,7 +350,7 @@
         for (Symbol sym : s.getSymbolsByName(v.name)) {
             if (sym.owner != v.owner) break;
             if (sym.kind == VAR &&
-                (sym.owner.kind & (VAR | MTH)) != 0 &&
+                sym.owner.kind.matches(KindSelector.VAL_MTH) &&
                 v.name != names.error) {
                 duplicateError(pos, sym);
                 return;
@@ -367,7 +368,7 @@
         for (Symbol sym : s.getSymbolsByName(c.name)) {
             if (sym.owner != c.owner) break;
             if (sym.kind == TYP && !sym.type.hasTag(TYPEVAR) &&
-                (sym.owner.kind & (VAR | MTH)) != 0 &&
+                sym.owner.kind.matches(KindSelector.VAL_MTH) &&
                 c.name != names.error) {
                 duplicateError(pos, sym);
                 return;
@@ -2573,7 +2574,7 @@
     void checkElemAccessFromSerializableLambda(final JCTree tree) {
         if (warnOnAccessToSensitiveMembers) {
             Symbol sym = TreeInfo.symbol(tree);
-            if ((sym.kind & (VAR | MTH)) == 0) {
+            if (!sym.kind.matches(KindSelector.VAL_MTH)) {
                 return;
             }
 
@@ -2599,7 +2600,7 @@
             return false;
         }
 
-        while (sym.kind != Kinds.PCK) {
+        while (sym.kind != PCK) {
             if ((sym.flags() & PUBLIC) == 0) {
                 return true;
             }
@@ -2957,7 +2958,7 @@
         Scope scope = container.members();
         for(Symbol elm : scope.getSymbols()) {
             if (elm.name != names.value &&
-                elm.kind == Kinds.MTH &&
+                elm.kind == MTH &&
                 ((MethodSymbol)elm).defaultValue == null) {
                 log.error(pos,
                           "invalid.repeatable.annotation.elem.nondefault",
@@ -3041,8 +3042,7 @@
             else if (target == names.METHOD)
                 { if (s.kind == MTH && !s.isConstructor()) return true; }
             else if (target == names.PARAMETER)
-                { if (s.kind == VAR &&
-                      s.owner.kind == MTH &&
+                { if (s.kind == VAR && s.owner.kind == MTH &&
                       (s.flags() & PARAMETER) != 0)
                     return true;
                 }
@@ -3060,8 +3060,7 @@
             else if (target == names.PACKAGE)
                 { if (s.kind == PCK) return true; }
             else if (target == names.TYPE_USE)
-                { if (s.kind == TYP ||
-                      s.kind == VAR ||
+                { if (s.kind == TYP || s.kind == VAR ||
                       (s.kind == MTH && !s.isConstructor() &&
                       !s.type.getReturnType().hasTag(VOID)) ||
                       (s.kind == MTH && s.isConstructor()))
@@ -3243,7 +3242,7 @@
         try {
             tsym.flags_field |= LOCKED;
             for (Symbol s : tsym.members().getSymbols(NON_RECURSIVE)) {
-                if (s.kind != Kinds.MTH)
+                if (s.kind != MTH)
                     continue;
                 checkAnnotationResType(pos, ((MethodSymbol)s).type.getReturnType());
             }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Wed Jul 05 20:05:30 2017 +0200
@@ -47,9 +47,10 @@
 import java.util.Set;
 import java.util.WeakHashMap;
 
-import static com.sun.tools.javac.code.Kinds.VAL;
 import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
+import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 
 /**
  * This is an helper class that is used to perform deferred type-analysis.
@@ -700,7 +701,7 @@
                      * which may happen if lambda's return type is an
                      * inference variable
                      */
-                    Attr.ResultInfo bodyResultInfo = attr.new ResultInfo(VAL, Type.noType);
+                    Attr.ResultInfo bodyResultInfo = attr.new ResultInfo(KindSelector.VAL, Type.noType);
                     localEnv.info.returnResult = bodyResultInfo;
 
                     // discard any log output
@@ -768,10 +769,10 @@
                     switch (lookupSym.kind) {
                         //note: as argtypes are erroneous types, type-errors must
                         //have been caused by arity mismatch
-                        case Kinds.ABSENT_MTH:
-                        case Kinds.WRONG_MTH:
-                        case Kinds.WRONG_MTHS:
-                        case Kinds.WRONG_STATICNESS:
+                        case ABSENT_MTH:
+                        case WRONG_MTH:
+                        case WRONG_MTHS:
+                        case WRONG_STATICNESS:
                            checkContext.report(tree, diags.fragment("incompatible.arg.types.in.mref"));
                     }
                 }
@@ -1185,7 +1186,7 @@
                     rs.getMemberReference(tree, localEnv, mref2,
                         exprTree.type, tree.name);
             tree.sym = res;
-            if (res.kind >= Kinds.ERRONEOUS ||
+            if (res.kind.isOverloadError() ||
                     res.type.hasTag(FORALL) ||
                     (res.flags() & Flags.VARARGS) != 0 ||
                     (TreeInfo.isStaticSelector(exprTree, tree.name.table.names) &&
@@ -1380,13 +1381,13 @@
          */
         <E> E analyzeCandidateMethods(Symbol sym, E defaultValue, MethodAnalyzer<E> analyzer) {
             switch (sym.kind) {
-                case Kinds.MTH:
+                case MTH:
                     return analyzer.process((MethodSymbol) sym);
-                case Kinds.AMBIGUOUS:
+                case AMBIGUOUS:
                     Resolve.AmbiguityError err = (Resolve.AmbiguityError)sym.baseSymbol();
                     E res = defaultValue;
                     for (Symbol s : err.ambiguousSyms) {
-                        if (s.kind == Kinds.MTH) {
+                        if (s.kind == MTH) {
                             res = analyzer.reduce(res, analyzer.process((MethodSymbol) s));
                             if (analyzer.shouldStop(res))
                                 return res;
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java	Wed Jul 05 20:05:30 2017 +0200
@@ -30,6 +30,7 @@
 import javax.tools.JavaFileManager;
 
 import com.sun.tools.javac.code.*;
+import com.sun.tools.javac.code.Kinds.KindSelector;
 import com.sun.tools.javac.code.Scope.*;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.Type.*;
@@ -43,7 +44,7 @@
 
 
 import static com.sun.tools.javac.code.Flags.*;
-import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 
 /** This class enters symbols for all encountered definitions into
  *  the symbol table. The pass consists of two phases, organized as
@@ -402,7 +403,7 @@
             // which contains this class in a non-static context
             // (its "enclosing instance class"), provided such a class exists.
             Symbol owner1 = owner;
-            while ((owner1.kind & (VAR | MTH)) != 0 &&
+            while (owner1.kind.matches(KindSelector.VAL_MTH) &&
                    (owner1.flags_field & STATIC) == 0) {
                 owner1 = owner1.owner;
             }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java	Wed Jul 05 20:05:30 2017 +0200
@@ -40,7 +40,7 @@
 
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Flags.BLOCK;
-import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.TypeTag.BOOLEAN;
 import static com.sun.tools.javac.code.TypeTag.VOID;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Wed Jul 05 20:05:30 2017 +0200
@@ -177,7 +177,6 @@
 
             resolveContext.methodCheck.argumentsAcceptable(env, deferredAttrContext,   //B2
                     argtypes, mt.getParameterTypes(), warn);
-
             if (allowGraphInference &&
                     resultInfo != null &&
                     !warn.hasNonSilentLint(Lint.LintCategory.UNCHECKED)) {
@@ -867,7 +866,10 @@
                     while (tmpTail.nonEmpty()) {
                         Type b1 = boundList.head;
                         Type b2 = tmpTail.head;
-                        if (b1 != b2) {
+                        /* This wildcard check is temporary workaround. This code may need to be
+                         * revisited once spec bug JDK-7034922 is fixed.
+                         */
+                        if (b1 != b2 && !b1.hasTag(WILDCARD) && !b2.hasTag(WILDCARD)) {
                             for (Pair<Type, Type> commonSupers : infer.getParameterizedSupers(b1, b2)) {
                                 List<Type> allParamsSuperBound1 = commonSupers.fst.allparams();
                                 List<Type> allParamsSuperBound2 = commonSupers.snd.allparams();
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Wed Jul 05 20:05:30 2017 +0200
@@ -30,7 +30,6 @@
 import com.sun.tools.javac.tree.TreeMaker;
 import com.sun.tools.javac.tree.TreeTranslator;
 import com.sun.tools.javac.code.Attribute;
-import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.code.Scope.WriteableScope;
 import com.sun.tools.javac.code.Symbol;
 import com.sun.tools.javac.code.Symbol.ClassSymbol;
@@ -58,7 +57,7 @@
 
 import static com.sun.tools.javac.comp.LambdaToMethod.LambdaSymbolKind.*;
 import static com.sun.tools.javac.code.Flags.*;
-import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
@@ -727,7 +726,7 @@
      * with the generated signature.
      */
     private List<JCExpression> convertArgs(Symbol meth, List<JCExpression> args, Type varargsElement) {
-       Assert.check(meth.kind == Kinds.MTH);
+       Assert.check(meth.kind == MTH);
        List<Type> formals = types.erasure(meth.type).getParameterTypes();
        if (varargsElement != null) {
            Assert.check((meth.flags() & VARARGS) != 0);
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java	Wed Jul 05 20:05:30 2017 +0200
@@ -28,6 +28,7 @@
 import java.util.*;
 
 import com.sun.tools.javac.code.*;
+import com.sun.tools.javac.code.Kinds.KindSelector;
 import com.sun.tools.javac.code.Scope.WriteableScope;
 import com.sun.tools.javac.jvm.*;
 import com.sun.tools.javac.main.Option.PkgInfo;
@@ -45,9 +46,9 @@
 
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Flags.BLOCK;
-import static com.sun.tools.javac.code.Kinds.*;
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 import static com.sun.tools.javac.code.TypeTag.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.jvm.ByteCodes.*;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
@@ -358,10 +359,10 @@
             return null;
         }
         Symbol currentOwner = c.owner;
-        while ((currentOwner.owner.kind & TYP) != 0 && currentOwner.isLocal()) {
+        while (currentOwner.owner.kind.matches(KindSelector.TYP) && currentOwner.isLocal()) {
             currentOwner = currentOwner.owner;
         }
-        if ((currentOwner.owner.kind & (VAR | MTH)) != 0 && c.isSubClass(currentOwner, types)) {
+        if (currentOwner.owner.kind.matches(KindSelector.VAL_MTH) && c.isSubClass(currentOwner, types)) {
             return (ClassSymbol)currentOwner;
         }
         return null;
@@ -376,7 +377,7 @@
         if (fvs != null) {
             return fvs;
         }
-        if ((c.owner.kind & (VAR | MTH)) != 0) {
+        if (c.owner.kind.matches(KindSelector.VAL_MTH)) {
             FreeVarCollector collector = new FreeVarCollector(c);
             collector.scan(classDef(c));
             fvs = collector.fvs;
@@ -2090,7 +2091,7 @@
             ClassSymbol c = types.boxedClass(type);
             Symbol typeSym =
                 rs.accessBase(
-                    rs.findIdentInType(attrEnv, c.type, names.TYPE, VAR),
+                    rs.findIdentInType(attrEnv, c.type, names.TYPE, KindSelector.VAR),
                     pos, c.type, names.TYPE, true);
             if (typeSym.kind == VAR)
                 ((VarSymbol)typeSym).getConstValue(); // ensure initializer is evaluated
@@ -2467,7 +2468,7 @@
         currentMethodSym = currentMethodSymPrev;
 
         // Return empty block {} as a placeholder for an inner class.
-        result = make_at(tree.pos()).Block(0, List.<JCStatement>nil());
+        result = make_at(tree.pos()).Block(SYNTHETIC, List.<JCStatement>nil());
     }
 
     /** Translate an enum class. */
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Wed Jul 05 20:05:30 2017 +0200
@@ -48,8 +48,9 @@
 
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Flags.ANNOTATION;
+import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.code.TypeTag.ERROR;
 import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
@@ -341,7 +342,7 @@
     ImportFilter typeImportFilter = new ImportFilter() {
         @Override
         public boolean accepts(Scope origin, Symbol t) {
-            return t.kind == Kinds.TYP;
+            return t.kind == TYP;
         }
     };
 
@@ -517,52 +518,46 @@
         }
 
         Env<AttrContext> localEnv = methodEnv(tree, env);
-
-        annotate.enterStart();
+        DiagnosticPosition prevLintPos = deferredLintHandler.setPos(tree.pos());
         try {
-            DiagnosticPosition prevLintPos = deferredLintHandler.setPos(tree.pos());
-            try {
-                // Compute the method type
-                m.type = signature(m, tree.typarams, tree.params,
-                                   tree.restype, tree.recvparam,
-                                   tree.thrown,
-                                   localEnv);
-            } finally {
-                deferredLintHandler.setPos(prevLintPos);
-            }
+            // Compute the method type
+            m.type = signature(m, tree.typarams, tree.params,
+                               tree.restype, tree.recvparam,
+                               tree.thrown,
+                               localEnv);
+        } finally {
+            deferredLintHandler.setPos(prevLintPos);
+        }
 
-            if (types.isSignaturePolymorphic(m)) {
-                m.flags_field |= SIGNATURE_POLYMORPHIC;
-            }
+        if (types.isSignaturePolymorphic(m)) {
+            m.flags_field |= SIGNATURE_POLYMORPHIC;
+        }
 
-            // Set m.params
-            ListBuffer<VarSymbol> params = new ListBuffer<>();
-            JCVariableDecl lastParam = null;
-            for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) {
-                JCVariableDecl param = lastParam = l.head;
-                params.append(Assert.checkNonNull(param.sym));
-            }
-            m.params = params.toList();
+        // Set m.params
+        ListBuffer<VarSymbol> params = new ListBuffer<>();
+        JCVariableDecl lastParam = null;
+        for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) {
+            JCVariableDecl param = lastParam = l.head;
+            params.append(Assert.checkNonNull(param.sym));
+        }
+        m.params = params.toList();
 
-            // mark the method varargs, if necessary
-            if (lastParam != null && (lastParam.mods.flags & Flags.VARARGS) != 0)
-                m.flags_field |= Flags.VARARGS;
+        // mark the method varargs, if necessary
+        if (lastParam != null && (lastParam.mods.flags & Flags.VARARGS) != 0)
+            m.flags_field |= Flags.VARARGS;
 
-            localEnv.info.scope.leave();
-            if (chk.checkUnique(tree.pos(), m, enclScope)) {
-            enclScope.enter(m);
-            }
+        localEnv.info.scope.leave();
+        if (chk.checkUnique(tree.pos(), m, enclScope)) {
+        enclScope.enter(m);
+        }
 
-            annotate.annotateLater(tree.mods.annotations, localEnv, m, tree.pos());
-            // Visit the signature of the method. Note that
-            // TypeAnnotate doesn't descend into the body.
-            annotate.annotateTypeLater(tree, localEnv, m, tree.pos());
+        annotate.annotateLater(tree.mods.annotations, localEnv, m, tree.pos());
+        // Visit the signature of the method. Note that
+        // TypeAnnotate doesn't descend into the body.
+        annotate.annotateTypeLater(tree, localEnv, m, tree.pos());
 
-            if (tree.defaultValue != null)
-                annotateDefaultValueLater(tree.defaultValue, localEnv, m);
-        } finally {
-            annotate.enterDone();
-        }
+        if (tree.defaultValue != null)
+            annotateDefaultValueLater(tree.defaultValue, localEnv, m);
     }
 
     /** Create a fresh environment for method bodies.
@@ -575,7 +570,8 @@
         localEnv.enclMethod = tree;
         if (tree.sym.type != null) {
             //when this is called in the enter stage, there's no type to be set
-            localEnv.info.returnResult = attr.new ResultInfo(VAL, tree.sym.type.getReturnType());
+            localEnv.info.returnResult = attr.new ResultInfo(KindSelector.VAL,
+                                                             tree.sym.type.getReturnType());
         }
         if ((tree.mods.flags & STATIC) != 0) localEnv.info.staticLevel++;
         return localEnv;
@@ -589,56 +585,51 @@
             localEnv.info.staticLevel++;
         }
         DiagnosticPosition prevLintPos = deferredLintHandler.setPos(tree.pos());
-        annotate.enterStart();
         try {
-            try {
-                if (TreeInfo.isEnumInit(tree)) {
-                    attr.attribIdentAsEnumType(localEnv, (JCIdent)tree.vartype);
-                } else {
-                    attr.attribType(tree.vartype, localEnv);
-                    if (TreeInfo.isReceiverParam(tree))
-                        checkReceiver(tree, localEnv);
-                }
-            } finally {
-                deferredLintHandler.setPos(prevLintPos);
-            }
-
-            if ((tree.mods.flags & VARARGS) != 0) {
-                //if we are entering a varargs parameter, we need to
-                //replace its type (a plain array type) with the more
-                //precise VarargsType --- we need to do it this way
-                //because varargs is represented in the tree as a
-                //modifier on the parameter declaration, and not as a
-                //distinct type of array node.
-                ArrayType atype = (ArrayType)tree.vartype.type;
-                tree.vartype.type = atype.makeVarargs();
+            if (TreeInfo.isEnumInit(tree)) {
+                attr.attribIdentAsEnumType(localEnv, (JCIdent)tree.vartype);
+            } else {
+                attr.attribType(tree.vartype, localEnv);
+                if (TreeInfo.isReceiverParam(tree))
+                    checkReceiver(tree, localEnv);
             }
-            WriteableScope enclScope = enter.enterScope(env);
-            VarSymbol v =
-                new VarSymbol(0, tree.name, tree.vartype.type, enclScope.owner);
-            v.flags_field = chk.checkFlags(tree.pos(), tree.mods.flags, v, tree);
-            tree.sym = v;
-            if (tree.init != null) {
-                v.flags_field |= HASINIT;
-                if ((v.flags_field & FINAL) != 0 &&
-                    needsLazyConstValue(tree.init)) {
-                    Env<AttrContext> initEnv = getInitEnv(tree, env);
-                    initEnv.info.enclVar = v;
-                    v.setLazyConstValue(initEnv(tree, initEnv), attr, tree);
-                }
+        } finally {
+            deferredLintHandler.setPos(prevLintPos);
+        }
+
+        if ((tree.mods.flags & VARARGS) != 0) {
+            //if we are entering a varargs parameter, we need to
+            //replace its type (a plain array type) with the more
+            //precise VarargsType --- we need to do it this way
+            //because varargs is represented in the tree as a
+            //modifier on the parameter declaration, and not as a
+            //distinct type of array node.
+            ArrayType atype = (ArrayType)tree.vartype.type;
+            tree.vartype.type = atype.makeVarargs();
+        }
+        WriteableScope enclScope = enter.enterScope(env);
+        VarSymbol v =
+            new VarSymbol(0, tree.name, tree.vartype.type, enclScope.owner);
+        v.flags_field = chk.checkFlags(tree.pos(), tree.mods.flags, v, tree);
+        tree.sym = v;
+        if (tree.init != null) {
+            v.flags_field |= HASINIT;
+            if ((v.flags_field & FINAL) != 0 &&
+                needsLazyConstValue(tree.init)) {
+                Env<AttrContext> initEnv = getInitEnv(tree, env);
+                initEnv.info.enclVar = v;
+                v.setLazyConstValue(initEnv(tree, initEnv), attr, tree);
             }
-            if (chk.checkUnique(tree.pos(), v, enclScope)) {
-                chk.checkTransparentVar(tree.pos(), v, enclScope);
-                enclScope.enter(v);
-            }
+        }
+        if (chk.checkUnique(tree.pos(), v, enclScope)) {
+            chk.checkTransparentVar(tree.pos(), v, enclScope);
+            enclScope.enter(v);
+        }
 
-            annotate.annotateLater(tree.mods.annotations, localEnv, v, tree.pos());
-            annotate.annotateTypeLater(tree.vartype, localEnv, v, tree.pos());
+        annotate.annotateLater(tree.mods.annotations, localEnv, v, tree.pos());
+        annotate.annotateTypeLater(tree.vartype, localEnv, v, tree.pos());
 
-            v.pos = tree.pos;
-        } finally {
-            annotate.enterDone();
-        }
+        v.pos = tree.pos;
     }
     // where
     void checkType(JCTree tree, Type type, String diag) {
@@ -864,219 +855,225 @@
             return;
         }
 
-        ClassSymbol c = (ClassSymbol)sym;
-        ClassType ct = (ClassType)c.type;
-        Env<AttrContext> env = typeEnvs.get(c);
-        JCClassDecl tree = (JCClassDecl)env.tree;
-        boolean wasFirst = isFirst;
-        isFirst = false;
+        try {
+            annotate.enterStart();
+
+            ClassSymbol c = (ClassSymbol)sym;
+            ClassType ct = (ClassType)c.type;
+            Env<AttrContext> env = typeEnvs.get(c);
+            JCClassDecl tree = (JCClassDecl)env.tree;
+            boolean wasFirst = isFirst;
+            isFirst = false;
+
+            JavaFileObject prev = log.useSource(env.toplevel.sourcefile);
+            DiagnosticPosition prevLintPos = deferredLintHandler.setPos(tree.pos());
+            try {
+                dependencies.push(c);
+
+                // Save class environment for later member enter (2) processing.
+                halfcompleted.append(env);
 
-        JavaFileObject prev = log.useSource(env.toplevel.sourcefile);
-        DiagnosticPosition prevLintPos = deferredLintHandler.setPos(tree.pos());
-        try {
-            dependencies.push(c);
+                // Mark class as not yet attributed.
+                c.flags_field |= UNATTRIBUTED;
+
+                // If this is a toplevel-class, make sure any preceding import
+                // clauses have been seen.
+                if (c.owner.kind == PCK) {
+                    memberEnter(env.toplevel, env.enclosing(TOPLEVEL));
+                    todo.append(env);
+                }
 
-            // Save class environment for later member enter (2) processing.
-            halfcompleted.append(env);
+                if (c.owner.kind == TYP)
+                    c.owner.complete();
+
+                // create an environment for evaluating the base clauses
+                Env<AttrContext> baseEnv = baseEnv(tree, env);
 
-            // Mark class as not yet attributed.
-            c.flags_field |= UNATTRIBUTED;
+                if (tree.extending != null)
+                    annotate.annotateTypeLater(tree.extending, baseEnv, sym, tree.pos());
+                for (JCExpression impl : tree.implementing)
+                    annotate.annotateTypeLater(impl, baseEnv, sym, tree.pos());
+                annotate.flush();
 
-            // If this is a toplevel-class, make sure any preceding import
-            // clauses have been seen.
-            if (c.owner.kind == PCK) {
-                memberEnter(env.toplevel, env.enclosing(TOPLEVEL));
-                todo.append(env);
-            }
-
-            if (c.owner.kind == TYP)
-                c.owner.complete();
-
-            // create an environment for evaluating the base clauses
-            Env<AttrContext> baseEnv = baseEnv(tree, env);
+                // Determine supertype.
+                Type supertype;
+                if (tree.extending != null) {
+                    dependencies.push(AttributionKind.EXTENDS, tree.extending);
+                    try {
+                        supertype = attr.attribBase(tree.extending, baseEnv,
+                                true, false, true);
+                    } finally {
+                        dependencies.pop();
+                    }
+                } else {
+                    supertype = ((tree.mods.flags & Flags.ENUM) != 0)
+                    ? attr.attribBase(enumBase(tree.pos, c), baseEnv,
+                                      true, false, false)
+                    : (c.fullname == names.java_lang_Object)
+                    ? Type.noType
+                    : syms.objectType;
+                }
+                ct.supertype_field = modelMissingTypes(supertype, tree.extending, false);
 
-            if (tree.extending != null)
-                annotate.annotateTypeLater(tree.extending, baseEnv, sym, tree.pos());
-            for (JCExpression impl : tree.implementing)
-                annotate.annotateTypeLater(impl, baseEnv, sym, tree.pos());
-            annotate.flush();
+                // Determine interfaces.
+                ListBuffer<Type> interfaces = new ListBuffer<>();
+                ListBuffer<Type> all_interfaces = null; // lazy init
+                Set<Type> interfaceSet = new HashSet<>();
+                List<JCExpression> interfaceTrees = tree.implementing;
+                for (JCExpression iface : interfaceTrees) {
+                    dependencies.push(AttributionKind.IMPLEMENTS, iface);
+                    try {
+                        Type it = attr.attribBase(iface, baseEnv, false, true, true);
+                        if (it.hasTag(CLASS)) {
+                            interfaces.append(it);
+                            if (all_interfaces != null) all_interfaces.append(it);
+                            chk.checkNotRepeated(iface.pos(), types.erasure(it), interfaceSet);
+                        } else {
+                            if (all_interfaces == null)
+                                all_interfaces = new ListBuffer<Type>().appendList(interfaces);
+                            all_interfaces.append(modelMissingTypes(it, iface, true));
+                        }
+                    } finally {
+                        dependencies.pop();
+                    }
+                }
 
-            // Determine supertype.
-            Type supertype;
-            if (tree.extending != null) {
-                dependencies.push(AttributionKind.EXTENDS, tree.extending);
-                try {
-                    supertype = attr.attribBase(tree.extending, baseEnv,
-                            true, false, true);
-                } finally {
-                    dependencies.pop();
+                if ((c.flags_field & ANNOTATION) != 0) {
+                    ct.interfaces_field = List.of(syms.annotationType);
+                    ct.all_interfaces_field = ct.interfaces_field;
+                }  else {
+                    ct.interfaces_field = interfaces.toList();
+                    ct.all_interfaces_field = (all_interfaces == null)
+                            ? ct.interfaces_field : all_interfaces.toList();
                 }
-            } else {
-                supertype = ((tree.mods.flags & Flags.ENUM) != 0)
-                ? attr.attribBase(enumBase(tree.pos, c), baseEnv,
-                                  true, false, false)
-                : (c.fullname == names.java_lang_Object)
-                ? Type.noType
-                : syms.objectType;
-            }
-            ct.supertype_field = modelMissingTypes(supertype, tree.extending, false);
+
+                if (c.fullname == names.java_lang_Object) {
+                    if (tree.extending != null) {
+                        chk.checkNonCyclic(tree.extending.pos(),
+                                           supertype);
+                        ct.supertype_field = Type.noType;
+                    }
+                    else if (tree.implementing.nonEmpty()) {
+                        chk.checkNonCyclic(tree.implementing.head.pos(),
+                                           ct.interfaces_field.head);
+                        ct.interfaces_field = List.nil();
+                    }
+                }
+
+                // Annotations.
+                // In general, we cannot fully process annotations yet,  but we
+                // can attribute the annotation types and then check to see if the
+                // @Deprecated annotation is present.
+                attr.attribAnnotationTypes(tree.mods.annotations, baseEnv);
+                if (hasDeprecatedAnnotation(tree.mods.annotations))
+                    c.flags_field |= DEPRECATED;
+                annotate.annotateLater(tree.mods.annotations, baseEnv,
+                            c, tree.pos());
+
+                chk.checkNonCyclicDecl(tree);
+
+                // class type parameters use baseEnv but everything uses env
+                attr.attribTypeVariables(tree.typarams, baseEnv);
+                for (JCTypeParameter tp : tree.typarams)
+                    annotate.annotateTypeLater(tp, baseEnv, sym, tree.pos());
 
-            // Determine interfaces.
-            ListBuffer<Type> interfaces = new ListBuffer<>();
-            ListBuffer<Type> all_interfaces = null; // lazy init
-            Set<Type> interfaceSet = new HashSet<>();
-            List<JCExpression> interfaceTrees = tree.implementing;
-            for (JCExpression iface : interfaceTrees) {
-                dependencies.push(AttributionKind.IMPLEMENTS, iface);
-                try {
-                    Type it = attr.attribBase(iface, baseEnv, false, true, true);
-                    if (it.hasTag(CLASS)) {
-                        interfaces.append(it);
-                        if (all_interfaces != null) all_interfaces.append(it);
-                        chk.checkNotRepeated(iface.pos(), types.erasure(it), interfaceSet);
-                    } else {
-                        if (all_interfaces == null)
-                            all_interfaces = new ListBuffer<Type>().appendList(interfaces);
-                        all_interfaces.append(modelMissingTypes(it, iface, true));
+                // Add default constructor if needed.
+                if ((c.flags() & INTERFACE) == 0 &&
+                    !TreeInfo.hasConstructors(tree.defs)) {
+                    List<Type> argtypes = List.nil();
+                    List<Type> typarams = List.nil();
+                    List<Type> thrown = List.nil();
+                    long ctorFlags = 0;
+                    boolean based = false;
+                    boolean addConstructor = true;
+                    JCNewClass nc = null;
+                    if (c.name.isEmpty()) {
+                        nc = (JCNewClass)env.next.tree;
+                        if (nc.constructor != null) {
+                            addConstructor = nc.constructor.kind != ERR;
+                            Type superConstrType = types.memberType(c.type,
+                                                                    nc.constructor);
+                            argtypes = superConstrType.getParameterTypes();
+                            typarams = superConstrType.getTypeArguments();
+                            ctorFlags = nc.constructor.flags() & VARARGS;
+                            if (nc.encl != null) {
+                                argtypes = argtypes.prepend(nc.encl.type);
+                                based = true;
+                            }
+                            thrown = superConstrType.getThrownTypes();
+                        }
                     }
-                } finally {
-                    dependencies.pop();
+                    if (addConstructor) {
+                        MethodSymbol basedConstructor = nc != null ?
+                                (MethodSymbol)nc.constructor : null;
+                        JCTree constrDef = DefaultConstructor(make.at(tree.pos), c,
+                                                            basedConstructor,
+                                                            typarams, argtypes, thrown,
+                                                            ctorFlags, based);
+                        tree.defs = tree.defs.prepend(constrDef);
+                    }
                 }
-            }
 
-            if ((c.flags_field & ANNOTATION) != 0) {
-                ct.interfaces_field = List.of(syms.annotationType);
-                ct.all_interfaces_field = ct.interfaces_field;
-            }  else {
-                ct.interfaces_field = interfaces.toList();
-                ct.all_interfaces_field = (all_interfaces == null)
-                        ? ct.interfaces_field : all_interfaces.toList();
-            }
+                // enter symbols for 'this' into current scope.
+                VarSymbol thisSym =
+                    new VarSymbol(FINAL | HASINIT, names._this, c.type, c);
+                thisSym.pos = Position.FIRSTPOS;
+                env.info.scope.enter(thisSym);
+                // if this is a class, enter symbol for 'super' into current scope.
+                if ((c.flags_field & INTERFACE) == 0 &&
+                        ct.supertype_field.hasTag(CLASS)) {
+                    VarSymbol superSym =
+                        new VarSymbol(FINAL | HASINIT, names._super,
+                                      ct.supertype_field, c);
+                    superSym.pos = Position.FIRSTPOS;
+                    env.info.scope.enter(superSym);
+                }
 
-            if (c.fullname == names.java_lang_Object) {
-                if (tree.extending != null) {
-                    chk.checkNonCyclic(tree.extending.pos(),
-                                       supertype);
-                    ct.supertype_field = Type.noType;
+                // check that no package exists with same fully qualified name,
+                // but admit classes in the unnamed package which have the same
+                // name as a top-level package.
+                if (checkClash &&
+                    c.owner.kind == PCK && c.owner != syms.unnamedPackage &&
+                    syms.packageExists(c.fullname)) {
+                    log.error(tree.pos, "clash.with.pkg.of.same.name", Kinds.kindName(sym), c);
                 }
-                else if (tree.implementing.nonEmpty()) {
-                    chk.checkNonCyclic(tree.implementing.head.pos(),
-                                       ct.interfaces_field.head);
-                    ct.interfaces_field = List.nil();
+                if (c.owner.kind == PCK && (c.flags_field & PUBLIC) == 0 &&
+                    !env.toplevel.sourcefile.isNameCompatible(c.name.toString(),JavaFileObject.Kind.SOURCE)) {
+                    c.flags_field |= AUXILIARY;
                 }
+            } catch (CompletionFailure ex) {
+                chk.completionError(tree.pos(), ex);
+            } finally {
+                deferredLintHandler.setPos(prevLintPos);
+                log.useSource(prev);
+                dependencies.pop();
             }
 
-            // Annotations.
-            // In general, we cannot fully process annotations yet,  but we
-            // can attribute the annotation types and then check to see if the
-            // @Deprecated annotation is present.
-            attr.attribAnnotationTypes(tree.mods.annotations, baseEnv);
-            if (hasDeprecatedAnnotation(tree.mods.annotations))
-                c.flags_field |= DEPRECATED;
-            annotate.annotateLater(tree.mods.annotations, baseEnv,
-                        c, tree.pos());
-
-            chk.checkNonCyclicDecl(tree);
-
-            // class type parameters use baseEnv but everything uses env
-            attr.attribTypeVariables(tree.typarams, baseEnv);
-            for (JCTypeParameter tp : tree.typarams)
-                annotate.annotateTypeLater(tp, baseEnv, sym, tree.pos());
-
-            // Add default constructor if needed.
-            if ((c.flags() & INTERFACE) == 0 &&
-                !TreeInfo.hasConstructors(tree.defs)) {
-                List<Type> argtypes = List.nil();
-                List<Type> typarams = List.nil();
-                List<Type> thrown = List.nil();
-                long ctorFlags = 0;
-                boolean based = false;
-                boolean addConstructor = true;
-                JCNewClass nc = null;
-                if (c.name.isEmpty()) {
-                    nc = (JCNewClass)env.next.tree;
-                    if (nc.constructor != null) {
-                        addConstructor = nc.constructor.kind != ERR;
-                        Type superConstrType = types.memberType(c.type,
-                                                                nc.constructor);
-                        argtypes = superConstrType.getParameterTypes();
-                        typarams = superConstrType.getTypeArguments();
-                        ctorFlags = nc.constructor.flags() & VARARGS;
-                        if (nc.encl != null) {
-                            argtypes = argtypes.prepend(nc.encl.type);
-                            based = true;
+            // Enter all member fields and methods of a set of half completed
+            // classes in a second phase.
+            if (wasFirst) {
+                Set<JCCompilationUnit> topLevels = new HashSet<>();
+                try {
+                    while (halfcompleted.nonEmpty()) {
+                        Env<AttrContext> toFinish = halfcompleted.next();
+                        topLevels.add(toFinish.toplevel);
+                        finish(toFinish);
+                        if (allowTypeAnnos) {
+                            typeAnnotations.organizeTypeAnnotationsSignatures(toFinish, (JCClassDecl)toFinish.tree);
+                            typeAnnotations.validateTypeAnnotationsSignatures(toFinish, (JCClassDecl)toFinish.tree);
                         }
-                        thrown = superConstrType.getThrownTypes();
                     }
+                } finally {
+                    isFirst = true;
                 }
-                if (addConstructor) {
-                    MethodSymbol basedConstructor = nc != null ?
-                            (MethodSymbol)nc.constructor : null;
-                    JCTree constrDef = DefaultConstructor(make.at(tree.pos), c,
-                                                        basedConstructor,
-                                                        typarams, argtypes, thrown,
-                                                        ctorFlags, based);
-                    tree.defs = tree.defs.prepend(constrDef);
-                }
-            }
 
-            // enter symbols for 'this' into current scope.
-            VarSymbol thisSym =
-                new VarSymbol(FINAL | HASINIT, names._this, c.type, c);
-            thisSym.pos = Position.FIRSTPOS;
-            env.info.scope.enter(thisSym);
-            // if this is a class, enter symbol for 'super' into current scope.
-            if ((c.flags_field & INTERFACE) == 0 &&
-                    ct.supertype_field.hasTag(CLASS)) {
-                VarSymbol superSym =
-                    new VarSymbol(FINAL | HASINIT, names._super,
-                                  ct.supertype_field, c);
-                superSym.pos = Position.FIRSTPOS;
-                env.info.scope.enter(superSym);
-            }
+                for (JCCompilationUnit toplevel : topLevels) {
+                    chk.checkImportsResolvable(toplevel);
+                }
 
-            // check that no package exists with same fully qualified name,
-            // but admit classes in the unnamed package which have the same
-            // name as a top-level package.
-            if (checkClash &&
-                c.owner.kind == PCK && c.owner != syms.unnamedPackage &&
-                syms.packageExists(c.fullname)) {
-                log.error(tree.pos, "clash.with.pkg.of.same.name", Kinds.kindName(sym), c);
-            }
-            if (c.owner.kind == PCK && (c.flags_field & PUBLIC) == 0 &&
-                !env.toplevel.sourcefile.isNameCompatible(c.name.toString(),JavaFileObject.Kind.SOURCE)) {
-                c.flags_field |= AUXILIARY;
             }
-        } catch (CompletionFailure ex) {
-            chk.completionError(tree.pos(), ex);
         } finally {
-            deferredLintHandler.setPos(prevLintPos);
-            log.useSource(prev);
-            dependencies.pop();
-        }
-
-        // Enter all member fields and methods of a set of half completed
-        // classes in a second phase.
-        if (wasFirst) {
-            Set<JCCompilationUnit> topLevels = new HashSet<>();
-            try {
-                while (halfcompleted.nonEmpty()) {
-                    Env<AttrContext> toFinish = halfcompleted.next();
-                    topLevels.add(toFinish.toplevel);
-                    finish(toFinish);
-                    if (allowTypeAnnos) {
-                        typeAnnotations.organizeTypeAnnotationsSignatures(toFinish, (JCClassDecl)toFinish.tree);
-                        typeAnnotations.validateTypeAnnotationsSignatures(toFinish, (JCClassDecl)toFinish.tree);
-                    }
-                }
-            } finally {
-                isFirst = true;
-            }
-
-            for (JCCompilationUnit toplevel : topLevels) {
-                chk.checkImportsResolvable(toplevel);
-            }
-
+            annotate.enterDone();
         }
     }
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Jul 05 20:05:30 2017 +0200
@@ -55,6 +55,7 @@
 
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.EnumMap;
 import java.util.EnumSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
@@ -65,7 +66,7 @@
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Flags.BLOCK;
 import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.Kinds.ERRONEOUS;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.comp.Resolve.MethodResolutionPhase.*;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
@@ -154,6 +155,11 @@
         return instance;
     }
 
+    private static Symbol bestOf(Symbol s1,
+                                 Symbol s2) {
+        return s1.kind.betterThan(s2.kind) ? s1 : s2;
+    }
+
     // <editor-fold defaultstate="collapsed" desc="Verbose resolution diagnostics support">
     enum VerboseResolutionMode {
         SUCCESS("success"),
@@ -192,7 +198,7 @@
 
     void reportVerboseResolutionDiagnostic(DiagnosticPosition dpos, Name name, Type site,
             List<Type> argtypes, List<Type> typeargtypes, Symbol bestSoFar) {
-        boolean success = bestSoFar.kind < ERRONEOUS;
+        boolean success = !bestSoFar.kind.isOverloadError();
 
         if (success && !verboseResolutionMode.contains(VerboseResolutionMode.SUCCESS)) {
             return;
@@ -517,7 +523,6 @@
                         boolean allowBoxing,
                         boolean useVarargs,
                         Warner warn) throws Infer.InferenceException {
-
         Type mt = types.memberType(site, m);
         // tvars is the list of formal type variables for which type arguments
         // need to inferred.
@@ -536,9 +541,10 @@
             while (formals.nonEmpty() && actuals.nonEmpty()) {
                 List<Type> bounds = types.subst(types.getBounds((TypeVar)formals.head),
                                                 pmt.tvars, typeargtypes);
-                for (; bounds.nonEmpty(); bounds = bounds.tail)
+                for (; bounds.nonEmpty(); bounds = bounds.tail) {
                     if (!types.isSubtypeUnchecked(actuals.head, bounds.head, warn))
                         throw inapplicableMethodException.setMessage("explicit.param.do.not.conform.to.bounds",actuals.head, bounds);
+                }
                 formals = formals.tail;
                 actuals = actuals.tail;
             }
@@ -558,7 +564,7 @@
             if (l.head.hasTag(FORALL)) instNeeded = true;
         }
 
-        if (instNeeded)
+        if (instNeeded) {
             return infer.instantiateMethod(env,
                                     tvars,
                                     (MethodType)mt,
@@ -569,6 +575,7 @@
                                     useVarargs,
                                     currentResolutionContext,
                                     warn);
+        }
 
         DeferredAttr.DeferredAttrContext dc = currentResolutionContext.deferredAttrContext(m, infer.emptyContext, resultInfo, warn);
         currentResolutionContext.methodCheck.argumentsAcceptable(env, dc,
@@ -992,7 +999,7 @@
     class MethodResultInfo extends ResultInfo {
 
         public MethodResultInfo(Type pt, CheckContext checkContext) {
-            attr.super(VAL, pt, checkContext);
+            attr.super(KindSelector.VAL, pt, checkContext);
         }
 
         @Override
@@ -1071,7 +1078,7 @@
         */
         ResultInfo methodCheckResult(Type to, DeferredAttr.DeferredAttrContext deferredAttrContext,
                Warner rsWarner, Type actual) {
-           return attr.new ResultInfo(Kinds.VAL, to,
+            return attr.new ResultInfo(KindSelector.VAL, to,
                    new MostSpecificCheckContext(strict, deferredAttrContext, rsWarner, actual));
         }
 
@@ -1304,7 +1311,7 @@
         Type st = types.supertype(c.type);
         if (st != null && (st.hasTag(CLASS) || st.hasTag(TYPEVAR))) {
             sym = findField(env, site, name, st.tsym);
-            if (sym.kind < bestSoFar.kind) bestSoFar = sym;
+            bestSoFar = bestOf(bestSoFar, sym);
         }
         for (List<Type> l = types.interfaces(c.type);
              bestSoFar.kind != AMBIGUOUS && l.nonEmpty();
@@ -1313,8 +1320,8 @@
             if (bestSoFar.exists() && sym.exists() &&
                 sym.owner != bestSoFar.owner)
                 bestSoFar = new AmbiguityError(bestSoFar, sym);
-            else if (sym.kind < bestSoFar.kind)
-                bestSoFar = sym;
+            else
+                bestSoFar = bestOf(bestSoFar, sym);
         }
         return bestSoFar;
     }
@@ -1364,8 +1371,8 @@
                     return new StaticError(sym);
                 else
                     return sym;
-            } else if (sym.kind < bestSoFar.kind) {
-                bestSoFar = sym;
+            } else {
+                bestSoFar = bestOf(bestSoFar, sym);
             }
 
             if ((env1.enclClass.sym.flags() & STATIC) != 0) staticOnly = true;
@@ -1383,10 +1390,11 @@
             for (Symbol currentSymbol : sc.getSymbolsByName(name)) {
                 if (currentSymbol.kind != VAR)
                     continue;
-                // invariant: sym.kind == VAR
-                if (bestSoFar.kind < AMBIGUOUS && currentSymbol.owner != bestSoFar.owner)
+                // invariant: sym.kind == Symbol.Kind.VAR
+                if (!bestSoFar.kind.isOverloadError() &&
+                    currentSymbol.owner != bestSoFar.owner)
                     return new AmbiguityError(bestSoFar, currentSymbol);
-                else if (bestSoFar.kind >= VAR) {
+                else if (!bestSoFar.kind.betterThan(VAR)) {
                     origin = sc.getOrigin(currentSymbol).owner;
                     bestSoFar = isAccessible(env, origin.type, currentSymbol)
                         ? currentSymbol : new AccessError(env, origin.type, currentSymbol);
@@ -1427,11 +1435,11 @@
                 !sym.isInheritedIn(site.tsym, types)) {
             return bestSoFar;
         } else if (useVarargs && (sym.flags() & VARARGS) == 0) {
-            return bestSoFar.kind >= ERRONEOUS ?
+            return bestSoFar.kind.isOverloadError() ?
                     new BadVarargsMethod((ResolveError)bestSoFar.baseSymbol()) :
                     bestSoFar;
         }
-        Assert.check(sym.kind < AMBIGUOUS);
+        Assert.check(!sym.kind.isOverloadError());
         try {
             Type mt = rawInstantiate(env, site, sym, null, argtypes, typeargtypes,
                                allowBoxing, useVarargs, types.noWarnings);
@@ -1455,7 +1463,7 @@
                 ? new AccessError(env, site, sym)
                 : bestSoFar;
         }
-        return (bestSoFar.kind > AMBIGUOUS)
+        return (bestSoFar.kind.isOverloadError() && bestSoFar.kind != AMBIGUOUS)
             ? sym
             : mostSpecific(argtypes, sym, bestSoFar, env, site,
                            allowBoxing && operator, useVarargs);
@@ -1689,6 +1697,7 @@
                               boolean operator) {
         @SuppressWarnings({"unchecked","rawtypes"})
         List<Type>[] itypes = (List<Type>[])new List[] { List.<Type>nil(), List.<Type>nil() };
+
         InterfaceLookupPhase iphase = InterfaceLookupPhase.ABSTRACT_OK;
         for (TypeSymbol s : superclasses(intype)) {
             bestSoFar = findMethodInScope(env, site, name, argtypes, typeargtypes,
@@ -1702,7 +1711,7 @@
             }
         }
 
-        Symbol concrete = bestSoFar.kind < ERR &&
+        Symbol concrete = bestSoFar.kind.isValid() &&
                 (bestSoFar.flags() & ABSTRACT) == 0 ?
                 bestSoFar : methodNotFound;
 
@@ -1715,7 +1724,8 @@
                 bestSoFar = findMethodInScope(env, site, name, argtypes, typeargtypes,
                         itype.tsym.members(), bestSoFar, allowBoxing, useVarargs, operator, true);
                 if (concrete != bestSoFar &&
-                        concrete.kind < ERR  && bestSoFar.kind < ERR &&
+                    concrete.kind.isValid() &&
+                    bestSoFar.kind.isValid() &&
                         types.isSubSignature(concrete.type, bestSoFar.type)) {
                     //this is an hack - as javac does not do full membership checks
                     //most specific ends up comparing abstract methods that might have
@@ -1832,8 +1842,8 @@
                     sym.owner.kind == TYP &&
                     (sym.flags() & STATIC) == 0) return new StaticError(sym);
                 else return sym;
-            } else if (sym.kind < bestSoFar.kind) {
-                bestSoFar = sym;
+            } else {
+                bestSoFar = bestOf(bestSoFar, sym);
             }
             if ((env1.enclClass.sym.flags() & STATIC) != 0) staticOnly = true;
             env1 = env1.outer;
@@ -1936,17 +1946,18 @@
         Type st = types.supertype(c.type);
         if (st != null && st.hasTag(CLASS)) {
             sym = findMemberType(env, site, name, st.tsym);
-            if (sym.kind < bestSoFar.kind) bestSoFar = sym;
+            bestSoFar = bestOf(bestSoFar, sym);
         }
         for (List<Type> l = types.interfaces(c.type);
              bestSoFar.kind != AMBIGUOUS && l.nonEmpty();
              l = l.tail) {
             sym = findMemberType(env, site, name, l.head.tsym);
-            if (bestSoFar.kind < AMBIGUOUS && sym.kind < AMBIGUOUS &&
+            if (!bestSoFar.kind.isOverloadError() &&
+                !sym.kind.isOverloadError() &&
                 sym.owner != bestSoFar.owner)
                 bestSoFar = new AmbiguityError(bestSoFar, sym);
-            else if (sym.kind < bestSoFar.kind)
-                bestSoFar = sym;
+            else
+                bestSoFar = bestOf(bestSoFar, sym);
         }
         return bestSoFar;
     }
@@ -1985,8 +1996,8 @@
             if (bestSoFar.kind == TYP && sym.kind == TYP &&
                 bestSoFar != sym)
                 return new AmbiguityError(bestSoFar, sym);
-            else if (sym.kind < bestSoFar.kind)
-                bestSoFar = sym;
+            else
+                bestSoFar = bestOf(bestSoFar, sym);
         }
         return bestSoFar;
     }
@@ -2041,7 +2052,7 @@
                 sym.type.getEnclosingType().isParameterized())
                 return new StaticError(sym);
             else if (sym.exists()) return sym;
-            else if (sym.kind < bestSoFar.kind) bestSoFar = sym;
+            else bestSoFar = bestOf(bestSoFar, sym);
 
             JCClassDecl encl = env1.baseClause ? (JCClassDecl)env1.tree : env1.enclClass;
             if ((encl.sym.flags() & STATIC) != 0)
@@ -2051,15 +2062,15 @@
         if (!env.tree.hasTag(IMPORT)) {
             sym = findGlobalType(env, env.toplevel.namedImportScope, name);
             if (sym.exists()) return sym;
-            else if (sym.kind < bestSoFar.kind) bestSoFar = sym;
+            else bestSoFar = bestOf(bestSoFar, sym);
 
             sym = findGlobalType(env, env.toplevel.packge.members(), name);
             if (sym.exists()) return sym;
-            else if (sym.kind < bestSoFar.kind) bestSoFar = sym;
+            else bestSoFar = bestOf(bestSoFar, sym);
 
             sym = findGlobalType(env, env.toplevel.starImportScope, name);
             if (sym.exists()) return sym;
-            else if (sym.kind < bestSoFar.kind) bestSoFar = sym;
+            else bestSoFar = bestOf(bestSoFar, sym);
         }
 
         return bestSoFar;
@@ -2071,23 +2082,25 @@
      *  @param kind      Indicates the possible symbol kinds
      *                   (a subset of VAL, TYP, PCK).
      */
-    Symbol findIdent(Env<AttrContext> env, Name name, int kind) {
+    Symbol findIdent(Env<AttrContext> env, Name name, KindSelector kind) {
         Symbol bestSoFar = typeNotFound;
         Symbol sym;
 
-        if ((kind & VAR) != 0) {
+        if (kind.contains(KindSelector.VAL)) {
             sym = findVar(env, name);
             if (sym.exists()) return sym;
-            else if (sym.kind < bestSoFar.kind) bestSoFar = sym;
+            else bestSoFar = bestOf(bestSoFar, sym);
         }
 
-        if ((kind & TYP) != 0) {
+        if (kind.contains(KindSelector.TYP)) {
             sym = findType(env, name);
+
             if (sym.exists()) return sym;
-            else if (sym.kind < bestSoFar.kind) bestSoFar = sym;
+            else bestSoFar = bestOf(bestSoFar, sym);
         }
 
-        if ((kind & PCK) != 0) return syms.enterPackage(name);
+        if (kind.contains(KindSelector.PCK))
+            return syms.enterPackage(name);
         else return bestSoFar;
     }
 
@@ -2098,21 +2111,21 @@
      *                   (a nonempty subset of TYP, PCK).
      */
     Symbol findIdentInPackage(Env<AttrContext> env, TypeSymbol pck,
-                              Name name, int kind) {
+                              Name name, KindSelector kind) {
         Name fullname = TypeSymbol.formFullName(name, pck);
         Symbol bestSoFar = typeNotFound;
         PackageSymbol pack = null;
-        if ((kind & PCK) != 0) {
+        if (kind.contains(KindSelector.PCK)) {
             pack = syms.enterPackage(fullname);
             if (pack.exists()) return pack;
         }
-        if ((kind & TYP) != 0) {
+        if (kind.contains(KindSelector.TYP)) {
             Symbol sym = loadClass(env, fullname);
             if (sym.exists()) {
                 // don't allow programs to use flatnames
                 if (name == sym.name) return sym;
             }
-            else if (sym.kind < bestSoFar.kind) bestSoFar = sym;
+            else bestSoFar = bestOf(bestSoFar, sym);
         }
         return (pack != null) ? pack : bestSoFar;
     }
@@ -2125,19 +2138,19 @@
      *                   (a subset of VAL, TYP).
      */
     Symbol findIdentInType(Env<AttrContext> env, Type site,
-                           Name name, int kind) {
+                           Name name, KindSelector kind) {
         Symbol bestSoFar = typeNotFound;
         Symbol sym;
-        if ((kind & VAR) != 0) {
+        if (kind.contains(KindSelector.VAL)) {
             sym = findField(env, site, name, site.tsym);
             if (sym.exists()) return sym;
-            else if (sym.kind < bestSoFar.kind) bestSoFar = sym;
+            else bestSoFar = bestOf(bestSoFar, sym);
         }
 
-        if ((kind & TYP) != 0) {
+        if (kind.contains(KindSelector.TYP)) {
             sym = findMemberType(env, site, name, site.tsym);
             if (sym.exists()) return sym;
-            else if (sym.kind < bestSoFar.kind) bestSoFar = sym;
+            else bestSoFar = bestOf(bestSoFar, sym);
         }
         return bestSoFar;
     }
@@ -2175,7 +2188,7 @@
                   List<Type> argtypes,
                   List<Type> typeargtypes,
                   LogResolveHelper logResolveHelper) {
-        if (sym.kind >= AMBIGUOUS) {
+        if (sym.kind.isOverloadError()) {
             ResolveError errSym = (ResolveError)sym.baseSymbol();
             sym = errSym.access(name, qualified ? site.tsym : syms.noSymbol);
             argtypes = logResolveHelper.getArgumentTypes(errSym, sym, name, argtypes);
@@ -2307,7 +2320,7 @@
      *  @param kind      The set of admissible symbol kinds for the identifier.
      */
     Symbol resolveIdent(DiagnosticPosition pos, Env<AttrContext> env,
-                        Name name, int kind) {
+                        Name name, KindSelector kind) {
         return accessBase(
             findIdent(env, name, kind),
             pos, env.enclClass.sym.type, name, false);
@@ -2367,7 +2380,7 @@
             }
             @Override
             Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
-                if (sym.kind >= AMBIGUOUS) {
+                if (sym.kind.isOverloadError()) {
                     sym = super.access(env, pos, location, sym);
                 } else if (allowMethodHandles) {
                     MethodSymbol msym = (MethodSymbol)sym;
@@ -2524,8 +2537,9 @@
                     }
                     @Override
                     Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
-                        if (sym.kind >= AMBIGUOUS) {
-                            if (sym.kind != WRONG_MTH && sym.kind != WRONG_MTHS) {
+                        if (sym.kind.isOverloadError()) {
+                            if (sym.kind != WRONG_MTH &&
+                                sym.kind != WRONG_MTHS) {
                                 sym = super.access(env, pos, location, sym);
                             } else {
                                 final JCDiagnostic details = sym.kind == WRONG_MTH ?
@@ -2713,7 +2727,7 @@
         if (isStaticSelector &&
             !name.equals(names.init) &&
             !boundSym.isStatic() &&
-            boundSym.kind < ERRONEOUS) {
+            !boundSym.kind.isOverloadError()) {
             boundSym = methodNotFound;
         }
 
@@ -2726,7 +2740,7 @@
             unboundSym = lookupMethod(unboundEnv, env.tree.pos(), site.tsym,
                     arityMethodCheck, unboundLookupHelper);
             if (unboundSym.isStatic() &&
-                unboundSym.kind < ERRONEOUS) {
+                !unboundSym.kind.isOverloadError()) {
                 unboundSym = methodNotFound;
             }
         }
@@ -2801,11 +2815,11 @@
                         boundSearchResultKind = SearchResultKind.BAD_MATCH_MORE_SPECIFIC;
                     } else {
                         boundSearchResultKind = SearchResultKind.BAD_MATCH;
-                        if (boundSym.kind < ERRONEOUS) {
+                        if (!boundSym.kind.isOverloadError()) {
                             boundSym = methodWithCorrectStaticnessNotFound;
                         }
                     }
-                } else if (boundSym.kind < ERRONEOUS) {
+                } else if (!boundSym.kind.isOverloadError()) {
                     boundSearchResultKind = SearchResultKind.GOOD_MATCH;
                 }
             }
@@ -2835,11 +2849,11 @@
                             unboundSearchResultKind = SearchResultKind.BAD_MATCH_MORE_SPECIFIC;
                         } else {
                             unboundSearchResultKind = SearchResultKind.BAD_MATCH;
-                            if (unboundSym.kind < ERRONEOUS) {
+                            if (!unboundSym.kind.isOverloadError()) {
                                 unboundSym = methodWithCorrectStaticnessNotFound;
                             }
                         }
-                    } else if (unboundSym.kind < ERRONEOUS) {
+                    } else if (!unboundSym.kind.isOverloadError()) {
                         unboundSearchResultKind = SearchResultKind.GOOD_MATCH;
                     }
                 }
@@ -2849,7 +2863,8 @@
         //merge results
         Pair<Symbol, ReferenceLookupHelper> res;
         Symbol bestSym = choose(boundSym, unboundSym);
-        if (bestSym.kind < ERRONEOUS && (staticErrorForBound || staticErrorForUnbound)) {
+        if (!bestSym.kind.isOverloadError() &&
+            (staticErrorForBound || staticErrorForUnbound)) {
             if (staticErrorForBound) {
                 boundSym = methodWithCorrectStaticnessNotFound;
             }
@@ -2983,7 +2998,7 @@
          */
         final boolean shouldStop(Symbol sym, MethodResolutionPhase phase) {
             return phase.ordinal() > maxPhase.ordinal() ||
-                    sym.kind < ERRONEOUS || sym.kind == AMBIGUOUS;
+                !sym.kind.isOverloadError() || sym.kind == AMBIGUOUS;
         }
 
         /**
@@ -3029,7 +3044,7 @@
 
         @Override
         Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
-            if (sym.kind >= AMBIGUOUS) {
+            if (sym.kind.isOverloadError()) {
                 //if nothing is found return the 'first' error
                 sym = accessMethod(sym, pos, location, site, name, true, argtypes, typeargtypes);
             }
@@ -3228,7 +3243,7 @@
             return sym.kind != MTH ||
                           site.getEnclosingType().hasTag(NONE) ||
                           hasEnclosingInstance(env, site) ?
-                          sym : new InvalidSymbolError(Kinds.MISSING_ENCL, sym, null) {
+                          sym : new InvalidSymbolError(MISSING_ENCL, sym, null) {
                     @Override
                     JCDiagnostic getDiagnostic(DiagnosticType dkind, DiagnosticPosition pos, Symbol location, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) {
                        return diags.create(dkind, log.currentSource(), pos,
@@ -3369,7 +3384,7 @@
 
     boolean hasEnclosingInstance(Env<AttrContext> env, Type type) {
         Symbol encl = resolveSelfContainingInternal(env, type.tsym, false);
-        return encl != null && encl.kind < ERRONEOUS;
+        return encl != null && !encl.kind.isOverloadError();
     }
 
     private Symbol resolveSelfContainingInternal(Env<AttrContext> env,
@@ -3405,7 +3420,7 @@
     }
 
     Type resolveImplicitThis(DiagnosticPosition pos, Env<AttrContext> env, Type t, boolean isSuperCall) {
-        Type thisType = (((t.tsym.owner.kind & (MTH|VAR)) != 0)
+        Type thisType = (t.tsym.owner.kind.matches(KindSelector.VAL_MTH)
                          ? resolveSelf(pos, env, t.getEnclosingType().tsym, names._this)
                          : resolveSelfContaining(pos, env, t.tsym, isSuperCall)).type;
         if (env.info.isSelfCall && thisType.tsym == env.enclClass.sym)
@@ -3466,7 +3481,7 @@
         /** The name of the kind of error, for debugging only. */
         final String debugName;
 
-        ResolveError(int kind, String debugName) {
+        ResolveError(Kind kind, String debugName) {
             super(kind, 0, null, null, null);
             this.debugName = debugName;
         }
@@ -3534,7 +3549,7 @@
         /** The invalid symbol found during resolution */
         Symbol sym;
 
-        InvalidSymbolError(int kind, Symbol sym, String debugName) {
+        InvalidSymbolError(Kind kind, Symbol sym, String debugName) {
             super(kind, debugName);
             this.sym = sym;
         }
@@ -3551,7 +3566,7 @@
 
         @Override
         public Symbol access(Name name, TypeSymbol location) {
-            if ((sym.kind & ERRONEOUS) == 0 && (sym.kind & TYP) != 0)
+            if (!sym.kind.isOverloadError() && sym.kind.matches(KindSelector.TYP))
                 return types.createErrorType(name, location, sym.type).tsym;
             else
                 return sym;
@@ -3564,11 +3579,11 @@
      */
     class SymbolNotFoundError extends ResolveError {
 
-        SymbolNotFoundError(int kind) {
+        SymbolNotFoundError(Kind kind) {
             this(kind, "symbol not found error");
         }
 
-        SymbolNotFoundError(int kind, String debugName) {
+        SymbolNotFoundError(Kind kind, String debugName) {
             super(kind, debugName);
         }
 
@@ -3609,7 +3624,7 @@
             }
             boolean isConstructor = (kind == ABSENT_MTH || kind == WRONG_STATICNESS) &&
                     name == names.init;
-            KindName kindname = isConstructor ? KindName.CONSTRUCTOR : absentKind(kind);
+            KindName kindname = isConstructor ? KindName.CONSTRUCTOR : kind.absentKind();
             Name idname = isConstructor ? site.tsym.name : name;
             String errKey = getErrorKey(kindname, typeargtypes.nonEmpty(), hasLocation);
             if (hasLocation) {
@@ -3669,7 +3684,7 @@
             this(WRONG_MTH, "inapplicable symbol error", context);
         }
 
-        protected InapplicableSymbolError(int kind, String debugName, MethodResolutionContext context) {
+        protected InapplicableSymbolError(Kind kind, String debugName, MethodResolutionContext context) {
             super(kind, debugName);
             this.resolveContext = context;
         }
@@ -3784,7 +3799,7 @@
                         log.currentSource(),
                         pos,
                         "cant.apply.symbols",
-                        name == names.init ? KindName.CONSTRUCTOR : absentKind(kind),
+                        name == names.init ? KindName.CONSTRUCTOR : kind.absentKind(),
                         name == names.init ? site.tsym.name : name,
                         methodArguments(argtypes));
                 return new JCDiagnostic.MultilineDiagnostic(err, candidateDetails(filteredCandidates, site));
@@ -4164,8 +4179,8 @@
             @Override
             public Symbol mergeResults(Symbol bestSoFar, Symbol sym) {
                 //Check invariants (see {@code LookupHelper.shouldStop})
-                Assert.check(bestSoFar.kind >= ERRONEOUS && bestSoFar.kind != AMBIGUOUS);
-                if (sym.kind < ERRONEOUS) {
+                Assert.check(bestSoFar.kind.isOverloadError() && bestSoFar.kind != AMBIGUOUS);
+                if (!sym.kind.isOverloadError()) {
                     //varargs resolution successful
                     return sym;
                 } else {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java	Wed Jul 05 20:05:30 2017 +0200
@@ -36,7 +36,7 @@
 import com.sun.tools.javac.util.List;
 
 import static com.sun.tools.javac.code.Flags.*;
-import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Wed Jul 05 20:05:30 2017 +0200
@@ -51,7 +51,7 @@
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
 
 import static com.sun.tools.javac.code.Flags.*;
-import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
 import static com.sun.tools.javac.jvm.ClassFile.*;
@@ -994,7 +994,7 @@
                     // but the class name does not match the file name, then it is
                     // an auxiliary class.
                     String sn = n.toString();
-                    if (c.owner.kind == Kinds.PCK &&
+                    if (c.owner.kind == PCK &&
                         sn.endsWith(".java") &&
                         !sn.equals(c.name.toString()+".java")) {
                         c.flags_field |= AUXILIARY;
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Wed Jul 05 20:05:30 2017 +0200
@@ -48,7 +48,7 @@
 import com.sun.tools.javac.util.*;
 
 import static com.sun.tools.javac.code.Flags.*;
-import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.main.Option.*;
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java	Wed Jul 05 20:05:30 2017 +0200
@@ -2017,13 +2017,12 @@
         List<VarSymbol> locals = lvtRanges.getVars(meth, tree);
         for (LocalVar localVar: lvar) {
             for (VarSymbol aliveLocal : locals) {
-                if (localVar == null) {
-                    return;
-                }
-                if (localVar.sym == aliveLocal && localVar.lastRange() != null) {
-                    char length = (char)(closingCP - localVar.lastRange().start_pc);
-                    if (length < Character.MAX_VALUE) {
-                        localVar.closeRange(length);
+                if (localVar != null) {
+                    if (localVar.sym == aliveLocal && localVar.lastRange() != null) {
+                        char length = (char)(closingCP - localVar.lastRange().start_pc);
+                        if (length < Character.MAX_VALUE) {
+                            localVar.closeRange(length);
+                        }
                     }
                 }
             }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Wed Jul 05 20:05:30 2017 +0200
@@ -44,7 +44,7 @@
 import com.sun.tools.javac.tree.JCTree.*;
 
 import static com.sun.tools.javac.code.Flags.*;
-import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.jvm.ByteCodes.*;
@@ -447,7 +447,7 @@
                 JCBlock block = (JCBlock)def;
                 if ((block.flags & STATIC) != 0)
                     clinitCode.append(block);
-                else
+                else if ((block.flags & SYNTHETIC) == 0)
                     initCode.append(block);
                 break;
             case METHODDEF:
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/JNIWriter.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/JNIWriter.java	Wed Jul 05 20:05:30 2017 +0200
@@ -51,7 +51,7 @@
 import com.sun.tools.javac.util.Pair;
 
 import static com.sun.tools.javac.main.Option.*;
-import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 
 /** This class provides operations to write native header files for classes.
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Pool.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Pool.java	Wed Jul 05 20:05:30 2017 +0200
@@ -25,7 +25,6 @@
 
 package com.sun.tools.javac.jvm;
 
-import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.code.Symbol;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.TypeTag;
@@ -43,6 +42,9 @@
 import com.sun.tools.javac.util.DefinedBy;
 import com.sun.tools.javac.util.DefinedBy.Api;
 
+import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
+
 /** An internal structure that corresponds to the constant pool of a classfile.
  *
  *  <p><b>This is NOT part of any supported API.
@@ -289,7 +291,7 @@
         @SuppressWarnings("fallthrough")
         private void checkConsistent() {
             boolean staticOk = false;
-            int expectedKind = -1;
+            Kind expectedKind = null;
             Filter<Name> nameFilter = nonInitFilter;
             boolean interfaceOwner = false;
             switch (refKind) {
@@ -298,25 +300,25 @@
                     staticOk = true;
                 case ClassFile.REF_getField:
                 case ClassFile.REF_putField:
-                    expectedKind = Kinds.VAR;
+                    expectedKind = VAR;
                     break;
                 case ClassFile.REF_newInvokeSpecial:
                     nameFilter = initFilter;
-                    expectedKind = Kinds.MTH;
+                    expectedKind = MTH;
                     break;
                 case ClassFile.REF_invokeInterface:
                     interfaceOwner = true;
-                    expectedKind = Kinds.MTH;
+                    expectedKind = MTH;
                     break;
                 case ClassFile.REF_invokeStatic:
                     interfaceOwner = true;
                     staticOk = true;
                 case ClassFile.REF_invokeVirtual:
-                    expectedKind = Kinds.MTH;
+                    expectedKind = MTH;
                     break;
                 case ClassFile.REF_invokeSpecial:
                     interfaceOwner = true;
-                    expectedKind = Kinds.MTH;
+                    expectedKind = MTH;
                     break;
             }
             Assert.check(!refSym.isStatic() || staticOk);
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Wed Jul 05 20:05:30 2017 +0200
@@ -68,12 +68,11 @@
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.Log.WriterKind;
 
-import static javax.tools.StandardLocation.CLASS_OUTPUT;
-
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.main.Option.*;
 import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag.*;
-
+import static javax.tools.StandardLocation.CLASS_OUTPUT;
 
 /** This class could be the main entry point for GJC when GJC is used as a
  *  component in a larger software system. It provides operations to
@@ -1105,23 +1104,23 @@
                     for (String nameStr : classnames) {
                         Symbol sym = resolveBinaryNameOrIdent(nameStr);
                         if (sym == null ||
-                            (sym.kind == Kinds.PCK && !processPcks) ||
-                            sym.kind == Kinds.ABSENT_TYP) {
+                            (sym.kind == PCK && !processPcks) ||
+                            sym.kind == ABSENT_TYP) {
                             log.error("proc.cant.find.class", nameStr);
                             errors = true;
                             continue;
                         }
                         try {
-                            if (sym.kind == Kinds.PCK)
+                            if (sym.kind == PCK)
                                 sym.complete();
                             if (sym.exists()) {
-                                if (sym.kind == Kinds.PCK)
+                                if (sym.kind == PCK)
                                     pckSymbols = pckSymbols.prepend((PackageSymbol)sym);
                                 else
                                     classSymbols = classSymbols.prepend((ClassSymbol)sym);
                                 continue;
                             }
-                            Assert.check(sym.kind == Kinds.PCK);
+                            Assert.check(sym.kind == PCK);
                             log.warning("proc.package.does.not.exist", nameStr);
                             pckSymbols = pckSymbols.prepend((PackageSymbol)sym);
                         } catch (CompletionFailure e) {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java	Wed Jul 05 20:05:30 2017 +0200
@@ -44,6 +44,7 @@
 import com.sun.tools.javac.util.*;
 
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 
 /**
  * A generator of dynamic proxy implementations of
@@ -121,7 +122,7 @@
         // First find the default values.
         ClassSymbol sym = (ClassSymbol) anno.type.tsym;
         for (Symbol s : sym.members().getSymbols(NON_RECURSIVE)) {
-            if (s.kind == Kinds.MTH) {
+            if (s.kind == MTH) {
                 MethodSymbol m = (MethodSymbol) s;
                 Attribute def = m.getDefaultValue();
                 if (def != null)
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java	Wed Jul 05 20:05:30 2017 +0200
@@ -49,6 +49,7 @@
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.DefinedBy.Api;
 import com.sun.tools.javac.util.Name;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
@@ -120,7 +121,7 @@
 
             sym.complete();
 
-            return (sym.kind != Kinds.ERR &&
+            return (sym.kind != ERR &&
                     sym.exists() &&
                     clazz.isInstance(sym) &&
                     name.equals(sym.getQualifiedName()))
@@ -460,7 +461,7 @@
 
         // Only static methods can hide other methods.
         // Methods only hide methods with matching signatures.
-        if (hider.kind == Kinds.MTH) {
+        if (hider.kind == MTH) {
             if (!hider.isStatic() ||
                         !types.isSubSignature(hider.type, hidee.type)) {
                 return false;
@@ -592,7 +593,7 @@
     private Env<AttrContext> getEnterEnv(Symbol sym) {
         // Get enclosing class of sym, or sym itself if it is a class
         // or package.
-        TypeSymbol ts = (sym.kind != Kinds.PCK)
+        TypeSymbol ts = (sym.kind != PCK)
                         ? sym.enclClass()
                         : (PackageSymbol) sym;
         return (ts != null)
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacTypes.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacTypes.java	Wed Jul 05 20:05:30 2017 +0200
@@ -39,6 +39,8 @@
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.DefinedBy.Api;
 
+import static com.sun.tools.javac.code.Kinds.Kind.*;
+
 /**
  * Utility methods for operating on types.
  *
@@ -328,7 +330,7 @@
             if (t != origin.type) {
                 ClassSymbol c = (ClassSymbol) t.tsym;
                 for (Symbol sym : c.members().getSymbolsByName(m.name)) {
-                    if (sym.kind == Kinds.MTH && m.overrides(sym, origin, types, true)) {
+                    if (sym.kind == MTH && m.overrides(sym, origin, types, true)) {
                         results.add((MethodSymbol) sym);
                     }
                 }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavadocTokenizer.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavadocTokenizer.java	Wed Jul 05 20:05:30 2017 +0200
@@ -30,6 +30,7 @@
 import com.sun.tools.javac.util.*;
 
 import java.nio.*;
+import java.util.regex.Pattern;
 
 import static com.sun.tools.javac.util.LayoutCharacters.*;
 
@@ -450,11 +451,15 @@
                 scanned = true;
                 comment_reader = null;
                 if (docComment != null &&
-                        docComment.matches("(?sm).*^\\s*@deprecated( |$).*")) {
+                        DEPRECATED_PATTERN.matcher(docComment).matches()) {
                     deprecatedFlag = true;
                 }
             }
         }
+        //where:
+            private static final Pattern DEPRECATED_PATTERN =
+                    Pattern.compile("(?sm).*^\\s*@deprecated( |$).*");
+
     }
 
     @Override
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Wed Jul 05 20:05:30 2017 +0200
@@ -75,6 +75,7 @@
 import com.sun.tools.javac.util.Options;
 import com.sun.tools.javac.util.ServiceLoader;
 import static com.sun.tools.javac.code.Lint.LintCategory.PROCESSING;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.main.Option.*;
 import static com.sun.tools.javac.comp.CompileStates.CompileState;
 import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag.*;
@@ -1079,7 +1080,7 @@
             boolean foundError = false;
 
             for (ClassSymbol cs : symtab.classes.values()) {
-                if (cs.kind == Kinds.ERR) {
+                if (cs.kind == ERR) {
                     foundError = true;
                     break;
                 }
@@ -1087,7 +1088,7 @@
 
             if (foundError) {
                 for (ClassSymbol cs : symtab.classes.values()) {
-                    if (cs.classfile != null || cs.kind == Kinds.ERR) {
+                    if (cs.classfile != null || cs.kind == ERR) {
                         cs.reset();
                         cs.type = new ClassType(cs.type.getEnclosingType(), null, cs);
                         if (cs.completer == null) {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/sym/CreateSymbols.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/sym/CreateSymbols.java	Wed Jul 05 20:05:30 2017 +0200
@@ -26,7 +26,6 @@
 package com.sun.tools.javac.sym;
 
 import com.sun.tools.javac.api.JavacTaskImpl;
-import com.sun.tools.javac.code.Kinds;
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.Symbol;
@@ -69,6 +68,8 @@
 import javax.tools.StandardLocation;
 import javax.tools.ToolProvider;
 
+import static com.sun.tools.javac.code.Kinds.Kind.*;
+
 /**
  * Used to generate a "symbol file" representing rt.jar that only
  * includes supported or legacy proprietary API.  Valid annotation
@@ -221,7 +222,7 @@
                 continue;
             }
             TypeSymbol sym = (TypeSymbol)compiler.resolveIdent(className);
-            if (sym.kind != Kinds.TYP) {
+            if (sym.kind != TYP) {
                 if (className.indexOf('$') < 0) {
                     System.err.println("Ignoring (other) " + className + " : " + sym);
                     System.err.println("   " + sym.getClass().getSimpleName() + " " + sym.type);
@@ -263,7 +264,7 @@
             cs.pool = pool;
             writer.writeClass(cs);
             for (Symbol sym : cs.members().getSymbols(NON_RECURSIVE)) {
-                if (sym.kind == Kinds.TYP) {
+                if (sym.kind == TYP) {
                     ClassSymbol nestedClass = (ClassSymbol)sym;
                     nestedClass.complete();
                     writeClass(pool, nestedClass, writer);
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Wed Jul 05 20:05:30 2017 +0200
@@ -37,6 +37,7 @@
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
 import static com.sun.tools.javac.code.Flags.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.TypeTag.BOT;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 import static com.sun.tools.javac.tree.JCTree.Tag.BLOCK;
@@ -339,8 +340,7 @@
     //where
         private static boolean isStaticSym(JCTree tree) {
             Symbol sym = symbol(tree);
-            return (sym.kind == Kinds.TYP ||
-                    sym.kind == Kinds.PCK);
+            return (sym.kind == TYP || sym.kind == PCK);
         }
 
     /** Return true if a tree represents the null literal. */
@@ -876,7 +876,7 @@
         if (!tree.hasTag(SELECT)) return false;
         JCFieldAccess s = (JCFieldAccess) tree;
         Symbol e = symbol(s.selected);
-        return e == null || (e.kind != Kinds.PCK && e.kind != Kinds.TYP);
+        return e == null || (e.kind != PCK && e.kind != TYP);
     }
 
     /** If this tree is an identifier or a field, set its symbol, otherwise skip.
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Wed Jul 05 20:05:30 2017 +0200
@@ -36,7 +36,7 @@
 import com.sun.tools.javac.tree.JCTree.*;
 
 import static com.sun.tools.javac.code.Flags.*;
-import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.TypeTag.*;
 
 /** Factory class for trees.
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Wed Jul 05 20:05:30 2017 +0200
@@ -31,7 +31,6 @@
 import java.util.Locale;
 import java.util.Map;
 
-import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.code.Printer;
 import com.sun.tools.javac.code.Symbol;
 import com.sun.tools.javac.code.Symbol.*;
@@ -42,6 +41,8 @@
 
 import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.code.Flags.*;
+import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.util.LayoutCharacters.*;
 import static com.sun.tools.javac.util.RichDiagnosticFormatter.RichConfiguration.*;
 
@@ -305,7 +306,7 @@
                     Symbol s2 = s;
                     while (s2.type.hasTag(CLASS) &&
                             s2.type.getEnclosingType().hasTag(CLASS) &&
-                            s2.owner.kind == Kinds.TYP) {
+                            s2.owner.kind == TYP) {
                         l = l.prepend(s2.getSimpleName());
                         s2 = s2.owner;
                     }
@@ -562,7 +563,7 @@
                     //this is a true typevar
                     JCDiagnostic d = diags.fragment("where.typevar" +
                         (boundErroneous ? ".1" : ""), t, bounds,
-                        Kinds.kindName(t.tsym.location()), t.tsym.location());
+                        kindName(t.tsym.location()), t.tsym.location());
                     whereClauses.get(WhereClauseKind.TYPEVAR).put(t, d);
                     symbolPreprocessor.visit(t.tsym.location(), null);
                     visit(bounds);
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/dependencies/TypeAndSupertypesDependency.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/dependencies/TypeAndSupertypesDependency.java	Wed Jul 05 20:05:30 2017 +0200
@@ -36,6 +36,7 @@
 import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.code.Type;
 
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 
 public class TypeAndSupertypesDependency implements Dependency {
 
@@ -61,7 +62,7 @@
 
     @Override
     public Set<PackageSymbol> getPackages() {
-        if (type.kind == Kinds.ERR)
+        if (type.kind == ERR)
             return Collections.emptySet();
         if (type instanceof ClassSymbol) {
             return allSupertypes(type).stream()
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/IdleResetSjavac.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/IdleResetSjavac.java	Wed Jul 05 20:05:30 2017 +0200
@@ -30,7 +30,6 @@
 import java.util.Set;
 import java.util.Timer;
 import java.util.TimerTask;
-import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * An sjavac implementation that keeps track of idleness and shuts down the
@@ -47,10 +46,10 @@
 public class IdleResetSjavac implements Sjavac {
 
     private final Sjavac delegate;
-    private final AtomicInteger outstandingCalls = new AtomicInteger();
     private final Terminable toShutdown;
     private final Timer idlenessTimer = new Timer();
     private final long idleTimeout;
+    private int outstandingCalls = 0;
 
     // Class invariant: idlenessTimerTask != null <-> idlenessTimerTask is scheduled
     private TimerTask idlenessTimerTask;
@@ -94,9 +93,9 @@
         }
     }
 
-    private void startCall() {
+    private synchronized void startCall() {
         // Was there no outstanding calls before this call?
-        if (outstandingCalls.incrementAndGet() == 1) {
+        if (++outstandingCalls == 1) {
             // Then the timer task must have been scheduled
             if (idlenessTimerTask == null)
                 throw new IllegalStateException("Idle timeout already cancelled");
@@ -106,8 +105,8 @@
         }
     }
 
-    private void endCall() {
-        if (outstandingCalls.decrementAndGet() == 0) {
+    private synchronized void endCall() {
+        if (--outstandingCalls == 0) {
             // No more outstanding calls. Schedule timeout.
             scheduleTimeout();
         }
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/AnnotationTypeDocImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/AnnotationTypeDocImpl.java	Wed Jul 05 20:05:30 2017 +0200
@@ -28,13 +28,14 @@
 import com.sun.javadoc.*;
 
 import com.sun.source.util.TreePath;
-import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.code.Symbol;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.util.List;
 
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 
+import static com.sun.tools.javac.code.Kinds.Kind.*;
+
 /**
  * Represents an annotation type.
  *
@@ -94,7 +95,7 @@
     public AnnotationTypeElementDoc[] elements() {
         List<AnnotationTypeElementDoc> elements = List.nil();
         for (Symbol sym : tsym.members().getSymbols(NON_RECURSIVE)) {
-            if (sym != null && sym.kind == Kinds.MTH) {
+            if (sym != null && sym.kind == MTH) {
                 MethodSymbol s = (MethodSymbol)sym;
                 elements = elements.prepend(env.getAnnotationTypeElementDoc(s));
             }
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/ClassDocImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/ClassDocImpl.java	Wed Jul 05 20:05:30 2017 +0200
@@ -41,6 +41,7 @@
 import com.sun.source.util.TreePath;
 import com.sun.tools.javac.code.Flags;
 import com.sun.tools.javac.code.Kinds;
+import com.sun.tools.javac.code.Kinds.KindSelector;
 import com.sun.tools.javac.code.Scope;
 import com.sun.tools.javac.code.Symbol;
 import com.sun.tools.javac.code.Symbol.*;
@@ -58,7 +59,7 @@
 import com.sun.tools.javac.util.Name;
 import com.sun.tools.javac.util.Names;
 import com.sun.tools.javac.util.Position;
-import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
@@ -617,7 +618,7 @@
         List<MethodDocImpl> methods = List.nil();
         for (Symbol sym :tsym.members().getSymbols(NON_RECURSIVE)) {
             if (sym != null
-                && sym.kind == Kinds.MTH
+                && sym.kind == MTH
                 && sym.name != names.init
                 && sym.name != names.clinit) {
                 MethodSymbol s = (MethodSymbol)sym;
@@ -652,7 +653,7 @@
         List<ConstructorDocImpl> constructors = List.nil();
         for (Symbol sym : tsym.members().getSymbols(NON_RECURSIVE)) {
             if (sym != null &&
-                sym.kind == Kinds.MTH && sym.name == names.init) {
+                sym.kind == MTH && sym.name == names.init) {
                 MethodSymbol s = (MethodSymbol)sym;
                 if (!filter || env.shouldDocument(s)) {
                     constructors = constructors.prepend(env.getConstructorDoc(s));
@@ -687,7 +688,7 @@
             l.append(this);
             List<ClassDocImpl> more = List.nil();
             for (Symbol sym : tsym.members().getSymbols(NON_RECURSIVE)) {
-                if (sym != null && sym.kind == Kinds.TYP) {
+                if (sym != null && sym.kind == TYP) {
                     ClassSymbol s = (ClassSymbol)sym;
                     ClassDocImpl c = env.getClassDoc(s);
                     if (c.isSynthetic()) continue;
@@ -714,7 +715,7 @@
     public ClassDoc[] innerClasses(boolean filter) {
         ListBuffer<ClassDocImpl> innerClasses = new ListBuffer<>();
         for (Symbol sym : tsym.members().getSymbols(NON_RECURSIVE)) {
-            if (sym != null && sym.kind == Kinds.TYP) {
+            if (sym != null && sym.kind == TYP) {
                 ClassSymbol s = (ClassSymbol)sym;
                 if ((s.flags_field & Flags.SYNTHETIC) != 0) continue;
                 if (!filter || env.isVisible(s)) {
@@ -810,7 +811,7 @@
 
             Scope s = compenv.toplevel.namedImportScope;
             for (Symbol sym : s.getSymbolsByName(names.fromString(className))) {
-                if (sym.kind == Kinds.TYP) {
+                if (sym.kind == TYP) {
                     ClassDoc c = env.getClassDoc((ClassSymbol)sym);
                     return c;
                 }
@@ -818,7 +819,7 @@
 
             s = compenv.toplevel.starImportScope;
             for (Symbol sym : s.getSymbolsByName(names.fromString(className))) {
-                if (sym.kind == Kinds.TYP) {
+                if (sym.kind == TYP) {
                     ClassDoc c = env.getClassDoc((ClassSymbol)sym);
                     return c;
                 }
@@ -931,7 +932,7 @@
             // attempt to emulate the old behavior.
             MethodSymbol lastFound = null;
             for (Symbol sym : tsym.members().getSymbolsByName(names.fromString(methodName))) {
-                if (sym.kind == Kinds.MTH) {
+                if (sym.kind == MTH) {
                     //### Should intern methodName as Name.
                     if (sym.name.toString().equals(methodName)) {
                         lastFound = (MethodSymbol)sym;
@@ -944,7 +945,7 @@
         } else {
             for (Symbol sym : tsym.members().getSymbolsByName(names.fromString(methodName))) {
                 if (sym != null &&
-                    sym.kind == Kinds.MTH) {
+                    sym.kind == MTH) {
                     //### Should intern methodName as Name.
                     if (hasParameterTypes((MethodSymbol)sym, paramTypes)) {
                         return env.getMethodDoc((MethodSymbol)sym);
@@ -1005,7 +1006,7 @@
                                           String[] paramTypes) {
         Names names = tsym.name.table.names;
         for (Symbol sym : tsym.members().getSymbolsByName(names.fromString("<init>"))) {
-            if (sym.kind == Kinds.MTH) {
+            if (sym.kind == MTH) {
                 if (hasParameterTypes((MethodSymbol)sym, paramTypes)) {
                     return env.getConstructorDoc((MethodSymbol)sym);
                 }
@@ -1047,7 +1048,7 @@
         searched.add(this);
 
         for (Symbol sym : tsym.members().getSymbolsByName(names.fromString(fieldName))) {
-            if (sym.kind == Kinds.VAR) {
+            if (sym.kind == VAR) {
                 //### Should intern fieldName as Name.
                 return env.getFieldDoc((VarSymbol)sym);
             }
@@ -1111,7 +1112,7 @@
             if (t.hasTag(IMPORT)) {
                 JCTree imp = ((JCImport) t).qualid;
                 if ((TreeInfo.name(imp) != asterisk) &&
-                        (imp.type.tsym.kind & Kinds.TYP) != 0) {
+                    imp.type.tsym.kind.matches(KindSelector.TYP)) {
                     importedClasses.append(
                             env.getClassDoc((ClassSymbol)imp.type.tsym));
                 }
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/JavadocEnter.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/JavadocEnter.java	Wed Jul 05 20:05:30 2017 +0200
@@ -28,7 +28,6 @@
 import javax.tools.JavaFileObject;
 
 import com.sun.source.util.TreePath;
-import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.comp.Enter;
 import com.sun.tools.javac.tree.JCTree.*;
@@ -36,6 +35,8 @@
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
 import com.sun.tools.javac.util.List;
 
+import static com.sun.tools.javac.code.Kinds.Kind.*;
+
 /**
  *  Javadoc's own enter phase does a few things above and beyond that
  *  done by javac.
@@ -95,7 +96,7 @@
     public void visitClassDef(JCClassDecl tree) {
         super.visitClassDef(tree);
         if (tree.sym == null) return;
-        if (tree.sym.kind == Kinds.TYP || tree.sym.kind == Kinds.ERR) {
+        if (tree.sym.kind == TYP || tree.sym.kind == ERR) {
             ClassSymbol c = tree.sym;
             docenv.makeClassDoc(c, docenv.getTreePath(env.toplevel, tree));
         }
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/JavadocMemberEnter.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/JavadocMemberEnter.java	Wed Jul 05 20:05:30 2017 +0200
@@ -27,7 +27,6 @@
 
 import com.sun.source.util.TreePath;
 import com.sun.tools.javac.code.Flags;
-import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.comp.MemberEnter;
 import com.sun.tools.javac.tree.JCTree;
@@ -35,6 +34,7 @@
 import com.sun.tools.javac.util.Context;
 
 import static com.sun.tools.javac.code.Flags.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 
 /**
  *  Javadoc's own memberEnter phase does a few things above and beyond that
@@ -74,7 +74,7 @@
     public void visitMethodDef(JCMethodDecl tree) {
         super.visitMethodDef(tree);
         MethodSymbol meth = tree.sym;
-        if (meth == null || meth.kind != Kinds.MTH) return;
+        if (meth == null || meth.kind != MTH) return;
         TreePath treePath = docenv.getTreePath(env.toplevel, env.enclClass, tree);
         if (meth.isConstructor())
             docenv.makeConstructorDoc(meth, treePath);
@@ -102,7 +102,7 @@
         }
         super.visitVarDef(tree);
         if (tree.sym != null &&
-                tree.sym.kind == Kinds.VAR &&
+                tree.sym.kind == VAR &&
                 !isParameter(tree.sym)) {
             docenv.makeFieldDoc(tree.sym, docenv.getTreePath(env.toplevel, env.enclClass, tree));
         }
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/SeeTagImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/SeeTagImpl.java	Wed Jul 05 20:05:30 2017 +0200
@@ -29,12 +29,13 @@
 import java.util.Locale;
 
 import com.sun.javadoc.*;
-import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.code.Printer;
 import com.sun.tools.javac.code.Symbol;
 import com.sun.tools.javac.code.Type.CapturedType;
 import com.sun.tools.javac.util.*;
 
+import static com.sun.tools.javac.code.Kinds.Kind.*;
+
 /**
  * Represents a see also documentation tag.
  * The @see tag can be plain text, or reference a class or member.
@@ -132,7 +133,7 @@
         sb.append("+++ ").append(file).append(": ")
                 .append(name()).append(" ").append(seetext).append(": ");
         sb.append(sym.getKind()).append(" ");
-        if (sym.kind == Kinds.MTH || sym.kind == Kinds.VAR)
+        if (sym.kind == MTH || sym.kind == VAR)
             sb.append(printer.visit(sym.owner, locale)).append(".");
         sb.append(printer.visit(sym, locale));
 
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/SerializedForm.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/SerializedForm.java	Wed Jul 05 20:05:30 2017 +0200
@@ -32,6 +32,7 @@
 import com.sun.tools.javac.code.Symbol.VarSymbol;
 import com.sun.tools.javac.util.*;
 
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 
 /**
@@ -158,7 +159,7 @@
          * so must lookup by ClassSymbol, not by ClassDocImpl.
          */
         for (Symbol sym : def.members().getSymbolsByName(names.fromString(SERIALIZABLE_FIELDS))) {
-            if (sym.kind == Kinds.VAR) {
+            if (sym.kind == VAR) {
                 VarSymbol f = (VarSymbol)sym;
                 if ((f.flags() & Flags.STATIC) != 0 &&
                     (f.flags() & Flags.PRIVATE) != 0) {
@@ -179,7 +180,7 @@
                                                   ClassSymbol def,
                                                   ClassDocImpl cd) {
         for (Symbol sym : def.members().getSymbols(NON_RECURSIVE)) {
-            if (sym != null && sym.kind == Kinds.VAR) {
+            if (sym != null && sym.kind == VAR) {
                 VarSymbol f = (VarSymbol)sym;
                 if ((f.flags() & Flags.STATIC) == 0 &&
                     (f.flags() & Flags.TRANSIENT) == 0) {
@@ -208,7 +209,7 @@
         Names names = def.name.table.names;
 
         for (Symbol sym : def.members().getSymbolsByName(names.fromString(methodName))) {
-            if (sym.kind == Kinds.MTH) {
+            if (sym.kind == MTH) {
                 MethodSymbol md = (MethodSymbol)sym;
                 if ((md.flags() & Flags.STATIC) == 0) {
                     /*
@@ -240,7 +241,7 @@
 
             // Look for a FieldDocImpl that is documented by serialFieldTagImpl.
             for (Symbol sym : def.members().getSymbolsByName(fieldName)) {
-                if (sym.kind == Kinds.VAR) {
+                if (sym.kind == VAR) {
                     VarSymbol f = (VarSymbol) sym;
                     FieldDocImpl fdi = env.getFieldDoc(f);
                     ((SerialFieldTagImpl) (tag)).mapToFieldDocImpl(fdi);
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/TypeVariableImpl.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/TypeVariableImpl.java	Wed Jul 05 20:05:30 2017 +0200
@@ -30,6 +30,7 @@
 import com.sun.tools.javac.code.Attribute;
 import com.sun.tools.javac.code.Attribute.TypeCompound;
 import com.sun.tools.javac.code.Kinds;
+import com.sun.tools.javac.code.Kinds.KindSelector;
 import com.sun.tools.javac.code.Symbol;
 import com.sun.tools.javac.code.Symbol.ClassSymbol;
 import com.sun.tools.javac.code.Symbol.MethodSymbol;
@@ -70,7 +71,7 @@
      */
     public ProgramElementDoc owner() {
         Symbol osym = type.tsym.owner;
-        if ((osym.kind & Kinds.TYP) != 0) {
+        if (osym.kind.matches(KindSelector.TYP)) {
             return env.getClassDoc((ClassSymbol)osym);
         }
         Names names = osym.name.table.names;
--- a/langtools/test/tools/javac/6889255/T6889255.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/test/tools/javac/6889255/T6889255.java	Wed Jul 05 20:05:30 2017 +0200
@@ -31,7 +31,6 @@
 import java.util.*;
 import javax.tools.StandardLocation;
 import com.sun.tools.javac.code.Flags;
-import com.sun.tools.javac.code.Kinds;
 import com.sun.tools.javac.code.Symbol;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.Symtab;
@@ -385,7 +384,7 @@
             for (Symbol s : sym.members_field.getSymbols(NON_RECURSIVE)) {
                 System.err.println("Checking member " + s);
                 switch (s.kind) {
-                    case Kinds.TYP: {
+                    case TYP: {
                         String name = s.flatName().toString();
                         if (!classes.contains(name)) {
                             classes.add(name);
@@ -393,7 +392,7 @@
                         }
                         break;
                     }
-                    case Kinds.MTH:
+                    case MTH:
                         verify((MethodSymbol) s, expectNames);
                         break;
                 }
--- a/langtools/test/tools/javac/T6558476.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/test/tools/javac/T6558476.java	Wed Jul 05 20:05:30 2017 +0200
@@ -23,8 +23,10 @@
 
 /*
  * @test
- * @bug 6558476
+ * @bug 6558476 5071352
  * @summary com/sun/tools/javac/Main.compile don't release file handles on return
+ * @library /tools/lib
+ * @build ToolBox
  * @run main/othervm -Xmx512m -Xms512m  T6558476
  */
 
@@ -37,66 +39,34 @@
 import com.sun.tools.javac.Main;
 
 public class T6558476 {
-    private static File copyFileTo(File file, File directory) throws IOException {
-        File newFile = new File(directory, file.getName());
-        FileInputStream fis = null;
-        FileOutputStream fos = null;
-        try {
-            fis = new FileInputStream(file);
-            fos = new FileOutputStream(newFile);
-            byte buff[] = new byte[1024];
-            int val;
-            while ((val = fis.read(buff)) > 0)
-                fos.write(buff, 0, val);
-        } finally {
-            if (fis != null)
-                fis.close();
-            if (fos != null)
-                fos.close();
-        }
-        return newFile;
-    }
 
-    private static String generateJavaClass(String className) {
-        StringBuffer sb = new StringBuffer();
-        sb.append("import sun.net.spi.nameservice.dns.DNSNameService;\n");
-        sb.append("public class ");
-        sb.append(className);
-        sb.append(" {\n");
-        sb.append("  public void doStuff() {\n");
-        sb.append("    DNSNameService dns = null;\n");
-        sb.append("  }\n");
-        sb.append("}\n");
-        return sb.toString();
-    }
+    private static final String classFoo = "class Foo {}";
+    private static final String classMyFoo =
+        "class MyFoo {\n" +
+         "  public static void main(String[] args) {\n"+
+         "    new Foo();\n"+
+         "  }\n"+
+        "}";
 
     public static void main(String[] args) throws IOException {
-        File javaHomeDir = new File(System.getProperty("java.home"));
-        File outputDir = new File("outputDir" + new Random().nextInt(65536));
-        outputDir.mkdir();
-        outputDir.deleteOnExit();
+        ToolBox tb = new ToolBox();
 
-        File dnsjarfile = new File(javaHomeDir, "lib" + File.separator + "ext" + File.separator + "dnsns.jar");
-        File tmpJar = copyFileTo(dnsjarfile, outputDir);
-        String className = "TheJavaFile";
-        File javaFile = new File(outputDir, className + ".java");
-        javaFile.deleteOnExit();
-        FileOutputStream fos = new FileOutputStream(javaFile);
-        fos.write(generateJavaClass(className).getBytes());
-        fos.close();
+        tb.new JavacTask()
+          .sources(classFoo)
+          .run();
+        tb.new JarTask("foo.jar")
+          .files("Foo.class")
+          .run();
 
-        int rc = Main.compile(new String[]{"-d", outputDir.getPath(),
-                    "-classpath",
-                    tmpJar.getPath(),
-                    javaFile.getAbsolutePath()});
-        if (rc != 0) {
-            throw new Error("Couldn't compile the file (exit code=" + rc + ")");
-        }
-
-        if (tmpJar.delete()) {
+        tb.new JavacTask()
+          .classpath("foo.jar")
+          .sources(classMyFoo)
+          .run();
+        File foo_jar = new File("foo.jar");
+        if (foo_jar.delete()) {
             System.out.println("jar file successfully deleted");
         } else {
-            throw new Error("Error deleting file \"" + tmpJar.getPath() + "\"");
+            throw new Error("Error deleting file \"" + foo_jar.getPath() + "\"");
         }
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/FinalStringInNested.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8054448
+ * @summary Verify that constant strings in nested classes in anonymous classes
+ *          can be used in annotations.
+ * @compile FinalStringInNested.java
+ */
+
+public class FinalStringInNested {
+
+    public void f() {
+        Object o = new Object() {
+            @FinalStringInNested.Annotation(Nested.ID)
+            class Nested {
+                static final String ID = "B";
+            }
+        };
+    }
+
+    @interface Annotation {
+        String value();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/T8057800/NPEMethodReferenceAndGenericsTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8057800
+ * @summary Method reference with generic type creates NPE when compiling
+ * @compile NPEMethodReferenceAndGenericsTest.java
+ */
+
+public class NPEMethodReferenceAndGenericsTest {
+    public <T> void foo(java.util.Comparator<? super T> comparator) {}
+
+    public <C extends Comparable<? super C>> void foo() {
+        foo(C::compareTo);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/linenumbers/NestedLineNumberTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8061778
+ * @summary  Wrong LineNumberTable for default constructors
+ */
+
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.ConstantPoolException;
+import com.sun.tools.classfile.Method;
+import com.sun.tools.classfile.Attribute;
+import com.sun.tools.classfile.Code_attribute;
+import com.sun.tools.classfile.LineNumberTable_attribute;
+import com.sun.tools.classfile.LineNumberTable_attribute.Entry;
+
+import java.io.IOException;
+
+public class NestedLineNumberTest {
+
+    public static void main(String[] args) throws Exception {
+        Entry[] lines = findEntries();
+        if (lines == null || lines.length != 1) {
+            int found = lines == null ? 0 : lines.length;
+            error(String.format("LineNumberTable contains wrong number of entries - expected %d, found %d", 1, found));
+        }
+
+        int line = lines[0].line_number;
+        if (line != 78) {
+            error(String.format("LineNumberTable contains wrong line number - expected %d, found %d", 78, line));
+        }
+    }
+
+    static Entry[] findEntries() throws IOException, ConstantPoolException {
+        ClassFile self = ClassFile.read(NestedLineNumberTest.Test.class.getResourceAsStream("NestedLineNumberTest$Test.class"));
+        for (Method m : self.methods) {
+            if ("<init>".equals(m.getName(self.constant_pool))) {
+                Code_attribute code_attribute = (Code_attribute)m.attributes.get(Attribute.Code);
+                for (Attribute at : code_attribute.attributes) {
+                    if (Attribute.LineNumberTable.equals(at.getName(self.constant_pool))) {
+                        return ((LineNumberTable_attribute)at).line_number_table;
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    static void error(String msg) {
+        throw new AssertionError(msg);
+    }
+
+    // The default constructor in this class should get only one LineNumberTable entry,
+    // pointing to the first line of the declaration of class Test.
+    static class Test {
+        static class Empty { }
+    }
+}
--- a/langtools/test/tools/javac/scope/HashCollisionTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/test/tools/javac/scope/HashCollisionTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -41,6 +41,8 @@
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.file.JavacFileManager;
 
+import static com.sun.tools.javac.code.Kinds.Kind.*;
+
 public class HashCollisionTest {
     public static void main(String... args) throws Exception {
         new HashCollisionTest().run();
@@ -116,7 +118,7 @@
         ImportFilter typeFilter = new ImportFilter() {
             @Override
             public boolean accepts(Scope origin, Symbol sym) {
-                return sym.kind == Kinds.TYP;
+                return sym.kind == TYP;
             }
         };
         starImportScope.importAll(fromScope, fromScope, typeFilter, false);
--- a/langtools/test/tools/javac/scope/StarImportTest.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/test/tools/javac/scope/StarImportTest.java	Wed Jul 05 20:05:30 2017 +0200
@@ -38,7 +38,7 @@
 import com.sun.tools.javac.file.JavacFileManager;
 import com.sun.tools.javac.util.*;
 
-import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.Kinds.Kind.*;
 
 public class StarImportTest {
     public static void main(String... args) throws Exception {
--- a/langtools/test/tools/javap/T6729471.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/langtools/test/tools/javap/T6729471.java	Wed Jul 05 20:05:30 2017 +0200
@@ -25,7 +25,10 @@
 /*
  * @test
  * @bug 6729471
- * @summary javap does not output inner interfaces of an interface
+ * @summary javap should accept class files on the command line
+ * @library /tools/lib
+ * @build ToolBox
+ * @run main T6729471
  */
 
 import java.io.*;
@@ -57,30 +60,26 @@
         verify(new File(testClasses, "T6729471.class").toURI().toString(),
                 "public static void main(java.lang.String...)");
 
-        // jar url: rt.jar
-        File java_home = new File(System.getProperty("java.home"));
-        if (java_home.getName().equals("jre"))
-            java_home = java_home.getParentFile();
-        File rt_jar = new File(new File(new File(java_home, "jre"), "lib"), "rt.jar");
+        // jar url
+        // Create a temp jar
+        ToolBox tb = new ToolBox();
+        tb.new JavacTask()
+          .sources("class Foo { public void sayHello() {} }")
+          .run();
+        String foo_jar = "foo.jar";
+        tb.new JarTask(foo_jar)
+          .files("Foo.class")
+          .run();
+        File foo_jarFile = new File(foo_jar);
+
+        // Verify
         try {
-            verify("jar:" + rt_jar.toURL() + "!/java/util/Map.class",
-                "public abstract boolean containsKey(java.lang.Object)");
+            verify("jar:" + foo_jarFile.toURL() + "!/Foo.class",
+                "public void sayHello()");
         } catch (MalformedURLException e) {
             error(e.toString());
         }
 
-        // jar url: ct.sym, if it exists
-        File ct_sym = new File(new File(java_home, "lib"), "ct.sym");
-        if (ct_sym.exists()) {
-            try {
-                verify("jar:" + ct_sym.toURL() + "!/META-INF/sym/rt.jar/java/util/Map.class",
-                    "public abstract boolean containsKey(java.lang.Object)");
-            } catch (MalformedURLException e) {
-                error(e.toString());
-            }
-        } else
-            System.err.println("warning: ct.sym not found");
-
         if (errors > 0)
             throw new Error(errors + " found.");
     }
--- a/make/CompileJavaModules.gmk	Wed Jul 05 20:04:47 2017 +0200
+++ b/make/CompileJavaModules.gmk	Wed Jul 05 20:05:30 2017 +0200
@@ -247,14 +247,6 @@
 # Exclude building of IIOP transport for RMI Connector
 java.management_EXCLUDES := com/sun/jmx/remote/protocol/iiop
 
-# Why is this in the open source tree?
-ifdef OPENJDK
-  java.management_EXCLUDES := \
-      com/sun/jmx/snmp \
-      sun/management/snmp \
-      #
-endif
-
 ifeq ($(RMICONNECTOR_IIOP), false)
   java.management_EXCLUDES += com/sun/jmx/remote/protocol/iiop
 endif
@@ -479,6 +471,11 @@
   $1_DEPS := $$(call FindDepsForModule, $1)
 
   $1_CLASSPATH := $$(addprefix $(JDK_OUTPUTDIR)/modules/,$$($1_DEPS))
+  # When crypto classes are prebuilt, need to look for classes already in 
+  # output dir.
+  ifneq ($(BUILD_CRYPTO), true)
+    $1_CLASSPATH += $(JDK_OUTPUTDIR)/modules/$1
+  endif
   ifeq ($1, jdk.hotspot.agent)
     ## The source of this module is compiled elsewhere, hotspot, and imported.
     ## Service types are required in the classpath when compiing module-info
--- a/make/Main.gmk	Wed Jul 05 20:04:47 2017 +0200
+++ b/make/Main.gmk	Wed Jul 05 20:05:30 2017 +0200
@@ -286,7 +286,7 @@
 
 test:
 	($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
-	    JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_OUTPUT_DIR) \
+	    JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_OUTPUTDIR) \
 	    ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true
 
 test-make:
--- a/make/common/Modules.gmk	Wed Jul 05 20:04:47 2017 +0200
+++ b/make/common/Modules.gmk	Wed Jul 05 20:05:30 2017 +0200
@@ -41,9 +41,6 @@
     $(NASHORN_TOPDIR)/src \
     #
 
-# There are snmp classes in the open but they are not included in OpenJDK
-JAVA_MODULES_FILTER := jdk.snmp
-
 # Find all modules with java sources by looking in the source dirs
 define FindJavaModules
   $(filter-out $(JAVA_MODULES_FILTER), $(sort $(notdir \
--- a/make/common/NON_CORE_PKGS.gmk	Wed Jul 05 20:04:47 2017 +0200
+++ b/make/common/NON_CORE_PKGS.gmk	Wed Jul 05 20:05:30 2017 +0200
@@ -94,7 +94,8 @@
 endif
 
 JDK_PKGS = jdk \
-      jdk.net
+      jdk.net \
+      jdk.management.cmm
 
 # non-core packages in rt.jar
 NON_CORE_PKGS = $(DOMAPI_PKGS) \
--- a/modules.xml	Wed Jul 05 20:04:47 2017 +0200
+++ b/modules.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -1579,6 +1579,10 @@
     <depend>jdk.crypto.ec</depend>
   </module>
   <module>
+    <name>jdk.crypto.ucrypto</name>
+    <depend>java.base</depend>
+  </module>
+  <module>
     <name>jdk.deploy.osx</name>
     <depend>java.base</depend>
     <depend>java.desktop</depend>
--- a/nashorn/.hgtags	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/.hgtags	Wed Jul 05 20:05:30 2017 +0200
@@ -269,3 +269,4 @@
 b374d8910e7f8de2b7ecacee9ae4cad88f23feab jdk9-b33
 4ece2dad8c37f520f1ccc1cf84870f362c8eb9d6 jdk9-b34
 63b8da4c958c3bbadfff082c547983f5daa50c0f jdk9-b35
+10fe62bc188476abb025e55f55128cbfecf24584 jdk9-b36
--- a/nashorn/bin/runopt.sh	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/bin/runopt.sh	Wed Jul 05 20:05:30 2017 +0200
@@ -69,7 +69,6 @@
 
 if [ -z $JFR_FILENAME ]; then
     JFR_FILENAME="./nashorn_$(date|sed "s/ /_/g"|sed "s/:/_/g").jfr"
-    echo "Using default JFR filename: ${JFR_FILENAME}..."
 fi
 
 # Flight recorder
--- a/nashorn/docs/DEVELOPER_README	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/docs/DEVELOPER_README	Wed Jul 05 20:05:30 2017 +0200
@@ -25,6 +25,14 @@
 > java -Dnashorn.args="--lazy-complation --log=compiler" large-java-app-with-nashorn.jar 
 > ant -Dnashorn.args="--log=codegen" antjob
 
+SYSTEM PROPERTY: -Dnashorn.args.prepend=<string>
+
+This property behaves like nashorn.args, but adds the given arguments
+before the existing ones instead of after them. Later arguments will
+overwrite earlier ones, so this is useful for setting default arguments
+that can be overwritten.
+
+
 SYSTEM PROPERTY: -Dnashorn.unstable.relink.threshold=x
 
 This property controls how many call site misses are allowed before a 
@@ -42,533 +50,38 @@
 The default value is 0x8000 (32768).
 
 
-SYSTEM PROPERTY: -Dnashorn.compiler.intarithmetic
-
-(and integer arithmetic in general)
-
-<currently disabled - this is being refactored for update releases> 
-
-Arithmetic operations in Nashorn (except bitwise ones) typically
-coerce the operands to doubles (as per the JavaScript spec). To switch
-this off and remain in integer mode, for example for "var x = a&b; var
-y = c&d; var z = x*y;", use this flag. This will force the
-multiplication of variables that are ints to be done with the IMUL
-bytecode and the result "z" to become an int.
-
-WARNING: Note that is is experimental only to ensure that type support
-exists for all primitive types. The generated code is unsound. This
-will be the case until we do optimizations based on it. There is a CR
-in Nashorn to do better range analysis, and ensure that this is only
-done where the operation can't overflow into a wider type. Currently
-no overflow checking is done, so at the moment, until range analysis
-has been completed, this option is turned off.
-
-We've experimented by using int arithmetic for everything and putting
-overflow checks afterwards, which would recompute the operation with
-the correct precision, but have yet to find a configuration where this
-is faster than just using doubles directly, even if the int operation
-does not overflow. Getting access to a JVM intrinsic that does branch
-on overflow would probably alleviate this.
-
-The future:
-
-We are transitioning to an optimistic type system that uses int
-arithmetic everywhere until proven wrong. The problem here is mostly
-catch an overflow exception and rolling back the state to a new method
-with less optimistic assumptions for an operation at a particular
-program point. This will most likely not be in the Java 8.0 release
-but likely end up in an update release
-
-For Java 8, several java.lang.Math methods like addExact, subExact and
-mulExact are available to help us. Experiments intrinsifying these
-show a lot of promise, and we have devised a system that basically
-does on stack replacement with exceptions in bytecode to revert
-erroneous assumptions. An explanation of how this works and what we
-are doing can be found here:
-http://www.slideshare.net/lagergren/lagergren-jvmls2013final
-
-Experiments with this show significant ~x2-3 performance increases on
-pretty much everything, provided that optimistic assumptions don't
-fail much. It will affect warmup time negatively, depending on how
-many erroneous too optimistic assumptions are placed in the code at
-compile time. We don't think this will be much of an issue.
-
-For example for a small benchmark that repeatedly executes this
-method taken from the Crypto Octane benchmark 
-
-function am3(i,x,w,j,c,n) {
-  var this_array = this.array;
-  var w_array    = w.array;
-  var xl = x&0x3fff, xh = x>>14;
-  while(--n >= 0) {
-    var l = this_array[i]&0x3fff;
-    var h = this_array[i++]>>14;
-    var m = xh*l+h*xl;
-    l = xl*l+((m&0x3fff)<<14)+w_array[j]+c;
-    c = (l>>28)+(m>>14)+xh*h;
-    w_array[j++] = l&0xfffffff;
-  }
-
-  return c;
-}
-
-The performance increase more than doubles. We are also working hard
-with the code generation team in the Java Virtual Machine to fix
-things that are lacking in invokedynamic performance, which is another
-area where a lot of ongoing performance work takes place
-
-"Pessimistic" bytecode for am3, guaranteed to be semantically correct:
+SYSTEM PROPERTY: -Dnashorn.serialize.compression=<x>
 
-// access flags 0x9
-  public static am3(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
-   L0
-    LINENUMBER 12 L0
-    ALOAD 0
-    INVOKEDYNAMIC dyn:getProp|getElem|getMethod:array(Ljava/lang/Object;)Ljava/lang/Object; [
-      // handle kind 0x6 : INVOKESTATIC
-      jdk/nashorn/internal/runtime/linker/Bootstrap.bootstrap((Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;I)Ljava/lang/invoke/CallSite;)
-      // arguments:
-      0
-    ]
-    ASTORE 8
-   L1
-    LINENUMBER 13 L1
-    ALOAD 3
-    INVOKEDYNAMIC dyn:getProp|getElem|getMethod:array(Ljava/lang/Object;)Ljava/lang/Object; [
-      // handle kind 0x6 : INVOKESTATIC
-      jdk/nashorn/internal/runtime/linker/Bootstrap.bootstrap((Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;I)Ljava/lang/invoke/CallSite;)
-      // arguments:
-      0
-    ]
-    ASTORE 9
-   L2
-    LINENUMBER 14 L2
-    ALOAD 2
-    INVOKESTATIC jdk/nashorn/internal/runtime/JSType.toInt32 (Ljava/lang/Object;)I
-    SIPUSH 16383
-    IAND
-    ISTORE 10
-    ALOAD 2
-    INVOKESTATIC jdk/nashorn/internal/runtime/JSType.toInt32 (Ljava/lang/Object;)I
-    BIPUSH 14
-    ISHR
-    ISTORE 11
-   L3
-    LINENUMBER 15 L3
-    GOTO L4
-   L5
-    LINENUMBER 16 L5
-   FRAME FULL [java/lang/Object java/lang/Object java/lang/Object java/lang/Object java/lang/Object java/lang/Object java/lang/Double T java/lang/Object java/lang/Object I I] []
-    ALOAD 8
-    ALOAD 1
-    INVOKEDYNAMIC dyn:getElem|getProp|getMethod(Ljava/lang/Object;Ljava/lang/Object;)I [
-      // handle kind 0x6 : INVOKESTATIC
-      jdk/nashorn/internal/runtime/linker/Bootstrap.bootstrap((Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;I)Ljava/lang/invoke/CallSite;)
-      // arguments:
-      0
-    ]
-    SIPUSH 16383
-    IAND
-    INVOKESTATIC java/lang/Integer.valueOf (I)Ljava/lang/Integer;
-    ASTORE 12
-   L6
-    LINENUMBER 17 L6
-    ALOAD 8
-    ALOAD 1
-    INVOKESTATIC jdk/nashorn/internal/runtime/JSType.toNumber (Ljava/lang/Object;)D
-    DUP2
-    DCONST_1
-    DADD
-    INVOKESTATIC java/lang/Double.valueOf (D)Ljava/lang/Double;
-    ASTORE 1
-    INVOKEDYNAMIC dyn:getElem|getProp|getMethod(Ljava/lang/Object;D)I [
-      // handle kind 0x6 : INVOKESTATIC
-      jdk/nashorn/internal/runtime/linker/Bootstrap.bootstrap((Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;I)Ljava/lang/invoke/CallSite;)
-      // arguments:
-      0
-    ]
-    BIPUSH 14
-    ISHR
-    ISTORE 13
-   L7
-    LINENUMBER 18 L7
-    ILOAD 11
-    I2D
-    ALOAD 12
-    INVOKESTATIC jdk/nashorn/internal/runtime/JSType.toNumber (Ljava/lang/Object;)D
-    DMUL
-    ILOAD 13
-    I2D
-    ILOAD 10
-    I2D
-    DMUL
-    DADD
-    DSTORE 14
-   L8
-    LINENUMBER 19 L8
-    ILOAD 10
-    I2D
-    ALOAD 12
-    INVOKESTATIC jdk/nashorn/internal/runtime/JSType.toNumber (Ljava/lang/Object;)D
-    DMUL
-    DLOAD 14
-    INVOKESTATIC jdk/nashorn/internal/runtime/JSType.toInt32 (D)I
-    SIPUSH 16383
-    IAND
-    BIPUSH 14
-    ISHL
-    I2D
-    DADD
-    ALOAD 9
-    ALOAD 4
-    INVOKEDYNAMIC dyn:getElem|getProp|getMethod(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; [
-      // handle kind 0x6 : INVOKESTATIC
-      jdk/nashorn/internal/runtime/linker/Bootstrap.bootstrap((Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;I)Ljava/lang/invoke/CallSite;)
-      // arguments:
-      0
-    ]
-    INVOKEDYNAMIC ADD:ODO_D(DLjava/lang/Object;)Ljava/lang/Object; [
-      // handle kind 0x6 : INVOKESTATIC
-      jdk/nashorn/internal/runtime/linker/Bootstrap.runtimeBootstrap((Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;)
-      // arguments: none
-    ]
-    ALOAD 5
-    INVOKEDYNAMIC ADD:OOO_I(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; [
-      // handle kind 0x6 : INVOKESTATIC
-      jdk/nashorn/internal/runtime/linker/Bootstrap.runtimeBootstrap((Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;)
-      // arguments: none
-    ]
-    ASTORE 12
-   L9
-    LINENUMBER 20 L9
-    ALOAD 12
-    INVOKESTATIC jdk/nashorn/internal/runtime/JSType.toInt32 (Ljava/lang/Object;)I
-    BIPUSH 28
-    ISHR
-    I2D
-    DLOAD 14
-    INVOKESTATIC jdk/nashorn/internal/runtime/JSType.toInt32 (D)I
-    BIPUSH 14
-    ISHR
-    I2D
-    DADD
-    ILOAD 11
-    I2D
-    ILOAD 13
-    I2D
-    DMUL
-    DADD
-    INVOKESTATIC java/lang/Double.valueOf (D)Ljava/lang/Double;
-    ASTORE 5
-   L10
-    LINENUMBER 21 L10
-    ALOAD 9
-    ALOAD 4
-    INVOKESTATIC jdk/nashorn/internal/runtime/JSType.toNumber (Ljava/lang/Object;)D
-    DUP2
-    DCONST_1
-    DADD
-    INVOKESTATIC java/lang/Double.valueOf (D)Ljava/lang/Double;
-    ASTORE 4
-    ALOAD 12
-    INVOKESTATIC jdk/nashorn/internal/runtime/JSType.toInt32 (Ljava/lang/Object;)I
-    LDC 268435455
-    IAND
-    INVOKEDYNAMIC dyn:setElem|setProp(Ljava/lang/Object;DI)V [
-      // handle kind 0x6 : INVOKESTATIC
-      jdk/nashorn/internal/runtime/linker/Bootstrap.bootstrap((Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;I)Ljava/lang/invoke/CallSite;)
-      // arguments:
-      0
-    ]
-   L4
-   FRAME FULL [java/lang/Object java/lang/Object java/lang/Object java/lang/Object java/lang/Object java/lang/Object java/lang/Object T java/lang/Object java/lang/Object I I] []
-    ALOAD 6
-    INVOKESTATIC jdk/nashorn/internal/runtime/JSType.toNumber (Ljava/lang/Object;)D
-    LDC -1.0
-    DADD
-    DUP2
-    INVOKESTATIC java/lang/Double.valueOf (D)Ljava/lang/Double;
-    ASTORE 6
-    DCONST_0
-    DCMPL
-    IFGE L5
-   L11
-    LINENUMBER 24 L11
-    ALOAD 5
-    ARETURN
-
-"Optimistic" bytecode that requires invalidation on e.g overflow. Factor
-x2-3 speedup:
-
-public static am3(Ljava/lang/Object;IILjava/lang/Object;III)I
-   L0
-    LINENUMBER 12 L0
-    ALOAD 0
-    INVOKEDYNAMIC dyn:getProp|getElem|getMethod:array(Ljava/lang/Object;)Ljava/lang/Object; [
-      // handle kind 0x6 : INVOKESTATIC
-      jdk/nashorn/internal/runtime/linker/Bootstrap.bootstrap((Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;I)Ljava/lang/invoke/CallSite;)
-      // arguments:
-      0
-    ]
-    ASTORE 8
-   L1
-    LINENUMBER 13 L1
-    ALOAD 3
-    INVOKEDYNAMIC dyn:getProp|getElem|getMethod:array(Ljava/lang/Object;)Ljava/lang/Object; [
-      // handle kind 0x6 : INVOKESTATIC
-      jdk/nashorn/internal/runtime/linker/Bootstrap.bootstrap((Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;I)Ljava/lang/invoke/CallSite;)
-      // arguments:
-      0
-    ]
-    ASTORE 9
-   L2
-    LINENUMBER 14 L2
-    ILOAD 2
-    SIPUSH 16383
-    IAND
-    ISTORE 10
-    ILOAD 2
-    BIPUSH 14
-    ISHR
-    ISTORE 11
-   L3
-    LINENUMBER 15 L3
-    GOTO L4
-   L5
-    LINENUMBER 16 L5
-   FRAME FULL [java/lang/Object I I java/lang/Object I I I T java/lang/Object java/lang/Object I I] []
-    ALOAD 8
-    ILOAD 1
-    INVOKEDYNAMIC dyn:getElem|getProp|getMethod(Ljava/lang/Object;I)I [
-      // handle kind 0x6 : INVOKESTATIC
-      jdk/nashorn/internal/runtime/linker/Bootstrap.bootstrap((Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;I)Ljava/lang/invoke/CallSite;)
-      // arguments:
-      0
-    ]
-    SIPUSH 16383
-    IAND
-    ISTORE 12
-   L6
-    LINENUMBER 17 L6
-    ALOAD 8
-    ILOAD 1
-    DUP
-    ICONST_1
-    IADD
-    ISTORE 1
-    INVOKEDYNAMIC dyn:getElem|getProp|getMethod(Ljava/lang/Object;I)I [
-      // handle kind 0x6 : INVOKESTATIC
-      jdk/nashorn/internal/runtime/linker/Bootstrap.bootstrap((Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;I)Ljava/lang/invoke/CallSite;)
-      // arguments:
-      0
-    ]
-    BIPUSH 14
-    ISHR
-    ISTORE 13
-   L7
-    LINENUMBER 18 L7
-    ILOAD 11
-    ILOAD 12
-    BIPUSH 8
-    INVOKESTATIC jdk/nashorn/internal/runtime/JSType.mulExact (III)I
-    ILOAD 13
-    ILOAD 10
-    BIPUSH 9
-    INVOKESTATIC jdk/nashorn/internal/runtime/JSType.mulExact (III)I
-    IADD
-    ISTORE 14
-   L8
-    LINENUMBER 19 L8
-    ILOAD 10
-    ILOAD 12
-    BIPUSH 11
-    INVOKESTATIC jdk/nashorn/internal/runtime/JSType.mulExact (III)I
-    ILOAD 14
-    SIPUSH 16383
-    IAND
-    BIPUSH 14
-    ISHL
-    IADD
-    ALOAD 9
-    ILOAD 4
-    INVOKEDYNAMIC dyn:getElem|getProp|getMethod(Ljava/lang/Object;I)I [
-      // handle kind 0x6 : INVOKESTATIC
-      jdk/nashorn/internal/runtime/linker/Bootstrap.bootstrap((Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;I)Ljava/lang/invoke/CallSite;)
-      // arguments:
-      0
-    ]
-    IADD
-    ILOAD 5
-    IADD
-    ISTORE 12
-   L9
-    LINENUMBER 20 L9
-    ILOAD 12
-    BIPUSH 28
-    ISHR
-    ILOAD 14
-    BIPUSH 14
-    ISHR
-    IADD
-    ILOAD 11
-    ILOAD 13
-    BIPUSH 21
-    INVOKESTATIC jdk/nashorn/internal/runtime/JSType.mulExact (III)I
-    IADD
-    ISTORE 5
-   L10
-    LINENUMBER 21 L10
-    ALOAD 9
-    ILOAD 4
-    DUP
-    ICONST_1
-    IADD
-    ISTORE 4
-    ILOAD 12
-    LDC 268435455
-    IAND
-    INVOKEDYNAMIC dyn:setElem|setProp(Ljava/lang/Object;II)V [
-      // handle kind 0x6 : INVOKESTATIC
-      jdk/nashorn/internal/runtime/linker/Bootstrap.bootstrap((Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;I)Ljava/lang/invoke/CallSite;)
-      // arguments:
-      0
-    ]
-   L4
-   FRAME SAME
-    ILOAD 6
-    ICONST_M1
-    IADD
-    DUP
-    ISTORE 6
-    ICONST_0
-    IF_ICMPGE L5
-   L11
-    LINENUMBER 24 L11
-    ILOAD 5
-    IRETURN
+This property sets the compression level used when deflating serialized
+AST structures of anonymous split functions. Valid values range from 0 to 9,
+the default value is 4. Higher values will reduce memory size of serialized
+AST but increase CPU usage required for compression.
 
 
-SYSTEM PROPERTY: -Dnashorn.codegen.debug, -Dnashorn.codegen.debug.trace=<x>
+SYSTEM PROPERTY: -Dnashorn.codegen.debug.trace=<x>
 
 See the description of the codegen logger below.
 
 
-SYSTEM_PROPERTY: -Dnashorn.fields.debug
+SYSTEM PROPERTY: -Dnashorn.fields.objects
 
-See the description on the fields logger below.
-
-
-SYSTEM PROPERTY: -Dnashorn.fields.dual
+When this property is true, Nashorn will only use object fields for
+AccessorProperties. This means that primitive values must be boxed
+when stored in a field, which is significantly slower than using
+primitive fields.
 
-When this property is true, Nashorn will attempt to use primitive
-fields for AccessorProperties (currently just AccessorProperties, not
-spill properties). Memory footprint for script objects will increase,
-as we need to maintain both a primitive field (a long) as well as an
-Object field for the property value. Ints are represented as the 32
-low bits of the long fields. Doubles are represented as the
-doubleToLongBits of their value. This way a single field can be used
-for all primitive types. Packing and unpacking doubles to their bit
-representation is intrinsified by the JVM and extremely fast.
-
-While dual fields in theory runs significantly faster than Object
-fields due to reduction of boxing and memory allocation overhead,
-there is still work to be done to make this a general purpose
-solution. Research is ongoing.
+By default, Nashorn uses dual object and long fields. Ints are
+represented as the 32 low bits of the long fields. Doubles are
+represented as the doubleToLongBits of their value. This way a
+single field can be used for all primitive types. Packing and
+unpacking doubles to their bit representation is intrinsified by
+the JVM and extremely fast.
 
 In the future, this might complement or be replaced by experimental
 feature sun.misc.TaggedArray, which has been discussed on the mlvm
 mailing list. TaggedArrays are basically a way to share data space
 between primitives and references, and have the GC understand this.
 
-As long as only primitive values are written to the fields and enough
-type information exists to make sure that any reads don't have to be
-uselessly boxed and unboxed, this is significantly faster than the
-standard "Objects only" approach that currently is the default. See
-test/examples/dual-fields-micro.js for an example that runs twice as
-fast with dual fields as without them. Here, the compiler, can
-determine that we are dealing with numbers only throughout the entire
-property life span of the properties involved.
-
-If a "real" object (not a boxed primitive) is written to a field that
-has a primitive representation, its callsite is relinked and an Object
-field is used forevermore for that particular field in that
-PropertyMap and its children, even if primitives are later assigned to
-it.
-
-As the amount of compile time type information is very small in a
-dynamic language like JavaScript, it is frequently the case that
-something has to be treated as an object, because we don't know any
-better. In reality though, it is often a boxed primitive is stored to
-an AccessorProperty. The fastest way to handle this soundly is to use
-a callsite typecheck and avoid blowing the field up to an Object. We
-never revert object fields to primitives. Ping-pong:ing back and forth
-between primitive representation and Object representation would cause
-fatal performance overhead, so this is not an option.
-
-For a general application the dual fields approach is still slower
-than objects only fields in some places, about the same in most cases,
-and significantly faster in very few. This is due the program using
-primitives, but we still can't prove it. For example "local_var a =
-call(); field = a;" may very well write a double to the field, but the
-compiler dare not guess a double type if field is a local variable,
-due to bytecode variables being strongly typed and later non
-interchangeable. To get around this, the entire method would have to
-be replaced and a continuation retained to restart from. We believe
-that the next steps we should go through are instead:
-
-1) Implement method specialization based on callsite, as it's quite
-frequently the case that numbers are passed around, but currently our
-function nodes just have object types visible to the compiler. For
-example "var b = 17; func(a,b,17)" is an example where two parameters
-can be specialized, but the main version of func might also be called
-from another callsite with func(x,y,"string").
-
-2) This requires lazy jitting as the functions have to be specialized
-per callsite.
-
-Even though "function square(x) { return x*x }" might look like a
-trivial function that can always only take doubles, this is not
-true. Someone might have overridden the valueOf for x so that the
-toNumber coercion has side effects. To fulfil JavaScript semantics,
-the coercion has to run twice for both terms of the multiplication
-even if they are the same object. This means that call site
-specialization is necessary, not parameter specialization on the form
-"function square(x) { var xd = (double)x; return xd*xd; }", as one
-might first think.
-
-Generating a method specialization for any variant of a function that
-we can determine by types at compile time is a combinatorial explosion
-of byte code (try it e.g. on all the variants of am3 in the Octane
-benchmark crypto.js). Thus, this needs to be lazy
-
-3) Optimistic callsite writes, something on the form
-
-x = y; //x is a field known to be a primitive. y is only an object as
-far as we can tell
-
-turns into
-
-try {
-  x = (int)y;
-} catch (X is not an integer field right now | ClassCastException e) {
-  x = y;
-}
-
-Mini POC shows that this is the key to a lot of dual field performance
-in seemingly trivial micros where one unknown object, in reality
-actually a primitive, foils it for us. Very common pattern. Once we
-are "all primitives", dual fields runs a lot faster than Object fields
-only.
-
-We still have to deal with objects vs primitives for local bytecode
-slots, possibly through code copying and versioning.
-
-The Future:
-
-We expect the usefulness of dual fields to increase significantly
-after the optimistic type system described in the section on 
-integer arithmetic above is implemented.
-
 
 SYSTEM PROPERTY: -Dnashorn.compiler.symbol.trace=[<x>[,*]], 
   -Dnashorn.compiler.symbol.stacktrace=[<x>[,*]]
@@ -628,6 +141,9 @@
 "identical" - this method compares two script objects for reference
 equality. It is a == Java comparison
 
+"equals" - Returns true if two objects are either referentially
+identical or equal as defined by java.lang.Object.equals.
+
 "dumpCounters" - will dump the debug counters' current values to
 stdout.
 
@@ -648,66 +164,66 @@
 when a callsite has to be relinked, due to a previous assumption of
 object layout being invalidated.
 
+"getContext" - return the current Nashorn context.
 
-SYSTEM PROPERTY: -Dnashorn.methodhandles.debug,
--Dnashorn.methodhandles.debug=create
+"equalWithoutType" - Returns true if if the two objects are both
+property maps, and they have identical properties in the same order,
+but allows the properties to differ in their types.
+
+"diffPropertyMaps" Returns a diagnostic string representing the difference
+of two property maps.
+
+"getClass" - Returns the Java class of an object, or undefined if null.
+
+"toJavaString" - Returns the Java toString representation of an object.
+
+"toIdentString" - Returns a string representation of an object consisting
+of its java class name and hash code.
+
+"getListenerCount" - Return the number of property listeners for a
+script object.
 
-If this property is enabled, each MethodHandle related call that uses
-the java.lang.invoke package gets its MethodHandle intercepted and an
-instrumentation printout of arguments and return value appended to
-it. This shows exactly which method handles are executed and from
-where. (Also MethodTypes and SwitchPoints). This can be augmented with
-more information, for example, instance count, by subclassing or
-further extending the TraceMethodHandleFactory implementation in
-MethodHandleFactory.java.
+"getEventQueueCapacity" - Get the capacity of the event queue.
+
+"setEventQueueCapacity" - Set the event queue capacity.
+
+"addRuntimeEvent" - Add a runtime event to the runtime event queue.
+The queue has a fixed size (see -Dnashorn.runtime.event.queue.size)
+and the oldest entry will be thrown out of the queue is about to overflow.
 
-If the property is specialized with "=create" as its option,
-instrumentation will be shown for method handles upon creation time
-rather than at runtime usage.
+"expandEventQueueCapacity" - Expands the event queue capacity,
+or truncates if capacity is lower than current capacity. Then only
+the newest entries are kept.
+
+"clearRuntimeEvents" - Clear the runtime event queue.
+
+"removeRuntimeEvent" - Remove a specific runtime event from the event queue.
+
+"getRuntimeEvents" - Return all runtime events in the queue as an array.
+
+"getLastRuntimeEvent" - Return the last runtime event in the queue.
 
 
 SYSTEM PROPERTY: -Dnashorn.methodhandles.debug.stacktrace
 
-This does the same as nashorn.methodhandles.debug, but when enabled
-also dumps the stack trace for every instrumented method handle
-operation. Warning: This is enormously verbose, but provides a pretty
+This enhances methodhandles logging (see below) to also dump the
+stack trace for every instrumented method handle operation.
+Warning: This is enormously verbose, but provides a pretty
 decent "grep:able" picture of where the calls are coming from.
 
-See the description of the codegen logger below for a more verbose
-description of this option
-
 
-SYSTEM PROPERTY: -Dnashorn.scriptfunction.specialization.disable
+SYSTEM PROPERTY: -Dnashorn.cce
+
+Setting this system property causes the Nashorn linker to rely on
+ClassCastExceptions for triggering a callsite relink. If not set, the linker
+will add an explicit instanceof guard.
 
-There are several "fast path" implementations of constructors and
-functions in the NativeObject classes that, in their original form,
-take a variable amount of arguments. Said functions are also declared
-to take Object parameters in their original form, as this is what the
-JavaScript specification mandates.
-However, we often know quite a lot more at a callsite of one of these
-functions. For example, Math.min is called with a fixed number (2) of
-integer arguments. The overhead of boxing these ints to Objects and
-folding them into an Object array for the generic varargs Math.min
-function is an order of magnitude slower than calling a specialized
-implementation of Math.min that takes two integers. Specialized
-functions and constructors are identified by the tag
-@SpecializedFunction and @SpecializedConstructor in the Nashorn
-code. The linker will link in the most appropriate (narrowest types,
-right number of types and least number of arguments) specialization if
-specializations are available.
+
+SYSTEM PROPERTY: -Dnashorn.spill.threshold=<x>
 
-Every ScriptFunction may carry specializations that the linker can
-choose from. This framework will likely be extended for user defined
-functions. The compiler can often infer enough parameter type info
-from callsites for in order to generate simpler versions with less
-generic Object types. This feature depends on future lazy jitting, as
-there tend to be many calls to user defined functions, some where the
-callsite can be specialized, some where we mostly see object
-parameters even at the callsite.
-
-If this system property is set to true, the linker will not attempt to
-use any specialized function or constructor for native objects, but
-just call the generic one.
+This property sets the number of fields in an object from which to use
+generic array based spill storage instead of Java fields. The default value
+is 256.
 
 
 SYSTEM PROPERTY: -Dnashorn.tcs.miss.samplePercent=<x>
@@ -719,8 +235,47 @@
 should be logged. Typically this is set to 1 or 5 (percent). 1% is the
 default value.
 
+SYSTEM PROPERTY: -Dnashorn.persistent.code.cache
 
-SYSTEM_PROPERTY: -Dnashorn.profilefile=<filename>
+This property can be used to set the directory where Nashorn stores
+serialized script classes generated with the -pcc/--persistent-code-cache
+option. The default directory name is "nashorn_code_cache".
+
+
+SYSTEM PROPERTY: -Dnashorn.typeInfo.maxFiles
+
+Maximum number of files to store in the type info cache. The type info cache
+is used to cache type data of JavaScript functions when running with
+optimistic types (-ot/--optimistic-types). There is one file per JavaScript
+function in the cache.
+
+The default value is 0 which means the feature is disabled. Setting this
+to something like 20000 is probably good enough for most applications and
+will usually cap the cache directory to about 80MB presuming a 4kB
+filesystem allocation unit. Set this to "unlimited" to run without limit.
+
+If the value is not 0 or "unlimited", Nashorn will spawn a cleanup thread
+that makes sure the number of files in the cache does not exceed the given
+value by deleting the least recently modified files.
+
+
+SYSTEM PROPERTY: -Dnashorn.typeInfo.cacheDir
+
+This property can be used to set the directory where Nashorn stores the
+type info cache when -Dnashorn.typeInfo.maxFiles is set to a nonzero
+value. The default location is platform specific. On Windows, it is
+"${java.io.tmpdir}\com.oracle.java.NashornTypeInfo". On Linux and
+Solaris it is "~/.cache/com.oracle.java.NashornTypeInfo". On Mac OS X,
+it is "~/Library/Caches/com.oracle.java.NashornTypeInfo".
+
+
+SYSTEM PROPERTY: -Dnashorn.typeInfo.cleanupDelaySeconds=<value>
+
+This sets the delay between cleanups of the typeInfo cache, in seconds.
+The default delay is 20 seconds.
+
+
+SYSTEM PROPERTY: -Dnashorn.profilefile=<filename>
 
 When running with the profile callsite options (-pcs), Nashorn will
 dump profiling data for all callsites to stderr as a shutdown hook. To
@@ -736,6 +291,11 @@
 an implementation based on Joni, the regular expression engine used by
 the JRuby project. The default value for this flag is "joni"
 
+SYSTEM PROPERTY: -Dnashorn.runtime.event.queue.size=<value>
+
+Nashorn provides a fixed sized runtime event queue for debugging purposes.
+See -Dnashorn.debug for methods to access the event queue.
+The default value is 1024.
 
 ===============
 2. The loggers.
@@ -767,7 +327,9 @@
 For example: --log=codegen,fields:finest is equivalent to
 --log=codegen:info --log=fields:finest
 
-The subsystems that currently support logging are:
+The following is an incomplete list of subsystems that currently
+support logging. Look for classes implementing
+jdk.nashorn.internal.runtime.logging.Loggable for more loggers.
 
 
 * compiler
@@ -780,6 +342,14 @@
 use.s
 
 
+* recompile
+
+This logger shows information about recompilation of scripts and
+functions at runtime. Recompilation may happen because a function
+was called with different parameter types, or because an optimistic
+assumption failed while executing a function with -ot/--optimistic-types.
+
+
 * codegen
 
 The code generator is the emitter stage of the code pipeline, and
@@ -836,25 +406,13 @@
 Lower is also responsible for determining control flow information
 like end points.
 
-
-* attr
+* symbols
 
-The lowering annotates a FunctionNode with symbols for each identifier
-and transforms high level constructs into lower level ones, that the
-CodeGenerator consumes.
+The symbols logger tracks the assignment os symbols to identifiers.
 
-Lower logging typically outputs things like post pass actions,
-insertions of casts because symbol types have been changed and type
-specialization information. Currently very little info is generated by
-this logger. This will probably change.
-
+* scopedepths
 
-* finalize
-
-This --log=finalize log option outputs information for type finalization,
-the third tier of the compiler. This means things like placement of 
-specialized scope nodes or explicit conversions. 
-
+This logs the calculation of scope depths for non-local symbols.
 
 * fields
 
@@ -896,6 +454,21 @@
 [time] 
 [time] Total runtime: 11994 ms (Non-runtime: 11027 ms [91%])
 
+* methodhandles
+
+If this logger is enabled, each MethodHandle related call that uses
+the java.lang.invoke package gets its MethodHandle intercepted and an
+instrumentation printout of arguments and return value appended to
+it. This shows exactly which method handles are executed and from
+where. (Also MethodTypes and SwitchPoints).
+
+* classcache
+
+This logger shows information about reusing code classes using the
+in-memory class cache. Nashorn will try to avoid compilation of
+scripts by using existing classes. This can significantly improve
+performance when repeatedly evaluating the same script.
+
 =======================
 3. Undocumented options
 =======================
--- a/nashorn/make/build-nasgen.xml	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/make/build-nasgen.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -25,7 +25,7 @@
     <description>Builds and runs nasgen.</description>
     <import file="build.xml"/>
 
-    <target name="build-nasgen" depends="compile-asm">
+    <target name="build-nasgen" depends="prepare">
         <ant inheritAll="false" dir="${basedir}/buildtools/nasgen"
             antfile="build.xml" target="jar"/>
     </target>
--- a/nashorn/make/build.xml	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/make/build.xml	Wed Jul 05 20:05:30 2017 +0200
@@ -49,8 +49,6 @@
     <condition property="git.executable" value="/usr/local/bin/git" else="git">
       <available file="/usr/local/bin/git"/>
     </condition>
-    <!-- check if JDK already has ASM classes -->
-    <available property="asm.available" classname="jdk.internal.org.objectweb.asm.Type"/>
     <!-- check if testng.jar is avaiable -->
     <available property="testng.available" file="${file.reference.testng.jar}"/>
     <!-- check if Jemmy ang testng.jar are avaiable -->
@@ -78,8 +76,31 @@
       <istrue value="${jfr}"/>
     </condition>
   </target>
+
+  <!-- check minimum ant version required to be 1.8.4 -->
+  <target name="check-ant-version">
+    <property name="ant.version.required" value="1.8.4"/>
+    <antversion property="ant.current.version" />
+    <fail message="The current ant version, ${ant.current.version}, is too old. Please use 1.8.4 or above.">
+        <condition>
+            <not>
+                <antversion atleast="${ant.version.required}"/>
+            </not>
+        </condition>
+    </fail>
+  </target>
+
+  <target name="check-java-version">
+    <!-- look for a Class that is available only in jdk1.8 or above -->
+    <!-- core/exposed API class is better than an implementation class -->
+    <available property="jdk1.8+" classname="java.util.stream.Stream"/>
+
+    <!-- need jdk1.8 or above -->
+    <fail message="Unsupported Java version: ${ant.java.version}. Please use Java version 1.8 or greater." unless="jdk1.8+">
+    </fail>
+  </target>
   
-  <target name="init" depends="init-conditions, init-cc">
+  <target name="init" depends="check-ant-version, check-java-version, init-conditions, init-cc">
     <!-- extends jvm args -->
     <property name="run.test.jvmargs" value="${run.test.jvmargs.main} ${run.test.cc.jvmargs} ${jfr.options}"/>
     <property name="run.test.jvmargs.octane" value="${run.test.jvmargs.octane.main} ${run.test.cc.jvmargs} ${jfr.options}"/>
@@ -107,19 +128,7 @@
     <delete dir="${dist.dir}"/>
   </target>
 
-  <!-- do it only if ASM is not available -->
-  <target name="compile-asm" depends="prepare" unless="asm.available">
-    <javac srcdir="${jdk.asm.src.dir}"
-           destdir="${build.classes.dir}"
-           excludes="**/optimizer/* **/xml/* **/attrs/*"
-           source="${javac.source}"
-           target="${javac.target}"
-           debug="${javac.debug}"
-           encoding="${javac.encoding}"
-           includeantruntime="false"/>
-  </target>
-
-  <target name="compile" depends="compile-asm" description="Compiles nashorn">
+  <target name="compile" depends="prepare" description="Compiles nashorn">
     <javac srcdir="${src.dir}"
            destdir="${build.classes.dir}"
            classpath="${javac.classpath}"
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ApplySpecialization.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ApplySpecialization.java	Wed Jul 05 20:05:30 2017 +0200
@@ -27,6 +27,7 @@
 
 import static jdk.nashorn.internal.codegen.CompilerConstants.ARGUMENTS_VAR;
 import static jdk.nashorn.internal.codegen.CompilerConstants.EXPLODED_ARGUMENT_PREFIX;
+
 import java.lang.invoke.MethodType;
 import java.util.ArrayDeque;
 import java.util.ArrayList;
@@ -38,6 +39,7 @@
 import jdk.nashorn.internal.ir.CallNode;
 import jdk.nashorn.internal.ir.Expression;
 import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
 import jdk.nashorn.internal.ir.IdentNode;
 import jdk.nashorn.internal.ir.LexicalContext;
 import jdk.nashorn.internal.ir.Node;
@@ -321,7 +323,7 @@
 
         explodedArguments.pop();
 
-        return newFunctionNode;
+        return newFunctionNode.setState(lc, CompilationState.BUILTINS_TRANSFORMED);
     }
 
     private static boolean isApply(final CallNode callNode) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/AssignSymbols.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/AssignSymbols.java	Wed Jul 05 20:05:30 2017 +0200
@@ -76,7 +76,6 @@
 import jdk.nashorn.internal.ir.Node;
 import jdk.nashorn.internal.ir.RuntimeNode;
 import jdk.nashorn.internal.ir.RuntimeNode.Request;
-import jdk.nashorn.internal.ir.SplitNode;
 import jdk.nashorn.internal.ir.Statement;
 import jdk.nashorn.internal.ir.SwitchNode;
 import jdk.nashorn.internal.ir.Symbol;
@@ -135,9 +134,6 @@
         if (!(functionNode.hasScopeBlock() || functionNode.needsParentScope())) {
             functionNode.compilerConstant(SCOPE).setNeedsSlot(false);
         }
-        if (!functionNode.usesReturnSymbol()) {
-            functionNode.compilerConstant(RETURN).setNeedsSlot(false);
-        }
         // Named function expressions that end up not referencing themselves won't need a local slot for the self symbol.
         if(!functionNode.isDeclared() && !functionNode.usesSelfSymbol() && !functionNode.isAnonymous()) {
             final Symbol selfSymbol = functionNode.getBody().getExistingSymbol(functionNode.getIdent().getName());
@@ -1014,7 +1010,7 @@
         boolean previousWasBlock = false;
         for (final Iterator<LexicalContextNode> it = lc.getAllNodes(); it.hasNext();) {
             final LexicalContextNode node = it.next();
-            if (node instanceof FunctionNode || node instanceof SplitNode || isSplitArray(node)) {
+            if (node instanceof FunctionNode || isSplitArray(node)) {
                 // We reached the function boundary or a splitting boundary without seeing a definition for the symbol.
                 // It needs to be in scope.
                 return true;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/AstSerializer.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.nashorn.internal.codegen;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.util.Collections;
+import java.util.zip.Deflater;
+import java.util.zip.DeflaterOutputStream;
+import jdk.nashorn.internal.ir.Block;
+import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.ir.LexicalContext;
+import jdk.nashorn.internal.ir.Node;
+import jdk.nashorn.internal.ir.Statement;
+import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+import jdk.nashorn.internal.runtime.options.Options;
+
+/**
+ * This static utility class performs serialization of FunctionNode ASTs to a byte array.
+ * The format is a standard Java serialization stream, deflated.
+ */
+final class AstSerializer {
+    // Experimentally, we concluded that compression level 4 gives a good tradeoff between serialization speed
+    // and size.
+    private static final int COMPRESSION_LEVEL = Options.getIntProperty("nashorn.serialize.compression", 4);
+    static byte[] serialize(final FunctionNode fn) {
+        final ByteArrayOutputStream out = new ByteArrayOutputStream();
+        try (final ObjectOutputStream oout = new ObjectOutputStream(new DeflaterOutputStream(out,
+                new Deflater(COMPRESSION_LEVEL)))) {
+            oout.writeObject(removeInnerFunctionBodies(fn));
+        } catch (final IOException e) {
+            throw new AssertionError("Unexpected exception serializing function", e);
+        }
+        return out.toByteArray();
+    }
+
+    private static FunctionNode removeInnerFunctionBodies(final FunctionNode fn) {
+        return (FunctionNode)fn.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
+            @Override
+            public Node leaveBlock(final Block block) {
+                if (lc.isFunctionBody() && lc.getFunction(block) != lc.getOutermostFunction()) {
+                    return block.setStatements(lc, Collections.<Statement>emptyList());
+                }
+                return super.leaveBlock(block);
+            }
+        });
+    }
+}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ClassEmitter.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ClassEmitter.java	Wed Jul 05 20:05:30 2017 +0200
@@ -51,6 +51,7 @@
 import static jdk.nashorn.internal.codegen.CompilerConstants.methodDescriptor;
 import static jdk.nashorn.internal.codegen.CompilerConstants.typeDescriptor;
 import static jdk.nashorn.internal.codegen.CompilerConstants.virtualCallNoLookup;
+
 import java.io.ByteArrayOutputStream;
 import java.io.PrintWriter;
 import java.security.AccessController;
@@ -64,7 +65,6 @@
 import jdk.internal.org.objectweb.asm.util.TraceClassVisitor;
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.ir.SplitNode;
 import jdk.nashorn.internal.ir.debug.NashornClassReader;
 import jdk.nashorn.internal.ir.debug.NashornTextifier;
 import jdk.nashorn.internal.runtime.Context;
@@ -476,12 +476,6 @@
         methodsStarted.remove(method);
     }
 
-    SplitMethodEmitter method(final SplitNode splitNode, final String methodName, final Class<?> rtype, final Class<?>... ptypes) {
-        methodCount++;
-        methodNames.add(methodName);
-        return new SplitMethodEmitter(this, methodVisitor(EnumSet.of(Flag.PUBLIC, Flag.STATIC), methodName, rtype, ptypes), splitNode);
-    }
-
     /**
      * Add a new method to the class - defaults to public method
      *
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java	Wed Jul 05 20:05:30 2017 +0200
@@ -34,9 +34,7 @@
 import static jdk.nashorn.internal.codegen.CompilerConstants.GET_STRING;
 import static jdk.nashorn.internal.codegen.CompilerConstants.QUICK_PREFIX;
 import static jdk.nashorn.internal.codegen.CompilerConstants.REGEX_PREFIX;
-import static jdk.nashorn.internal.codegen.CompilerConstants.RETURN;
 import static jdk.nashorn.internal.codegen.CompilerConstants.SCOPE;
-import static jdk.nashorn.internal.codegen.CompilerConstants.SPLIT_ARRAY_ARG;
 import static jdk.nashorn.internal.codegen.CompilerConstants.SPLIT_PREFIX;
 import static jdk.nashorn.internal.codegen.CompilerConstants.THIS;
 import static jdk.nashorn.internal.codegen.CompilerConstants.VARARGS;
@@ -99,10 +97,10 @@
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
+import jdk.nashorn.internal.ir.GetSplitState;
 import jdk.nashorn.internal.ir.IdentNode;
 import jdk.nashorn.internal.ir.IfNode;
 import jdk.nashorn.internal.ir.IndexNode;
-import jdk.nashorn.internal.ir.JoinPredecessor;
 import jdk.nashorn.internal.ir.JoinPredecessorExpression;
 import jdk.nashorn.internal.ir.JumpStatement;
 import jdk.nashorn.internal.ir.LabelNode;
@@ -121,7 +119,8 @@
 import jdk.nashorn.internal.ir.ReturnNode;
 import jdk.nashorn.internal.ir.RuntimeNode;
 import jdk.nashorn.internal.ir.RuntimeNode.Request;
-import jdk.nashorn.internal.ir.SplitNode;
+import jdk.nashorn.internal.ir.SetSplitState;
+import jdk.nashorn.internal.ir.SplitReturn;
 import jdk.nashorn.internal.ir.Statement;
 import jdk.nashorn.internal.ir.SwitchNode;
 import jdk.nashorn.internal.ir.Symbol;
@@ -209,6 +208,8 @@
     private static final Type ITERATOR_TYPE = Type.typeFor(ITERATOR_CLASS);
     private static final Type EXCEPTION_TYPE = Type.typeFor(CompilerConstants.EXCEPTION_PREFIX.type());
 
+    private static final Integer INT_ZERO = Integer.valueOf(0);
+
     /** Constant data & installation. The only reason the compiler keeps this is because it is assigned
      *  by reflection in class installation */
     private final Compiler compiler;
@@ -493,8 +494,7 @@
         //walk up the chain from starting block and when we bump into the current function boundary, add the external
         //information.
         final FunctionNode fn   = lc.getCurrentFunction();
-        final int          fnId = fn.getId();
-        final int externalDepth = compiler.getScriptFunctionData(fnId).getExternalSymbolDepth(symbol.getName());
+        final int externalDepth = compiler.getScriptFunctionData(fn.getId()).getExternalSymbolDepth(symbol.getName());
 
         //count the number of scopes from this place to the start of the function
 
@@ -554,10 +554,10 @@
     }
 
     MethodEmitter loadBinaryOperands(final BinaryNode binaryNode) {
-        return loadBinaryOperands(binaryNode.lhs(), binaryNode.rhs(), TypeBounds.UNBOUNDED.notWiderThan(binaryNode.getWidestOperandType()), false);
+        return loadBinaryOperands(binaryNode.lhs(), binaryNode.rhs(), TypeBounds.UNBOUNDED.notWiderThan(binaryNode.getWidestOperandType()), false, false);
     }
 
-    private MethodEmitter loadBinaryOperands(final Expression lhs, final Expression rhs, final TypeBounds explicitOperandBounds, final boolean baseAlreadyOnStack) {
+    private MethodEmitter loadBinaryOperands(final Expression lhs, final Expression rhs, final TypeBounds explicitOperandBounds, final boolean baseAlreadyOnStack, final boolean forceConversionSeparation) {
         // ECMAScript 5.1 specification (sections 11.5-11.11 and 11.13) prescribes that when evaluating a binary
         // expression "LEFT op RIGHT", the order of operations must be: LOAD LEFT, LOAD RIGHT, CONVERT LEFT, CONVERT
         // RIGHT, EXECUTE OP. Unfortunately, doing it in this order defeats potential optimizations that arise when we
@@ -574,15 +574,34 @@
         final Type narrowestOperandType = Type.narrowest(Type.widest(lhs.getType(), rhs.getType()), explicitOperandBounds.widest);
         final TypeBounds operandBounds = explicitOperandBounds.notNarrowerThan(narrowestOperandType);
         if (noToPrimitiveConversion(lhs.getType(), explicitOperandBounds.widest) || rhs.isLocal()) {
-            // Can reorder. Combine load and convert into single operations.
-            loadExpression(lhs, operandBounds, baseAlreadyOnStack);
-            loadExpression(rhs, operandBounds, false);
+            // Can reorder. We might still need to separate conversion, but at least we can do it with reordering
+            if (forceConversionSeparation) {
+                // Can reorder, but can't move conversion into the operand as the operation depends on operands
+                // exact types for its overflow guarantees. E.g. with {L}{%I}expr1 {L}* {L}{%I}expr2 we are not allowed
+                // to merge {L}{%I} into {%L}, as that can cause subsequent overflows; test for JDK-8058610 contains
+                // concrete cases where this could happen.
+                final TypeBounds safeConvertBounds = TypeBounds.UNBOUNDED.notNarrowerThan(narrowestOperandType);
+                loadExpression(lhs, safeConvertBounds, baseAlreadyOnStack);
+                method.convert(operandBounds.within(method.peekType()));
+                loadExpression(rhs, safeConvertBounds, false);
+                method.convert(operandBounds.within(method.peekType()));
+            } else {
+                // Can reorder and move conversion into the operand. Combine load and convert into single operations.
+                loadExpression(lhs, operandBounds, baseAlreadyOnStack);
+                loadExpression(rhs, operandBounds, false);
+            }
         } else {
             // Can't reorder. Load and convert separately.
             final TypeBounds safeConvertBounds = TypeBounds.UNBOUNDED.notNarrowerThan(narrowestOperandType);
             loadExpression(lhs, safeConvertBounds, baseAlreadyOnStack);
+            final Type lhsType = method.peekType();
             loadExpression(rhs, safeConvertBounds, false);
-            method.swap().convert(operandBounds.within(method.peekType())).swap().convert(operandBounds.within(method.peekType()));
+            final Type convertedLhsType = operandBounds.within(method.peekType());
+            if (convertedLhsType != lhsType) {
+                // Do it conditionally, so that if conversion is a no-op we don't introduce a SWAP, SWAP.
+                method.swap().convert(convertedLhsType).swap();
+            }
+            method.convert(operandBounds.within(method.peekType()));
         }
         assert Type.generic(method.peekType()) == operandBounds.narrowest;
         assert Type.generic(method.peekType(1)) == operandBounds.narrowest;
@@ -633,19 +652,11 @@
         }
 
         TypeBounds booleanToInt() {
-            return maybeNew(booleanToInt(narrowest), booleanToInt(widest));
+            return maybeNew(CodeGenerator.booleanToInt(narrowest), CodeGenerator.booleanToInt(widest));
         }
 
         TypeBounds objectToNumber() {
-            return maybeNew(objectToNumber(narrowest), objectToNumber(widest));
-        }
-
-        private static Type booleanToInt(final Type t) {
-            return t == Type.BOOLEAN ? Type.INT : t;
-        }
-
-        private static Type objectToNumber(final Type t) {
-            return t.isObject() ? Type.NUMBER : t;
+            return maybeNew(CodeGenerator.objectToNumber(narrowest), CodeGenerator.objectToNumber(widest));
         }
 
         Type within(final Type type) {
@@ -664,6 +675,14 @@
         }
     }
 
+    private static Type booleanToInt(final Type t) {
+        return t == Type.BOOLEAN ? Type.INT : t;
+    }
+
+    private static Type objectToNumber(final Type t) {
+        return t.isObject() ? Type.NUMBER : t;
+    }
+
     MethodEmitter loadExpressionAsType(final Expression expr, final Type type) {
         if(type == Type.BOOLEAN) {
             return loadExpressionAsBoolean(expr);
@@ -1048,6 +1067,13 @@
             }
 
             @Override
+            public boolean enterGetSplitState(final GetSplitState getSplitState) {
+                method.loadScope();
+                method.invoke(Scope.GET_SPLIT_STATE);
+                return false;
+            }
+
+            @Override
             public boolean enterDefault(final Node otherNode) {
                 // Must have handled all expressions that can legally be encountered.
                 throw new AssertionError(otherNode.getClass().getName());
@@ -1219,7 +1245,7 @@
         popScopesUntil(target);
         final Label targetLabel = jump.getTargetLabel(target);
         targetLabel.markAsBreakTarget();
-        method.splitAwareGoto(lc, targetLabel, target);
+        method._goto(targetLabel);
 
         return false;
     }
@@ -2029,10 +2055,10 @@
     }
 
     private void lineNumber(final int lineNumber) {
-        if (lineNumber != lastLineNumber) {
+        if (lineNumber != lastLineNumber && lineNumber != Node.NO_LINE_NUMBER) {
             method.lineNumber(lineNumber);
-        }
-        lastLineNumber = lineNumber;
+            lastLineNumber = lineNumber;
+        }
     }
 
     int getLastLineNumber() {
@@ -2079,13 +2105,14 @@
                 method.begin();
 
                 defineCommonSplitMethodParameters();
-                defineSplitMethodParameter(3, arrayType);
-
-                fixScopeSlot(currentFunction);
+                defineSplitMethodParameter(CompilerConstants.SPLIT_ARRAY_ARG.slot(), arrayType);
+
+                // NOTE: when this is no longer needed, SplitIntoFunctions will no longer have to add IS_SPLIT
+                // to synthetic functions, and FunctionNode.needsCallee() will no longer need to test for isSplit().
+                final int arraySlot = fixScopeSlot(currentFunction, 3);
 
                 lc.enterSplitNode();
 
-                final int arraySlot = SPLIT_ARRAY_ARG.slot();
                 for (int i = arrayUnit.getLo(); i < arrayUnit.getHi(); i++) {
                     method.load(arrayType, arraySlot);
                     storeElement(nodes, elementType, postsets[i]);
@@ -2700,73 +2727,6 @@
         method.convert(newRuntimeNode.getType());
     }
 
-    @Override
-    public boolean enterSplitNode(final SplitNode splitNode) {
-        if(!method.isReachable()) {
-            return false;
-        }
-
-        final CompileUnit splitCompileUnit = splitNode.getCompileUnit();
-
-        final FunctionNode fn   = lc.getCurrentFunction();
-        final String className  = splitCompileUnit.getUnitClassName();
-        final String name       = splitNode.getName();
-
-        final Type returnType = fn.getReturnType();
-
-        final Class<?>   rtype          = fn.getReturnType().getTypeClass();
-        final boolean    needsArguments = fn.needsArguments();
-        final Class<?>[] ptypes         = needsArguments ?
-                new Class<?>[] {ScriptFunction.class, Object.class, ScriptObject.class, ScriptObject.class} :
-                new Class<?>[] {ScriptFunction.class, Object.class, ScriptObject.class};
-
-        final MethodEmitter caller = method;
-        unit = lc.pushCompileUnit(splitCompileUnit);
-
-        final Call splitCall = staticCallNoLookup(
-            className,
-            name,
-            methodDescriptor(rtype, ptypes));
-
-        final MethodEmitter splitEmitter =
-                splitCompileUnit.getClassEmitter().method(
-                        splitNode,
-                        name,
-                        rtype,
-                        ptypes);
-
-        pushMethodEmitter(splitEmitter);
-        method.setFunctionNode(fn);
-
-        assert fn.needsCallee() : "split function should require callee";
-        caller.loadCompilerConstant(CALLEE);
-        caller.loadCompilerConstant(THIS);
-        caller.loadCompilerConstant(SCOPE);
-        if (needsArguments) {
-            caller.loadCompilerConstant(ARGUMENTS);
-        }
-        caller.invoke(splitCall);
-        caller.storeCompilerConstant(RETURN, returnType);
-
-        method.begin();
-
-        defineCommonSplitMethodParameters();
-        if(needsArguments) {
-            defineSplitMethodParameter(3, ARGUMENTS);
-        }
-
-        // Copy scope to its target slot as first thing because the original slot could be used by return symbol.
-        fixScopeSlot(fn);
-
-        final int returnSlot = fn.compilerConstant(RETURN).getSlot(returnType);
-        method.defineBlockLocalVariable(returnSlot, returnSlot + returnType.getSlots());
-        method.loadUndefined(returnType);
-        method.storeCompilerConstant(RETURN, returnType);
-
-        lc.enterSplitNode();
-        return true;
-    }
-
     private void defineCommonSplitMethodParameters() {
         defineSplitMethodParameter(0, CALLEE);
         defineSplitMethodParameter(1, THIS);
@@ -2782,114 +2742,40 @@
         method.onLocalStore(type, slot);
     }
 
-    private void fixScopeSlot(final FunctionNode functionNode) {
+    private int fixScopeSlot(final FunctionNode functionNode, final int extraSlot) {
         // TODO hack to move the scope to the expected slot (needed because split methods reuse the same slots as the root method)
         final int actualScopeSlot = functionNode.compilerConstant(SCOPE).getSlot(SCOPE_TYPE);
         final int defaultScopeSlot = SCOPE.slot();
+        int newExtraSlot = extraSlot;
         if (actualScopeSlot != defaultScopeSlot) {
-            method.defineBlockLocalVariable(actualScopeSlot, actualScopeSlot + 1);
+            if (actualScopeSlot == extraSlot) {
+                newExtraSlot = extraSlot + 1;
+                method.defineBlockLocalVariable(newExtraSlot, newExtraSlot + 1);
+                method.load(Type.OBJECT, extraSlot);
+                method.storeHidden(Type.OBJECT, newExtraSlot);
+            } else {
+                method.defineBlockLocalVariable(actualScopeSlot, actualScopeSlot + 1);
+            }
             method.load(SCOPE_TYPE, defaultScopeSlot);
             method.storeCompilerConstant(SCOPE);
         }
+        return newExtraSlot;
     }
 
     @Override
-    public Node leaveSplitNode(final SplitNode splitNode) {
-        assert method instanceof SplitMethodEmitter;
-        lc.exitSplitNode();
-        final boolean hasReturn = method.hasReturn();
-        final SplitMethodEmitter splitMethod = ((SplitMethodEmitter)method);
-        final List<Label> targets = splitMethod.getExternalTargets();
-        final boolean hasControlFlow = hasReturn || !targets.isEmpty();
-        final List<BreakableNode> targetNodes  = splitMethod.getExternalTargetNodes();
-        final Type returnType = lc.getCurrentFunction().getReturnType();
-
-        try {
-            // Wrap up this method.
-
-            if(method.isReachable()) {
-                if (hasControlFlow) {
-                    method.setSplitState(-1);
-                }
-                method.loadCompilerConstant(RETURN, returnType);
-                method._return(returnType);
-            }
-            method.end();
-
-            lc.releaseSlots();
-
-            unit   = lc.popCompileUnit(splitNode.getCompileUnit());
-            popMethodEmitter();
-
-        } catch (final Throwable t) {
-            Context.printStackTrace(t);
-            final VerifyError e = new VerifyError("Code generation bug in \"" + splitNode.getName() + "\": likely stack misaligned: " + t + " " + getCurrentSource().getName());
-            e.initCause(t);
-            throw e;
-        }
-
-        //no external jump targets or return in switch node
-        if (!hasControlFlow) {
-            return splitNode;
-        }
-
-        // Handle return from split method if there was one.
-        final MethodEmitter caller = method;
-        final int     targetCount = targets.size();
-
-        caller.loadScope();
-        caller.invoke(Scope.GET_SPLIT_STATE);
-
-        final Label breakLabel = new Label("no_split_state");
-        // Split state is -1 for no split state, 0 for return, 1..n+1 for break/continue
-
-        //the common case is that we don't need a switch
-        if (targetCount == 0) {
-            assert hasReturn;
-            caller.ifne(breakLabel);
-            //has to be zero
-            caller.label(new Label("split_return"));
-            caller.loadCompilerConstant(RETURN, returnType);
-            caller._return(returnType);
-            caller.label(breakLabel);
-        } else {
-            assert !targets.isEmpty();
-
-            final int     low         = hasReturn ? 0 : 1;
-            final int     labelCount  = targetCount + 1 - low;
-            final Label[] labels      = new Label[labelCount];
-
-            for (int i = 0; i < labelCount; i++) {
-                labels[i] = new Label(i == 0 ? "split_return" : "split_" + targets.get(i - 1));
-            }
-            caller.tableswitch(low, targetCount, breakLabel, labels);
-            for (int i = low; i <= targetCount; i++) {
-                caller.label(labels[i - low]);
-                if (i == 0) {
-                    caller.loadCompilerConstant(RETURN, returnType);
-                    caller._return(returnType);
-                } else {
-                    final BreakableNode targetNode = targetNodes.get(i - 1);
-                    final Label label = targets.get(i - 1);
-                    if (!lc.isExternalTarget(splitNode, targetNode)) {
-                        final JoinPredecessor jumpOrigin = splitNode.getJumpOrigin(label);
-                        if(jumpOrigin != null) {
-                            method.beforeJoinPoint(jumpOrigin);
-                        }
-                        popScopesUntil(targetNode);
-                    }
-                    caller.splitAwareGoto(lc, label, targetNode);
-                }
-            }
-            caller.label(breakLabel);
-        }
-
-        // If split has a return and caller is itself a split method it needs to propagate the return.
-        if (hasReturn) {
-            caller.setHasReturn();
-        }
-
-        return splitNode;
+    public boolean enterSplitReturn(final SplitReturn splitReturn) {
+        if (method.isReachable()) {
+            method.loadUndefined(lc.getCurrentFunction().getReturnType())._return();
+        }
+        return false;
+    }
+
+    @Override
+    public boolean enterSetSplitState(final SetSplitState setSplitState) {
+        if (method.isReachable()) {
+            method.setSplitState(setSplitState.getState());
+        }
+        return false;
     }
 
     @Override
@@ -3678,13 +3564,15 @@
             void loadStack() {
                 final TypeBounds operandBounds;
                 final boolean isOptimistic = isValid(getProgramPoint());
+                boolean forceConversionSeparation = false;
                 if(isOptimistic) {
                     operandBounds = new TypeBounds(binaryNode.getType(), Type.OBJECT);
                 } else {
                     // Non-optimistic, non-FP +. Allow it to overflow.
                     operandBounds = new TypeBounds(binaryNode.getWidestOperandType(), Type.OBJECT);
+                    forceConversionSeparation = binaryNode.getWidestOperationType().narrowerThan(resultBounds.widest);
                 }
-                loadBinaryOperands(binaryNode.lhs(), binaryNode.rhs(), operandBounds, false);
+                loadBinaryOperands(binaryNode.lhs(), binaryNode.rhs(), operandBounds, false, forceConversionSeparation);
             }
 
             @Override
@@ -3795,12 +3683,21 @@
         @Override
         protected void evaluate() {
             final Expression lhs = assignNode.lhs();
-            final Type widest = assignNode.isTokenType(TokenType.ASSIGN_ADD) ? Type.OBJECT : assignNode.getWidestOperationType();
+            final Expression rhs = assignNode.rhs();
+            final Type widestOperationType = assignNode.getWidestOperationType();
+            final Type widest = assignNode.isTokenType(TokenType.ASSIGN_ADD) ? Type.OBJECT : widestOperationType;
             final TypeBounds bounds = new TypeBounds(assignNode.getType(), widest);
             new OptimisticOperation(assignNode, bounds) {
                 @Override
                 void loadStack() {
-                    loadBinaryOperands(lhs, assignNode.rhs(), bounds, true);
+                    final boolean forceConversionSeparation;
+                    if (isValid(getProgramPoint()) || widestOperationType == Type.NUMBER) {
+                        forceConversionSeparation = false;
+                    } else {
+                        final Type operandType = Type.widest(booleanToInt(objectToNumber(lhs.getType())), booleanToInt(objectToNumber(rhs.getType())));
+                        forceConversionSeparation = operandType.narrowerThan(widestOperationType);
+                    }
+                    loadBinaryOperands(lhs, rhs, bounds, true, forceConversionSeparation);
                 }
                 @Override
                 void consumeStack() {
@@ -3823,7 +3720,7 @@
 
         @Override
         protected void evaluate() {
-            loadBinaryOperands(assignNode.lhs(), assignNode.rhs(), TypeBounds.UNBOUNDED.notWiderThan(assignNode.getWidestOperandType()), true);
+            loadBinaryOperands(assignNode.lhs(), assignNode.rhs(), TypeBounds.UNBOUNDED.notWiderThan(assignNode.getWidestOperandType()), true, false);
             op();
         }
     }
@@ -3922,7 +3819,12 @@
 
     private void doSHR() {
         // TODO: make SHR optimistic
-        method.shr().convert(Type.LONG).load(JSType.MAX_UINT).and();
+        method.shr();
+        toUint();
+    }
+
+    private void toUint() {
+        JSType.TO_UINT32_I.invoke(method);
     }
 
     private void loadASSIGN_SUB(final BinaryNode binaryNode) {
@@ -3946,6 +3848,7 @@
                 @Override
                 void loadStack() {
                     final TypeBounds operandBounds;
+                    boolean forceConversionSeparation = false;
                     if(numericBounds.narrowest == Type.NUMBER) {
                         // Result should be double always. Propagate it into the operands so we don't have lots of I2D
                         // and L2D after operand evaluation.
@@ -3963,9 +3866,10 @@
                             // Non-optimistic, non-FP subtraction or multiplication. Allow them to overflow.
                             operandBounds = new TypeBounds(Type.narrowest(node.getWidestOperandType(),
                                     numericBounds.widest), Type.NUMBER);
+                            forceConversionSeparation = node.getWidestOperationType().narrowerThan(numericBounds.widest);
                         }
                     }
-                    loadBinaryOperands(node.lhs(), node.rhs(), operandBounds, false);
+                    loadBinaryOperands(node.lhs(), node.rhs(), operandBounds, false, forceConversionSeparation);
                 }
 
                 @Override
@@ -3982,8 +3886,18 @@
     }
 
     private void loadBIT_OR(final BinaryNode binaryNode) {
-        loadBinaryOperands(binaryNode);
-        method.or();
+        // Optimize x|0 to (int)x
+        if (isRhsZero(binaryNode)) {
+            loadExpressionAsType(binaryNode.lhs(), Type.INT);
+        } else {
+            loadBinaryOperands(binaryNode);
+            method.or();
+        }
+    }
+
+    private static boolean isRhsZero(final BinaryNode binaryNode) {
+        final Expression rhs = binaryNode.rhs();
+        return rhs instanceof LiteralNode && INT_ZERO.equals(((LiteralNode)rhs).getValue());
     }
 
     private void loadBIT_XOR(final BinaryNode binaryNode) {
@@ -4060,8 +3974,14 @@
     }
 
     private void loadSHR(final BinaryNode binaryNode) {
-        loadBinaryOperands(binaryNode);
-        doSHR();
+        // Optimize x >>> 0 to (uint)x
+        if (isRhsZero(binaryNode)) {
+            loadExpressionAsType(binaryNode.lhs(), Type.INT);
+            toUint();
+        } else {
+            loadBinaryOperands(binaryNode);
+            doSHR();
+        }
     }
 
     private void loadSUB(final BinaryNode binaryNode, final TypeBounds resultBounds) {
@@ -4379,11 +4299,7 @@
     private void newFunctionObject(final FunctionNode functionNode, final boolean addInitializer) {
         assert lc.peek() == functionNode;
 
-        final int fnId = functionNode.getId();
-
-        final RecompilableScriptFunctionData data = compiler.getScriptFunctionData(fnId);
-
-        assert data != null : functionNode.getName() + " has no data";
+        final RecompilableScriptFunctionData data = compiler.getScriptFunctionData(functionNode.getId());
 
         if (functionNode.isProgram() && !compiler.isOnDemandCompilation()) {
             final CompileUnit fnUnit = functionNode.getCompileUnit();
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CompilationPhase.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CompilationPhase.java	Wed Jul 05 20:05:30 2017 +0200
@@ -38,12 +38,11 @@
 import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.SPLIT;
 import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.SYMBOLS_ASSIGNED;
 import static jdk.nashorn.internal.runtime.logging.DebugLogger.quote;
+
 import java.io.PrintWriter;
-import java.util.ArrayList;
 import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
@@ -53,10 +52,7 @@
 import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
 import jdk.nashorn.internal.ir.LexicalContext;
 import jdk.nashorn.internal.ir.LiteralNode;
-import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode;
-import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode.ArrayUnit;
 import jdk.nashorn.internal.ir.Node;
-import jdk.nashorn.internal.ir.SplitNode;
 import jdk.nashorn.internal.ir.debug.ASTWriter;
 import jdk.nashorn.internal.ir.debug.PrintVisitor;
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
@@ -81,7 +77,7 @@
                 PARSED)) {
         @Override
         FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
-            return (FunctionNode)fn.accept(new FoldConstants(compiler));
+            return transformFunction(fn, new FoldConstants(compiler));
         }
 
         @Override
@@ -104,7 +100,7 @@
                 CONSTANT_FOLDED)) {
         @Override
         FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
-            return (FunctionNode)fn.accept(new Lower(compiler));
+            return transformFunction(fn, new Lower(compiler));
         }
 
         @Override
@@ -118,23 +114,6 @@
      * optimistic ops a program point so that an UnwarrantedException knows from where
      * a guess went wrong when creating the continuation to roll back this execution
      */
-    PROGRAM_POINT_PHASE(
-            EnumSet.of(
-                INITIALIZED,
-                PARSED,
-                CONSTANT_FOLDED,
-                LOWERED)) {
-        @Override
-        FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
-            return (FunctionNode)fn.accept(new ProgramPoints());
-        }
-
-        @Override
-        public String toString() {
-            return "'Program Point Calculation'";
-        }
-    },
-
     TRANSFORM_BUILTINS_PHASE(
             EnumSet.of(
                     INITIALIZED,
@@ -144,13 +123,7 @@
         //we only do this if we have a param type map, otherwise this is not a specialized recompile
         @Override
         FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
-            final FunctionNode newFunctionNode = (FunctionNode)fn.accept(new ApplySpecialization(compiler));
-            return (FunctionNode)newFunctionNode.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
-                @Override
-                public Node leaveFunctionNode(final FunctionNode node) {
-                    return node.setState(lc, BUILTINS_TRANSFORMED);
-                }
-            });
+            return setStates(transformFunction(fn, new ApplySpecialization(compiler)), BUILTINS_TRANSFORMED);
         }
 
         @Override
@@ -177,7 +150,7 @@
             FunctionNode newFunctionNode;
 
             //ensure elementTypes, postsets and presets exist for splitter and arraynodes
-            newFunctionNode = (FunctionNode)fn.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
+            newFunctionNode = transformFunction(fn, new NodeVisitor<LexicalContext>(new LexicalContext()) {
                 @Override
                 public LiteralNode<?> leaveLiteralNode(final LiteralNode<?> literalNode) {
                     return literalNode.initialize(lc);
@@ -185,7 +158,7 @@
             });
 
             newFunctionNode = new Splitter(compiler, newFunctionNode, outermostCompileUnit).split(newFunctionNode, true);
-
+            newFunctionNode = transformFunction(newFunctionNode, new SplitIntoFunctions(compiler));
             assert newFunctionNode.getCompileUnit() == outermostCompileUnit : "fn=" + fn.getName() + ", fn.compileUnit (" + newFunctionNode.getCompileUnit() + ") != " + outermostCompileUnit;
             assert newFunctionNode.isStrict() == compiler.isStrict() : "functionNode.isStrict() != compiler.isStrict() for " + quote(newFunctionNode.getName());
 
@@ -198,6 +171,52 @@
         }
     },
 
+    PROGRAM_POINT_PHASE(
+            EnumSet.of(
+                    INITIALIZED,
+                    PARSED,
+                    CONSTANT_FOLDED,
+                    LOWERED,
+                    BUILTINS_TRANSFORMED,
+                    SPLIT)) {
+        @Override
+        FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
+            return transformFunction(fn, new ProgramPoints());
+        }
+
+        @Override
+        public String toString() {
+            return "'Program Point Calculation'";
+        }
+    },
+
+    SERIALIZE_SPLIT_PHASE(
+            EnumSet.of(
+                    INITIALIZED,
+                    PARSED,
+                    CONSTANT_FOLDED,
+                    LOWERED,
+                    BUILTINS_TRANSFORMED,
+                    SPLIT)) {
+        @Override
+        FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
+            return transformFunction(fn, new NodeVisitor<LexicalContext>(new LexicalContext()) {
+                @Override
+                public boolean enterFunctionNode(final FunctionNode functionNode) {
+                    if (functionNode.isSplit()) {
+                        compiler.serializeAst(functionNode);
+                    }
+                    return true;
+                }
+            });
+        }
+
+        @Override
+        public String toString() {
+            return "'Serialize Split Functions'";
+        }
+    },
+
     SYMBOL_ASSIGNMENT_PHASE(
             EnumSet.of(
                     INITIALIZED,
@@ -208,7 +227,7 @@
                     SPLIT)) {
         @Override
         FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
-            return (FunctionNode)fn.accept(new AssignSymbols(compiler));
+            return transformFunction(fn, new AssignSymbols(compiler));
         }
 
         @Override
@@ -228,7 +247,7 @@
                     SYMBOLS_ASSIGNED)) {
         @Override
         FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
-            return (FunctionNode)fn.accept(new FindScopeDepths(compiler));
+            return transformFunction(fn, new FindScopeDepths(compiler));
         }
 
         @Override
@@ -250,7 +269,7 @@
         @Override
         FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
             if (compiler.useOptimisticTypes()) {
-                return (FunctionNode)fn.accept(new OptimisticTypesCalculator(compiler));
+                return transformFunction(fn, new OptimisticTypesCalculator(compiler));
             }
             return setStates(fn, OPTIMISTIC_TYPES_ASSIGNED);
         }
@@ -274,8 +293,7 @@
                     OPTIMISTIC_TYPES_ASSIGNED)) {
         @Override
         FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
-            final FunctionNode newFunctionNode = (FunctionNode)fn.accept(new LocalVariableTypesCalculator(compiler));
-
+            final FunctionNode newFunctionNode = transformFunction(fn, new LocalVariableTypesCalculator(compiler));
             final ScriptEnvironment senv = compiler.getScriptEnvironment();
             final PrintWriter       err  = senv.getErr();
 
@@ -330,13 +348,7 @@
 
             for (final CompileUnit oldUnit : compiler.getCompileUnits()) {
                 assert map.get(oldUnit) == null;
-                final StringBuilder sb = new StringBuilder(compiler.nextCompileUnitName());
-                if (phases.isRestOfCompilation()) {
-                    sb.append("$restOf");
-                }
-                //it's ok to not copy the initCount, methodCount and clinitCount here, as codegen is what
-                //fills those out anyway. Thus no need for a copy constructor
-                final CompileUnit newUnit = compiler.createCompileUnit(sb.toString(), oldUnit.getWeight());
+                final CompileUnit newUnit = createNewCompileUnit(compiler, phases);
                 log.fine("Creating new compile unit ", oldUnit, " => ", newUnit);
                 map.put(oldUnit, newUnit);
                 assert newUnit != null;
@@ -350,47 +362,10 @@
             //replace old compile units in function nodes, if any are assigned,
             //for example by running the splitter on this function node in a previous
             //partial code generation
-            final FunctionNode newFunctionNode = (FunctionNode)fn.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
-                @Override
-                public Node leaveFunctionNode(final FunctionNode node) {
-                    final CompileUnit oldUnit = node.getCompileUnit();
-                    assert oldUnit != null : "no compile unit in function node";
-
-                    final CompileUnit newUnit = map.get(oldUnit);
-                    assert newUnit != null : "old unit has no mapping to new unit " + oldUnit;
-
-                    log.fine("Replacing compile unit: ", oldUnit, " => ", newUnit, " in ", quote(node.getName()));
-                    return node.setCompileUnit(lc, newUnit).setState(lc, CompilationState.COMPILE_UNITS_REUSED);
-                }
-
+            final FunctionNode newFunctionNode = transformFunction(fn, new ReplaceCompileUnits() {
                 @Override
-                public Node leaveSplitNode(final SplitNode node) {
-                    final CompileUnit oldUnit = node.getCompileUnit();
-                    assert oldUnit != null : "no compile unit in function node";
-
-                    final CompileUnit newUnit = map.get(oldUnit);
-                    assert newUnit != null : "old unit has no mapping to new unit " + oldUnit;
-
-                    log.fine("Replacing compile unit: ", oldUnit, " => ", newUnit, " in ", quote(node.getName()));
-                    return node.setCompileUnit(lc, newUnit);
-                }
-
-                @Override
-                public Node leaveLiteralNode(final LiteralNode<?> node) {
-                    if (node instanceof ArrayLiteralNode) {
-                        final ArrayLiteralNode aln = (ArrayLiteralNode)node;
-                        if (aln.getUnits() == null) {
-                            return node;
-                        }
-                        final List<ArrayUnit> newArrayUnits = new ArrayList<>();
-                        for (final ArrayUnit au : aln.getUnits()) {
-                            final CompileUnit newUnit = map.get(au.getCompileUnit());
-                            assert newUnit != null;
-                            newArrayUnits.add(new ArrayUnit(newUnit, au.getLo(), au.getHi()));
-                        }
-                        return aln.setUnits(lc, newArrayUnits);
-                    }
-                    return node;
+                CompileUnit getReplacement(CompileUnit original) {
+                    return map.get(original);
                 }
 
                 @Override
@@ -408,7 +383,59 @@
         }
     },
 
-     /**
+    REINITIALIZE_SERIALIZED(
+            EnumSet.of(
+                    INITIALIZED,
+                    PARSED,
+                    CONSTANT_FOLDED,
+                    LOWERED,
+                    BUILTINS_TRANSFORMED,
+                    SPLIT)) {
+        @Override
+        FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
+            final Set<CompileUnit> unitSet = CompileUnit.createCompileUnitSet();
+            final Map<CompileUnit, CompileUnit> unitMap = new HashMap<>();
+
+            // Ensure that the FunctionNode's compile unit is the first in the list of new units. Install phase
+            // will use that as the root class.
+            createCompileUnit(fn.getCompileUnit(), unitSet, unitMap, compiler, phases);
+
+            final FunctionNode newFn = transformFunction(fn, new ReplaceCompileUnits() {
+                @Override
+                CompileUnit getReplacement(final CompileUnit oldUnit) {
+                    final CompileUnit existing = unitMap.get(oldUnit);
+                    if (existing != null) {
+                        return existing;
+                    }
+                    return createCompileUnit(oldUnit, unitSet, unitMap, compiler, phases);
+                }
+
+                @Override
+                public Node leaveFunctionNode(final FunctionNode fn2) {
+                    return super.leaveFunctionNode(
+                            // restore flags for deserialized nested function nodes
+                            compiler.getScriptFunctionData(fn2.getId()).restoreFlags(lc, fn2));
+                };
+            });
+            compiler.replaceCompileUnits(unitSet);
+            return newFn;
+        }
+
+        private CompileUnit createCompileUnit(final CompileUnit oldUnit, final Set<CompileUnit> unitSet,
+                final Map<CompileUnit, CompileUnit> unitMap, final Compiler compiler, final CompilationPhases phases) {
+            final CompileUnit newUnit = createNewCompileUnit(compiler, phases);
+            unitMap.put(oldUnit, newUnit);
+            unitSet.add(newUnit);
+            return newUnit;
+        }
+
+        @Override
+        public String toString() {
+            return "'Deserialize'";
+        }
+    },
+
+    /**
      * Bytecode generation:
      *
      * Generate the byte code class(es) resulting from the compiled FunctionNode
@@ -443,7 +470,7 @@
             try {
                 // Explicitly set BYTECODE_GENERATED here; it can not be set in case of skipping codegen for :program
                 // in the lazy + optimistic world. See CodeGenerator.skipFunction().
-                newFunctionNode = ((FunctionNode)newFunctionNode.accept(codegen)).setState(null, BYTECODE_GENERATED);
+                newFunctionNode = transformFunction(newFunctionNode, codegen).setState(null, BYTECODE_GENERATED);
                 codegen.generateScopeCalls();
             } catch (final VerifyError e) {
                 if (senv._verify_code || senv._print_code) {
@@ -615,7 +642,7 @@
         if (!AssertsEnabled.assertsEnabled()) {
             return functionNode;
         }
-        return (FunctionNode)functionNode.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
+        return transformFunction(functionNode, new NodeVisitor<LexicalContext>(new LexicalContext()) {
             @Override
             public Node leaveFunctionNode(final FunctionNode fn) {
                 return fn.setState(lc, state);
@@ -701,4 +728,17 @@
         return end(compiler, transform(compiler, phases, begin(compiler, functionNode)));
     }
 
+    private static FunctionNode transformFunction(final FunctionNode fn, final NodeVisitor<?> visitor) {
+        return (FunctionNode) fn.accept(visitor);
+    }
+
+    private static CompileUnit createNewCompileUnit(final Compiler compiler, final CompilationPhases phases) {
+        final StringBuilder sb = new StringBuilder(compiler.nextCompileUnitName());
+        if (phases.isRestOfCompilation()) {
+            sb.append("$restOf");
+        }
+        //it's ok to not copy the initCount, methodCount and clinitCount here, as codegen is what
+        //fills those out anyway. Thus no need for a copy constructor
+        return compiler.createCompileUnit(sb.toString(), 0);
+    }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CompileUnit.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CompileUnit.java	Wed Jul 05 20:05:30 2017 +0200
@@ -25,24 +25,31 @@
 
 package jdk.nashorn.internal.codegen;
 
+import java.io.Serializable;
 import java.util.Set;
 import java.util.TreeSet;
+import jdk.nashorn.internal.ir.CompileUnitHolder;
 
 /**
- * Used to track split class compilation.
- */
-public final class CompileUnit implements Comparable<CompileUnit> {
+  * Used to track split class compilation. Note that instances of the class are serializable, but all fields are
+  * transient, making the serialized version of the class only useful for tracking the referential topology of other
+  * AST nodes referencing the same or different compile units. We do want to preserve this topology though as
+  * {@link CompileUnitHolder}s in a deserialized AST will undergo reinitialization.
+  */
+public final class CompileUnit implements Comparable<CompileUnit>, Serializable {
+    private static final long serialVersionUID = 1L;
+
     /** Current class name */
-    private final String className;
+    private transient final String className;
 
     /** Current class generator */
-    private ClassEmitter classEmitter;
+    private transient ClassEmitter classEmitter;
 
-    private long weight;
+    private transient long weight;
 
-    private Class<?> clazz;
+    private transient Class<?> clazz;
 
-    private boolean isUsed;
+    private transient boolean isUsed;
 
     private static int emittedUnitCount;
 
@@ -122,14 +129,6 @@
     }
 
     /**
-     * Get the current weight of the compile unit.
-     * @return the unit's weight
-     */
-    long getWeight() {
-        return weight;
-    }
-
-    /**
      * Check if this compile unit can hold {@code weight} more units of weight
      * @param w weight to check if can be added
      * @return true if weight fits in this compile unit
@@ -155,7 +154,7 @@
     }
 
     private static String shortName(final String name) {
-        return name.lastIndexOf('/') == -1 ? name : name.substring(name.lastIndexOf('/') + 1);
+        return name == null ? null : name.lastIndexOf('/') == -1 ? name : name.substring(name.lastIndexOf('/') + 1);
     }
 
     @Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Compiler.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Compiler.java	Wed Jul 05 20:05:30 2017 +0200
@@ -32,15 +32,16 @@
 import static jdk.nashorn.internal.codegen.CompilerConstants.THIS;
 import static jdk.nashorn.internal.codegen.CompilerConstants.VARARGS;
 import static jdk.nashorn.internal.runtime.logging.DebugLogger.quote;
+
 import java.io.File;
 import java.lang.invoke.MethodType;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -159,75 +160,142 @@
      */
     private static final int COMPILE_UNIT_NAME_BUFFER_SIZE = 32;
 
+    private final Map<Integer, byte[]> serializedAsts = new HashMap<>();
+
     /**
      * Compilation phases that a compilation goes through
      */
     public static class CompilationPhases implements Iterable<CompilationPhase> {
 
-        /** Singleton that describes a standard eager compilation - this includes code installation */
-        public final static CompilationPhases COMPILE_ALL = new CompilationPhases(
-                "Compile all",
-                new CompilationPhase[] {
-                        CompilationPhase.CONSTANT_FOLDING_PHASE,
-                        CompilationPhase.LOWERING_PHASE,
-                        CompilationPhase.PROGRAM_POINT_PHASE,
-                        CompilationPhase.TRANSFORM_BUILTINS_PHASE,
-                        CompilationPhase.SPLITTING_PHASE,
-                        CompilationPhase.SYMBOL_ASSIGNMENT_PHASE,
-                        CompilationPhase.SCOPE_DEPTH_COMPUTATION_PHASE,
-                        CompilationPhase.OPTIMISTIC_TYPE_ASSIGNMENT_PHASE,
-                        CompilationPhase.LOCAL_VARIABLE_TYPE_CALCULATION_PHASE,
-                        CompilationPhase.BYTECODE_GENERATION_PHASE,
-                        CompilationPhase.INSTALL_PHASE
-                });
+        /**
+         * Singleton that describes compilation up to the phase where a function can be serialized.
+         */
+        private final static CompilationPhases COMPILE_UPTO_SERIALIZABLE = new CompilationPhases(
+                "Common initial phases",
+                CompilationPhase.CONSTANT_FOLDING_PHASE,
+                CompilationPhase.LOWERING_PHASE,
+                CompilationPhase.TRANSFORM_BUILTINS_PHASE,
+                CompilationPhase.SPLITTING_PHASE,
+                CompilationPhase.PROGRAM_POINT_PHASE,
+                CompilationPhase.SERIALIZE_SPLIT_PHASE
+                );
 
-        /** Compile all for a rest of method */
-        public final static CompilationPhases COMPILE_ALL_RESTOF =
-                COMPILE_ALL.setDescription("Compile all, rest of").addAfter(CompilationPhase.LOCAL_VARIABLE_TYPE_CALCULATION_PHASE, CompilationPhase.REUSE_COMPILE_UNITS_PHASE);
+        private final static CompilationPhases COMPILE_SERIALIZABLE_UPTO_BYTECODE = new CompilationPhases(
+                "After common phases, before bytecode generator",
+                CompilationPhase.SYMBOL_ASSIGNMENT_PHASE,
+                CompilationPhase.SCOPE_DEPTH_COMPUTATION_PHASE,
+                CompilationPhase.OPTIMISTIC_TYPE_ASSIGNMENT_PHASE,
+                CompilationPhase.LOCAL_VARIABLE_TYPE_CALCULATION_PHASE
+                );
 
-        /** Singleton that describes a standard eager compilation, but no installation, for example used by --compile-only */
-        public final static CompilationPhases COMPILE_ALL_NO_INSTALL =
-                COMPILE_ALL.
-                removeLast().
-                setDescription("Compile without install");
-
-        /** Singleton that describes compilation up to the CodeGenerator, but not actually generating code */
-        public final static CompilationPhases COMPILE_UPTO_BYTECODE =
-                COMPILE_ALL.
-                removeLast().
-                removeLast().
-                setDescription("Compile upto bytecode");
+        /**
+         * Singleton that describes additional steps to be taken after deserializing, all the way up to (but not
+         * including) generating and installing code.
+         */
+        public final static CompilationPhases RECOMPILE_SERIALIZED_UPTO_BYTECODE = new CompilationPhases(
+                "Recompile serialized function up to bytecode",
+                CompilationPhase.REINITIALIZE_SERIALIZED,
+                COMPILE_SERIALIZABLE_UPTO_BYTECODE
+                );
 
         /**
          * Singleton that describes back end of method generation, given that we have generated the normal
          * method up to CodeGenerator as in {@link CompilationPhases#COMPILE_UPTO_BYTECODE}
          */
-        public final static CompilationPhases COMPILE_FROM_BYTECODE = new CompilationPhases(
+        public final static CompilationPhases GENERATE_BYTECODE_AND_INSTALL = new CompilationPhases(
                 "Generate bytecode and install",
-                new CompilationPhase[] {
-                        CompilationPhase.BYTECODE_GENERATION_PHASE,
-                        CompilationPhase.INSTALL_PHASE
-                });
+                CompilationPhase.BYTECODE_GENERATION_PHASE,
+                CompilationPhase.INSTALL_PHASE
+                );
+
+        /** Singleton that describes compilation up to the CodeGenerator, but not actually generating code */
+        public final static CompilationPhases COMPILE_UPTO_BYTECODE = new CompilationPhases(
+                "Compile upto bytecode",
+                COMPILE_UPTO_SERIALIZABLE,
+                COMPILE_SERIALIZABLE_UPTO_BYTECODE);
+
+        /** Singleton that describes a standard eager compilation, but no installation, for example used by --compile-only */
+        public final static CompilationPhases COMPILE_ALL_NO_INSTALL = new CompilationPhases(
+                "Compile without install",
+                COMPILE_UPTO_BYTECODE,
+                CompilationPhase.BYTECODE_GENERATION_PHASE);
+
+        /** Singleton that describes a standard eager compilation - this includes code installation */
+        public final static CompilationPhases COMPILE_ALL = new CompilationPhases(
+                "Full eager compilation",
+                COMPILE_UPTO_BYTECODE,
+                GENERATE_BYTECODE_AND_INSTALL);
+
+        /** Singleton that describes a full compilation - this includes code installation - from serialized state*/
+        public final static CompilationPhases COMPILE_ALL_SERIALIZED = new CompilationPhases(
+                "Eager compilation from serializaed state",
+                RECOMPILE_SERIALIZED_UPTO_BYTECODE,
+                GENERATE_BYTECODE_AND_INSTALL);
 
         /**
          * Singleton that describes restOf method generation, given that we have generated the normal
          * method up to CodeGenerator as in {@link CompilationPhases#COMPILE_UPTO_BYTECODE}
          */
-        public final static CompilationPhases COMPILE_FROM_BYTECODE_RESTOF =
-                COMPILE_FROM_BYTECODE.
-                addFirst(CompilationPhase.REUSE_COMPILE_UNITS_PHASE).
-                setDescription("Generate bytecode and install - RestOf method");
+        public final static CompilationPhases GENERATE_BYTECODE_AND_INSTALL_RESTOF = new CompilationPhases(
+                "Generate bytecode and install - RestOf method",
+                CompilationPhase.REUSE_COMPILE_UNITS_PHASE,
+                GENERATE_BYTECODE_AND_INSTALL);
+
+        /** Compile all for a rest of method */
+        public final static CompilationPhases COMPILE_ALL_RESTOF = new CompilationPhases(
+                "Compile all, rest of",
+                COMPILE_UPTO_BYTECODE,
+                GENERATE_BYTECODE_AND_INSTALL_RESTOF);
+
+        /** Compile from serialized for a rest of method */
+        public final static CompilationPhases COMPILE_SERIALIZED_RESTOF = new CompilationPhases(
+                "Compile serialized, rest of",
+                RECOMPILE_SERIALIZED_UPTO_BYTECODE,
+                GENERATE_BYTECODE_AND_INSTALL_RESTOF);
 
         private final List<CompilationPhase> phases;
 
         private final String desc;
 
         private CompilationPhases(final String desc, final CompilationPhase... phases) {
-            this.desc = desc;
+            this(desc, Arrays.asList(phases));
+        }
+
+        private CompilationPhases(final String desc, final CompilationPhases base, final CompilationPhase... phases) {
+            this(desc, concat(base.phases, Arrays.asList(phases)));
+        }
+
+        private CompilationPhases(final String desc, final CompilationPhase first, final CompilationPhases rest) {
+            this(desc, concat(Collections.singletonList(first), rest.phases));
+        }
+
+        private CompilationPhases(final String desc, final CompilationPhases base) {
+            this(desc, base.phases);
+        }
+
+        private CompilationPhases(final String desc, final CompilationPhases... bases) {
+            this(desc, concatPhases(bases));
+        }
 
-            final List<CompilationPhase> newPhases = new LinkedList<>();
-            newPhases.addAll(Arrays.asList(phases));
-            this.phases = Collections.unmodifiableList(newPhases);
+        private CompilationPhases(final String desc, final List<CompilationPhase> phases) {
+            this.desc = desc;
+            this.phases = phases;
+        }
+
+        private static List<CompilationPhase> concatPhases(final CompilationPhases[] bases) {
+            final ArrayList<CompilationPhase> l = new ArrayList<>();
+            for(final CompilationPhases base: bases) {
+                l.addAll(base.phases);
+            }
+            l.trimToSize();
+            return l;
+        }
+
+        private static <T> List<T> concat(final List<T> l1, final List<T> l2) {
+            final ArrayList<T> l = new ArrayList<>(l1);
+            l.addAll(l2);
+            l.trimToSize();
+            return l;
         }
 
         @Override
@@ -235,45 +303,6 @@
             return "'" + desc + "' " + phases.toString();
         }
 
-        private CompilationPhases setDescription(final String desc) {
-            return new CompilationPhases(desc, phases.toArray(new CompilationPhase[phases.size()]));
-        }
-
-        private CompilationPhases removeLast() {
-            final LinkedList<CompilationPhase> list = new LinkedList<>(phases);
-            list.removeLast();
-            return new CompilationPhases(desc, list.toArray(new CompilationPhase[list.size()]));
-        }
-
-        private CompilationPhases addFirst(final CompilationPhase phase) {
-            if (phases.contains(phase)) {
-                return this;
-            }
-            final LinkedList<CompilationPhase> list = new LinkedList<>(phases);
-            list.addFirst(phase);
-            return new CompilationPhases(desc, list.toArray(new CompilationPhase[list.size()]));
-        }
-
-        @SuppressWarnings("unused") //TODO I'll use this soon
-        private CompilationPhases replace(final CompilationPhase phase, final CompilationPhase newPhase) {
-            final LinkedList<CompilationPhase> list = new LinkedList<>();
-            for (final CompilationPhase p : phases) {
-                list.add(p == phase ? newPhase : p);
-            }
-            return new CompilationPhases(desc, list.toArray(new CompilationPhase[list.size()]));
-        }
-
-        private CompilationPhases addAfter(final CompilationPhase phase, final CompilationPhase newPhase) {
-            final LinkedList<CompilationPhase> list = new LinkedList<>();
-            for (final CompilationPhase p : phases) {
-                list.add(p);
-                if (p == phase) {
-                    list.add(newPhase);
-                }
-            }
-            return new CompilationPhases(desc, list.toArray(new CompilationPhase[list.size()]));
-        }
-
         boolean contains(final CompilationPhase phase) {
             return phases.contains(phase);
         }
@@ -284,7 +313,7 @@
         }
 
         boolean isRestOfCompilation() {
-            return this == COMPILE_ALL_RESTOF || this == COMPILE_FROM_BYTECODE_RESTOF;
+            return this == COMPILE_ALL_RESTOF || this == GENERATE_BYTECODE_AND_INSTALL_RESTOF || this == COMPILE_SERIALIZED_RESTOF;
         }
 
         String getDesc() {
@@ -749,6 +778,14 @@
         compileUnits.addAll(newUnits);
     }
 
+    void serializeAst(final FunctionNode fn) {
+        serializedAsts.put(fn.getId(), AstSerializer.serialize(fn));
+    }
+
+    byte[] removeSerializedAst(final int fnId) {
+        return serializedAsts.remove(fnId);
+    }
+
     CompileUnit findUnit(final long weight) {
         for (final CompileUnit unit : compileUnits) {
             if (unit.canHold(weight)) {
@@ -771,7 +808,10 @@
     }
 
     RecompilableScriptFunctionData getScriptFunctionData(final int functionId) {
-        return compiledFunction == null ? null : compiledFunction.getScriptFunctionData(functionId);
+        assert compiledFunction != null;
+        final RecompilableScriptFunctionData fn = compiledFunction.getScriptFunctionData(functionId);
+        assert fn != null : functionId;
+        return fn;
     }
 
     boolean isGlobalSymbol(final FunctionNode fn, final String name) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FindScopeDepths.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FindScopeDepths.java	Wed Jul 05 20:05:30 2017 +0200
@@ -187,7 +187,6 @@
 
         if (compiler.isOnDemandCompilation()) {
             final RecompilableScriptFunctionData data = compiler.getScriptFunctionData(newFunctionNode.getId());
-            assert data != null : newFunctionNode.getName() + " lacks data";
             if (data.inDynamicContext()) {
                 log.fine("Reviving scriptfunction ", quote(name), " as defined in previous (now lost) dynamic scope.");
                 newFunctionNode = newFunctionNode.setInDynamicContext(lc);
@@ -202,7 +201,7 @@
 
         //create recompilable scriptfunctiondata
         final int fnId = newFunctionNode.getId();
-        final Map<Integer, RecompilableScriptFunctionData> nestedFunctions = fnIdToNestedFunctions.get(fnId);
+        final Map<Integer, RecompilableScriptFunctionData> nestedFunctions = fnIdToNestedFunctions.remove(fnId);
 
         assert nestedFunctions != null;
         // Generate the object class and property map in case this function is ever used as constructor
@@ -212,8 +211,8 @@
                 new AllocatorDescriptor(newFunctionNode.getThisProperties()),
                 nestedFunctions,
                 externalSymbolDepths.get(fnId),
-                internalSymbols.get(fnId)
-                );
+                internalSymbols.get(fnId),
+                compiler.removeSerializedAst(fnId));
 
         if (lc.getOutermostFunction() != newFunctionNode) {
             final FunctionNode parentFn = lc.getParentFunction(newFunctionNode);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FoldConstants.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/FoldConstants.java	Wed Jul 05 20:05:30 2017 +0200
@@ -291,7 +291,7 @@
                 value = lhs.getNumber() - rhs.getNumber();
                 break;
             case SHR:
-                return LiteralNode.newInstance(token, finish, (lhs.getInt32() >>> rhs.getInt32()) & JSType.MAX_UINT);
+                return LiteralNode.newInstance(token, finish, JSType.toUint32(lhs.getInt32() >>> rhs.getInt32()));
             case SAR:
                 return LiteralNode.newInstance(token, finish, lhs.getInt32() >> rhs.getInt32());
             case SHL:
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Label.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Label.java	Wed Jul 05 20:05:30 2017 +0200
@@ -24,6 +24,7 @@
  */
 package jdk.nashorn.internal.codegen;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.BitSet;
@@ -39,7 +40,9 @@
  *
  * see -Dnashorn.codegen.debug, --log=codegen
  */
-public final class Label {
+public final class Label implements Serializable {
+    private static final long serialVersionUID = 1L;
+
     //byte code generation evaluation type stack for consistency check
     //and correct opcode selection. one per label as a label may be a
     //join point
@@ -491,7 +494,7 @@
     private final String name;
 
     /** Type stack at this label */
-    private Label.Stack stack;
+    private transient Label.Stack stack;
 
     /** ASM representation of this label */
     private jdk.internal.org.objectweb.asm.Label label;
@@ -500,9 +503,9 @@
     private final int id;
 
     /** Is this label reachable (anything ever jumped to it)? */
-    private boolean reachable;
+    private transient boolean reachable;
 
-    private boolean breakTarget;
+    private transient boolean breakTarget;
 
     /**
      * Constructor
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java	Wed Jul 05 20:05:30 2017 +0200
@@ -72,7 +72,7 @@
 import jdk.nashorn.internal.ir.ReturnNode;
 import jdk.nashorn.internal.ir.RuntimeNode;
 import jdk.nashorn.internal.ir.RuntimeNode.Request;
-import jdk.nashorn.internal.ir.SplitNode;
+import jdk.nashorn.internal.ir.SplitReturn;
 import jdk.nashorn.internal.ir.Statement;
 import jdk.nashorn.internal.ir.SwitchNode;
 import jdk.nashorn.internal.ir.Symbol;
@@ -361,10 +361,6 @@
     // Synthetic return node that we must insert at the end of the function if it's end is reachable.
     private ReturnNode syntheticReturn;
 
-    // Topmost current split node (if any)
-    private SplitNode topSplit;
-    private boolean split;
-
     private boolean alreadyEnteredTopLevelFunction;
 
     // LvarType and conversion information gathered during the top-down pass; applied to nodes in the bottom-up pass.
@@ -477,22 +473,7 @@
             return false;
         }
         final BreakableNode target = jump.getTarget(lc);
-        return splitAwareJumpToLabel(jump, target, jump.getTargetLabel(target));
-    }
-
-    private boolean splitAwareJumpToLabel(final JumpStatement jumpStatement, final BreakableNode target, final Label targetLabel) {
-        final JoinPredecessor jumpOrigin;
-        if(topSplit != null && lc.isExternalTarget(topSplit, target)) {
-            // If the jump target is outside the topmost split node, then we'll create a synthetic jump origin in the
-            // split node.
-            jumpOrigin = new JoinPredecessorExpression();
-            topSplit.addJump(jumpOrigin, targetLabel);
-        } else {
-            // Otherwise, the original jump statement is the jump origin
-            jumpOrigin = jumpStatement;
-        }
-
-        jumpToLabel(jumpOrigin, targetLabel, getBreakTargetTypes(target));
+        jumpToLabel(jump, jump.getTargetLabel(target), getBreakTargetTypes(target));
         doesNotContinueSequentially();
         return false;
     }
@@ -703,18 +684,9 @@
     }
 
     @Override
-    public boolean enterSplitNode(final SplitNode splitNode) {
-        if(!reachable) {
-            return false;
-        }
-        // Need to visit inside of split nodes. While it's true that they don't have local variables, we need to visit
-        // breaks, continues, and returns in them.
-        if(topSplit == null) {
-            topSplit = splitNode;
-        }
-        split = true;
-        setType(getCompilerConstantSymbol(lc.getCurrentFunction(), CompilerConstants.RETURN), LvarType.UNDEFINED);
-        return true;
+    public boolean enterSplitReturn(final SplitReturn splitReturn) {
+        doesNotContinueSequentially();
+        return false;
     }
 
     @Override
@@ -1116,15 +1088,6 @@
         if(returnType.isUnknown()) {
             returnType = Type.OBJECT;
         }
-
-        if(split) {
-            // If the function is split, the ":return" symbol is used and needs a slot. Note we can't mark the return
-            // symbol as used in enterSplitNode, as we don't know the final return type of the function earlier than
-            // here.
-            final Symbol retSymbol = getCompilerConstantSymbol(lc.getCurrentFunction(), CompilerConstants.RETURN);
-            retSymbol.setHasSlotFor(returnType);
-            retSymbol.setNeedsSlot(true);
-        }
     }
 
     private void createSyntheticReturn(final Block body) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Lower.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Lower.java	Wed Jul 05 20:05:30 2017 +0200
@@ -352,8 +352,6 @@
     private Node spliceFinally(final TryNode tryNode, final List<ThrowNode> rethrows, final Block finallyBody) {
         assert tryNode.getFinallyBody() == null;
 
-        final LexicalContext lowerLc = lc;
-
         final TryNode newTryNode = (TryNode)tryNode.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
             final List<Node> insideTry = new ArrayList<>();
 
@@ -406,7 +404,6 @@
                     //still in the try block, store it in a result value and return it afterwards
                     resultNode = new IdentNode(Lower.this.compilerConstant(RETURN));
                     newStatements.add(new ExpressionStatement(returnNode.getLineNumber(), returnNode.getToken(), returnNode.getFinish(), new BinaryNode(Token.recast(returnNode.getToken(), TokenType.ASSIGN), resultNode, expr)));
-                    lowerLc.setFlag(lowerLc.getCurrentFunction(), FunctionNode.USES_RETURN_SYMBOL);
                 } else {
                     resultNode = null;
                 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MethodEmitter.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MethodEmitter.java	Wed Jul 05 20:05:30 2017 +0200
@@ -71,6 +71,7 @@
 import static jdk.nashorn.internal.codegen.ObjectClassGenerator.PRIMITIVE_FIELD_TYPE;
 import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.CALLSITE_OPTIMISTIC;
 import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.CALLSITE_PROGRAM_POINT_SHIFT;
+
 import java.io.PrintStream;
 import java.lang.reflect.Array;
 import java.util.Collection;
@@ -88,11 +89,9 @@
 import jdk.nashorn.internal.codegen.types.BitwiseType;
 import jdk.nashorn.internal.codegen.types.NumericType;
 import jdk.nashorn.internal.codegen.types.Type;
-import jdk.nashorn.internal.ir.BreakableNode;
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.IdentNode;
 import jdk.nashorn.internal.ir.JoinPredecessor;
-import jdk.nashorn.internal.ir.LexicalContext;
 import jdk.nashorn.internal.ir.LiteralNode;
 import jdk.nashorn.internal.ir.LocalVariableConversion;
 import jdk.nashorn.internal.ir.RuntimeNode;
@@ -1663,19 +1662,6 @@
     }
 
     /**
-     * Goto, possibly when splitting is taking place. If
-     * a splitNode exists, we need to handle the case that the
-     * jump target is another method
-     *
-     * @param label destination label
-     * @param targetNode the node to which the destination label belongs (the label is normally a break or continue
-     * label)
-     */
-    void splitAwareGoto(final LexicalContext lc, final Label label, final BreakableNode targetNode) {
-        _goto(label);
-    }
-
-    /**
      * Perform a comparison of two number types that are popped from the stack
      *
      * @param isCmpG is this a dcmpg semantic, false if it's a dcmpl semantic
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesCalculator.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesCalculator.java	Wed Jul 05 20:05:30 2017 +0200
@@ -30,7 +30,6 @@
 import java.util.ArrayDeque;
 import java.util.BitSet;
 import java.util.Deque;
-import jdk.nashorn.internal.IntDeque;
 import jdk.nashorn.internal.ir.AccessNode;
 import jdk.nashorn.internal.ir.BinaryNode;
 import jdk.nashorn.internal.ir.CallNode;
@@ -49,7 +48,6 @@
 import jdk.nashorn.internal.ir.Node;
 import jdk.nashorn.internal.ir.Optimistic;
 import jdk.nashorn.internal.ir.PropertyNode;
-import jdk.nashorn.internal.ir.SplitNode;
 import jdk.nashorn.internal.ir.Symbol;
 import jdk.nashorn.internal.ir.TernaryNode;
 import jdk.nashorn.internal.ir.UnaryNode;
@@ -70,8 +68,6 @@
 
     // Per-function bit set of program points that must never be optimistic.
     final Deque<BitSet> neverOptimistic = new ArrayDeque<>();
-    // Per-function depth of split nodes
-    final IntDeque splitDepth = new IntDeque();
 
     OptimisticTypesCalculator(final Compiler compiler) {
         super(new LexicalContext());
@@ -155,7 +151,6 @@
             return false;
         }
         neverOptimistic.push(new BitSet());
-        splitDepth.push(0);
         return true;
     }
 
@@ -190,19 +185,6 @@
     }
 
     @Override
-    public boolean enterSplitNode(final SplitNode splitNode) {
-        splitDepth.getAndIncrement();
-        return true;
-    }
-
-    @Override
-    public Node leaveSplitNode(final SplitNode splitNode) {
-        final int depth = splitDepth.decrementAndGet();
-        assert depth >= 0;
-        return splitNode;
-    }
-
-    @Override
     public boolean enterVarNode(final VarNode varNode) {
         tagNeverOptimistic(varNode.getName());
         return true;
@@ -226,16 +208,11 @@
     @Override
     public Node leaveFunctionNode(final FunctionNode functionNode) {
         neverOptimistic.pop();
-        final int lastSplitDepth = splitDepth.pop();
-        assert lastSplitDepth == 0;
         return functionNode.setState(lc, CompilationState.OPTIMISTIC_TYPES_ASSIGNED);
     }
 
     @Override
     public Node leaveIdentNode(final IdentNode identNode) {
-        if(inSplitNode()) {
-            return identNode;
-        }
         final Symbol symbol = identNode.getSymbol();
         if(symbol == null) {
             assert identNode.isPropertyName();
@@ -256,7 +233,7 @@
 
     private Expression leaveOptimistic(final Optimistic opt) {
         final int pp = opt.getProgramPoint();
-        if(isValid(pp) && !inSplitNode() && !neverOptimistic.peek().get(pp)) {
+        if(isValid(pp) && !neverOptimistic.peek().get(pp)) {
             return (Expression)opt.setType(compiler.getOptimisticType(opt));
         }
         return (Expression)opt;
@@ -277,8 +254,4 @@
             tagNeverOptimistic(test.getExpression());
         }
     }
-
-    private boolean inSplitNode() {
-        return splitDepth.peek() > 0;
-    }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ProgramPoints.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ProgramPoints.java	Wed Jul 05 20:05:30 2017 +0200
@@ -85,7 +85,7 @@
 
     @Override
     public boolean enterVarNode(final VarNode varNode) {
-        noProgramPoint.add(varNode.getAssignmentDest());
+        noProgramPoint.add(varNode.getName());
         return true;
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ReplaceCompileUnits.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.codegen;
+
+import java.util.ArrayList;
+import java.util.List;
+import jdk.nashorn.internal.ir.CompileUnitHolder;
+import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
+import jdk.nashorn.internal.ir.LexicalContext;
+import jdk.nashorn.internal.ir.LiteralNode;
+import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode;
+import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode.ArrayUnit;
+import jdk.nashorn.internal.ir.Node;
+import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+
+/**
+ * Base class for a node visitor that replaces {@link CompileUnit}s in {@link CompileUnitHolder}s.
+ */
+abstract class ReplaceCompileUnits extends NodeVisitor<LexicalContext> {
+    ReplaceCompileUnits() {
+        super(new LexicalContext());
+    }
+
+    /**
+     * Override to provide a replacement for an old compile unit.
+     * @param oldUnit the old compile unit to replace
+     * @return the compile unit's replacement.
+     */
+    abstract CompileUnit getReplacement(final CompileUnit oldUnit);
+
+    CompileUnit getExistingReplacement(final CompileUnitHolder node) {
+        final CompileUnit oldUnit = node.getCompileUnit();
+        assert oldUnit != null;
+
+        final CompileUnit newUnit = getReplacement(oldUnit);
+        assert newUnit != null;
+
+        return newUnit;
+    }
+
+    @Override
+    public Node leaveFunctionNode(final FunctionNode node) {
+        return node.setCompileUnit(lc, getExistingReplacement(node)).setState(lc, CompilationState.COMPILE_UNITS_REUSED);
+    }
+
+    @Override
+    public Node leaveLiteralNode(final LiteralNode<?> node) {
+        if (node instanceof ArrayLiteralNode) {
+            final ArrayLiteralNode aln = (ArrayLiteralNode)node;
+            if (aln.getUnits() == null) {
+                return node;
+            }
+            final List<ArrayUnit> newArrayUnits = new ArrayList<>();
+            for (final ArrayUnit au : aln.getUnits()) {
+                newArrayUnits.add(new ArrayUnit(getExistingReplacement(au), au.getLo(), au.getHi()));
+            }
+            return aln.setUnits(lc, newArrayUnits);
+        }
+        return node;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/SplitIntoFunctions.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,450 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.codegen;
+
+import static jdk.nashorn.internal.ir.Node.NO_FINISH;
+import static jdk.nashorn.internal.ir.Node.NO_LINE_NUMBER;
+import static jdk.nashorn.internal.ir.Node.NO_TOKEN;
+
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Deque;
+import java.util.List;
+import java.util.Objects;
+import jdk.nashorn.internal.ir.AccessNode;
+import jdk.nashorn.internal.ir.BinaryNode;
+import jdk.nashorn.internal.ir.Block;
+import jdk.nashorn.internal.ir.BlockLexicalContext;
+import jdk.nashorn.internal.ir.BreakNode;
+import jdk.nashorn.internal.ir.CallNode;
+import jdk.nashorn.internal.ir.CaseNode;
+import jdk.nashorn.internal.ir.ContinueNode;
+import jdk.nashorn.internal.ir.Expression;
+import jdk.nashorn.internal.ir.ExpressionStatement;
+import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
+import jdk.nashorn.internal.ir.GetSplitState;
+import jdk.nashorn.internal.ir.IdentNode;
+import jdk.nashorn.internal.ir.IfNode;
+import jdk.nashorn.internal.ir.JumpStatement;
+import jdk.nashorn.internal.ir.LiteralNode;
+import jdk.nashorn.internal.ir.Node;
+import jdk.nashorn.internal.ir.ReturnNode;
+import jdk.nashorn.internal.ir.SetSplitState;
+import jdk.nashorn.internal.ir.SplitNode;
+import jdk.nashorn.internal.ir.SplitReturn;
+import jdk.nashorn.internal.ir.Statement;
+import jdk.nashorn.internal.ir.SwitchNode;
+import jdk.nashorn.internal.ir.VarNode;
+import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+import jdk.nashorn.internal.parser.Token;
+import jdk.nashorn.internal.parser.TokenType;
+
+/**
+ * A node visitor that replaces {@link SplitNode}s with anonymous function invocations and some additional constructs
+ * to support control flow across splits. By using this transformation, split functions are translated into ordinary
+ * JavaScript functions with nested anonymous functions. The transformations however introduce several AST nodes that
+ * have no JavaScript source representations ({@link GetSplitState}, {@link SetSplitState}, and {@link SplitReturn}),
+ * and therefore such function is no longer reparseable from its source. For that reason, split functions and their
+ * fragments are serialized in-memory and deserialized when they need to be recompiled either for deoptimization or
+ * for type specialization.
+ * NOTE: all {@code leave*()} methods for statements are returning their input nodes. That way, they will not mutate
+ * the original statement list in the block containing the statement, which is fine, as it'll be replaced by the
+ * lexical context when the block is left. If we returned something else (e.g. null), we'd cause a mutation in the
+ * enclosing block's statement list that is otherwise overwritten later anyway.
+ */
+final class SplitIntoFunctions extends NodeVisitor<BlockLexicalContext> {
+    private static final int FALLTHROUGH_STATE = -1;
+    private static final int RETURN_STATE = 0;
+    private static final int BREAK_STATE = 1;
+    private static final int FIRST_JUMP_STATE = 2;
+
+    private static final String THIS_NAME = CompilerConstants.THIS.symbolName();
+    private static final String RETURN_NAME = CompilerConstants.RETURN.symbolName();
+    // Used as the name of the formal parameter for passing the current value of :return symbol into a split fragment.
+    private static final String RETURN_PARAM_NAME = RETURN_NAME + "-in";
+
+    private final Deque<FunctionState> functionStates = new ArrayDeque<>();
+    private final Deque<SplitState> splitStates = new ArrayDeque<>();
+    private final Namespace namespace;
+
+    private boolean artificialBlock = false;
+
+    // -1 is program; we need to use negative ones
+    private int nextFunctionId = -2;
+
+    public SplitIntoFunctions(final Compiler compiler) {
+        super(new BlockLexicalContext() {
+            @Override
+            protected Block afterSetStatements(Block block) {
+                for(Statement stmt: block.getStatements()) {
+                    assert !(stmt instanceof SplitNode);
+                }
+                return block;
+            }
+        });
+        namespace = new Namespace(compiler.getScriptEnvironment().getNamespace());
+    }
+
+    @Override
+    public boolean enterFunctionNode(final FunctionNode functionNode) {
+        functionStates.push(new FunctionState(functionNode));
+        return true;
+    }
+
+    @Override
+    public Node leaveFunctionNode(final FunctionNode functionNode) {
+        functionStates.pop();
+        return functionNode;
+    }
+
+    @Override
+    protected Node leaveDefault(final Node node) {
+        if (node instanceof Statement) {
+            appendStatement((Statement)node);
+        }
+        return node;
+    }
+
+    @Override
+    public boolean enterSplitNode(final SplitNode splitNode) {
+        getCurrentFunctionState().splitDepth++;
+        splitStates.push(new SplitState(splitNode));
+        return true;
+    }
+
+    @Override
+    public Node leaveSplitNode(final SplitNode splitNode) {
+        // Replace the split node with an anonymous function expression call.
+
+        final FunctionState fnState = getCurrentFunctionState();
+
+        final String name = splitNode.getName();
+        Block body = splitNode.getBody();
+        final int firstLineNumber = body.getFirstStatementLineNumber();
+        final long token = body.getToken();
+        final int finish = body.getFinish();
+
+        final FunctionNode originalFn = fnState.fn;
+        assert originalFn == lc.getCurrentFunction();
+        final boolean isProgram = originalFn.isProgram();
+
+        // Change SplitNode({...}) into "function () { ... }", or "function (:return-in) () { ... }" (for program)
+        final long newFnToken = Token.toDesc(TokenType.FUNCTION, nextFunctionId--, 0);
+        final FunctionNode fn = new FunctionNode(
+                originalFn.getSource(),
+                body.getFirstStatementLineNumber(),
+                newFnToken,
+                finish,
+                newFnToken,
+                NO_TOKEN,
+                namespace,
+                createIdent(name),
+                originalFn.getName() + "$" + name,
+                isProgram ? Collections.singletonList(createReturnParamIdent()) : Collections.<IdentNode>emptyList(),
+                FunctionNode.Kind.NORMAL,
+                // We only need IS_SPLIT conservatively, in case it contains any array units so that we force
+                // the :callee's existence, to force :scope to never be in a slot lower than 2. This is actually
+                // quite a horrible hack to do with CodeGenerator.fixScopeSlot not trampling other parameters
+                // and should go away once we no longer have array unit handling in codegen. Note however that
+                // we still use IS_SPLIT as the criteria in CompilationPhase.SERIALIZE_SPLIT_PHASE.
+                FunctionNode.IS_ANONYMOUS | FunctionNode.USES_ANCESTOR_SCOPE | FunctionNode.IS_SPLIT,
+                body,
+                CompilationState.INITIALIZED,
+                null
+        )
+        .setCompileUnit(lc, splitNode.getCompileUnit())
+        .copyCompilationState(lc, originalFn);
+
+        // Call the function:
+        //     either "(function () { ... }).call(this)"
+        //     or     "(function (:return-in) { ... }).call(this, :return)"
+        // NOTE: Function.call() has optimized linking that basically does a pass-through to the function being invoked.
+        // NOTE: CompilationPhase.PROGRAM_POINT_PHASE happens after this, so these calls are subject to optimistic
+        // assumptions on their return value (when they return a value), as they should be.
+        final IdentNode thisIdent = createIdent(THIS_NAME);
+        final CallNode callNode = new CallNode(firstLineNumber, token, finish, new AccessNode(NO_TOKEN, NO_FINISH, fn, "call"),
+                isProgram ? Arrays.<Expression>asList(thisIdent, createReturnIdent())
+                          : Collections.<Expression>singletonList(thisIdent),
+                false);
+
+        final SplitState splitState = splitStates.pop();
+        fnState.splitDepth--;
+
+        final Expression callWithReturn;
+        final boolean hasReturn = splitState.hasReturn;
+        if (hasReturn && fnState.splitDepth > 0) {
+            final SplitState parentSplit = splitStates.peek();
+            if (parentSplit != null) {
+                // Propagate hasReturn to parent split
+                parentSplit.hasReturn = true;
+            }
+        }
+        if (hasReturn || isProgram) {
+            // capture return value: ":return = (function () { ... })();"
+            callWithReturn = new BinaryNode(Token.recast(token, TokenType.ASSIGN), createReturnIdent(), callNode);
+        } else {
+            // no return value, just call : "(function () { ... })();"
+            callWithReturn = callNode;
+        }
+        appendStatement(new ExpressionStatement(firstLineNumber, token, finish, callWithReturn));
+
+        Statement splitStateHandler;
+
+        final List<JumpStatement> jumpStatements = splitState.jumpStatements;
+        final int jumpCount = jumpStatements.size();
+        // There are jumps (breaks or continues) that need to be propagated outside the split node. We need to
+        // set up a switch statement for them:
+        // switch(:scope.getScopeState()) { ... }
+        if (jumpCount > 0) {
+            final List<CaseNode> cases = new ArrayList<>(jumpCount + (hasReturn ? 1 : 0));
+            if (hasReturn) {
+                // If the split node also contained a return, we'll slip it as a case in the switch statement
+                addCase(cases, RETURN_STATE, createReturnFromSplit());
+            }
+            int i = FIRST_JUMP_STATE;
+            for (final JumpStatement jump: jumpStatements) {
+                addCase(cases, i++, enblockAndVisit(jump));
+            }
+            splitStateHandler = new SwitchNode(NO_LINE_NUMBER, token, finish, GetSplitState.INSTANCE, cases, null);
+        } else {
+            splitStateHandler = null;
+        }
+
+        // As the switch statement itself is breakable, an unlabelled break can't be in the switch statement,
+        // so we need to test for it separately.
+        if (splitState.hasBreak) {
+            // if(:scope.getScopeState() == Scope.BREAK) { break; }
+            splitStateHandler = makeIfStateEquals(firstLineNumber, token, finish, BREAK_STATE,
+                    enblockAndVisit(new BreakNode(NO_LINE_NUMBER, token, finish, null)), splitStateHandler);
+        }
+
+        // Finally, if the split node had a return statement, but there were no external jumps, we didn't have
+        // the switch statement to handle the return, so we need a separate if for it.
+        if (hasReturn && jumpCount == 0) {
+            // if (:scope.getScopeState() == Scope.RETURN) { return :return; }
+            splitStateHandler = makeIfStateEquals(NO_LINE_NUMBER, token, finish, RETURN_STATE,
+                    createReturnFromSplit(), splitStateHandler);
+        }
+
+        if (splitStateHandler != null) {
+            appendStatement(splitStateHandler);
+        }
+
+        return splitNode;
+    }
+
+    private static void addCase(final List<CaseNode> cases, final int i, final Block body) {
+        cases.add(new CaseNode(NO_TOKEN, NO_FINISH, intLiteral(i), body));
+    }
+
+    private static LiteralNode<Number> intLiteral(final int i) {
+        return LiteralNode.newInstance(NO_TOKEN, NO_FINISH, i);
+    }
+
+    private static Block createReturnFromSplit() {
+        return new Block(NO_TOKEN, NO_FINISH, createReturnReturn());
+    }
+
+    private static ReturnNode createReturnReturn() {
+        return new ReturnNode(NO_LINE_NUMBER, NO_TOKEN, NO_FINISH, createReturnIdent());
+    }
+
+    private static IdentNode createReturnIdent() {
+        return createIdent(RETURN_NAME);
+    }
+
+    private static IdentNode createReturnParamIdent() {
+        return createIdent(RETURN_PARAM_NAME);
+    }
+
+    private static IdentNode createIdent(final String name) {
+        return new IdentNode(NO_TOKEN, NO_FINISH, name);
+    }
+
+    private Block enblockAndVisit(final JumpStatement jump) {
+        artificialBlock = true;
+        final Block block = (Block)new Block(NO_TOKEN, NO_FINISH, jump).accept(this);
+        artificialBlock = false;
+        return block;
+    }
+
+    private static IfNode makeIfStateEquals(final int lineNumber, final long token, final int finish,
+            final int value, final Block pass, final Statement fail) {
+        return new IfNode(lineNumber, token, finish,
+                new BinaryNode(Token.recast(token, TokenType.EQ_STRICT),
+                        GetSplitState.INSTANCE, intLiteral(value)),
+                pass,
+                fail == null ? null : new Block(NO_TOKEN, NO_FINISH, fail));
+    }
+
+    @Override
+    public boolean enterVarNode(VarNode varNode) {
+        if (!inSplitNode()) {
+            return super.enterVarNode(varNode);
+        }
+        assert !varNode.isBlockScoped(); //TODO: we must handle these too, but we currently don't
+
+        final Expression init = varNode.getInit();
+        if (varNode.isAnonymousFunctionDeclaration()) {
+            // We ain't moving anonymous function declarations.
+            return super.enterVarNode(varNode);
+        }
+
+        // Move a declaration-only var statement to the top of the outermost function.
+        getCurrentFunctionState().varStatements.add(varNode.setInit(null));
+        // If it had an initializer, replace it with an assignment expression statement. Note that "var" is a
+        // statement, so it doesn't contribute to :return of the programs, therefore we are _not_ adding a
+        // ":return = ..." assignment around the original assignment.
+        if (init != null) {
+            final long token = Token.recast(varNode.getToken(), TokenType.ASSIGN);
+            new ExpressionStatement(varNode.getLineNumber(), token, varNode.getFinish(),
+                    new BinaryNode(token, varNode.getName(), varNode.getInit())).accept(this);
+        }
+
+        return false;
+    }
+
+    @Override
+    public Node leaveBlock(final Block block) {
+        if (!artificialBlock) {
+            if (lc.isFunctionBody()) {
+                // Prepend declaration-only var statements to the top of the statement list.
+                lc.prependStatements(getCurrentFunctionState().varStatements);
+            } else if (lc.isSplitBody()) {
+                appendSplitReturn(FALLTHROUGH_STATE, NO_LINE_NUMBER);
+                if (getCurrentFunctionState().fn.isProgram()) {
+                    // If we're splitting the program, make sure every shard ends with "return :return" and
+                    // begins with ":return = :return-in;".
+                    lc.prependStatement(new ExpressionStatement(NO_LINE_NUMBER, NO_TOKEN, NO_FINISH,
+                            new BinaryNode(Token.toDesc(TokenType.ASSIGN, 0, 0), createReturnIdent(), createReturnParamIdent())));
+                }
+            }
+        }
+        return block;
+    }
+
+    @Override
+    public Node leaveBreakNode(final BreakNode breakNode) {
+        return leaveJumpNode(breakNode);
+    }
+
+    @Override
+    public Node leaveContinueNode(final ContinueNode continueNode) {
+        return leaveJumpNode(continueNode);
+    }
+
+    private JumpStatement leaveJumpNode(final JumpStatement jump) {
+        if (inSplitNode()) {
+            final SplitState splitState = getCurrentSplitState();
+            final SplitNode splitNode = splitState.splitNode;
+            if (lc.isExternalTarget(splitNode, jump.getTarget(lc))) {
+                appendSplitReturn(splitState.getSplitStateIndex(jump), jump.getLineNumber());
+                return jump;
+            }
+        }
+        appendStatement(jump);
+        return jump;
+    }
+
+    private void appendSplitReturn(final int splitState, final int lineNumber) {
+        appendStatement(new SetSplitState(splitState, lineNumber));
+        if (getCurrentFunctionState().fn.isProgram()) {
+            // If we're splitting the program, make sure every fragment passes back :return
+            appendStatement(createReturnReturn());
+        } else {
+            appendStatement(SplitReturn.INSTANCE);
+        }
+    }
+
+    @Override
+    public Node leaveReturnNode(final ReturnNode returnNode) {
+        if(inSplitNode()) {
+            appendStatement(new SetSplitState(RETURN_STATE, returnNode.getLineNumber()));
+            getCurrentSplitState().hasReturn = true;
+        }
+        appendStatement(returnNode);
+        return returnNode;
+    }
+
+    private void appendStatement(final Statement statement) {
+        lc.appendStatement(statement);
+    }
+
+    private boolean inSplitNode() {
+        return getCurrentFunctionState().splitDepth > 0;
+    }
+
+    private FunctionState getCurrentFunctionState() {
+        return functionStates.peek();
+    }
+
+    private SplitState getCurrentSplitState() {
+        return splitStates.peek();
+    }
+
+    private static class FunctionState {
+        final FunctionNode fn;
+        final List<Statement> varStatements = new ArrayList<>();
+        int splitDepth;
+
+        FunctionState(final FunctionNode fn) {
+            this.fn = fn;
+        }
+    }
+
+    private static class SplitState {
+        final SplitNode splitNode;
+        boolean hasReturn;
+        boolean hasBreak;
+
+        final List<JumpStatement> jumpStatements = new ArrayList<>();
+
+        int getSplitStateIndex(final JumpStatement jump) {
+            if (jump instanceof BreakNode && jump.getLabelName() == null) {
+                // Unlabelled break is a special case
+                hasBreak = true;
+                return BREAK_STATE;
+            }
+
+            int i = 0;
+            for(final JumpStatement exJump: jumpStatements) {
+                if (jump.getClass() == exJump.getClass() && Objects.equals(jump.getLabelName(), exJump.getLabelName())) {
+                    return i + FIRST_JUMP_STATE;
+                }
+                ++i;
+            }
+            jumpStatements.add(jump);
+            return i + FIRST_JUMP_STATE;
+        }
+
+        SplitState(final SplitNode splitNode) {
+            this.splitNode = splitNode;
+        }
+    }
+}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/SplitMethodEmitter.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.nashorn.internal.codegen;
-
-import java.util.ArrayList;
-import java.util.List;
-import jdk.internal.org.objectweb.asm.MethodVisitor;
-import jdk.nashorn.internal.codegen.types.Type;
-import jdk.nashorn.internal.ir.BreakableNode;
-import jdk.nashorn.internal.ir.LexicalContext;
-import jdk.nashorn.internal.ir.SplitNode;
-
-/**
- * Emitter used for splitting methods. Needs to keep track of if there are jump targets
- * outside the current split node. All external jump targets encountered at method
- * emission are logged, and {@code CodeGenerator#leaveSplitNode(SplitNode)} creates
- * an appropriate jump table when the SplitNode has been iterated through
- */
-public class SplitMethodEmitter extends MethodEmitter {
-
-    private final SplitNode splitNode;
-
-    private final List<Label> externalTargets = new ArrayList<>();
-    /**
-     * In addition to external target labels, we need to track the target breakables too as the code generator needs to
-     * be able to correctly pop the scopes to the target, see {@link CodeGenerator#leaveSplitNode(SplitNode)}. Note that
-     * this is only used within CodeGenerator, which doesn't mutate the AST, so keeping pointers to other nodes is not
-     * incorrect.
-     */
-    private final List<BreakableNode> externalTargetNodes = new ArrayList<>();
-
-    SplitMethodEmitter(final ClassEmitter classEmitter, final MethodVisitor mv, final SplitNode splitNode) {
-        super(classEmitter, mv);
-        this.splitNode = splitNode;
-    }
-
-    @Override
-    void splitAwareGoto(final LexicalContext lc, final Label label, final BreakableNode targetNode) {
-        assert splitNode != null;
-        final int index = findExternalTarget(lc, label, targetNode);
-        if (index >= 0) {
-            setSplitState(index + 1); // 0 is ordinary return
-            final Type retType = functionNode.getReturnType();
-            loadUndefined(retType);
-            _return(retType);
-        } else {
-            super.splitAwareGoto(lc, label, targetNode);
-        }
-    }
-
-    private int findExternalTarget(final LexicalContext lc, final Label label, final BreakableNode targetNode) {
-        final int index = externalTargets.indexOf(label);
-
-        if (index >= 0) {
-            return index;
-        }
-
-        if (lc.isExternalTarget(splitNode, targetNode)) {
-            externalTargets.add(label);
-            externalTargetNodes.add(targetNode);
-            return externalTargets.size() - 1;
-        }
-        return -1;
-    }
-
-    @Override
-    MethodEmitter registerReturn() {
-        setHasReturn();
-        return setSplitState(0);
-    }
-
-    final List<Label> getExternalTargets() {
-        return externalTargets;
-    }
-
-    final List<BreakableNode> getExternalTargetNodes() {
-        return externalTargetNodes;
-    }
-}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/ArrayType.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/ArrayType.java	Wed Jul 05 20:05:30 2017 +0200
@@ -37,6 +37,7 @@
  * This is an array type, i.e. OBJECT_ARRAY, NUMBER_ARRAY.
  */
 public class ArrayType extends ObjectType implements BytecodeArrayOps {
+    private static final long serialVersionUID = 1L;
 
     /**
      * Constructor
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/BitwiseType.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/BitwiseType.java	Wed Jul 05 20:05:30 2017 +0200
@@ -29,6 +29,7 @@
  * This class represents a numeric type that can be used for bit operations.
  */
 public abstract class BitwiseType extends NumericType implements BytecodeBitwiseOps {
+    private static final long serialVersionUID = 1L;
 
     /**
      * Constructor
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/BooleanType.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/BooleanType.java	Wed Jul 05 20:05:30 2017 +0200
@@ -69,6 +69,7 @@
  * The boolean type class
  */
 public final class BooleanType extends Type {
+    private static final long serialVersionUID = 1L;
 
     private static final CompilerConstants.Call VALUE_OF = staticCallNoLookup(Boolean.class, "valueOf", Boolean.class, boolean.class);
     private static final CompilerConstants.Call TO_STRING = staticCallNoLookup(Boolean.class, "toString", String.class, boolean.class);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/IntType.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/IntType.java	Wed Jul 05 20:05:30 2017 +0200
@@ -60,6 +60,7 @@
  * Type class: INT
  */
 class IntType extends BitwiseType {
+    private static final long serialVersionUID = 1L;
 
     private static final CompilerConstants.Call TO_STRING = staticCallNoLookup(Integer.class, "toString", String.class, int.class);
     private static final CompilerConstants.Call VALUE_OF  = staticCallNoLookup(Integer.class, "valueOf", Integer.class, int.class);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/LongType.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/LongType.java	Wed Jul 05 20:05:30 2017 +0200
@@ -54,6 +54,7 @@
  * Type class: LONG
  */
 class LongType extends BitwiseType {
+    private static final long serialVersionUID = 1L;
 
     private static final CompilerConstants.Call VALUE_OF = staticCallNoLookup(Long.class, "valueOf", Long.class, long.class);
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/NumberType.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/NumberType.java	Wed Jul 05 20:05:30 2017 +0200
@@ -46,6 +46,7 @@
 import jdk.nashorn.internal.runtime.JSType;
 
 class NumberType extends NumericType {
+    private static final long serialVersionUID = 1L;
 
     private static final CompilerConstants.Call VALUE_OF = staticCallNoLookup(Double.class, "valueOf", Double.class, double.class);
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/NumericType.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/NumericType.java	Wed Jul 05 20:05:30 2017 +0200
@@ -29,6 +29,8 @@
  * This is a numeric type, i.e. NUMBER, LONG, INT, INT32.
  */
 public abstract class NumericType extends Type implements BytecodeNumericOps {
+    private static final long serialVersionUID = 1L;
+
     /**
      * Constructor
      *
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/ObjectType.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/ObjectType.java	Wed Jul 05 20:05:30 2017 +0200
@@ -47,6 +47,7 @@
  * contain a class that is a more specialized object
  */
 class ObjectType extends Type {
+    private static final long serialVersionUID = 1L;
 
     protected ObjectType() {
         this(Object.class);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/Type.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/Type.java	Wed Jul 05 20:05:30 2017 +0200
@@ -47,9 +47,11 @@
 import static jdk.internal.org.objectweb.asm.Opcodes.T_INT;
 import static jdk.internal.org.objectweb.asm.Opcodes.T_LONG;
 import static jdk.nashorn.internal.codegen.CompilerConstants.staticCallNoLookup;
+
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
+import java.io.Serializable;
 import java.lang.invoke.CallSite;
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
@@ -88,19 +90,20 @@
  * INTs rather than OBJECTs
  */
 
-public abstract class Type implements Comparable<Type>, BytecodeOps {
+public abstract class Type implements Comparable<Type>, BytecodeOps, Serializable {
+    private static final long serialVersionUID = 1L;
 
     /** Human readable name for type */
-    private final String name;
+    private transient final String name;
 
     /** Descriptor for type */
-    private final String descriptor;
+    private transient final String descriptor;
 
     /** The "weight" of the type. Used for picking widest/least specific common type */
-    private final int weight;
+    private transient final int weight;
 
     /** How many bytecode slots does this type occupy */
-    private final int slots;
+    private transient final int slots;
 
     /** The class for this type */
     private final Class<?> clazz;
@@ -113,7 +116,7 @@
             Collections.synchronizedMap(new WeakHashMap<Class<?>, jdk.internal.org.objectweb.asm.Type>());
 
     /** Internal ASM type for this Type - computed once at construction */
-    private final jdk.internal.org.objectweb.asm.Type internalType;
+    private transient final jdk.internal.org.objectweb.asm.Type internalType;
 
     /** Weights are used to decide which types are "wider" than other types */
     protected static final int MIN_WEIGHT = -1;
@@ -583,6 +586,7 @@
     public int getSlots() {
         return slots;
     }
+
     /**
      * Returns the widest or most common of two types
      *
@@ -606,6 +610,18 @@
     }
 
     /**
+     * Returns the widest or most common of two types, given as classes
+     *
+     * @param type0 type one
+     * @param type1 type two
+     *
+     * @return the widest type
+     */
+    public static Class<?> widest(final Class<?> type0, final Class<?> type1) {
+        return widest(Type.typeFor(type0), Type.typeFor(type1)).getTypeClass();
+    }
+
+    /**
      * When doing widening for return types of a function or a ternary operator, it is not valid to widen a boolean to
      * anything other than object. Note that this wouldn't be necessary if {@code Type.widest} did not allow
      * boolean-to-number widening. Eventually, we should address it there, but it affects too many other parts of the
@@ -934,6 +950,8 @@
      * This is the singleton for integer arrays
      */
     public static final ArrayType INT_ARRAY = new ArrayType(int[].class) {
+        private static final long serialVersionUID = 1L;
+
         @Override
         public void astore(final MethodVisitor method) {
             method.visitInsn(IASTORE);
@@ -961,6 +979,8 @@
      * This is the singleton for long arrays
      */
     public static final ArrayType LONG_ARRAY = new ArrayType(long[].class) {
+        private static final long serialVersionUID = 1L;
+
         @Override
         public void astore(final MethodVisitor method) {
             method.visitInsn(LASTORE);
@@ -988,6 +1008,8 @@
      * This is the singleton for numeric arrays
      */
     public static final ArrayType NUMBER_ARRAY = new ArrayType(double[].class) {
+        private static final long serialVersionUID = 1L;
+
         @Override
         public void astore(final MethodVisitor method) {
             method.visitInsn(DASTORE);
@@ -1022,6 +1044,8 @@
 
     /** This type, always an object type, just a toString override */
     public static final Type THIS = new ObjectType() {
+        private static final long serialVersionUID = 1L;
+
         @Override
         public String toString() {
             return "this";
@@ -1030,6 +1054,8 @@
 
     /** Scope type, always an object type, just a toString override */
     public static final Type SCOPE = new ObjectType() {
+        private static final long serialVersionUID = 1L;
+
         @Override
         public String toString() {
             return "scope";
@@ -1041,6 +1067,7 @@
     }
 
     private abstract static class ValueLessType extends Type {
+        private static final long serialVersionUID = 1L;
 
         ValueLessType(final String name) {
             super(name, Unknown.class, MIN_WEIGHT, 1);
@@ -1092,6 +1119,8 @@
      * inference. It has the minimum type width
      */
     public static final Type UNKNOWN = new ValueLessType("<unknown>") {
+        private static final long serialVersionUID = 1L;
+
         @Override
         public String getDescriptor() {
             return "<unknown>";
@@ -1108,6 +1137,7 @@
      * inference. It has the minimum type width
      */
     public static final Type SLOT_2 = new ValueLessType("<slot_2>") {
+        private static final long serialVersionUID = 1L;
 
         @Override
         public String getDescriptor() {
@@ -1124,4 +1154,8 @@
         cache.put(type.getTypeClass(), type);
         return type;
     }
+
+    protected final Object readResolve() {
+        return Type.typeFor(clazz);
+    }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/AccessNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/AccessNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -34,6 +34,8 @@
  */
 @Immutable
 public final class AccessNode extends BaseNode {
+    private static final long serialVersionUID = 1L;
+
     /** Property name. */
     private final String property;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BaseNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BaseNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -39,6 +39,7 @@
  */
 @Immutable
 public abstract class BaseNode extends Expression implements FunctionCall, Optimistic {
+    private static final long serialVersionUID = 1L;
 
     /** Base Node. */
     protected final Expression base;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BinaryNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BinaryNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -43,6 +43,8 @@
  */
 @Immutable
 public final class BinaryNode extends Expression implements Assignment<Expression>, Optimistic {
+    private static final long serialVersionUID = 1L;
+
     // Placeholder for "undecided optimistic ADD type". Unfortunately, we can't decide the type of ADD during optimistic
     // type calculation as it can have local variables as its operands that will decide its ultimate type.
     private static final Type OPTIMISTIC_UNDECIDED_TYPE = Type.typeFor(new Object(){/*empty*/}.getClass());
@@ -56,8 +58,8 @@
 
     private final Type type;
 
-    private Type cachedType;
-    private Object cachedTypeFunction;
+    private transient Type cachedType;
+    private transient Object cachedTypeFunction;
 
     @Ignore
     private static final Set<TokenType> CAN_OVERFLOW =
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Block.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Block.java	Wed Jul 05 20:05:30 2017 +0200
@@ -42,6 +42,8 @@
  */
 @Immutable
 public class Block extends Node implements BreakableNode, Terminal, Flags<Block> {
+    private static final long serialVersionUID = 1L;
+
     /** List of statements */
     protected final List<Statement> statements;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BlockLexicalContext.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BlockLexicalContext.java	Wed Jul 05 20:05:30 2017 +0200
@@ -109,6 +109,16 @@
     }
 
     /**
+     * Prepend a list of statement to the block being generated
+     * @param statements a list of statements to prepend
+     */
+    public void prependStatements(final List<Statement> statements) {
+        assert statements != null;
+        sstack.peek().addAll(0, statements);
+    }
+
+
+    /**
      * Get the last statement that was emitted into a block
      * @return the last statement emitted
      */
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BlockStatement.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BlockStatement.java	Wed Jul 05 20:05:30 2017 +0200
@@ -32,6 +32,8 @@
  * Represents a block used as a statement.
  */
 public class BlockStatement extends Statement {
+    private static final long serialVersionUID = 1L;
+
     /** Block to execute. */
     private final Block block;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BreakNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BreakNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -34,6 +34,7 @@
  */
 @Immutable
 public final class BreakNode extends JumpStatement {
+    private static final long serialVersionUID = 1L;
 
     /**
      * Constructor
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BreakableStatement.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BreakableStatement.java	Wed Jul 05 20:05:30 2017 +0200
@@ -32,6 +32,7 @@
 
 @Immutable
 abstract class BreakableStatement extends LexicalContextStatement implements BreakableNode {
+    private static final long serialVersionUID = 1L;
 
     /** break label. */
     protected final Label breakLabel;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/CallNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/CallNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -27,6 +27,7 @@
 
 import static jdk.nashorn.internal.runtime.UnwarrantedOptimismException.INVALID_PROGRAM_POINT;
 
+import java.io.Serializable;
 import java.util.Collections;
 import java.util.List;
 import java.util.function.Function;
@@ -40,6 +41,7 @@
  */
 @Immutable
 public final class CallNode extends LexicalContextExpression implements Optimistic {
+    private static final long serialVersionUID = 1L;
 
     /** Function identifier or function body. */
     private final Expression function;
@@ -64,7 +66,8 @@
     /**
      * Arguments to be passed to builtin {@code eval} function
      */
-    public static class EvalArgs {
+    public static class EvalArgs implements Serializable {
+        private static final long serialVersionUID = 1L;
         private final List<Expression> args;
 
         /** location string for the eval call */
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/CaseNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/CaseNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -37,6 +37,8 @@
  */
 @Immutable
 public final class CaseNode extends Node implements JoinPredecessor, Labels, Terminal {
+    private static final long serialVersionUID = 1L;
+
     /** Test expression. */
     private final Expression test;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/CatchNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/CatchNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -33,6 +33,8 @@
  */
 @Immutable
 public final class CatchNode extends Statement {
+    private static final long serialVersionUID = 1L;
+
     /** Exception identifier. */
     private final IdentNode exception;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ContinueNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ContinueNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -34,6 +34,8 @@
  */
 @Immutable
 public class ContinueNode extends JumpStatement {
+    private static final long serialVersionUID = 1L;
+
     /**
      * Constructor
      *
@@ -80,4 +82,3 @@
         return ((LoopNode)target).getContinueLabel();
     }
 }
-
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/EmptyNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/EmptyNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -33,6 +33,7 @@
  */
 @Immutable
 public final class EmptyNode extends Statement {
+    private static final long serialVersionUID = 1L;
 
     /**
      * Constructor
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Expression.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Expression.java	Wed Jul 05 20:05:30 2017 +0200
@@ -35,6 +35,8 @@
  *
  */
 public abstract class Expression extends Node {
+    private static final long serialVersionUID = 1L;
+
     static final String OPT_IDENTIFIER = "%";
 
     private static final Function<Symbol, Type> UNKNOWN_LOCALS = new Function<Symbol, Type>() {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ExpressionStatement.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ExpressionStatement.java	Wed Jul 05 20:05:30 2017 +0200
@@ -35,6 +35,8 @@
  */
 @Immutable
 public final class ExpressionStatement extends Statement {
+    private static final long serialVersionUID = 1L;
+
     /** Expression to execute. */
     private final Expression expression;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ForNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ForNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -33,6 +33,8 @@
  */
 @Immutable
 public final class ForNode extends LoopNode {
+    private static final long serialVersionUID = 1L;
+
     /** Initialize expression for an ordinary for statement, or the LHS expression receiving iterated-over values in a
      * for-in statement. */
     private final Expression init;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/FunctionNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/FunctionNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -31,6 +31,7 @@
 import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.CALLSITE_TRACE_ENTEREXIT;
 import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.CALLSITE_TRACE_MISSES;
 import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.CALLSITE_TRACE_VALUES;
+
 import java.util.Collections;
 import java.util.EnumSet;
 import java.util.Iterator;
@@ -57,6 +58,8 @@
  */
 @Immutable
 public final class FunctionNode extends LexicalContextExpression implements Flags<FunctionNode>, CompileUnitHolder {
+    private static final long serialVersionUID = 1L;
+
     /** Type used for all FunctionNodes */
     public static final Type FUNCTION_TYPE = Type.typeFor(ScriptFunction.class);
 
@@ -107,7 +110,7 @@
     }
 
     /** Source of entity. */
-    private final Source source;
+    private transient final Source source;
 
     /**
      * Opaque object representing parser state at the end of the function. Used when reparsing outer functions
@@ -141,7 +144,7 @@
     private final long lastToken;
 
     /** Method's namespace. */
-    private final Namespace namespace;
+    private transient final Namespace namespace;
 
     /** Current compilation state */
     @Ignore
@@ -207,31 +210,23 @@
     /** Are we vararg, but do we just pass the arguments along to apply or call */
     public static final int HAS_APPLY_TO_CALL_SPECIALIZATION = 1 << 12;
 
-    /** Does this function explicitly use the {@link CompilerConstants#RETURN} symbol? Some functions are known to
-     * always use the return symbol, namely a function that is a program (as it must track its last executed expression
-     * statement's value) as well as functions that are split (to communicate return values from inner to outer
-     * partitions). Other functions normally don't use the return symbol (so we optimize away its slot), except in some
-     * very special cases, e.g. when containing a return statement in a finally block. These special cases set this
-     * flag. */
-    public static final int USES_RETURN_SYMBOL = 1 << 13;
-
     /**
      * Is this function the top-level program?
      */
-    public static final int IS_PROGRAM = 1 << 14;
+    public static final int IS_PROGRAM = 1 << 13;
 
     /**
      * Flag indicating whether this function uses the local variable symbol for itself. Only named function expressions
      * can have this flag set if they reference themselves (e.g. "(function f() { return f })". Declared functions will
      * use the symbol in their parent scope instead when they reference themselves by name.
      */
-    public static final int USES_SELF_SYMBOL = 1 << 15;
+    public static final int USES_SELF_SYMBOL = 1 << 14;
 
     /** Does this function use the "this" keyword? */
-    public static final int USES_THIS = 1 << 16;
+    public static final int USES_THIS = 1 << 15;
 
     /** Is this declared in a dynamic context */
-    public static final int IN_DYNAMIC_CONTEXT = 1 << 17;
+    public static final int IN_DYNAMIC_CONTEXT = 1 << 16;
 
     /**
      * The following flags are derived from directive comments within this function.
@@ -239,28 +234,28 @@
      */
 
     /** parser, print parse tree */
-    public static final int IS_PRINT_PARSE       = 1 << 18;
+    public static final int IS_PRINT_PARSE       = 1 << 17;
     /** parser, print lower parse tree */
-    public static final int IS_PRINT_LOWER_PARSE = 1 << 19;
+    public static final int IS_PRINT_LOWER_PARSE = 1 << 18;
     /** parser, print AST */
-    public static final int IS_PRINT_AST         = 1 << 20;
+    public static final int IS_PRINT_AST         = 1 << 19;
     /** parser, print lower AST */
-    public static final int IS_PRINT_LOWER_AST   = 1 << 21;
+    public static final int IS_PRINT_LOWER_AST   = 1 << 20;
     /** parser, print symbols */
-    public static final int IS_PRINT_SYMBOLS     = 1 << 22;
+    public static final int IS_PRINT_SYMBOLS     = 1 << 21;
 
     // callsite tracing, profiling within this function
     /** profile callsites in this function? */
-    public static final int IS_PROFILE         = 1 << 23;
+    public static final int IS_PROFILE         = 1 << 22;
 
     /** trace callsite enterexit in this function? */
-    public static final int IS_TRACE_ENTEREXIT = 1 << 24;
+    public static final int IS_TRACE_ENTEREXIT = 1 << 23;
 
     /** trace callsite misses in this function? */
-    public static final int IS_TRACE_MISSES    = 1 << 25;
+    public static final int IS_TRACE_MISSES    = 1 << 24;
 
     /** trace callsite values in this function? */
-    public static final int IS_TRACE_VALUES    = 1 << 26;
+    public static final int IS_TRACE_VALUES    = 1 << 25;
 
     /**
      * Whether this function needs the callee {@link ScriptFunction} instance passed to its code as a
@@ -268,7 +263,7 @@
      * Rather, it is always calculated (see {@link #needsCallee()}). {@link RecompilableScriptFunctionData}
      * will, however, cache the value of this flag.
      */
-    public static final int NEEDS_CALLEE       = 1 << 27;
+    public static final int NEEDS_CALLEE       = 1 << 26;
 
     /** extension callsite flags mask */
     public static final int EXTENSION_CALLSITE_FLAGS = IS_PRINT_PARSE |
@@ -285,8 +280,8 @@
     /** Does this function potentially need "arguments"? Note that this is not a full test, as further negative check of REDEFINES_ARGS is needed. */
     private static final int MAYBE_NEEDS_ARGUMENTS = USES_ARGUMENTS | HAS_EVAL;
 
-    /** Does this function need the parent scope? It needs it if either it or its descendants use variables from it, or have a deep eval. */
-    private static final int NEEDS_PARENT_SCOPE = USES_ANCESTOR_SCOPE | HAS_DEEP_EVAL;
+    /** Does this function need the parent scope? It needs it if either it or its descendants use variables from it, or have a deep eval, or it's the program. */
+    public static final int NEEDS_PARENT_SCOPE = USES_ANCESTOR_SCOPE | HAS_DEEP_EVAL | IS_PROGRAM;
 
     /** What is the return type of this function? */
     private Type returnType = Type.UNKNOWN;
@@ -358,7 +353,8 @@
         final Block body,
         final List<IdentNode> parameters,
         final int thisProperties,
-        final Class<?> rootClass) {
+        final Class<?> rootClass,
+        final Source source, Namespace namespace) {
         super(functionNode);
 
         this.endParserState    = endParserState;
@@ -373,11 +369,11 @@
         this.parameters       = parameters;
         this.thisProperties   = thisProperties;
         this.rootClass        = rootClass;
+        this.source           = source;
+        this.namespace        = namespace;
 
         // the fields below never change - they are final and assigned in constructor
-        this.source          = functionNode.source;
         this.ident           = functionNode.ident;
-        this.namespace       = functionNode.namespace;
         this.kind            = functionNode.kind;
         this.firstToken      = functionNode.firstToken;
     }
@@ -443,6 +439,39 @@
     }
 
     /**
+     * Sets the source and namespace for this function. It can only set a non-null source and namespace for a function
+     * that currently has both a null source and a null namespace. This is used to re-set the source and namespace for
+     * a deserialized function node.
+     * @param source the source for the function.
+     * @param namespace the namespace for the function
+     * @return a new function node with the set source and namespace
+     * @throws IllegalArgumentException if the specified source or namespace is null
+     * @throws IllegalStateException if the function already has either a source or namespace set.
+     */
+    public FunctionNode initializeDeserialized(final Source source, final Namespace namespace) {
+        if (source == null || namespace == null) {
+            throw new IllegalArgumentException();
+        } else if (this.source == source && this.namespace == namespace) {
+            return this;
+        } else if (this.source != null || this.namespace != null) {
+            throw new IllegalStateException();
+        }
+        return new FunctionNode(
+            this,
+            lastToken,
+            endParserState,
+            flags,
+            name,
+            returnType,
+            compileUnit,
+            compilationState,
+            body,
+            parameters,
+            thisProperties,
+            rootClass, source, namespace);
+    }
+
+    /**
      * Get the unique ID for this function within the script file.
      * @return the id
      */
@@ -543,6 +572,28 @@
         }
         final EnumSet<CompilationState> newState = EnumSet.copyOf(this.compilationState);
         newState.add(state);
+        return setCompilationState(lc, newState);
+    }
+
+    /**
+     * Copy a compilation state from an original function to this function. Used when creating synthetic
+     * function nodes by the splitter.
+     *
+     * @param lc lexical context
+     * @param original the original function node to copy compilation state from
+     * @return function node or a new one if state was changed
+     */
+    public FunctionNode copyCompilationState(final LexicalContext lc, final FunctionNode original) {
+        final EnumSet<CompilationState> origState = original.compilationState;
+        if (!AssertsEnabled.assertsEnabled() || this.compilationState.containsAll(origState)) {
+            return this;
+        }
+        final EnumSet<CompilationState> newState = EnumSet.copyOf(this.compilationState);
+        newState.addAll(origState);
+        return setCompilationState(lc, newState);
+    }
+
+    private FunctionNode setCompilationState(final LexicalContext lc, final EnumSet<CompilationState> compilationState) {
         return Node.replaceInLexicalContext(
                 lc,
                 this,
@@ -554,13 +605,14 @@
                         name,
                         returnType,
                         compileUnit,
-                        newState,
+                        compilationState,
                         body,
                         parameters,
                         thisProperties,
-                        rootClass));
+                        rootClass, source, namespace));
     }
 
+
     /**
      * Create a unique name in the namespace of this FunctionNode
      * @param base prefix for name
@@ -630,7 +682,7 @@
                         body,
                         parameters,
                         thisProperties,
-                        rootClass));
+                        rootClass, source, namespace));
     }
 
     @Override
@@ -705,18 +757,11 @@
      * @return true if the function's generated Java method needs a {@code callee} parameter.
      */
     public boolean needsCallee() {
+        // NOTE: we only need isSplit() here to ensure that :scope can never drop below slot 2 for splitting array units.
         return needsParentScope() || usesSelfSymbol() || isSplit() || (needsArguments() && !isStrict()) || hasOptimisticApplyToCall();
     }
 
     /**
-     * Check if this function uses the return symbol
-     * @return true if uses the return symbol
-     */
-    public boolean usesReturnSymbol() {
-        return isProgram() || isSplit() || getFlag(USES_RETURN_SYMBOL);
-    }
-
-    /**
      * Return {@code true} if this function makes use of the {@code this} object.
      *
      * @return true if function uses {@code this} object
@@ -778,7 +823,7 @@
                         body,
                         parameters,
                         thisProperties,
-                        rootClass));
+                        rootClass, source, namespace));
     }
 
     /**
@@ -846,7 +891,7 @@
      * @return true if the function needs parent scope.
      */
     public boolean needsParentScope() {
-        return getFlag(NEEDS_PARENT_SCOPE) || isProgram();
+        return getFlag(NEEDS_PARENT_SCOPE);
     }
 
     /**
@@ -874,7 +919,7 @@
                         body,
                         parameters,
                         thisProperties,
-                        rootClass));
+                        rootClass, source, namespace));
     }
 
     /**
@@ -951,7 +996,7 @@
                         body,
                         parameters,
                         thisProperties,
-                        rootClass));
+                        rootClass, source, namespace));
     }
 
     /**
@@ -965,9 +1010,9 @@
     }
 
     /**
-     * Checks if this function is a sub-function generated by splitting a larger one
+     * Checks if this function is split into several smaller fragments.
      *
-     * @return true if this function is split from a larger one
+     * @return true if this function is split into several smaller fragments.
      */
     public boolean isSplit() {
         return getFlag(IS_SPLIT);
@@ -1017,7 +1062,7 @@
                         body,
                         parameters,
                         thisProperties,
-                        rootClass));
+                        rootClass, source, namespace));
     }
 
     /**
@@ -1096,7 +1141,7 @@
                 body,
                 parameters,
                 thisProperties,
-                rootClass
+                rootClass, source, namespace
                 ));
    }
 
@@ -1144,7 +1189,7 @@
                         body,
                         parameters,
                         thisProperties,
-                        rootClass));
+                        rootClass, source, namespace));
     }
 
     /**
@@ -1200,6 +1245,6 @@
                         body,
                         parameters,
                         thisProperties,
-                        rootClass));
+                        rootClass, source, namespace));
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/GetSplitState.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.ir;
+
+import java.util.function.Function;
+import jdk.nashorn.internal.codegen.CompilerConstants;
+import jdk.nashorn.internal.codegen.types.Type;
+import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+import jdk.nashorn.internal.runtime.Scope;
+
+/**
+ * Synthetic AST node that represents loading of the scope object and invocation of the {@link Scope#getSplitState()}
+ * method on it. It has no JavaScript source representation and only occurs in synthetic functions created by
+ * the split-into-functions transformation.
+ */
+public final class GetSplitState extends Expression {
+    private static final long serialVersionUID = 1L;
+
+    /** The sole instance of this AST node. */
+    public final static GetSplitState INSTANCE = new GetSplitState();
+
+    private GetSplitState() {
+        super(NO_TOKEN, NO_FINISH);
+    }
+
+    @Override
+    public Type getType(final Function<Symbol, Type> localVariableTypes) {
+        return Type.INT;
+    }
+
+    @Override
+    public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
+        return visitor.enterGetSplitState(this) ? visitor.leaveGetSplitState(this) : this;
+    }
+
+    @Override
+    public void toString(final StringBuilder sb, final boolean printType) {
+        if (printType) {
+            sb.append("{I}");
+        }
+        sb.append(CompilerConstants.SCOPE.symbolName()).append('.').append(Scope.GET_SPLIT_STATE.name()).append("()");
+    }
+
+    private Object readResolve() {
+        return INSTANCE;
+    }
+}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/IdentNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/IdentNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -42,6 +42,8 @@
  */
 @Immutable
 public final class IdentNode extends Expression implements PropertyKey, FunctionCall, Optimistic, JoinPredecessor {
+    private static final long serialVersionUID = 1L;
+
     private static final int PROPERTY_NAME     = 1 << 0;
     private static final int INITIALIZED_HERE  = 1 << 1;
     private static final int FUNCTION          = 1 << 2;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/IfNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/IfNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -33,6 +33,8 @@
  */
 @Immutable
 public final class IfNode extends Statement implements JoinPredecessor {
+    private static final long serialVersionUID = 1L;
+
     /** Test expression. */
     private final Expression test;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/IndexNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/IndexNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -33,6 +33,8 @@
  */
 @Immutable
 public final class IndexNode extends BaseNode {
+    private static final long serialVersionUID = 1L;
+
     /** Property index. */
     private final Expression index;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/JoinPredecessorExpression.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/JoinPredecessorExpression.java	Wed Jul 05 20:05:30 2017 +0200
@@ -33,6 +33,7 @@
  * A wrapper for an expression that is in a position to be a join predecessor.
  */
 public class JoinPredecessorExpression extends Expression implements JoinPredecessor {
+    private static final long serialVersionUID = 1L;
 
     private final Expression expression;
     private final LocalVariableConversion conversion;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/JumpStatement.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/JumpStatement.java	Wed Jul 05 20:05:30 2017 +0200
@@ -31,6 +31,7 @@
  * Common base class for jump statements (e.g. {@code break} and {@code continue}).
  */
 public abstract class JumpStatement extends Statement implements JoinPredecessor {
+    private static final long serialVersionUID = 1L;
 
     private final String labelName;
     private final LocalVariableConversion conversion;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/LabelNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/LabelNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -35,6 +35,8 @@
  */
 @Immutable
 public final class LabelNode extends LexicalContextStatement implements JoinPredecessor {
+    private static final long serialVersionUID = 1L;
+
     /** Label ident. */
     private final String labelName;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/LexicalContext.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/LexicalContext.java	Wed Jul 05 20:05:30 2017 +0200
@@ -440,6 +440,14 @@
     }
 
     /**
+     * Is the topmost lexical context element body of a SplitNode?
+     * @return true if it's the body of a split node.
+     */
+    public boolean isSplitBody() {
+        return sp >= 2 && stack[sp - 1] instanceof Block && stack[sp - 2] instanceof SplitNode;
+    }
+
+    /**
      * Get the parent function for a function in the lexical context
      * @param functionNode function for which to get parent
      * @return parent function of functionNode or null if none (e.g. if functionNode is the program)
@@ -472,9 +480,6 @@
             final LexicalContextNode node = iter.next();
             if (node == until) {
                 break;
-            } else if (node instanceof SplitNode) {
-                // Don't bother popping scopes if we're going to do a return from a split method anyway.
-                return 0;
             }
             assert !(node instanceof FunctionNode); // Can't go outside current function
             if (node instanceof WithNode || node instanceof Block && ((Block)node).needsScope()) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/LexicalContextExpression.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/LexicalContextExpression.java	Wed Jul 05 20:05:30 2017 +0200
@@ -28,6 +28,7 @@
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 
 abstract class LexicalContextExpression extends Expression implements LexicalContextNode {
+    private static final long serialVersionUID = 1L;
 
     LexicalContextExpression(final LexicalContextExpression expr) {
         super(expr);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/LexicalContextStatement.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/LexicalContextStatement.java	Wed Jul 05 20:05:30 2017 +0200
@@ -28,6 +28,8 @@
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 
 abstract class LexicalContextStatement extends Statement implements LexicalContextNode {
+    private static final long serialVersionUID = 1L;
+
     /**
      * Constructor
      *
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/LiteralNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/LiteralNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -25,6 +25,7 @@
 
 package jdk.nashorn.internal.ir;
 
+import java.io.Serializable;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
@@ -49,6 +50,8 @@
  */
 @Immutable
 public abstract class LiteralNode<T> extends Expression implements PropertyKey {
+    private static final long serialVersionUID = 1L;
+
     /** Literal value */
     protected final T value;
 
@@ -270,6 +273,8 @@
      * @param <T> the literal type
      */
     public static class PrimitiveLiteralNode<T> extends LiteralNode<T> {
+        private static final long serialVersionUID = 1L;
+
         private PrimitiveLiteralNode(final long token, final int finish, final T value) {
             super(token, finish, value);
         }
@@ -304,6 +309,7 @@
 
     @Immutable
     private static final class BooleanLiteralNode extends PrimitiveLiteralNode<Boolean> {
+        private static final long serialVersionUID = 1L;
 
         private BooleanLiteralNode(final long token, final int finish, final boolean value) {
             super(Token.recast(token, value ? TokenType.TRUE : TokenType.FALSE), finish, value);
@@ -356,6 +362,7 @@
 
     @Immutable
     private static final class NumberLiteralNode extends PrimitiveLiteralNode<Number> {
+        private static final long serialVersionUID = 1L;
 
         private final Type type = numberGetType(value);
 
@@ -418,6 +425,8 @@
     }
 
     private static class UndefinedLiteralNode extends PrimitiveLiteralNode<Undefined> {
+        private static final long serialVersionUID = 1L;
+
         private UndefinedLiteralNode(final long token, final int finish) {
             super(Token.recast(token, TokenType.OBJECT), finish, ScriptRuntime.UNDEFINED);
         }
@@ -454,6 +463,8 @@
 
     @Immutable
     private static class StringLiteralNode extends PrimitiveLiteralNode<String> {
+        private static final long serialVersionUID = 1L;
+
         private StringLiteralNode(final long token, final int finish, final String value) {
             super(Token.recast(token, TokenType.STRING), finish, value);
         }
@@ -497,6 +508,8 @@
 
     @Immutable
     private static class LexerTokenLiteralNode extends LiteralNode<LexerToken> {
+        private static final long serialVersionUID = 1L;
+
         private LexerTokenLiteralNode(final long token, final int finish, final LexerToken value) {
             super(Token.recast(token, TokenType.STRING), finish, value); //TODO is string the correct token type here?
         }
@@ -560,6 +573,7 @@
     }
 
     private static final class NullLiteralNode extends PrimitiveLiteralNode<Object> {
+        private static final long serialVersionUID = 1L;
 
         private NullLiteralNode(final long token, final int finish) {
             super(Token.recast(token, TokenType.OBJECT), finish, null);
@@ -590,6 +604,7 @@
      */
     @Immutable
     public static final class ArrayLiteralNode extends LiteralNode<Expression[]> implements LexicalContextNode {
+        private static final long serialVersionUID = 1L;
 
         /** Array element type. */
         private final Type elementType;
@@ -607,7 +622,9 @@
          * An ArrayUnit is a range in an ArrayLiteral. ArrayLiterals can
          * be split if they are too large, for bytecode generation reasons
          */
-        public static final class ArrayUnit implements CompileUnitHolder {
+        public static final class ArrayUnit implements CompileUnitHolder, Serializable {
+            private static final long serialVersionUID = 1L;
+
             /** Compile unit associated with the postsets range. */
             private final CompileUnit compileUnit;
 
@@ -655,13 +672,13 @@
         private static final class ArrayLiteralInitializer {
 
             static ArrayLiteralNode initialize(final ArrayLiteralNode node) {
-                final Type elementType = computeElementType(node.value, node.elementType);
+                final Type elementType = computeElementType(node.value);
                 final int[] postsets = computePostsets(node.value);
                 final Object presets = computePresets(node.value, elementType, postsets);
                 return new ArrayLiteralNode(node, node.value, elementType, postsets, presets, node.units);
             }
 
-            private static Type computeElementType(final Expression[] value, final Type elementType) {
+            private static Type computeElementType(final Expression[] value) {
                 Type widestElementType = Type.INT;
 
                 for (final Expression elem : value) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/LoopNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/LoopNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -34,6 +34,8 @@
  * A loop node, for example a while node, do while node or for node
  */
 public abstract class LoopNode extends BreakableStatement {
+    private static final long serialVersionUID = 1L;
+
     /** loop continue label. */
     protected final Label continueLabel;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Node.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Node.java	Wed Jul 05 20:05:30 2017 +0200
@@ -25,6 +25,7 @@
 
 package jdk.nashorn.internal.ir;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
@@ -34,7 +35,18 @@
 /**
  * Nodes are used to compose Abstract Syntax Trees.
  */
-public abstract class Node implements Cloneable {
+public abstract class Node implements Cloneable, Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /** Constant used for synthetic AST nodes that have no line number. */
+    public static final int NO_LINE_NUMBER = -1;
+
+    /** Constant used for synthetic AST nodes that have no token. */
+    public static final long NO_TOKEN = 0L;
+
+    /** Constant used for synthetic AST nodes that have no finish. */
+    public static final int NO_FINISH = 0;
+
     /** Start of source range. */
     protected final int start;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ObjectNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ObjectNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -37,6 +37,7 @@
  */
 @Immutable
 public final class ObjectNode extends Expression {
+    private static final long serialVersionUID = 1L;
 
     /** Literal elements. */
     private final List<PropertyNode> elements;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/PropertyNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/PropertyNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -33,6 +33,7 @@
  */
 @Immutable
 public final class PropertyNode extends Node {
+    private static final long serialVersionUID = 1L;
 
     /** Property key. */
     private final PropertyKey key;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ReturnNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ReturnNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -36,6 +36,8 @@
  */
 @Immutable
 public class ReturnNode extends Statement {
+    private static final long serialVersionUID = 1L;
+
     /** Optional expression. */
     private final Expression expression;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/RuntimeNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/RuntimeNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -42,6 +42,7 @@
  */
 @Immutable
 public class RuntimeNode extends Expression implements Optimistic {
+    private static final long serialVersionUID = 1L;
 
     /**
      * Request enum used for meta-information about the runtime request
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/SetSplitState.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.ir;
+
+import jdk.nashorn.internal.codegen.CompilerConstants;
+import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+import jdk.nashorn.internal.runtime.Scope;
+
+/**
+ * Synthetic AST node that represents loading of the scope object and invocation of the {@link Scope#setSplitState(int)}
+ * method on it. It has no JavaScript source representation and only occurs in synthetic functions created by
+ * the split-into-functions transformation.
+ */
+public final class SetSplitState extends Statement {
+    private static final long serialVersionUID = 1L;
+
+    private final int state;
+
+    /**
+     * Creates a new split state setter
+     * @param state the state to set
+     * @param lineNumber the line number where it is inserted
+     */
+    public SetSplitState(final int state, final int lineNumber) {
+        super(lineNumber, NO_TOKEN, NO_FINISH);
+        this.state = state;
+    }
+
+    /**
+     * Returns the state this setter sets.
+     * @return the state this setter sets.
+     */
+    public int getState() {
+        return state;
+    }
+
+    @Override
+    public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
+        return visitor.enterSetSplitState(this) ? visitor.leaveSetSplitState(this) : this;
+    }
+
+    @Override
+    public void toString(final StringBuilder sb, final boolean printType) {
+        sb.append(CompilerConstants.SCOPE.symbolName()).append('.').append(Scope.SET_SPLIT_STATE.name())
+        .append('(').append(state).append(");");
+    }
+}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/SplitNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/SplitNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -25,13 +25,10 @@
 
 package jdk.nashorn.internal.ir;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.io.IOException;
+import java.io.NotSerializableException;
+import java.io.ObjectOutputStream;
 import jdk.nashorn.internal.codegen.CompileUnit;
-import jdk.nashorn.internal.codegen.Label;
 import jdk.nashorn.internal.ir.annotations.Immutable;
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 
@@ -39,7 +36,9 @@
  * Node indicating code is split across classes.
  */
 @Immutable
-public class SplitNode extends LexicalContextStatement implements Labels, CompileUnitHolder {
+public class SplitNode extends LexicalContextStatement implements CompileUnitHolder {
+    private static final long serialVersionUID = 1L;
+
     /** Split node method name. */
     private final String name;
 
@@ -49,8 +48,6 @@
     /** Body of split code. */
     private final Block body;
 
-    private Map<Label, JoinPredecessor> jumps;
-
     /**
      * Constructor
      *
@@ -65,19 +62,18 @@
         this.compileUnit = compileUnit;
     }
 
-    private SplitNode(final SplitNode splitNode, final Block body, final CompileUnit compileUnit, final Map<Label, JoinPredecessor> jumps) {
+    private SplitNode(final SplitNode splitNode, final Block body, final CompileUnit compileUnit) {
         super(splitNode);
         this.name        = splitNode.name;
         this.body        = body;
         this.compileUnit = compileUnit;
-        this.jumps       = jumps;
     }
 
     /**
      * Get the body for this split node - i.e. the actual code it encloses
      * @return body for split node
      */
-    public Node getBody() {
+    public Block getBody() {
         return body;
     }
 
@@ -85,7 +81,7 @@
         if (this.body == body) {
             return this;
         }
-        return Node.replaceInLexicalContext(lc, this, new SplitNode(this, body, compileUnit, jumps));
+        return Node.replaceInLexicalContext(lc, this, new SplitNode(this, body, compileUnit));
     }
 
     @Override
@@ -131,33 +127,12 @@
         if (this.compileUnit == compileUnit) {
             return this;
         }
-        return Node.replaceInLexicalContext(lc, this, new SplitNode(this, body, compileUnit, jumps));
+        return Node.replaceInLexicalContext(lc, this, new SplitNode(this, body, compileUnit));
     }
 
-    /**
-     * Adds a jump that crosses this split node's boundary (it originates within the split node, and goes to a target
-     * outside of it).
-     * @param jumpOrigin the join predecessor that's the origin of the jump
-     * @param targetLabel the label that's the target of the jump.
-     */
-    public void addJump(final JoinPredecessor jumpOrigin, final Label targetLabel) {
-        if (jumps == null) {
-            jumps = new HashMap<>();
-        }
-        jumps.put(targetLabel, jumpOrigin);
-    }
-
-    /**
-     * Returns the jump origin within this split node for a target.
-     * @param targetLabel the target for which a jump origin is sought.
-     * @return the jump origin, or null.
-     */
-    public JoinPredecessor getJumpOrigin(final Label targetLabel) {
-        return jumps == null ? null : jumps.get(targetLabel);
-    }
-
-    @Override
-    public List<Label> getLabels() {
-        return Collections.unmodifiableList(new ArrayList<>(jumps.keySet()));
+    private void writeObject(final ObjectOutputStream out) throws IOException {
+        // We are only serializing the AST after we run SplitIntoFunctions; no SplitNodes can remain for the
+        // serialization.
+        throw new NotSerializableException(getClass().getName());
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/SplitReturn.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.ir;
+
+import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+
+/**
+ * Synthetic AST node that represents return from a split fragment of a split function for control flow reasons (break
+ * or continue into a target outside the current fragment). It has no JavaScript source representation and only occurs
+ * in synthetic functions created by the split-into-functions transformation. It is different from a return node in
+ * that the return value is irrelevant, and doesn't affect the function's return type calculation.
+ */
+public final class SplitReturn extends Statement {
+    private static final long serialVersionUID = 1L;
+
+    /** The sole instance of this AST node. */
+    public static final SplitReturn INSTANCE = new SplitReturn();
+
+    private SplitReturn() {
+        super(NO_LINE_NUMBER, NO_TOKEN, NO_FINISH);
+    }
+
+    @Override
+    public boolean isTerminal() {
+        return true;
+    }
+
+    @Override
+    public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
+        return visitor.enterSplitReturn(this) ? visitor.leaveSplitReturn(this) : this;
+    }
+
+    @Override
+    public void toString(StringBuilder sb, boolean printType) {
+        sb.append(":splitreturn;");
+    }
+
+    private Object readResolve() {
+        return INSTANCE;
+    }
+}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Statement.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Statement.java	Wed Jul 05 20:05:30 2017 +0200
@@ -31,6 +31,7 @@
  * location information is the Statement
  */
 public abstract class Statement extends Node implements Terminal {
+    private static final long serialVersionUID = 1L;
 
     private final int lineNumber;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/SwitchNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/SwitchNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -37,6 +37,8 @@
  */
 @Immutable
 public final class SwitchNode extends BreakableStatement {
+    private static final long serialVersionUID = 1L;
+
     /** Switch expression. */
     private final Expression expression;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Symbol.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Symbol.java	Wed Jul 05 20:05:30 2017 +0200
@@ -97,7 +97,7 @@
     private int firstSlot = -1;
 
     /** Field number in scope or property; array index in varargs when not using arguments object. */
-    private int fieldIndex;
+    private int fieldIndex = -1;
 
     /** Number of times this symbol is used in code */
     private int useCount;
@@ -135,28 +135,15 @@
      *
      * @param name  name of symbol
      * @param flags symbol flags
-     * @param slot  bytecode slot for this symbol
      */
-    protected Symbol(final String name, final int flags, final int slot) {
+    public Symbol(final String name, final int flags) {
         this.name       = name;
         this.flags      = flags;
-        this.firstSlot  = slot;
-        this.fieldIndex = -1;
         if(shouldTrace()) {
             trace("CREATE SYMBOL " + name);
         }
     }
 
-    /**
-     * Constructor
-     *
-     * @param name  name of symbol
-     * @param flags symbol flags
-     */
-    public Symbol(final String name, final int flags) {
-        this(name, flags, -1);
-    }
-
     private static String align(final String string, final int max) {
         final StringBuilder sb = new StringBuilder();
         sb.append(string.substring(0, Math.min(string.length(), max)));
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/TernaryNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/TernaryNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -37,6 +37,8 @@
  */
 @Immutable
 public final class TernaryNode extends Expression {
+    private static final long serialVersionUID = 1L;
+
     private final Expression test;
     private final JoinPredecessorExpression trueExpr;
     private final JoinPredecessorExpression falseExpr;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ThrowNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ThrowNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -33,6 +33,8 @@
  */
 @Immutable
 public final class ThrowNode extends Statement implements JoinPredecessor {
+    private static final long serialVersionUID = 1L;
+
     /** Exception expression. */
     private final Expression expression;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/TryNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/TryNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -36,6 +36,8 @@
  */
 @Immutable
 public final class TryNode extends Statement implements JoinPredecessor {
+    private static final long serialVersionUID = 1L;
+
     /** Try statements. */
     private final Block body;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/UnaryNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/UnaryNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -46,6 +46,8 @@
  */
 @Immutable
 public final class UnaryNode extends Expression implements Assignment<Expression>, Optimistic {
+    private static final long serialVersionUID = 1L;
+
     /** Right hand side argument. */
     private final Expression expression;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/VarNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/VarNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -34,6 +34,8 @@
  */
 @Immutable
 public final class VarNode extends Statement implements Assignment<IdentNode> {
+    private static final long serialVersionUID = 1L;
+
     /** Var name. */
     private final IdentNode name;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/WhileNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/WhileNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -34,6 +34,8 @@
  */
 @Immutable
 public final class WhileNode extends LoopNode {
+    private static final long serialVersionUID = 1L;
+
 
     /** is this a do while node ? */
     private final boolean isDoWhile;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/WithNode.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/WithNode.java	Wed Jul 05 20:05:30 2017 +0200
@@ -33,6 +33,8 @@
  */
 @Immutable
 public final class WithNode extends LexicalContextStatement {
+    private static final long serialVersionUID = 1L;
+
    /** This expression. */
     private final Expression expression;
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/visitor/NodeVisitor.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/visitor/NodeVisitor.java	Wed Jul 05 20:05:30 2017 +0200
@@ -38,6 +38,7 @@
 import jdk.nashorn.internal.ir.ExpressionStatement;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.ir.GetSplitState;
 import jdk.nashorn.internal.ir.IdentNode;
 import jdk.nashorn.internal.ir.IfNode;
 import jdk.nashorn.internal.ir.IndexNode;
@@ -50,7 +51,9 @@
 import jdk.nashorn.internal.ir.PropertyNode;
 import jdk.nashorn.internal.ir.ReturnNode;
 import jdk.nashorn.internal.ir.RuntimeNode;
+import jdk.nashorn.internal.ir.SetSplitState;
 import jdk.nashorn.internal.ir.SplitNode;
+import jdk.nashorn.internal.ir.SplitReturn;
 import jdk.nashorn.internal.ir.SwitchNode;
 import jdk.nashorn.internal.ir.TernaryNode;
 import jdk.nashorn.internal.ir.ThrowNode;
@@ -390,6 +393,26 @@
     }
 
     /**
+     * Callback for entering a {@link GetSplitState}.
+     *
+     * @param  getSplitState the get split state expression
+     * @return true if traversal should continue and node children be traversed, false otherwise
+     */
+    public boolean enterGetSplitState(final GetSplitState getSplitState) {
+        return enterDefault(getSplitState);
+    }
+
+    /**
+     * Callback for leaving a {@link GetSplitState}.
+     *
+     * @param  getSplitState the get split state expression
+     * @return processed node, which will replace the original one, or the original node
+     */
+    public Node leaveGetSplitState(final GetSplitState getSplitState) {
+        return leaveDefault(getSplitState);
+    }
+
+    /**
      * Callback for entering an IdentNode
      *
      * @param  identNode the node
@@ -570,6 +593,26 @@
     }
 
     /**
+     * Callback for entering a {@link SetSplitState}.
+     *
+     * @param  setSplitState the set split state statement
+     * @return true if traversal should continue and node children be traversed, false otherwise
+     */
+    public boolean enterSetSplitState(final SetSplitState setSplitState) {
+        return enterDefault(setSplitState);
+    }
+
+    /**
+     * Callback for leaving a {@link SetSplitState}.
+     *
+     * @param  setSplitState the set split state expression
+     * @return processed node, which will replace the original one, or the original node
+     */
+    public Node leaveSetSplitState(final SetSplitState setSplitState) {
+        return leaveDefault(setSplitState);
+    }
+
+    /**
      * Callback for entering a SplitNode
      *
      * @param  splitNode the node
@@ -590,6 +633,26 @@
     }
 
     /**
+     * Callback for entering a SplitReturn
+     *
+     * @param  splitReturn the node
+     * @return true if traversal should continue and node children be traversed, false otherwise
+     */
+    public boolean enterSplitReturn(final SplitReturn splitReturn) {
+        return enterDefault(splitReturn);
+    }
+
+    /**
+     * Callback for leaving a SplitReturn
+     *
+     * @param  splitReturn the node
+     * @return processed node, which will replace the original one, or the original node
+     */
+    public Node leaveSplitReturn(final SplitReturn splitReturn) {
+        return leaveDefault(splitReturn);
+    }
+
+    /**
      * Callback for entering a SwitchNode
      *
      * @param  switchNode the node
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/lookup/MethodHandleFactory.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/lookup/MethodHandleFactory.java	Wed Jul 05 20:05:30 2017 +0200
@@ -48,7 +48,7 @@
 /**
  * This class is abstraction for all method handle, switchpoint and method type
  * operations. This enables the functionality interface to be subclassed and
- * intrumensted, as it has been proven vital to keep the number of method
+ * instrumented, as it has been proven vital to keep the number of method
  * handles in the system down.
  *
  * All operations of the above type should go through this class, and not
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArray.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArray.java	Wed Jul 05 20:05:30 2017 +0200
@@ -33,6 +33,7 @@
 import static jdk.nashorn.internal.runtime.arrays.ArrayLikeIterator.arrayLikeIterator;
 import static jdk.nashorn.internal.runtime.arrays.ArrayLikeIterator.reverseArrayLikeIterator;
 import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.CALLSITE_STRICT;
+
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.SwitchPoint;
 import java.util.ArrayList;
@@ -92,9 +93,10 @@
     private static final Object CALL_CMP                 = new Object();
     private static final Object TO_LOCALE_STRING         = new Object();
 
-    private SwitchPoint   lengthMadeNotWritableSwitchPoint;
-    private PushLinkLogic pushLinkLogic;
-    private PopLinkLogic  popLinkLogic;
+    private SwitchPoint     lengthMadeNotWritableSwitchPoint;
+    private PushLinkLogic   pushLinkLogic;
+    private PopLinkLogic    popLinkLogic;
+    private ConcatLinkLogic concatLinkLogic;
 
     /**
      * Index for the modification SwitchPoint that triggers when length
@@ -130,7 +132,9 @@
         this(ArrayData.allocate(array.length));
 
         ArrayData arrayData = this.getArray();
-        arrayData.ensure(array.length - 1);
+        if (array.length > 0) {
+            arrayData.ensure(array.length - 1);
+        }
 
         for (int index = 0; index < array.length; index++) {
             final Object value = array[index];
@@ -266,7 +270,7 @@
 
     @Override
     public Object getLength() {
-        final long length = getArray().length() & JSType.MAX_UINT;
+        final long length = JSType.toUint32(getArray().length());
         if(length < Integer.MAX_VALUE) {
             return (int)length;
         }
@@ -476,7 +480,7 @@
     @Getter(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_CONFIGURABLE)
     public static Object length(final Object self) {
         if (isArray(self)) {
-            return ((ScriptObject) self).getArray().length() & JSType.MAX_UINT;
+            return JSType.toUint32(((ScriptObject) self).getArray().length());
         }
 
         return 0;
@@ -757,12 +761,86 @@
      * ECMA 15.4.4.4 Array.prototype.concat ( [ item1 [ , item2 [ , ... ] ] ] )
      *
      * @param self self reference
+     * @param arg argument
+     * @return resulting NativeArray
+     */
+    @SpecializedFunction(linkLogic=ConcatLinkLogic.class)
+    public static NativeArray concat(final Object self, final int arg) {
+        final ContinuousArrayData newData = getContinuousArrayDataCCE(self, Integer.class).copy(); //get at least an integer data copy of this data
+        newData.fastPush(arg); //add an integer to its end
+        return new NativeArray(newData);
+    }
+
+    /**
+     * ECMA 15.4.4.4 Array.prototype.concat ( [ item1 [ , item2 [ , ... ] ] ] )
+     *
+     * @param self self reference
+     * @param arg argument
+     * @return resulting NativeArray
+     */
+    @SpecializedFunction(linkLogic=ConcatLinkLogic.class)
+    public static NativeArray concat(final Object self, final long arg) {
+        final ContinuousArrayData newData = getContinuousArrayDataCCE(self, Long.class).copy(); //get at least a long array data copy of this data
+        newData.fastPush(arg); //add a long at the end
+        return new NativeArray(newData);
+    }
+
+    /**
+     * ECMA 15.4.4.4 Array.prototype.concat ( [ item1 [ , item2 [ , ... ] ] ] )
+     *
+     * @param self self reference
+     * @param arg argument
+     * @return resulting NativeArray
+     */
+    @SpecializedFunction(linkLogic=ConcatLinkLogic.class)
+    public static NativeArray concat(final Object self, final double arg) {
+        final ContinuousArrayData newData = getContinuousArrayDataCCE(self, Double.class).copy(); //get at least a number array data copy of this data
+        newData.fastPush(arg); //add a double at the end
+        return new NativeArray(newData);
+    }
+
+    /**
+     * ECMA 15.4.4.4 Array.prototype.concat ( [ item1 [ , item2 [ , ... ] ] ] )
+     *
+     * @param self self reference
+     * @param arg argument
+     * @return resulting NativeArray
+     */
+    @SpecializedFunction(linkLogic=ConcatLinkLogic.class)
+    public static NativeArray concat(final Object self, final Object arg) {
+        //arg is [NativeArray] of same type.
+        final ContinuousArrayData selfData = getContinuousArrayDataCCE(self);
+        final ContinuousArrayData newData;
+
+        if (arg instanceof NativeArray) {
+            final ContinuousArrayData argData = (ContinuousArrayData)((NativeArray)arg).getArray();
+            if (argData.isEmpty()) {
+                newData = selfData.copy();
+            } else if (selfData.isEmpty()) {
+                newData = argData.copy();
+            } else {
+                final Class<?> widestElementType = selfData.widest(argData).getBoxedElementType();
+                newData = ((ContinuousArrayData)selfData.convert(widestElementType)).fastConcat((ContinuousArrayData)argData.convert(widestElementType));
+            }
+        } else {
+            newData = getContinuousArrayDataCCE(self, Object.class).copy();
+            newData.fastPush(arg);
+        }
+
+        return new NativeArray(newData);
+    }
+
+    /**
+     * ECMA 15.4.4.4 Array.prototype.concat ( [ item1 [ , item2 [ , ... ] ] ] )
+     *
+     * @param self self reference
      * @param args arguments
      * @return resulting NativeArray
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, arity = 1)
     public static NativeArray concat(final Object self, final Object... args) {
         final ArrayList<Object> list = new ArrayList<>();
+
         concatToList(list, Global.toObject(self));
 
         for (final Object obj : args) {
@@ -1692,13 +1770,15 @@
             return pushLinkLogic == null ? new PushLinkLogic(this) : pushLinkLogic;
         } else if (clazz == PopLinkLogic.class) {
             return popLinkLogic == null ? new PopLinkLogic(this) : pushLinkLogic;
+        } else if (clazz == ConcatLinkLogic.class) {
+            return concatLinkLogic == null ? new ConcatLinkLogic(this) : concatLinkLogic;
         }
         return null;
     }
 
     @Override
     public boolean hasPerInstanceAssumptions() {
-        return true; //length switchpoint
+        return true; //length writable switchpoint
     }
 
     /**
@@ -1798,6 +1878,40 @@
     }
 
     /**
+     * This is linker logic for optimistic concatenations
+     */
+    private static final class ConcatLinkLogic extends ArrayLinkLogic {
+        private ConcatLinkLogic(final NativeArray array) {
+            super(array);
+        }
+
+        @Override
+        public boolean canLink(final Object self, final CallSiteDescriptor desc, final LinkRequest request) {
+            final Object[] args = request.getArguments();
+
+            if (args.length != 3) { //single argument check
+                return false;
+            }
+
+            final ContinuousArrayData selfData = getContinuousArrayData(self);
+            if (selfData == null) {
+                return false;
+            }
+
+            final Object arg = args[2];
+            //args[2] continuousarray or non arraydata, let past non array datas
+            if (arg instanceof NativeArray) {
+                final ContinuousArrayData argData = getContinuousArrayData(arg);
+                if (argData == null) {
+                    return false;
+                }
+            }
+
+            return true;
+        }
+    }
+
+    /**
      * This is linker logic for optimistic pushes
      */
     private static final class PushLinkLogic extends ArrayLinkLogic {
@@ -1864,6 +1978,14 @@
         throw new ClassCastException();
     }
 
+    private static final ContinuousArrayData getContinuousArrayDataCCE(final Object self) {
+        try {
+            return (ContinuousArrayData)((NativeArray)self).getArray();
+         } catch (final NullPointerException e) {
+             throw new ClassCastException();
+         }
+    }
+
     private static final ContinuousArrayData getContinuousArrayDataCCE(final Object self, final Class<?> elementType) {
         try {
            return (ContinuousArrayData)((NativeArray)self).getArray(elementType); //ensure element type can fit "elementType"
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDataView.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDataView.java	Wed Jul 05 20:05:30 2017 +0200
@@ -27,6 +27,7 @@
 import static jdk.nashorn.internal.runtime.ECMAErrors.rangeError;
 import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
 import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
+
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 import jdk.nashorn.internal.objects.annotations.Attribute;
@@ -432,7 +433,7 @@
     @SpecializedFunction
     public static long getUint32(final Object self, final int byteOffset) {
         try {
-            return JSType.MAX_UINT & getBuffer(self, false).getInt(JSType.toInt32(byteOffset));
+            return JSType.toUint32(getBuffer(self, false).getInt(JSType.toInt32(byteOffset)));
         } catch (final IllegalArgumentException iae) {
             throw rangeError(iae, "dataview.offset");
         }
@@ -449,7 +450,7 @@
     @SpecializedFunction
     public static long getUint32(final Object self, final int byteOffset, final boolean littleEndian) {
         try {
-            return JSType.MAX_UINT & getBuffer(self, littleEndian).getInt(JSType.toInt32(byteOffset));
+            return JSType.toUint32(getBuffer(self, littleEndian).getInt(JSType.toInt32(byteOffset)));
         } catch (final IllegalArgumentException iae) {
             throw rangeError(iae, "dataview.offset");
         }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDate.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDate.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1045,7 +1045,8 @@
 
     // ECMA 15.9.1.2 TimeWithinDay (t)
     private static double timeWithinDay(final double t) {
-        return t % msPerDay;
+        final double val = t % msPerDay;
+        return val < 0? val + msPerDay : val;
     }
 
     // ECMA 15.9.1.3 InLeapYear (t)
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat32Array.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat32Array.java	Wed Jul 05 20:05:30 2017 +0200
@@ -90,6 +90,11 @@
         }
 
         @Override
+        public Class<?> getBoxedElementType() {
+            return Double.class;
+        }
+
+        @Override
         protected MethodHandle getGetElem() {
             return GET_ELEM;
         }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat64Array.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFloat64Array.java	Wed Jul 05 20:05:30 2017 +0200
@@ -99,6 +99,11 @@
             return double.class;
         }
 
+        @Override
+        public Class<?> getBoxedElementType() {
+            return Double.class;
+        }
+
         private double getElem(final int index) {
             try {
                 return nb.get(index);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt16Array.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt16Array.java	Wed Jul 05 20:05:30 2017 +0200
@@ -100,6 +100,11 @@
             return int.class;
         }
 
+        @Override
+        public Class<?> getBoxedElementType() {
+            return Integer.class;
+        }
+
         private int getElem(final int index) {
             try {
                 return nb.get(index);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt32Array.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt32Array.java	Wed Jul 05 20:05:30 2017 +0200
@@ -118,6 +118,11 @@
         }
 
         @Override
+        public Class<?> getBoxedElementType() {
+            return Integer.class;
+        }
+
+        @Override
         public int getInt(final int index) {
             return getElem(index);
         }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt8Array.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt8Array.java	Wed Jul 05 20:05:30 2017 +0200
@@ -98,6 +98,11 @@
             return int.class;
         }
 
+        @Override
+        public Class<?> getBoxedElementType() {
+            return Integer.class;
+        }
+
         private int getElem(final int index) {
             try {
                 return nb.get(index);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeObject.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeObject.java	Wed Jul 05 20:05:30 2017 +0200
@@ -28,7 +28,6 @@
 import static jdk.nashorn.internal.lookup.Lookup.MH;
 import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
 import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
-
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeRegExpExecResult.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeRegExpExecResult.java	Wed Jul 05 20:05:30 2017 +0200
@@ -74,7 +74,7 @@
     @Getter(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_CONFIGURABLE)
     public static Object length(final Object self) {
         if (self instanceof ScriptObject) {
-            return ((ScriptObject)self).getArray().length() & JSType.MAX_UINT;
+            return JSType.toUint32(((ScriptObject)self).getArray().length());
         }
 
         return 0;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint16Array.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint16Array.java	Wed Jul 05 20:05:30 2017 +0200
@@ -124,6 +124,11 @@
         }
 
         @Override
+        public Class<?> getBoxedElementType() {
+            return Integer.class;
+        }
+
+        @Override
         public int getInt(final int index) {
             return getElem(index);
         }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint32Array.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint32Array.java	Wed Jul 05 20:05:30 2017 +0200
@@ -105,7 +105,7 @@
 
         private long getElem(final int index) {
             try {
-                return nb.get(index) & JSType.MAX_UINT;
+                return JSType.toUint32(nb.get(index));
             } catch (final IndexOutOfBoundsException e) {
                 throw new ClassCastException(); //force relink - this works for unoptimistic too
             }
@@ -133,6 +133,11 @@
         }
 
         @Override
+        public Class<?> getBoxedElementType() {
+            return Integer.class;
+        }
+
+        @Override
         public int getInt(final int index) {
             return (int)getLong(index);
         }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8Array.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8Array.java	Wed Jul 05 20:05:30 2017 +0200
@@ -124,6 +124,11 @@
         }
 
         @Override
+        public Class<?> getBoxedElementType() {
+            return Integer.class;
+        }
+
+        @Override
         public int getInt(final int index) {
             return getElem(index);
         }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java	Wed Jul 05 20:05:30 2017 +0200
@@ -103,6 +103,11 @@
             return int.class;
         }
 
+        @Override
+        public Class<?> getBoxedElementType() {
+            return int.class;
+        }
+
         private int getElem(final int index) {
             try {
                 return nb.get(index) & 0xff;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/JSONParser.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/JSONParser.java	Wed Jul 05 20:05:30 2017 +0200
@@ -32,7 +32,6 @@
 import static jdk.nashorn.internal.parser.TokenType.RBRACE;
 import static jdk.nashorn.internal.parser.TokenType.RBRACKET;
 import static jdk.nashorn.internal.parser.TokenType.STRING;
-
 import java.util.ArrayList;
 import java.util.List;
 import jdk.nashorn.internal.ir.Expression;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Lexer.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Lexer.java	Wed Jul 05 20:05:30 2017 +0200
@@ -46,6 +46,7 @@
 import static jdk.nashorn.internal.parser.TokenType.STRING;
 import static jdk.nashorn.internal.parser.TokenType.XML;
 
+import java.io.Serializable;
 import jdk.nashorn.internal.runtime.ECMAErrors;
 import jdk.nashorn.internal.runtime.ErrorManager;
 import jdk.nashorn.internal.runtime.JSErrorType;
@@ -1717,7 +1718,9 @@
      * Helper class for Lexer tokens, e.g XML or RegExp tokens.
      * This is the abstract superclass
      */
-    public static abstract class LexerToken {
+    public static abstract class LexerToken implements Serializable {
+        private static final long serialVersionUID = 1L;
+
         private final String expression;
 
         /**
@@ -1741,6 +1744,8 @@
      * Temporary container for regular expressions.
      */
     public static class RegexToken extends LexerToken {
+        private static final long serialVersionUID = 1L;
+
         /** Options. */
         private final String options;
 
@@ -1773,6 +1778,7 @@
      * Temporary container for XML expression.
      */
     public static class XMLToken extends LexerToken {
+        private static final long serialVersionUID = 1L;
 
         /**
          * Constructor.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/AstDeserializer.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.nashorn.internal.runtime;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.util.zip.InflaterInputStream;
+import jdk.nashorn.internal.ir.FunctionNode;
+
+/**
+ * This static utility class performs deserialization of FunctionNode ASTs from a byte array.
+ * The format is a standard Java serialization stream, deflated.
+ */
+final class AstDeserializer {
+    static FunctionNode deserialize(final byte[] serializedAst) {
+        try {
+            return (FunctionNode)new ObjectInputStream(new InflaterInputStream(new ByteArrayInputStream(
+                    serializedAst))).readObject();
+        } catch (final ClassNotFoundException | IOException e) {
+            // This is internal, can't happen
+            throw new AssertionError("Unexpected exception deserializing function", e);
+        }
+    }
+}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CompiledFunction.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CompiledFunction.java	Wed Jul 05 20:05:30 2017 +0200
@@ -27,6 +27,7 @@
 import static jdk.nashorn.internal.lookup.Lookup.MH;
 import static jdk.nashorn.internal.runtime.UnwarrantedOptimismException.INVALID_PROGRAM_POINT;
 import static jdk.nashorn.internal.runtime.UnwarrantedOptimismException.isValid;
+
 import java.lang.invoke.CallSite;
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
@@ -786,6 +787,7 @@
         // isn't available, we'll use the old one bound into the call site.
         final OptimismInfo effectiveOptInfo = currentOptInfo != null ? currentOptInfo : oldOptInfo;
         FunctionNode fn = effectiveOptInfo.reparse();
+        final boolean serialized = effectiveOptInfo.isSerialized();
         final Compiler compiler = effectiveOptInfo.getCompiler(fn, callSiteType, re); //set to non rest-of
 
         if (!shouldRecompile) {
@@ -793,17 +795,17 @@
             // recompiled a deoptimized version for an inner invocation.
             // We still need to do the rest of from the beginning
             logRecompile("Rest-of compilation [STANDALONE] ", fn, callSiteType, effectiveOptInfo.invalidatedProgramPoints);
-            return restOfHandle(effectiveOptInfo, compiler.compile(fn, CompilationPhases.COMPILE_ALL_RESTOF), currentOptInfo != null);
+            return restOfHandle(effectiveOptInfo, compiler.compile(fn, serialized ? CompilationPhases.COMPILE_SERIALIZED_RESTOF : CompilationPhases.COMPILE_ALL_RESTOF), currentOptInfo != null);
         }
 
         logRecompile("Deoptimizing recompilation (up to bytecode) ", fn, callSiteType, effectiveOptInfo.invalidatedProgramPoints);
-        fn = compiler.compile(fn, CompilationPhases.COMPILE_UPTO_BYTECODE);
+        fn = compiler.compile(fn, serialized ? CompilationPhases.RECOMPILE_SERIALIZED_UPTO_BYTECODE : CompilationPhases.COMPILE_UPTO_BYTECODE);
         log.info("Reusable IR generated");
 
         // compile the rest of the function, and install it
         log.info("Generating and installing bytecode from reusable IR...");
         logRecompile("Rest-of compilation [CODE PIPELINE REUSE] ", fn, callSiteType, effectiveOptInfo.invalidatedProgramPoints);
-        final FunctionNode normalFn = compiler.compile(fn, CompilationPhases.COMPILE_FROM_BYTECODE);
+        final FunctionNode normalFn = compiler.compile(fn, CompilationPhases.GENERATE_BYTECODE_AND_INSTALL);
 
         if (effectiveOptInfo.data.usePersistentCodeCache()) {
             final RecompilableScriptFunctionData data = effectiveOptInfo.data;
@@ -829,7 +831,7 @@
         constructor = null; // Will be regenerated when needed
 
         log.info("Done: ", invoker);
-        final MethodHandle restOf = restOfHandle(effectiveOptInfo, compiler.compile(fn, CompilationPhases.COMPILE_FROM_BYTECODE_RESTOF), canBeDeoptimized);
+        final MethodHandle restOf = restOfHandle(effectiveOptInfo, compiler.compile(fn, CompilationPhases.GENERATE_BYTECODE_AND_INSTALL_RESTOF), canBeDeoptimized);
 
         // Note that we only adjust the switch point after we set the invoker/constructor. This is important.
         if (canBeDeoptimized) {
@@ -921,6 +923,10 @@
         FunctionNode reparse() {
             return data.reparse();
         }
+
+        boolean isSerialized() {
+            return data.isSerialized();
+        }
     }
 
     @SuppressWarnings("unused")
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java	Wed Jul 05 20:05:30 2017 +0200
@@ -150,6 +150,13 @@
         private final Context      context;
         private final ScriptLoader loader;
         private final CodeSource   codeSource;
+        private int usageCount = 0;
+        private int bytesDefined = 0;
+
+        // We reuse this installer for 10 compilations or 200000 defined bytes. Usually the first condition
+        // will occur much earlier, the second is a safety measure for very large scripts/functions.
+        private final static int MAX_USAGES = 10;
+        private final static int MAX_BYTES_DEFINED = 200_000;
 
         private ContextCodeInstaller(final Context context, final ScriptLoader loader, final CodeSource codeSource) {
             this.context    = context;
@@ -168,6 +175,8 @@
 
         @Override
         public Class<?> install(final String className, final byte[] bytecode) {
+            usageCount++;
+            bytesDefined += bytecode.length;
             final String   binaryName = Compiler.binaryName(className);
             return loader.installClass(binaryName, bytecode, codeSource);
         }
@@ -225,6 +234,10 @@
 
         @Override
         public CodeInstaller<ScriptEnvironment> withNewLoader() {
+            // Reuse this installer if we're within our limits.
+            if (usageCount < MAX_USAGES && bytesDefined < MAX_BYTES_DEFINED) {
+                return this;
+            }
             return new ContextCodeInstaller(context, context.createNewLoader(), codeSource);
         }
 
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java	Wed Jul 05 20:05:30 2017 +0200
@@ -29,7 +29,6 @@
 import static jdk.nashorn.internal.codegen.ObjectClassGenerator.OBJECT_FIELDS_ONLY;
 import static jdk.nashorn.internal.lookup.Lookup.MH;
 import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
-
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.reflect.Array;
@@ -115,6 +114,9 @@
     /** JavaScript compliant conversion function from double to int32 */
     public static final Call TO_INT32_D = staticCall(JSTYPE_LOOKUP, JSType.class, "toInt32", int.class, double.class);
 
+    /** JavaScript compliant conversion function from int to uint32 */
+    public static final Call TO_UINT32_I = staticCall(JSTYPE_LOOKUP, JSType.class, "toUint32", long.class, int.class);
+
     /** JavaScript compliant conversion function from Object to uint32 */
     public static final Call TO_UINT32 = staticCall(JSTYPE_LOOKUP, JSType.class, "toUint32", long.class, Object.class);
 
@@ -1002,6 +1004,16 @@
     }
 
     /**
+     * JavaScript compliant int to uint32 conversion
+     *
+     * @param num an int
+     * @return a uint32
+     */
+    public static long toUint32(final int num) {
+        return num & MAX_UINT;
+    }
+
+    /**
      * JavaScript compliant Object to uint16 conversion
      * ECMA 9.7 ToUint16: (Unsigned 16 Bit Integer)
      *
@@ -1776,6 +1788,23 @@
     }
 
     /**
+     * Returns the boxed version of a primitive class
+     * @param clazz the class
+     * @return the boxed type of clazz, or unchanged if not primitive
+     */
+    public static Class<?> getBoxedClass(final Class<?> clazz) {
+        if (clazz == int.class) {
+            return Integer.class;
+        } else if (clazz == long.class) {
+            return Long.class;
+        } else if (clazz == double.class) {
+            return Double.class;
+        }
+        assert !clazz.isPrimitive();
+        return clazz;
+    }
+
+    /**
      * Create a method handle constant of the correct primitive type
      * for a constant object
      * @param o object
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java	Wed Jul 05 20:05:30 2017 +0200
@@ -43,6 +43,7 @@
 import jdk.nashorn.internal.codegen.Compiler.CompilationPhases;
 import jdk.nashorn.internal.codegen.CompilerConstants;
 import jdk.nashorn.internal.codegen.FunctionSignature;
+import jdk.nashorn.internal.codegen.Namespace;
 import jdk.nashorn.internal.codegen.ObjectClassGenerator.AllocatorDescriptor;
 import jdk.nashorn.internal.codegen.OptimisticTypesPersistence;
 import jdk.nashorn.internal.codegen.TypeMap;
@@ -79,6 +80,9 @@
     /** Source from which FunctionNode was parsed. */
     private transient Source source;
 
+    /** Serialized, compressed form of the AST. Used by split functions as they can't be reparsed from source. */
+    private final byte[] serializedAst;
+
     /** Token of this function within the source. */
     private final long token;
 
@@ -127,6 +131,7 @@
      * @param nestedFunctions     nested function map
      * @param externalScopeDepths external scope depths
      * @param internalSymbols     internal symbols to method, defined in its scope
+     * @param serializedAst       a serialized AST representation. Normally only used for split functions.
      */
     public RecompilableScriptFunctionData(
         final FunctionNode functionNode,
@@ -134,7 +139,8 @@
         final AllocatorDescriptor allocationDescriptor,
         final Map<Integer, RecompilableScriptFunctionData> nestedFunctions,
         final Map<String, Integer> externalScopeDepths,
-        final Set<String> internalSymbols) {
+        final Set<String> internalSymbols,
+        final byte[] serializedAst) {
 
         super(functionName(functionNode),
               Math.min(functionNode.getParameters().size(), MAX_ARITY),
@@ -158,6 +164,7 @@
             nfn.setParent(this);
         }
 
+        this.serializedAst = serializedAst;
         createLogger();
     }
 
@@ -212,10 +219,7 @@
      */
     public int getExternalSymbolDepth(final String symbolName) {
         final Integer depth = externalScopeDepths.get(symbolName);
-        if (depth == null) {
-            return -1;
-        }
-        return depth;
+        return depth == null ? -1 : depth;
     }
 
     /**
@@ -354,8 +358,15 @@
         return allocationStrategy.allocate(map);
     }
 
+    boolean isSerialized() {
+        return serializedAst != null;
+    }
+
     FunctionNode reparse() {
-        // NOTE: If we aren't recompiling the top-level program, we decrease functionNodeId 'cause we'll have a synthetic program node
+        if (isSerialized()) {
+            return deserialize();
+        }
+
         final int descPosition = Token.descPosition(token);
         final Context context = Context.getContextTrusted();
         final Parser parser = new Parser(
@@ -363,8 +374,10 @@
             source,
             new Context.ThrowErrorManager(),
             isStrict(),
+            // source starts at line 0, so even though lineNumber is the correct declaration line, back off
+            // one to make it exclusive
             lineNumber - 1,
-            context.getLogger(Parser.class)); // source starts at line 0, so even though lineNumber is the correct declaration line, back off one to make it exclusive
+            context.getLogger(Parser.class));
 
         if (getFunctionFlag(FunctionNode.IS_ANONYMOUS)) {
             parser.setFunctionName(functionName);
@@ -378,6 +391,17 @@
         return (isProgram() ? program : extractFunctionFromScript(program)).setName(null, functionName);
     }
 
+    private FunctionNode deserialize() {
+        final ScriptEnvironment env = installer.getOwner();
+        final Timing timing = env._timing;
+        final long t1 = System.nanoTime();
+        try {
+            return AstDeserializer.deserialize(serializedAst).initializeDeserialized(source, new Namespace(env.getNamespace()));
+        } finally {
+            timing.accumulateTime("'Deserialize'", System.nanoTime() - t1);
+        }
+    }
+
     private boolean getFunctionFlag(final int flag) {
         return (functionFlags & flag) != 0;
     }
@@ -486,7 +510,8 @@
 
         final FunctionNode fn = reparse();
         final Compiler compiler = getCompiler(fn, actualCallSiteType, runtimeScope);
-        final FunctionNode compiledFn = compiler.compile(fn, CompilationPhases.COMPILE_ALL);
+        final FunctionNode compiledFn = compiler.compile(fn,
+                isSerialized() ? CompilationPhases.COMPILE_ALL_SERIALIZED : CompilationPhases.COMPILE_ALL);
 
         if (persist && !compiledFn.getFlag(FunctionNode.HAS_APPLY_TO_CALL_SPECIALIZATION)) {
             compiler.persistClassInfo(cacheKey, compiledFn);
@@ -606,7 +631,7 @@
 
     MethodHandle lookupCodeMethod(final Class<?> codeClass, final MethodType targetType) {
         if (log.isEnabled()) {
-            log.info("Looking up ", DebugLogger.quote(name), " type=", targetType);
+            log.info("Looking up ", DebugLogger.quote(functionName), " type=", targetType);
         }
         return MH.findStatic(LOOKUP, codeClass, functionName, targetType);
     }
@@ -817,6 +842,26 @@
         return true;
     }
 
+    /**
+     * Restores the {@link #getFunctionFlags()} flags to a function node. During on-demand compilation, we might need
+     * to restore flags to a function node that was otherwise not subjected to a full compile pipeline (e.g. its parse
+     * was skipped, or it's a nested function of a deserialized function.
+     * @param lc current lexical context
+     * @param fn the function node to restore flags onto
+     * @return the transformed function node
+     */
+    public FunctionNode restoreFlags(final LexicalContext lc, final FunctionNode fn) {
+        assert fn.getId() == functionNodeId;
+        FunctionNode newFn = fn.setFlags(lc, functionFlags);
+        // This compensates for missing markEval() in case the function contains an inner function
+        // that contains eval(), that now we didn't discover since we skipped the inner function.
+        if (newFn.hasNestedEval()) {
+            assert newFn.hasScopeBlock();
+            newFn = newFn.setBody(lc, newFn.getBody().setNeedsScope(null));
+        }
+        return newFn;
+    }
+
     private void readObject(final java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
         in.defaultReadObject();
         createLogger();
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java	Wed Jul 05 20:05:30 2017 +0200
@@ -692,8 +692,7 @@
         assert isValidArrayIndex(index) : "invalid array index";
         final long longIndex = ArrayIndex.toLongIndex(index);
         doesNotHaveEnsureDelete(longIndex, getArray().length(), false);
-        setArray(getArray().ensure(longIndex));
-        setArray(getArray().set(index, value, false));
+        setArray(getArray().ensure(longIndex).set(index,value, false));
     }
 
     private void checkIntegerKey(final String key) {
@@ -1462,9 +1461,8 @@
 
         //invalidate any fast array setters
         final ArrayData array = getArray();
-        if (array != null) {
-            array.invalidateSetters();
-        }
+        assert array != null;
+        setArray(ArrayData.preventExtension(array));
         return this;
     }
 
@@ -2645,20 +2643,22 @@
       * @param newLength new length to set
       */
     public final void setLength(final long newLength) {
-       final long arrayLength = getArray().length();
-       if (newLength == arrayLength) {
-           return;
-       }
-
-       if (newLength > arrayLength) {
-           setArray(getArray().ensure(newLength - 1));
-            if (getArray().canDelete(arrayLength, newLength - 1, false)) {
-               setArray(getArray().delete(arrayLength, newLength - 1));
-           }
-           return;
-       }
-
-       if (newLength < arrayLength) {
+        ArrayData data = getArray();
+        final long arrayLength = data.length();
+        if (newLength == arrayLength) {
+            return;
+        }
+
+        if (newLength > arrayLength) {
+            data = data.ensure(newLength - 1);
+            if (data.canDelete(arrayLength, newLength - 1, false)) {
+               data = data.delete(arrayLength, newLength - 1);
+            }
+            setArray(data);
+            return;
+        }
+
+        if (newLength < arrayLength) {
            long actualLength = newLength;
 
            // Check for numeric keys in property map and delete them or adjust length, depending on whether
@@ -2680,8 +2680,8 @@
                }
            }
 
-           setArray(getArray().shrink(actualLength));
-           getArray().setLength(actualLength);
+           setArray(data.shrink(actualLength));
+           data.setLength(actualLength);
        }
     }
 
@@ -3194,8 +3194,9 @@
         final int    index        = getArrayIndex(primitiveKey);
 
         if (isValidArrayIndex(index)) {
-            if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+            final ArrayData data = getArray();
+            if (data.has(index)) {
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
@@ -3213,8 +3214,9 @@
         final int    index        = getArrayIndex(primitiveKey);
 
         if (isValidArrayIndex(index)) {
-            if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+            final ArrayData data = getArray();
+            if (data.has(index)) {
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
@@ -3232,8 +3234,9 @@
         final int    index        = getArrayIndex(primitiveKey);
 
         if (isValidArrayIndex(index)) {
-            if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+            final ArrayData data = getArray();
+            if (data.has(index)) {
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
@@ -3251,8 +3254,9 @@
         final int    index        = getArrayIndex(primitiveKey);
 
         if (isValidArrayIndex(index)) {
-            if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+            final ArrayData data = getArray();
+            if (data.has(index)) {
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
@@ -3269,8 +3273,9 @@
         final int index = getArrayIndex(key);
 
         if (isValidArrayIndex(index)) {
-            if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+            final ArrayData data = getArray();
+            if (data.has(index)) {
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
@@ -3287,8 +3292,9 @@
         final int index = getArrayIndex(key);
 
         if (isValidArrayIndex(index)) {
-            if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+            final ArrayData data = getArray();
+            if (data.has(index)) {
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
@@ -3305,8 +3311,9 @@
         final int index = getArrayIndex(key);
 
         if (isValidArrayIndex(index)) {
-            if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+            final ArrayData data = getArray();
+            if (data.has(index)) {
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
@@ -3323,8 +3330,9 @@
         final int index = getArrayIndex(key);
 
         if (isValidArrayIndex(index)) {
-            if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+            final ArrayData data = getArray();
+            if (data.has(index)) {
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
@@ -3341,8 +3349,9 @@
         final int index = getArrayIndex(key);
 
         if (isValidArrayIndex(index)) {
-            if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+            final ArrayData data = getArray();
+            if (data.has(index)) {
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
@@ -3359,8 +3368,9 @@
         final int index = getArrayIndex(key);
 
         if (isValidArrayIndex(index)) {
-            if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+            final ArrayData data = getArray();
+            if (data.has(index)) {
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
@@ -3377,8 +3387,9 @@
         final int index = getArrayIndex(key);
 
         if (isValidArrayIndex(index)) {
-            if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+            final ArrayData data = getArray();
+            if (data.has(index)) {
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
@@ -3395,8 +3406,9 @@
         final int index = getArrayIndex(key);
 
         if (isValidArrayIndex(index)) {
-            if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+            final ArrayData data = getArray();
+            if (data.has(index)) {
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
@@ -3413,7 +3425,8 @@
         final int index = getArrayIndex(key);
         if (isValidArrayIndex(index)) {
             if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+                final ArrayData data = getArray();
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
@@ -3429,8 +3442,9 @@
         final int index = getArrayIndex(key);
 
         if (isValidArrayIndex(index)) {
-            if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+            final ArrayData data = getArray();
+            if (data.has(index)) {
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
@@ -3447,8 +3461,9 @@
         final int index = getArrayIndex(key);
 
         if (isValidArrayIndex(index)) {
-            if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+            final ArrayData data = getArray();
+            if (data.has(index)) {
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
@@ -3465,8 +3480,9 @@
         final int index = getArrayIndex(key);
 
         if (isValidArrayIndex(index)) {
-            if (getArray().has(index)) {
-                setArray(getArray().set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
+            final ArrayData data = getArray();
+            if (data.has(index)) {
+                setArray(data.set(index, value, NashornCallSiteDescriptor.isStrictFlag(callSiteFlags)));
             } else {
                 doesNotHave(index, value, callSiteFlags);
             }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/AnyElements.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.nashorn.internal.runtime.arrays;
+
+/**
+ * Marker interface for any ContinuousArray with any elements
+ * Used for type checks that throw ClassCastExceptions and force relinks
+ * for fast NativeArray specializations of builtin methods
+ */
+public interface AnyElements {
+    /**
+     * Return a numeric weight of the element type - wider is higher
+     * @return element type weight
+     */
+    public int getElementWeight();
+}
\ No newline at end of file
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ArrayData.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ArrayData.java	Wed Jul 05 20:05:30 2017 +0200
@@ -28,6 +28,7 @@
 import static jdk.nashorn.internal.codegen.CompilerConstants.staticCall;
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Array;
 import java.nio.ByteBuffer;
 import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.linker.GuardedInvocation;
@@ -37,6 +38,7 @@
 import jdk.nashorn.internal.objects.Global;
 import jdk.nashorn.internal.runtime.JSType;
 import jdk.nashorn.internal.runtime.PropertyDescriptor;
+import jdk.nashorn.internal.runtime.ScriptRuntime;
 import jdk.nashorn.internal.runtime.UnwarrantedOptimismException;
 
 /**
@@ -49,10 +51,180 @@
     /** Mask for getting a chunk */
     protected static final int CHUNK_MASK = CHUNK_SIZE - 1;
 
+    /** Untouched data - still link callsites as IntArrayData, but expands to
+     *  a proper ArrayData when we try to write to it */
+    public static final ArrayData EMPTY_ARRAY = new UntouchedArrayData();
+
     /**
      * Immutable empty array to get ScriptObjects started.
+     * Use the same array and convert it to mutable as soon as it is modified
      */
-    public static final ArrayData EMPTY_ARRAY = new NoTypeArrayData();
+    private static class UntouchedArrayData extends ContinuousArrayData {
+        private UntouchedArrayData() {
+            this(0);
+        }
+
+        private UntouchedArrayData(final int length) {
+            super(length);
+        }
+
+        private ArrayData toRealArrayData() {
+            return toRealArrayData(0);
+        }
+
+        private ArrayData toRealArrayData(final int index) {
+            final IntArrayData newData = new IntArrayData(index + 1);
+            if (index == 0) {
+                return newData;
+            }
+            return new DeletedRangeArrayFilter(newData, 0, index);
+        }
+
+        @Override
+        public ContinuousArrayData copy() {
+            return new UntouchedArrayData((int)length);
+        }
+
+        @Override
+        public Object asArrayOfType(final Class<?> componentType) {
+            return Array.newInstance(componentType, 0);
+        }
+
+        @Override
+        public Object[] asObjectArray() {
+            return ScriptRuntime.EMPTY_ARRAY;
+        }
+
+        @Override
+        public ArrayData ensure(final long safeIndex) {
+            if (safeIndex > 0L) {
+                return toRealArrayData((int)safeIndex).ensure(safeIndex);
+           }
+           return this;
+        }
+
+        @Override
+        public ArrayData convert(final Class<?> type) {
+            return toRealArrayData(0).convert(type);
+        }
+
+        @Override
+        public void shiftLeft(final int by) {
+            //nop, always empty or we wouldn't be of this class
+        }
+
+        @Override
+        public ArrayData shiftRight(final int by) {
+            return this; //always empty or we wouldn't be of this class
+        }
+
+        @Override
+        public ArrayData shrink(final long newLength) {
+            return this;
+        }
+
+        @Override
+        public ArrayData set(final int index, final Object value, final boolean strict) {
+            return toRealArrayData(index).set(index, value, strict);
+        }
+
+        @Override
+        public ArrayData set(final int index, final int value, final boolean strict) {
+            return toRealArrayData(index).set(index, value, strict);
+        }
+
+        @Override
+        public ArrayData set(final int index, final long value, final boolean strict) {
+            return toRealArrayData(index).set(index, value, strict);
+        }
+
+        @Override
+        public ArrayData set(final int index, final double value, final boolean strict) {
+            return toRealArrayData(index).set(index, value, strict);
+        }
+
+        @Override
+        public int getInt(final int index) {
+            throw new ArrayIndexOutOfBoundsException(index); //empty
+        }
+
+        @Override
+        public long getLong(final int index) {
+            throw new ArrayIndexOutOfBoundsException(index); //empty
+        }
+
+        @Override
+        public double getDouble(final int index) {
+            throw new ArrayIndexOutOfBoundsException(index); //empty
+        }
+
+        @Override
+        public Object getObject(final int index) {
+            throw new ArrayIndexOutOfBoundsException(index); //empty
+        }
+
+        @Override
+        public boolean has(final int index) {
+            return false; //empty
+        }
+
+        @Override
+        public ArrayData delete(final int index) {
+            return new DeletedRangeArrayFilter(this, index, index);
+        }
+
+        @Override
+        public ArrayData delete(final long fromIndex, final long toIndex) {
+            return new DeletedRangeArrayFilter(this, fromIndex, toIndex);
+        }
+
+        @Override
+        public Object pop() {
+            return ScriptRuntime.UNDEFINED;
+        }
+
+        @Override
+        public ArrayData push(final boolean strict, final Object item) {
+            return toRealArrayData().push(strict, item);
+        }
+
+        @Override
+        public ArrayData slice(final long from, final long to) {
+            return this; //empty
+        }
+
+        @Override
+        public ContinuousArrayData fastConcat(final ContinuousArrayData otherData) {
+            return otherData.copy();
+        }
+
+        //no need to override fastPopInt, as the default behavior is to throw classcast exception so we
+        //can relink and return an undefined, this is the IntArrayData default behavior
+        @Override
+        public String toString() {
+            return getClass().getSimpleName();
+        }
+
+        @Override
+        public MethodHandle getElementGetter(final Class<?> returnType, final int programPoint) {
+            return null;
+        }
+
+        @Override
+        public MethodHandle getElementSetter(final Class<?> elementType) {
+            return null;
+        }
+
+        @Override
+        public Class<?> getElementType() {
+            return int.class;
+        }
+
+        @Override
+        public Class<?> getBoxedElementType() {
+            return Integer.class;
+        }
+    };
 
     /**
      * Length of the array data. Not necessarily length of the wrapped array.
@@ -77,7 +249,7 @@
      * Factory method for unspecified array - start as int
      * @return ArrayData
      */
-    public static ArrayData initialArray() {
+    public final static ArrayData initialArray() {
         return new IntArrayData();
     }
 
@@ -92,24 +264,13 @@
         throw new UnwarrantedOptimismException(data.getObject(index), programPoint);
     }
 
-    private static int alignUp(final int size) {
-        return size + CHUNK_SIZE - 1 & ~(CHUNK_SIZE - 1);
-    }
-
     /**
-     * Generic invalidation hook for script object to have call sites to this array indexing
-     * relinked, e.g. when a native array is marked as non extensible
+     * Align an array size up to the nearest array chunk size
+     * @param size size required
+     * @return size given, always >= size
      */
-    public void invalidateGetters() {
-        //subclass responsibility
-    }
-
-    /**
-     * Generic invalidation hook for script object to have call sites to this array indexing
-     * relinked, e.g. when a native array is marked as non extensible
-     */
-    public void invalidateSetters() {
-        //subclass responsibility
+    protected final static int alignUp(final int size) {
+        return size + CHUNK_SIZE - 1 & ~(CHUNK_SIZE - 1);
     }
 
     /**
@@ -118,7 +279,7 @@
      * @param length the initial length
      * @return ArrayData
      */
-    public static ArrayData allocate(final int length) {
+    public static final ArrayData allocate(final int length) {
         if (length == 0) {
             return new IntArrayData();
         } else if (length >= SparseArrayData.MAX_DENSE_LENGTH) {
@@ -134,7 +295,7 @@
      * @param  array the array
      * @return ArrayData wrapping this array
      */
-    public static ArrayData allocate(final Object array) {
+    public static final ArrayData allocate(final Object array) {
         final Class<?> clazz = array.getClass();
 
         if (clazz == int[].class) {
@@ -154,7 +315,7 @@
      * @param array the array to use for initial elements
      * @return the ArrayData
      */
-    public static ArrayData allocate(final int[] array) {
+    public static final ArrayData allocate(final int[] array) {
          return new IntArrayData(array, array.length);
     }
 
@@ -164,7 +325,7 @@
      * @param array the array to use for initial elements
      * @return the ArrayData
      */
-    public static ArrayData allocate(final long[] array) {
+    public static final ArrayData allocate(final long[] array) {
         return new LongArrayData(array, array.length);
     }
 
@@ -174,7 +335,7 @@
      * @param array the array to use for initial elements
      * @return the ArrayData
      */
-    public static ArrayData allocate(final double[] array) {
+    public static final ArrayData allocate(final double[] array) {
         return new NumberArrayData(array, array.length);
     }
 
@@ -184,7 +345,7 @@
      * @param array the array to use for initial elements
      * @return the ArrayData
      */
-    public static ArrayData allocate(final Object[] array) {
+    public static final ArrayData allocate(final Object[] array) {
         return new ObjectArrayData(array, array.length);
     }
 
@@ -194,7 +355,7 @@
      * @param buf the nio ByteBuffer to wrap
      * @return the ArrayData
      */
-    public static ArrayData allocate(final ByteBuffer buf) {
+    public static final ArrayData allocate(final ByteBuffer buf) {
         return new ByteBufferArrayData(buf);
     }
 
@@ -204,7 +365,7 @@
      * @param underlying  the underlying ArrayData to wrap in the freeze filter
      * @return the frozen ArrayData
      */
-    public static ArrayData freeze(final ArrayData underlying) {
+    public static final ArrayData freeze(final ArrayData underlying) {
         return new FrozenArrayFilter(underlying);
     }
 
@@ -214,11 +375,21 @@
      * @param underlying  the underlying ArrayData to wrap in the seal filter
      * @return the sealed ArrayData
      */
-    public static ArrayData seal(final ArrayData underlying) {
+    public static final ArrayData seal(final ArrayData underlying) {
         return new SealedArrayFilter(underlying);
     }
 
     /**
+     * Prevent this array from being extended
+     *
+     * @param  underlying the underlying ArrayData to wrap in the non extensible filter
+     * @return new array data, filtered
+     */
+    public static final ArrayData preventExtension(final ArrayData underlying) {
+        return new NonExtensibleArrayFilter(underlying);
+    }
+
+    /**
      * Return the length of the array data. This may differ from the actual
      * length of the array this wraps as length may be set or gotten as any
      * other JavaScript Property
@@ -728,5 +899,4 @@
     public GuardedInvocation findFastSetIndexMethod(final Class<? extends ArrayData> clazz, final CallSiteDescriptor desc, final LinkRequest request) { // array, index, value
         return null;
     }
-
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ArrayIndex.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ArrayIndex.java	Wed Jul 05 20:05:30 2017 +0200
@@ -182,15 +182,15 @@
     }
 
     /**
-     * Convert an index to a long value. This basically amounts to ANDing it
-     * with {@link JSType#MAX_UINT}, as the maximum array index in JavaScript
+     * Convert an index to a long value. This basically amounts to converting it into a
+     * {@link JSType#toUint32(int)} uint32} as the maximum array index in JavaScript
      * is 0xfffffffe
      *
      * @param index index to convert to long form
      * @return index as uint32 in a long
      */
     public static long toLongIndex(final int index) {
-        return index & JSType.MAX_UINT;
+        return JSType.toUint32(index);
     }
 
     /**
@@ -201,7 +201,7 @@
      * @return index as string
      */
     public static String toKey(final int index) {
-        return Long.toString(index & JSType.MAX_UINT);
+        return Long.toString(JSType.toUint32(index));
     }
 
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ContinuousArrayData.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ContinuousArrayData.java	Wed Jul 05 20:05:30 2017 +0200
@@ -1,5 +1,4 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +29,6 @@
 import static jdk.nashorn.internal.runtime.JSType.getAccessorTypeIndex;
 import static jdk.nashorn.internal.runtime.UnwarrantedOptimismException.INVALID_PROGRAM_POINT;
 import static jdk.nashorn.internal.runtime.UnwarrantedOptimismException.isValid;
-
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
@@ -50,9 +48,6 @@
  */
 @Logger(name="arrays")
 public abstract class ContinuousArrayData extends ArrayData {
-
-    private SwitchPoint sp;
-
     /**
      * Constructor
      * @param length length (elementLength)
@@ -61,18 +56,6 @@
         super(length);
     }
 
-    private SwitchPoint ensureSwitchPointExists() {
-        if (sp == null){
-            sp = new SwitchPoint();
-        }
-        return sp;
-    }
-
-    @Override
-    public void invalidateSetters() {
-        SwitchPoint.invalidateAll(new SwitchPoint[] { ensureSwitchPointExists() });
-    }
-
     /**
      * Check if we can put one more element at the end of this continous
      * array without reallocating, or if we are overwriting an already
@@ -86,6 +69,14 @@
     }
 
     /**
+     * Check if an arraydata is empty
+     * @return true if empty
+     */
+    public boolean isEmpty() {
+        return length == 0L;
+    }
+
+    /**
      * Return element getter for a certain type at a certain program point
      * @param returnType   return type
      * @param programPoint program point
@@ -109,13 +100,16 @@
      * @param index index to check - currently only int indexes
      * @return index
      */
-    protected int throwHas(final int index) {
+    protected final int throwHas(final int index) {
         if (!has(index)) {
             throw new ClassCastException();
         }
         return index;
     }
 
+    @Override
+    public abstract ContinuousArrayData copy();
+
     /**
      * Returns the type used to store an element in this array
      * @return element type
@@ -128,6 +122,25 @@
     }
 
     /**
+     * Returns the boxed type of the type used to store an element in this array
+     * @return element type
+     */
+    public abstract Class<?> getBoxedElementType();
+
+    /**
+     * Get the widest element type of two arrays. This can be done faster in subclasses, but
+     * this works for all ContinuousArrayDatas and for where more optimal checks haven't been
+     * implemented.
+     *
+     * @param otherData another ContinuousArrayData
+     * @return the widest boxed element type
+     */
+    public ContinuousArrayData widest(final ContinuousArrayData otherData) {
+        final Class<?> elementType = getElementType();
+        return Type.widest(elementType, otherData.getElementType()) == elementType ? this : otherData;
+    }
+
+    /**
      * Look up a continuous array element getter
      * @param get          getter, sometimes combined with a has check that throws CCE on failure for relink
      * @param returnType   return type
@@ -256,12 +269,7 @@
             final Object[]        args  = request.getArguments();
             final int             index = (int)args[args.length - 2];
 
-            //sp may be invalidated by e.g. preventExtensions before the first setter is linked
-            //then it is already created. otherwise, create it here to guard against future
-            //invalidations
-            ensureSwitchPointExists();
-
-            if (!sp.hasBeenInvalidated() && hasRoomFor(index)) {
+            if (hasRoomFor(index)) {
                 MethodHandle setElement = getElementSetter(elementType); //Z(continuousarraydata, int, int), return true if successful
                 if (setElement != null) {
                     //else we are dealing with a wider type than supported by this callsite
@@ -269,7 +277,7 @@
                     getArray   = MH.asType(getArray, getArray.type().changeReturnType(getClass()));
                     setElement = MH.filterArguments(setElement, 0, getArray);
                     final MethodHandle guard = MH.insertArguments(FAST_ACCESS_GUARD, 0, clazz);
-                    return new GuardedInvocation(setElement, guard, sp, ClassCastException.class); //CCE if not a scriptObject anymore
+                    return new GuardedInvocation(setElement, guard, (SwitchPoint)null, ClassCastException.class); //CCE if not a scriptObject anymore
                 }
             }
         }
@@ -344,4 +352,13 @@
     public Object fastPopObject() {
         throw new ClassCastException(String.valueOf(getClass())); //type is wrong, relink
     }
+
+    /**
+     * Specialization - fast concat implementation
+     * @param otherData data to concat
+     * @return new arraydata
+     */
+    public ContinuousArrayData fastConcat(final ContinuousArrayData otherData) {
+        throw new ClassCastException(String.valueOf(getClass()) + " != " + String.valueOf(otherData.getClass()));
+    }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/IntArrayData.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/IntArrayData.java	Wed Jul 05 20:05:30 2017 +0200
@@ -26,7 +26,6 @@
 package jdk.nashorn.internal.runtime.arrays;
 
 import static jdk.nashorn.internal.codegen.CompilerConstants.specialCall;
-
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.util.Arrays;
@@ -57,17 +56,32 @@
      * @param array an int array
      * @param length a length, not necessarily array.length
      */
-    IntArrayData(final int array[], final int length) {
+    IntArrayData(final int[] array, final int length) {
         super(length);
-        assert array.length >= length;
+        assert array == null || array.length >= length;
         this.array = array;
     }
 
     @Override
-    public Class<?> getElementType() {
+    public final Class<?> getElementType() {
         return int.class;
     }
 
+    @Override
+    public final Class<?> getBoxedElementType() {
+        return Integer.class;
+    }
+
+    @Override
+    public final int getElementWeight() {
+        return 1;
+    }
+
+    @Override
+    public final ContinuousArrayData widest(final ContinuousArrayData otherData) {
+        return otherData;
+    }
+
     private static final MethodHandle HAS_GET_ELEM = specialCall(MethodHandles.lookup(), IntArrayData.class, "getElem", int.class, int.class).methodHandle();
     private static final MethodHandle SET_ELEM     = specialCall(MethodHandles.lookup(), IntArrayData.class, "setElem", void.class, int.class, int.class).methodHandle();
 
@@ -104,7 +118,7 @@
     }
 
     @Override
-    public ArrayData copy() {
+    public IntArrayData copy() {
         return new IntArrayData(array.clone(), (int)length);
     }
 
@@ -165,8 +179,7 @@
     public ArrayData convert(final Class<?> type) {
         if (type == Integer.class) {
             return this;
-        }
-        if (type == Long.class) {
+        } else if (type == Long.class) {
             return convertToLong();
         } else if (type == Double.class) {
             return convertToDouble();
@@ -209,8 +222,7 @@
 
     @Override
     public ArrayData shrink(final long newLength) {
-        Arrays.fill(array, (int) newLength, array.length, 0);
-
+        Arrays.fill(array, (int)newLength, array.length, 0);
         return this;
     }
 
@@ -322,10 +334,7 @@
 
     @Override
     public ArrayData slice(final long from, final long to) {
-        final long start     = from < 0 ? from + length : from;
-        final long newLength = to - start;
-
-        return new IntArrayData(Arrays.copyOfRange(array, (int)from, (int)to), (int)newLength);
+        return new IntArrayData(Arrays.copyOfRange(array, (int)from, (int)to), (int)(to - (from < 0 ? from + length : from)));
     }
 
     @Override
@@ -347,7 +356,13 @@
             throw new UnsupportedOperationException();
         }
         final ArrayData returnValue = removed == 0 ?
-                EMPTY_ARRAY : new IntArrayData(Arrays.copyOfRange(array, start, start + removed), removed);
+                EMPTY_ARRAY :
+                new IntArrayData(
+                        Arrays.copyOfRange(
+                                array,
+                                start,
+                                start + removed),
+                        removed);
 
         if (newLength != oldLength) {
             final int[] newArray;
@@ -403,4 +418,26 @@
     public Object fastPopObject() {
         return fastPopInt();
     }
+
+    @Override
+    public ContinuousArrayData fastConcat(final ContinuousArrayData otherData) {
+        final int   otherLength = (int)otherData.length;
+        final int   thisLength  = (int)length;
+        assert otherLength > 0 && thisLength > 0;
+
+        final int[] otherArray  = ((IntArrayData)otherData).array;
+        final int   newLength   = otherLength + thisLength;
+        final int[] newArray    = new int[ArrayData.alignUp(newLength)];
+
+        System.arraycopy(array, 0, newArray, 0, thisLength);
+        System.arraycopy(otherArray, 0, newArray, thisLength, otherLength);
+
+        return new IntArrayData(newArray, newLength);
+    }
+
+    @Override
+    public String toString() {
+        assert length <= array.length : length + " > " + array.length;
+        return getClass().getSimpleName() + ':' + Arrays.toString(Arrays.copyOf(array, (int)length));
+    }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/LongArrayData.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/LongArrayData.java	Wed Jul 05 20:05:30 2017 +0200
@@ -52,16 +52,31 @@
     LongArrayData(final long array[], final int length) {
         super(length);
         assert array.length >= length;
-        this.array  = array;
+        this.array = array;
     }
 
     @Override
-    public Class<?> getElementType() {
+    public final Class<?> getElementType() {
         return long.class;
     }
 
     @Override
-    public ArrayData copy() {
+    public final Class<?> getBoxedElementType() {
+        return Long.class;
+    }
+
+    @Override
+    public final ContinuousArrayData widest(final ContinuousArrayData otherData) {
+        return otherData instanceof IntElements ? this : otherData;
+    }
+
+    @Override
+    public final int getElementWeight() {
+        return 2;
+    }
+
+    @Override
+    public LongArrayData copy() {
         return new LongArrayData(array.clone(), (int)length);
     }
 
@@ -101,7 +116,7 @@
     }
 
     @Override
-    public ArrayData convert(final Class<?> type) {
+    public ContinuousArrayData convert(final Class<?> type) {
         if (type == Integer.class || type == Long.class) {
             return this;
         }
@@ -145,8 +160,7 @@
 
     @Override
     public ArrayData shrink(final long newLength) {
-        Arrays.fill(array, (int) newLength, array.length, 0);
-
+        Arrays.fill(array, (int)newLength, array.length, 0L);
         return this;
     }
 
@@ -359,4 +373,37 @@
     public Object fastPopObject() {
         return fastPopLong();
     }
+
+    @Override
+    public ContinuousArrayData fastConcat(final ContinuousArrayData otherData) {
+        final int   otherLength = (int)otherData.length;
+        final int   thisLength  = (int)length;
+        assert otherLength > 0 && thisLength > 0;
+
+        final long[] otherArray  = ((LongArrayData)otherData).array;
+        final int    newLength   = otherLength + thisLength;
+        final long[] newArray   = new long[ArrayData.alignUp(newLength)];
+
+        System.arraycopy(array, 0, newArray, 0, thisLength);
+        System.arraycopy(otherArray, 0, newArray, thisLength, otherLength);
+
+        return new LongArrayData(newArray, newLength);
+    }
+
+    @Override
+    public String toString() {
+        assert length <= array.length : length + " > " + array.length;
+
+        final StringBuilder sb = new StringBuilder(getClass().getSimpleName()).
+                append(": [");
+        for (int i = 0; i < length; i++) {
+            sb.append(array[i]).append('L'); //make sure L suffix is on elements, to discriminate this from IntArrayData.toString()
+            if (i + 1 < length) {
+                sb.append(", ");
+            }
+        }
+        sb.append(']');
+
+        return sb.toString();
+    }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/NoTypeArrayData.java	Wed Jul 05 20:04:47 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.nashorn.internal.runtime.arrays;
-
-import java.lang.reflect.Array;
-import jdk.nashorn.internal.runtime.ScriptRuntime;
-
-/**
- * Place holding array data for non-array objects.  Activates a true array when
- * accessed.  Should only exist as a singleton defined in ArrayData.
- */
-final class NoTypeArrayData extends ArrayData {
-    NoTypeArrayData() {
-        super(0);
-    }
-
-    NoTypeArrayData(final long length) {
-         super(length);
-    }
-
-    @Override
-    public Object[] asObjectArray() {
-        return ScriptRuntime.EMPTY_ARRAY;
-    }
-
-    @Override
-    public ArrayData copy() {
-        return new NoTypeArrayData();
-    }
-
-    @Override
-    public Object asArrayOfType(final Class<?> componentType) {
-        return Array.newInstance(componentType, 0);
-    }
-
-    @Override
-    public ArrayData convert(final Class<?> type) {
-        final long len = length;
-        final ArrayData arrayData;
-        if (type == Long.class) {
-            arrayData = new LongArrayData(new long[ArrayData.nextSize((int)len)], (int)len);
-        } else if (type == Double.class) {
-            arrayData = new NumberArrayData(new double[ArrayData.nextSize((int)len)], (int)len);
-        } else if (type == Integer.class) {
-            arrayData = new IntArrayData(new int[ArrayData.nextSize((int)len)], (int)len);
-        } else {
-            assert !type.isPrimitive();
-            arrayData = new ObjectArrayData(new Object[ArrayData.nextSize((int)len)], (int)len);
-        }
-        return length == 0 ? arrayData : new DeletedRangeArrayFilter(arrayData, 0, len - 1);
-    }
-
-    @Override
-    public void shiftLeft(final int by) {
-        //empty
-    }
-
-    @Override
-    public ArrayData shiftRight(final int by) {
-        return this;
-    }
-
-    @Override
-    public ArrayData ensure(final long safeIndex) {
-        if (safeIndex >= SparseArrayData.MAX_DENSE_LENGTH) {
-            return new SparseArrayData(this, safeIndex + 1);
-        }
-
-        // Don't trample the shared EMPTY_ARRAY.
-        if (length == 0) {
-            return new NoTypeArrayData(Math.max(safeIndex + 1, length));
-        }
-
-        setLength(Math.max(safeIndex + 1, length));
-        return this;
-    }
-
-    @Override
-    public ArrayData shrink(final long newLength) {
-        return this;
-    }
-
-    @Override
-    public ArrayData set(final int index, final Object value, final boolean strict) {
-        ArrayData newData;
-
-        if (value instanceof Double) {
-            newData = convert(Double.class);
-        } else if (value instanceof Long) {
-            newData = convert(Long.class);
-        } else if (value instanceof Integer) {
-            newData = convert(Integer.class);
-        } else {
-            assert !(value instanceof Number);
-            newData = convert(value == null ? Object.class : value.getClass());
-        }
-
-        return newData.set(index, value, strict);
-    }
-
-    @Override
-    public ArrayData set(final int index, final int value, final boolean strict) {
-        final ArrayData newData = convert(Integer.class);
-        return newData.set(index, value, strict);
-    }
-
-    @Override
-    public ArrayData set(final int index, final long value, final boolean strict) {
-        final ArrayData newData = convert(Long.class);
-        return newData.set(index, value, strict);
-    }
-
-    @Override
-    public ArrayData set(final int index, final double value, final boolean strict) {
-        final ArrayData newData = convert(Double.class);
-        return newData.set(index, value, strict);
-    }
-
-    @Override
-    public int getInt(final int index) {
-        throw new ArrayIndexOutOfBoundsException(index);
-    }
-
-    @Override
-    public long getLong(final int index) {
-        throw new ArrayIndexOutOfBoundsException(index);
-    }
-
-    @Override
-    public double getDouble(final int index) {
-        throw new ArrayIndexOutOfBoundsException(index);
-    }
-
-    @Override
-    public Object getObject(final int index) {
-        throw new ArrayIndexOutOfBoundsException(index);
-    }
-
-    @Override
-    public boolean has(final int index) {
-        return false;
-    }
-
-    @Override
-    public ArrayData delete(final int index) {
-        return new DeletedRangeArrayFilter(this, index, index);
-    }
-
-    @Override
-    public ArrayData delete(final long fromIndex, final long toIndex) {
-        return new DeletedRangeArrayFilter(this, fromIndex, toIndex);
-    }
-
-    @Override
-    public Object pop() {
-        return ScriptRuntime.UNDEFINED;
-    }
-
-    @Override
-    public ArrayData slice(final long from, final long to) {
-        return this;
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/NonExtensibleArrayFilter.java	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,68 @@
+package jdk.nashorn.internal.runtime.arrays;
+
+import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
+import jdk.nashorn.internal.objects.Global;
+import jdk.nashorn.internal.runtime.ScriptRuntime;
+
+/**
+ * Filter class that wrap arrays that have been tagged non extensible
+ */
+public class NonExtensibleArrayFilter extends ArrayFilter {
+
+    /**
+     * Constructor
+     * @param underlying array
+     */
+    public NonExtensibleArrayFilter(final ArrayData underlying) {
+        super(underlying);
+    }
+
+    @Override
+    public ArrayData copy() {
+        return new NonExtensibleArrayFilter(underlying.copy());
+    }
+
+    @Override
+    public ArrayData slice(final long from, final long to) {
+        return new NonExtensibleArrayFilter(underlying.slice(from, to));
+    }
+
+    private ArrayData extensionCheck(final boolean strict, final int index) {
+        if (!strict) {
+            return this;
+        }
+        throw typeError(Global.instance(), "object.non.extensible", String.valueOf(index), ScriptRuntime.safeToString(this));
+    }
+
+    @Override
+    public ArrayData set(final int index, final Object value, final boolean strict) {
+        if (has(index)) {
+            return underlying.set(index, value, strict);
+        }
+        return extensionCheck(strict, index);
+    }
+
+    @Override
+    public ArrayData set(final int index, final int value, final boolean strict) {
+        if (has(index)) {
+            return underlying.set(index, value, strict);
+        }
+        return extensionCheck(strict, index);
+    }
+
+    @Override
+    public ArrayData set(final int index, final long value, final boolean strict) {
+        if (has(index)) {
+            return underlying.set(index, value, strict);
+        }
+        return extensionCheck(strict, index);
+    }
+
+    @Override
+    public ArrayData set(final int index, final double value, final boolean strict) {
+        if (has(index)) {
+            return underlying.set(index, value, strict);
+        }
+        return extensionCheck(strict, index);
+    }
+}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java	Wed Jul 05 20:05:30 2017 +0200
@@ -48,19 +48,34 @@
      * @param array an int array
      * @param length a length, not necessarily array.length
      */
-    NumberArrayData(final double array[], final int length) {
+    NumberArrayData(final double[] array, final int length) {
         super(length);
         assert array.length >= length;
-        this.array  = array;
+        this.array = array;
     }
 
     @Override
-    public Class<?> getElementType() {
+    public final Class<?> getElementType() {
         return double.class;
     }
 
     @Override
-    public ArrayData copy() {
+    public final Class<?> getBoxedElementType() {
+        return Double.class;
+    }
+
+    @Override
+    public final int getElementWeight() {
+        return 3;
+    }
+
+    @Override
+    public final ContinuousArrayData widest(final ContinuousArrayData otherData) {
+        return otherData instanceof IntOrLongElements ? this : otherData;
+    }
+
+    @Override
+    public NumberArrayData copy() {
         return new NumberArrayData(array.clone(), (int)length);
     }
 
@@ -88,7 +103,7 @@
     }
 
     @Override
-    public ArrayData convert(final Class<?> type) {
+    public ContinuousArrayData convert(final Class<?> type) {
         if (type != Double.class && type != Integer.class && type != Long.class) {
             final int len = (int)length;
             return new ObjectArrayData(toObjectArray(false), len);
@@ -129,7 +144,7 @@
 
     @Override
     public ArrayData shrink(final long newLength) {
-        Arrays.fill(array, (int) newLength, array.length, 0.0);
+        Arrays.fill(array, (int)newLength, array.length, 0.0);
         return this;
     }
 
@@ -334,4 +349,26 @@
     public Object fastPopObject() {
         return fastPopDouble();
     }
+
+    @Override
+    public ContinuousArrayData fastConcat(final ContinuousArrayData otherData) {
+        final int   otherLength = (int)otherData.length;
+        final int   thisLength  = (int)length;
+        assert otherLength > 0 && thisLength > 0;
+
+        final double[] otherArray = ((NumberArrayData)otherData).array;
+        final int      newLength  = otherLength + thisLength;
+        final double[] newArray   = new double[ArrayData.alignUp(newLength)];
+
+        System.arraycopy(array, 0, newArray, 0, thisLength);
+        System.arraycopy(otherArray, 0, newArray, thisLength, otherLength);
+
+        return new NumberArrayData(newArray, newLength);
+    }
+
+    @Override
+    public String toString() {
+        assert length <= array.length : length + " > " + array.length;
+        return getClass().getSimpleName() + ':' + Arrays.toString(Arrays.copyOf(array, (int)length));
+    }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/NumericElements.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/NumericElements.java	Wed Jul 05 20:05:30 2017 +0200
@@ -30,6 +30,6 @@
  * Used for type checks that throw ClassCastExceptions and force relinks
  * for fast NativeArray specializations of builtin methods
  */
-public interface NumericElements {
+public interface NumericElements extends AnyElements {
     //empty
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java	Wed Jul 05 20:05:30 2017 +0200
@@ -37,7 +37,7 @@
  * Implementation of {@link ArrayData} as soon as an Object has been
  * written to the array
  */
-final class ObjectArrayData extends ContinuousArrayData {
+final class ObjectArrayData extends ContinuousArrayData implements AnyElements {
 
     /**
      * The wrapped array
@@ -49,19 +49,34 @@
      * @param array an int array
      * @param length a length, not necessarily array.length
      */
-    ObjectArrayData(final Object array[], final int length) {
+    ObjectArrayData(final Object[] array, final int length) {
         super(length);
         assert array.length >= length;
         this.array  = array;
     }
 
     @Override
-    public Class<?> getElementType() {
+    public final Class<?> getElementType() {
         return Object.class;
     }
 
     @Override
-    public ArrayData copy() {
+    public final Class<?> getBoxedElementType() {
+        return getElementType();
+    }
+
+    @Override
+    public final int getElementWeight() {
+        return 4;
+    }
+
+    @Override
+    public final ContinuousArrayData widest(final ContinuousArrayData otherData) {
+        return otherData instanceof NumericElements ? this : otherData;
+    }
+
+    @Override
+    public ObjectArrayData copy() {
         return new ObjectArrayData(array.clone(), (int)length);
     }
 
@@ -79,7 +94,7 @@
     }
 
     @Override
-    public ArrayData convert(final Class<?> type) {
+    public ObjectArrayData convert(final Class<?> type) {
         return this;
     }
 
@@ -325,4 +340,26 @@
 
         return returnValue;
     }
+
+    @Override
+    public ContinuousArrayData fastConcat(final ContinuousArrayData otherData) {
+        final int   otherLength = (int)otherData.length;
+        final int   thisLength  = (int)length;
+        assert otherLength > 0 && thisLength > 0;
+
+        final Object[] otherArray = ((ObjectArrayData)otherData).array;
+        final int      newLength  = otherLength + thisLength;
+        final Object[] newArray   = new Object[ArrayData.alignUp(newLength)];
+
+        System.arraycopy(array, 0, newArray, 0, thisLength);
+        System.arraycopy(otherArray, 0, newArray, thisLength, otherLength);
+
+        return new ObjectArrayData(newArray, newLength);
+    }
+
+    @Override
+    public String toString() {
+        assert length <= array.length : length + " > " + array.length;
+        return getClass().getSimpleName() + ':' + Arrays.toString(Arrays.copyOf(array, (int)length));
+    }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/TypedArrayData.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/TypedArrayData.java	Wed Jul 05 20:05:30 2017 +0200
@@ -88,7 +88,7 @@
     }
 
     @Override
-    public ArrayData copy() {
+    public TypedArrayData<T> copy() {
         throw new UnsupportedOperationException();
     }
 
@@ -133,7 +133,7 @@
     }
 
     @Override
-    public ArrayData convert(final Class<?> type) {
+    public TypedArrayData<T> convert(final Class<?> type) {
         throw new UnsupportedOperationException();
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8058610.js	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8058610: must not let long operations overflow
+ *
+ * @test
+ * @run
+ */
+
+function mul(x) { 
+    return x.foo * x.bar; 
+} 
+print("=== mul ===")
+print(mul({foo: 2147483647,  bar: 2147483647})); // 2^31
+print(mul({foo: 17179869184, bar: 2147483647})); // 2^34
+
+function self_mul(x) {
+    return x.foo *= x.bar; 
+}
+print("=== self_mul ===")
+print(self_mul({foo: 2147483647,  bar: 2147483647})); // 2^31
+print(self_mul({foo: 17179869184, bar: 2147483647})); // 2^34
+
+// We'll need to use this function to obtain long values larger in 
+// magnitude than those precisely representable in a double (2^53), 
+// as Nashorn's parser will reify such literals as a double. For 
+// overflow on add and sub we need (2^63)-1.
+var parseLong = Java.type("java.lang.Long").parseLong;
+
+function sub(x) {
+    return x.foo - x.bar;
+}
+print("=== sub ===")
+print(sub({foo: 2147483647,  bar: -2147483647})); // 2^31
+print(sub({foo: parseLong("9223372036854775807"), bar: parseLong("-9223372036854775807")})); // 2^63-1
+
+function self_sub(x) {
+    return x.foo -= x.bar;
+}
+print("=== self_sub ===")
+print(self_sub({foo: 2147483647,  bar: -2147483647})); // 2^31
+print(self_sub({foo: parseLong("9223372036854775807"), bar: parseLong("-9223372036854775807")})); // 2^63-1
+
+function add(x) {
+    return x.foo + x.bar;
+}
+print("=== add ===")
+print(add({foo: 2147483647,  bar: 2147483647})); // 2^31
+print(add({foo: parseLong("9223372036854775807"), bar: parseLong("9223372036854775807")})); // 2^63-1
+
+function self_add(x) {
+    return x.foo += x.bar;
+}
+print("=== self_add ===")
+print(self_add({foo: 2147483647,  bar: 2147483647})); // 2^31
+print(self_add({foo: parseLong("9223372036854775807"), bar: parseLong("9223372036854775807")})); // 2^63-1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8058610.js.EXPECTED	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,18 @@
+=== mul ===
+4611686014132420600
+36893488130239234000
+=== self_mul ===
+4611686014132420600
+36893488130239234000
+=== sub ===
+4294967294
+18446744073709552000
+=== self_sub ===
+4294967294
+18446744073709552000
+=== add ===
+4294967294
+18446744073709552000
+=== self_add ===
+4294967294
+18446744073709552000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8061391.js	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8061391 - Checks that the optimistic builtin for concat is semantically
+ * correct.
+ *
+ * @test
+ * @run
+ */
+
+var maxJavaInt = 0x7fffffff;
+
+var ia = [1, 2, 3, 4];
+var la = [maxJavaInt + 1000, maxJavaInt + 2000, maxJavaInt + 3000, maxJavaInt + 4000];
+var da = [1.1, 2.2, 3.3, 4.4];
+var oa = ["one", "two", "three", "four"];  
+
+var aa = [ia, la, da, oa];
+
+function concats() {
+    print("shared callsite");
+
+    print(ia);
+    print(la);
+    print(da);
+    print(oa);
+    print(aa);
+    
+    for (var i = 0; i < aa.length; i++) {
+	print(aa[i].concat(aa[i][0]));
+	for (var j = 0; j < aa.length ; j++) {
+	    print(aa[i].concat(aa[j]));
+	}
+    }
+}
+
+function concats_inline() {
+    print("separate callsites");
+
+    print(ia);
+    print(la);
+    print(da);
+    print(oa);
+    print(aa);
+    
+    print(aa[0].concat(aa[0]));
+    print(aa[0].concat(aa[1]));
+    print(aa[0].concat(aa[2]));
+    print(aa[0].concat(aa[3]));
+    print(aa[0].concat(aa[0][0]));    
+
+    print(aa[1].concat(aa[0]));
+    print(aa[1].concat(aa[1]));
+    print(aa[1].concat(aa[2]));
+    print(aa[1].concat(aa[3]));
+    print(aa[1].concat(aa[1][0]));    
+
+    print(aa[2].concat(aa[0]));
+    print(aa[2].concat(aa[1]));
+    print(aa[2].concat(aa[2]));
+    print(aa[2].concat(aa[3]));
+    print(aa[2].concat(aa[2][0]));    
+
+    print(aa[3].concat(aa[0]));
+    print(aa[3].concat(aa[1]));
+    print(aa[3].concat(aa[2]));
+    print(aa[3].concat(aa[3]));
+    print(aa[3].concat(aa[3][0]));    
+}
+
+concats();
+concats_inline();
+
+print();
+var oldia = ia.slice(0); //clone ia
+print("oldia = " + oldia);
+ia[10] = "sparse";
+print("oldia = " + oldia);
+
+print();
+print("Redoing with sparse arrays");
+
+concats();
+concats_inline();
+
+ia = oldia;
+print("Restored ia = " + ia);
+
+function concat_expand() {
+    print("concat type expansion");
+    print(ia.concat(la));
+    print(ia.concat(da));
+    print(ia.concat(oa));
+    print(la.concat(ia));
+    print(la.concat(da));
+    print(la.concat(oa));
+    print(da.concat(ia));
+    print(da.concat(la));
+    print(da.concat(oa));
+}
+
+print();
+concat_expand();
+
+print();
+
+function concat_varargs() {
+    print("concat varargs");
+    print(ia.concat(la)); //fast
+    print(ia.concat(la, da, oa)); //slow
+    var slow = ia.concat(1, maxJavaInt * 2, 4711.17, function() { print("hello, world") }); //slow
+    print(slow);
+    return slow;
+}
+
+var slow = concat_varargs();
+
+print();
+print("sanity checks");
+slow.map(
+	 function(elem) {
+	     if (elem instanceof Function) {
+		 elem();
+	     } else {
+		 print((typeof elem) + " = " + elem);
+	     }
+	 });
+
+print(ia.concat({key: "value"}));
+print(ia.concat({key: "value"}, {key2: "value2"}));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8061391.js.EXPECTED	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,138 @@
+shared callsite
+1,2,3,4
+2147484647,2147485647,2147486647,2147487647
+1.1,2.2,3.3,4.4
+one,two,three,four
+1,2,3,4,2147484647,2147485647,2147486647,2147487647,1.1,2.2,3.3,4.4,one,two,three,four
+1,2,3,4,1
+1,2,3,4,1,2,3,4
+1,2,3,4,2147484647,2147485647,2147486647,2147487647
+1,2,3,4,1.1,2.2,3.3,4.4
+1,2,3,4,one,two,three,four
+2147484647,2147485647,2147486647,2147487647,2147484647
+2147484647,2147485647,2147486647,2147487647,1,2,3,4
+2147484647,2147485647,2147486647,2147487647,2147484647,2147485647,2147486647,2147487647
+2147484647,2147485647,2147486647,2147487647,1.1,2.2,3.3,4.4
+2147484647,2147485647,2147486647,2147487647,one,two,three,four
+1.1,2.2,3.3,4.4,1.1
+1.1,2.2,3.3,4.4,1,2,3,4
+1.1,2.2,3.3,4.4,2147484647,2147485647,2147486647,2147487647
+1.1,2.2,3.3,4.4,1.1,2.2,3.3,4.4
+1.1,2.2,3.3,4.4,one,two,three,four
+one,two,three,four,one
+one,two,three,four,1,2,3,4
+one,two,three,four,2147484647,2147485647,2147486647,2147487647
+one,two,three,four,1.1,2.2,3.3,4.4
+one,two,three,four,one,two,three,four
+separate callsites
+1,2,3,4
+2147484647,2147485647,2147486647,2147487647
+1.1,2.2,3.3,4.4
+one,two,three,four
+1,2,3,4,2147484647,2147485647,2147486647,2147487647,1.1,2.2,3.3,4.4,one,two,three,four
+1,2,3,4,1,2,3,4
+1,2,3,4,2147484647,2147485647,2147486647,2147487647
+1,2,3,4,1.1,2.2,3.3,4.4
+1,2,3,4,one,two,three,four
+1,2,3,4,1
+2147484647,2147485647,2147486647,2147487647,1,2,3,4
+2147484647,2147485647,2147486647,2147487647,2147484647,2147485647,2147486647,2147487647
+2147484647,2147485647,2147486647,2147487647,1.1,2.2,3.3,4.4
+2147484647,2147485647,2147486647,2147487647,one,two,three,four
+2147484647,2147485647,2147486647,2147487647,2147484647
+1.1,2.2,3.3,4.4,1,2,3,4
+1.1,2.2,3.3,4.4,2147484647,2147485647,2147486647,2147487647
+1.1,2.2,3.3,4.4,1.1,2.2,3.3,4.4
+1.1,2.2,3.3,4.4,one,two,three,four
+1.1,2.2,3.3,4.4,1.1
+one,two,three,four,1,2,3,4
+one,two,three,four,2147484647,2147485647,2147486647,2147487647
+one,two,three,four,1.1,2.2,3.3,4.4
+one,two,three,four,one,two,three,four
+one,two,three,four,one
+
+oldia = 1,2,3,4
+oldia = 1,2,3,4
+
+Redoing with sparse arrays
+shared callsite
+1,2,3,4,,,,,,,sparse
+2147484647,2147485647,2147486647,2147487647
+1.1,2.2,3.3,4.4
+one,two,three,four
+1,2,3,4,,,,,,,sparse,2147484647,2147485647,2147486647,2147487647,1.1,2.2,3.3,4.4,one,two,three,four
+1,2,3,4,,,,,,,sparse,1
+1,2,3,4,,,,,,,sparse,1,2,3,4,,,,,,,sparse
+1,2,3,4,,,,,,,sparse,2147484647,2147485647,2147486647,2147487647
+1,2,3,4,,,,,,,sparse,1.1,2.2,3.3,4.4
+1,2,3,4,,,,,,,sparse,one,two,three,four
+2147484647,2147485647,2147486647,2147487647,2147484647
+2147484647,2147485647,2147486647,2147487647,1,2,3,4,,,,,,,sparse
+2147484647,2147485647,2147486647,2147487647,2147484647,2147485647,2147486647,2147487647
+2147484647,2147485647,2147486647,2147487647,1.1,2.2,3.3,4.4
+2147484647,2147485647,2147486647,2147487647,one,two,three,four
+1.1,2.2,3.3,4.4,1.1
+1.1,2.2,3.3,4.4,1,2,3,4,,,,,,,sparse
+1.1,2.2,3.3,4.4,2147484647,2147485647,2147486647,2147487647
+1.1,2.2,3.3,4.4,1.1,2.2,3.3,4.4
+1.1,2.2,3.3,4.4,one,two,three,four
+one,two,three,four,one
+one,two,three,four,1,2,3,4,,,,,,,sparse
+one,two,three,four,2147484647,2147485647,2147486647,2147487647
+one,two,three,four,1.1,2.2,3.3,4.4
+one,two,three,four,one,two,three,four
+separate callsites
+1,2,3,4,,,,,,,sparse
+2147484647,2147485647,2147486647,2147487647
+1.1,2.2,3.3,4.4
+one,two,three,four
+1,2,3,4,,,,,,,sparse,2147484647,2147485647,2147486647,2147487647,1.1,2.2,3.3,4.4,one,two,three,four
+1,2,3,4,,,,,,,sparse,1,2,3,4,,,,,,,sparse
+1,2,3,4,,,,,,,sparse,2147484647,2147485647,2147486647,2147487647
+1,2,3,4,,,,,,,sparse,1.1,2.2,3.3,4.4
+1,2,3,4,,,,,,,sparse,one,two,three,four
+1,2,3,4,,,,,,,sparse,1
+2147484647,2147485647,2147486647,2147487647,1,2,3,4,,,,,,,sparse
+2147484647,2147485647,2147486647,2147487647,2147484647,2147485647,2147486647,2147487647
+2147484647,2147485647,2147486647,2147487647,1.1,2.2,3.3,4.4
+2147484647,2147485647,2147486647,2147487647,one,two,three,four
+2147484647,2147485647,2147486647,2147487647,2147484647
+1.1,2.2,3.3,4.4,1,2,3,4,,,,,,,sparse
+1.1,2.2,3.3,4.4,2147484647,2147485647,2147486647,2147487647
+1.1,2.2,3.3,4.4,1.1,2.2,3.3,4.4
+1.1,2.2,3.3,4.4,one,two,three,four
+1.1,2.2,3.3,4.4,1.1
+one,two,three,four,1,2,3,4,,,,,,,sparse
+one,two,three,four,2147484647,2147485647,2147486647,2147487647
+one,two,three,four,1.1,2.2,3.3,4.4
+one,two,three,four,one,two,three,four
+one,two,three,four,one
+Restored ia = 1,2,3,4
+
+concat type expansion
+1,2,3,4,2147484647,2147485647,2147486647,2147487647
+1,2,3,4,1.1,2.2,3.3,4.4
+1,2,3,4,one,two,three,four
+2147484647,2147485647,2147486647,2147487647,1,2,3,4
+2147484647,2147485647,2147486647,2147487647,1.1,2.2,3.3,4.4
+2147484647,2147485647,2147486647,2147487647,one,two,three,four
+1.1,2.2,3.3,4.4,1,2,3,4
+1.1,2.2,3.3,4.4,2147484647,2147485647,2147486647,2147487647
+1.1,2.2,3.3,4.4,one,two,three,four
+
+concat varargs
+1,2,3,4,2147484647,2147485647,2147486647,2147487647
+1,2,3,4,2147484647,2147485647,2147486647,2147487647,1.1,2.2,3.3,4.4,one,two,three,four
+1,2,3,4,1,4294967294,4711.17,function() { print("hello, world") }
+
+sanity checks
+number = 1
+number = 2
+number = 3
+number = 4
+number = 1
+number = 4294967294
+number = 4711.17
+hello, world
+1,2,3,4,[object Object]
+1,2,3,4,[object Object],[object Object]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8061391_2.js	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Array extension check
+ *
+ * @test
+ * @run
+ */
+
+"use strict";
+var a = [1,2,3];
+Object.preventExtensions(a);
+try {
+    a[4] = 4;
+    print(a);
+} catch (e) {
+    if (!(e instanceof TypeError)) {
+	print("TypeError expected but got e");
+    }
+}
+
+if (a[0] != 1) {
+    throw "element 0 is wrong";
+}
+if (a[1] != 2) {
+    throw "element 1 is wrong";
+}
+if (a[2] != 3) {
+    throw "element 2 is wrong";
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8061391_3.js	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Array extension check
+ *
+ * @test
+ * @run
+ */
+
+var a = [1,2,3];
+Object.preventExtensions(a);
+a[4] = 4;
+print(a);
+if (a[0] != 1) {
+    throw "element 0 is wrong";
+}
+if (a[1] != 2) {
+    throw "element 1 is wrong";
+}
+if (a[2] != 3) {
+    throw "element 2 is wrong";
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8061391_3.js.EXPECTED	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,1 @@
+1,2,3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8062024.js	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8062024: Issue with date.setFullYear when time other than midnight
+ *
+ * @test
+ * @run
+ */
+
+var date1 = new Date("January 01, 1950 00:00:00");
+print("Before:", date1);
+date1.setFullYear(1960);
+print("After:", date1);
+
+var date2 = new Date("January 01, 1950 00:00:01");
+print("Before:", date2);
+date2.setFullYear(1960);
+print("After:", date2);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8062024.js.EXPECTED	Wed Jul 05 20:05:30 2017 +0200
@@ -0,0 +1,4 @@
+Before: Sun Jan 01 1950 00:00:00 GMT+0530 (IST)
+After: Fri Jan 01 1960 00:00:00 GMT+0530 (IST)
+Before: Sun Jan 01 1950 00:00:01 GMT+0530 (IST)
+After: Fri Jan 01 1960 00:00:01 GMT+0530 (IST)
--- a/nashorn/test/src/jdk/nashorn/internal/test/framework/ParallelTestRunner.java	Wed Jul 05 20:04:47 2017 +0200
+++ b/nashorn/test/src/jdk/nashorn/internal/test/framework/ParallelTestRunner.java	Wed Jul 05 20:05:30 2017 +0200
@@ -78,7 +78,8 @@
     // ParallelTestRunner-specific
     private static final String    TEST_JS_THREADS     = "test.js.threads";
     private static final String    TEST_JS_REPORT_FILE = "test.js.report.file";
-    private static final int       THREADS             = Integer.getInteger(TEST_JS_THREADS, Runtime.getRuntime().availableProcessors());
+    // test262 does a lot of eval's and the JVM hates multithreaded class definition, so lower thread count is usually faster.
+    private static final int       THREADS = Integer.getInteger(TEST_JS_THREADS, Runtime.getRuntime().availableProcessors() > 4 ? 4 : 2);
 
     private final List<ScriptRunnable> tests    = new ArrayList<>();
     private final Set<String>      orphans  = new TreeSet<>();