[mapguide-commits] r9786 - in sandbox/jng/vanilla_swig: Bindings Bindings/src/Bindings/Common/Java Bindings/src/Bindings/DotNet Bindings/src/Bindings/Java Bindings/src/Managed/DotNet/OSGeo.MapGuide.Foundation/custom Bindings/src/Managed/Java/org/osgeo/mapguide Bindings/src/Test/DotNet/src/TestMisc Bindings/src/Test/Java Bindings/src/Test/Java/src/org/osgeo/mapguide/test/common UnitTest/WebTier

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Nov 14 07:46:53 PST 2020


Author: jng
Date: 2020-11-14 07:46:53 -0800 (Sat, 14 Nov 2020)
New Revision: 9786

Removed:
   sandbox/jng/vanilla_swig/UnitTest/WebTier/DotNet/
   sandbox/jng/vanilla_swig/UnitTest/WebTier/Java/
   sandbox/jng/vanilla_swig/UnitTest/WebTier/Php/
Modified:
   sandbox/jng/vanilla_swig/Bindings/TODO.txt
   sandbox/jng/vanilla_swig/Bindings/src/Bindings/Common/Java/exception.i
   sandbox/jng/vanilla_swig/Bindings/src/Bindings/Common/Java/extensions.i
   sandbox/jng/vanilla_swig/Bindings/src/Bindings/DotNet/README.md
   sandbox/jng/vanilla_swig/Bindings/src/Bindings/Java/README.md
   sandbox/jng/vanilla_swig/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Foundation/custom/ManagedException.cs
   sandbox/jng/vanilla_swig/Bindings/src/Managed/Java/org/osgeo/mapguide/ObjectFactory.java
   sandbox/jng/vanilla_swig/Bindings/src/Test/DotNet/src/TestMisc/Program.cs
   sandbox/jng/vanilla_swig/Bindings/src/Test/Java/build.xml
   sandbox/jng/vanilla_swig/Bindings/src/Test/Java/src/org/osgeo/mapguide/test/common/TestResult.java
Log:
- Fix up Java binding to reflect the new flattened exception hierarchy. The java runner now runs to completion on windows with all tests passing.
- Implement java.lang.AutoCloseable for candidate classes with a close() method
- Update README.md for the .net binding
- Remove old webtier test code (as it is all superceded by the new test suite)
- Fix C++ stack order in .net ManagedException (.net is upwards, C++ was downwards)

Modified: sandbox/jng/vanilla_swig/Bindings/TODO.txt
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/TODO.txt	2020-11-14 14:54:14 UTC (rev 9785)
+++ sandbox/jng/vanilla_swig/Bindings/TODO.txt	2020-11-14 15:46:53 UTC (rev 9786)
@@ -3,6 +3,7 @@
  - [x] Generate XML documentation for our .net wrapper binding projects
  - [ ] Make sure we can build debug bindings
  - [ ] Fix up inconsistent stack direction in C# exceptions (C++ call stack are printed downwards, C# call stack is printed upwards)
+ - [ ] Add memory leak test (ref: http://osgeo-org.1560.x6.nabble.com/Memory-Leak-in-Java-td5425579.html) and see if this still happens
  - [x] Check in test case admin tool
  - [x] Consolidate Tools.sln into Bindings.sln
  - [ ] Relocate/remove existing test code
@@ -25,7 +26,7 @@
    - [x] Add test data setup script for .net/Java test suites to copy the synced up test data under /UnitTest to the location the test suite is expecting
  - Java binding
    - [ ] Re-shuffle MgBase64 and AppThrowable to a .internal package (so we can bulk svn ignore *.java/*.class in the current dir where sources are generated)
-   - [ ] Verify test suite still passes (Windows)
+   - [x] Verify test suite still passes (Windows)
    - [ ] Verify test suite still passes (Linux)
  - Migrate to SWIG 4.0.0 (https://github.com/jumpinjackie/mapguide-api-bindings/issues/36)
    - [ ] Check if we can get rid of custom .net wstring marshaler (presumably SWIG 4.0 has better support in this area)

Modified: sandbox/jng/vanilla_swig/Bindings/src/Bindings/Common/Java/exception.i
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Bindings/Common/Java/exception.i	2020-11-14 14:54:14 UTC (rev 9785)
+++ sandbox/jng/vanilla_swig/Bindings/src/Bindings/Common/Java/exception.i	2020-11-14 15:46:53 UTC (rev 9786)
@@ -18,8 +18,8 @@
 %insert(header) %{
 void ThrowJavaExceptionWrapper(JNIEnv *jenv, MgException* e) 
 {
-    std::string exName = "org/osgeo/mapguide/";
-    exName += e->GetMultiByteClassName();
+    // Because of our flattened hierarchy, we are now always throwing MgException
+    std::string exName = "org/osgeo/mapguide/MgException";
     jclass exCls = jenv->FindClass(exName.c_str());
     jmethodID ctorId = jenv->GetMethodID(exCls, "<init>", "(JZ)V");
     jthrowable exObj = (jthrowable)jenv->NewObject(exCls, ctorId, (jlong)e, (jboolean)1);

Modified: sandbox/jng/vanilla_swig/Bindings/src/Bindings/Common/Java/extensions.i
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Bindings/Common/Java/extensions.i	2020-11-14 14:54:14 UTC (rev 9785)
+++ sandbox/jng/vanilla_swig/Bindings/src/Bindings/Common/Java/extensions.i	2020-11-14 15:46:53 UTC (rev 9786)
@@ -17,13 +17,12 @@
 
 //---------------------- Java interface decorations ------------------------------//
 
-//NOTE: If we're eventually targeting JDK7, change to AutoCloseable for automatic try-with-resources syntax support
-%typemap(javainterfaces) MgReader "java.io.Closeable"
-%typemap(javainterfaces) MgFeatureReader "java.io.Closeable"
-%typemap(javainterfaces) MgDataReader "java.io.Closeable"
-%typemap(javainterfaces) MgSqlDataReader "java.io.Closeable"
-%typemap(javainterfaces) MgLongTransactionReader "java.io.Closeable"
-%typemap(javainterfaces) MgSpatialContextReader "java.io.Closeable"
+%typemap(javainterfaces) MgReader "java.lang.AutoCloseable"
+%typemap(javainterfaces) MgFeatureReader "java.lang.AutoCloseable"
+%typemap(javainterfaces) MgDataReader "java.lang.AutoCloseable"
+%typemap(javainterfaces) MgSqlDataReader "java.lang.AutoCloseable"
+%typemap(javainterfaces) MgLongTransactionReader "java.lang.AutoCloseable"
+%typemap(javainterfaces) MgSpatialContextReader "java.lang.AutoCloseable"
 
 //This is a helper macro to implement the required APIs for collection items
 //

Modified: sandbox/jng/vanilla_swig/Bindings/src/Bindings/DotNet/README.md
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Bindings/DotNet/README.md	2020-11-14 14:54:14 UTC (rev 9785)
+++ sandbox/jng/vanilla_swig/Bindings/src/Bindings/DotNet/README.md	2020-11-14 15:46:53 UTC (rev 9786)
@@ -5,16 +5,15 @@
 # Differences from the official .net binding
 
  * General
-    * This binding is back to being a monolithic assembly. A split assembly layout is not possible due to missing types in .net Core that made this possible in the full framework (eg. AppDomain)
     * This assembly is not strong named.
     * In line with the .net core build system, the unit of consumption is a nuget package.
-    * The nuget package is completely portable and self-contained. It contains both x86 and x64 windows binaries (and also includes a native interop binary for Ubuntu 14.04 64-bit) and because it targets `netstandard2.0` it can be used in both .net Core and Full Framework.
+    * The nuget package is completely portable and self-contained. It contains both x64 windows binaries and also includes native interop binaries for Linux x64 and because it targets `netstandard2.0` it can be used in both .net Core and legacy .net "full" Framework (4.7.2 and higher).
       * For full .net Framework, the package includes a MSBuild `.targets` file that will ensure that in the consuming project, the supporting windows binaries are copied to the project's output directory
          * The project must be explicitly set to build for `x86` or `x64` (and not `AnyCPU`) for supporting binaries to be copied.
-    * If you intend to develop/deploy your .net application on .net Core on Linux, the only supported Linux distro is the one that official MapGuide binaries are provided for: Ubuntu 14.04 64-bit. The nuget package includes the necessary native interop library.
+    * If you intend to develop/deploy your .net application on .net Core on Linux, the only supported Linux distro is the one that official MapGuide binaries are provided for: Ubuntu 16.04 64-bit. The nuget package includes the necessary native interop library. You may attempt to deploy on other distros where .net Core is supported at your own risk.
  * API
     * General
-       * The ```(IntPtr cPtr, bool memOwn)``` constructor signature is no longer public. This was always for SWIG internal use and should not be public. 
+       * The ```(IntPtr cPtr, bool memOwn)``` constructor signature is no longer public except for types where it is being subclassed by types in other MapGuide assemblies. This was always for SWIG internal use and should not be used by anyting other than SWIG. 
     * MgColor
        * There is no overload that accepts ```System.Drawing.Color``` as a parameter. (```System.Drawing``` does not exist in .net core)
     * MgStringCollection

Modified: sandbox/jng/vanilla_swig/Bindings/src/Bindings/Java/README.md
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Bindings/Java/README.md	2020-11-14 14:54:14 UTC (rev 9785)
+++ sandbox/jng/vanilla_swig/Bindings/src/Bindings/Java/README.md	2020-11-14 15:46:53 UTC (rev 9786)
@@ -7,15 +7,15 @@
 Reference `MapGuideApi.jar` like you would any other java jar library and make sure that the `java.library.path` of your root Java application contains the path to:
 
  * `MapGuideJavaApi.dll` and supporting dlls on Windows
- * `libMapGuideJavaApi.so` on Linux. The zip package includes distro-specific builds of this library, make sure to use the correct library for your distro. All builds of this library have their RPATH set to `/usr/local/mapguideopensource-3.1.1/lib` and `/usr/local/mapguideopensource-3.1.1/webserverextensions/lib`, so any dependent libraries of `libMapGuideJavaApi.so` will be automatically detected and loaded assuming you have MapGuide Open Source 3.1.1 already installed.
+ * `libMapGuideJavaApi.so` on Linux. The zip package includes distro-specific builds of this library, make sure to use the correct library for your distro. All builds of this library have their RPATH set to `/usr/local/mapguideopensource-4.0.0/lib` and `/usr/local/mapguideopensource-4.0.0/webserverextensions/lib`, so any dependent libraries of `libMapGuideJavaApi.so` will be automatically detected and loaded assuming you have MapGuide Open Source 3.1.1 already installed.
 
 # Overview of differences
 
-This wrapper is based on the `MapGuideJavaApiEx` variant of the official Java binding ([original RFC here](https://trac.osgeo.org/mapguide/wiki/MapGuideRfc129)), and carries most of its changes/differences:
+This wrapper is based on and replaces the previous `MapGuideJavaApiEx` variant of the official Java binding ([original RFC here](https://trac.osgeo.org/mapguide/wiki/MapGuideRfc129)), and carries most of its changes/differences (detailed below to recap):
 
 ## 1. Minimum Java version
 
-This binding was built with JDK 7
+This binding was built with JDK 8
 
 ## 2. `MgException`/`AppThrowable` is no longer a checked exception
 

Modified: sandbox/jng/vanilla_swig/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Foundation/custom/ManagedException.cs
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Foundation/custom/ManagedException.cs	2020-11-14 14:54:14 UTC (rev 9785)
+++ sandbox/jng/vanilla_swig/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Foundation/custom/ManagedException.cs	2020-11-14 15:46:53 UTC (rev 9786)
@@ -34,7 +34,10 @@
         private string mMessage;
         private string mStackTrace;
 
-        public ManagedException()
+        /// <summary>
+        /// Constructs a new instance of this exception
+        /// </summary>
+        protected ManagedException()
         {
             mIsWrapper = true;
             mMessage = string.Empty;
@@ -41,6 +44,7 @@
             mStackTrace = string.Empty;
         }
 
+        ///<inheritdoc/>
         public override string Message
         {
             get
@@ -49,6 +53,7 @@
             }
         }
 
+        ///<inheritdoc/>
         public override string StackTrace
         {
             get
@@ -66,6 +71,10 @@
                     //The "-" being a leftover, so replace "at-" with "at" as well after re-joining.
                     //The reason we don't blindly replace "-" in the C++ stack is because we don't want to scramble any physical path
                     //that would also contain a "-"
+                    //
+                    //Also the C++ stack is in the opposite order to the managed one (managed goes up, C++ goes down), so we'll reverse the
+                    //C++ one
+                    Array.Reverse(mgStackTrace);
                     string sanitizedStack = ("   at" + string.Join(Environment.NewLine + "   at", mgStackTrace)).Replace("at-", "at");
                     return string.Format("{0}{1}   ==== [C++ <-> .net] ===={1}{2}", sanitizedStack, Environment.NewLine, base.StackTrace);
                 }
@@ -76,6 +85,7 @@
             }
         }
 
+        ///<inheritdoc/>
         public override string ToString()
         {
             string className = this.GetType().ToString();

Modified: sandbox/jng/vanilla_swig/Bindings/src/Managed/Java/org/osgeo/mapguide/ObjectFactory.java
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Managed/Java/org/osgeo/mapguide/ObjectFactory.java	2020-11-14 14:54:14 UTC (rev 9785)
+++ sandbox/jng/vanilla_swig/Bindings/src/Managed/Java/org/osgeo/mapguide/ObjectFactory.java	2020-11-14 15:46:53 UTC (rev 9786)
@@ -31,11 +31,7 @@
         {
             classMap.put(new Integer(20004), getSWIGCtor("MgAgfReaderWriter"));
             classMap.put(new Integer(20005), getSWIGCtor("MgAggregateGeometry"));
-            classMap.put(new Integer(1500), getSWIGCtor("MgApplicationException"));
             classMap.put(new Integer(20006), getSWIGCtor("MgArcSegment"));
-            classMap.put(new Integer(1501), getSWIGCtor("MgArgumentOutOfRangeException"));
-            classMap.put(new Integer(10500), getSWIGCtor("MgArrayTypeMismatchException"));
-            classMap.put(new Integer(30000), getSWIGCtor("MgAuthenticationFailedException"));
             classMap.put(new Integer(1005), getSWIGCtor("MgBatchPropertyCollection"));
             classMap.put(new Integer(10252), getSWIGCtor("MgBlobProperty"));
             classMap.put(new Integer(10253), getSWIGCtor("MgBooleanProperty"));
@@ -45,14 +41,8 @@
             classMap.put(new Integer(1251), getSWIGCtor("MgByteSource"));
             classMap.put(new Integer(11750), getSWIGCtor("MgClassDefinition"));
             classMap.put(new Integer(11780), getSWIGCtor("MgClassDefinitionCollection"));
-            classMap.put(new Integer(1502), getSWIGCtor("MgClassNotFoundException"));
             classMap.put(new Integer(10255), getSWIGCtor("MgClobProperty"));
             classMap.put(new Integer(10250), getSWIGCtor("MgColor"));
-            classMap.put(new Integer(1503), getSWIGCtor("MgConfigurationException"));
-            classMap.put(new Integer(1504), getSWIGCtor("MgConfigurationLoadFailedException"));
-            classMap.put(new Integer(1505), getSWIGCtor("MgConfigurationSaveFailedException"));
-            classMap.put(new Integer(30001), getSWIGCtor("MgConnectionFailedException"));
-            classMap.put(new Integer(30002), getSWIGCtor("MgConnectionNotOpenException"));
             classMap.put(new Integer(20003), getSWIGCtor("MgCoordinate"));
             classMap.put(new Integer(20009), getSWIGCtor("MgCoordinateIterator"));
             classMap.put(new Integer(20500), getSWIGCtor("MgCoordinateSystem"));
@@ -59,8 +49,6 @@
             classMap.put(new Integer(20504), getSWIGCtor("MgCoordinateSystemCatalog"));
             classMap.put(new Integer(20506), getSWIGCtor("MgCoordinateSystemCategory"));
             classMap.put(new Integer(20510), getSWIGCtor("MgCoordinateSystemCategoryDictionary"));
-            classMap.put(new Integer(21000), getSWIGCtor("MgCoordinateSystemComputationFailedException"));
-            classMap.put(new Integer(21001), getSWIGCtor("MgCoordinateSystemConversionFailedException"));
             classMap.put(new Integer(20507), getSWIGCtor("MgCoordinateSystemDatum"));
             classMap.put(new Integer(20512), getSWIGCtor("MgCoordinateSystemDatumDictionary"));
             classMap.put(new Integer(20511), getSWIGCtor("MgCoordinateSystemDictionary"));
@@ -92,15 +80,11 @@
             classMap.put(new Integer(20525), getSWIGCtor("MgCoordinateSystemGridSpecification"));
             classMap.put(new Integer(20531), getSWIGCtor("MgCoordinateSystemGridTick"));
             classMap.put(new Integer(20528), getSWIGCtor("MgCoordinateSystemGridTickCollection"));
-            classMap.put(new Integer(21002), getSWIGCtor("MgCoordinateSystemInitializationFailedException"));
-            classMap.put(new Integer(21003), getSWIGCtor("MgCoordinateSystemLoadFailedException"));
             classMap.put(new Integer(20518), getSWIGCtor("MgCoordinateSystemMathComparator"));
             classMap.put(new Integer(20502), getSWIGCtor("MgCoordinateSystemMeasure"));
-            classMap.put(new Integer(21004), getSWIGCtor("MgCoordinateSystemMeasureFailedException"));
             classMap.put(new Integer(20522), getSWIGCtor("MgCoordinateSystemMgrs"));
             classMap.put(new Integer(20520), getSWIGCtor("MgCoordinateSystemProjectionInformation"));
             classMap.put(new Integer(20503), getSWIGCtor("MgCoordinateSystemTransform"));
-            classMap.put(new Integer(21005), getSWIGCtor("MgCoordinateSystemTransformFailedException"));
             classMap.put(new Integer(20519), getSWIGCtor("MgCoordinateSystemUnitInformation"));
             classMap.put(new Integer(20048), getSWIGCtor("MgCoordinateXY"));
             classMap.put(new Integer(20051), getSWIGCtor("MgCoordinateXYM"));
@@ -118,41 +102,13 @@
             classMap.put(new Integer(11751), getSWIGCtor("MgDataPropertyDefinition"));
             classMap.put(new Integer(11773), getSWIGCtor("MgDataReader"));
             classMap.put(new Integer(1256), getSWIGCtor("MgDateTime"));
-            classMap.put(new Integer(1506), getSWIGCtor("MgDateTimeException"));
             classMap.put(new Integer(10256), getSWIGCtor("MgDateTimeProperty"));
-            classMap.put(new Integer(30003), getSWIGCtor("MgDbException"));
-            classMap.put(new Integer(30004), getSWIGCtor("MgDbXmlException"));
-            classMap.put(new Integer(1507), getSWIGCtor("MgDecryptionException"));
             classMap.put(new Integer(11775), getSWIGCtor("MgDeleteFeatures"));
-            classMap.put(new Integer(1508), getSWIGCtor("MgDirectoryNotFoundException"));
             classMap.put(new Integer(1000), getSWIGCtor("MgDisposableCollection"));
-            classMap.put(new Integer(1509), getSWIGCtor("MgDivideByZeroException"));
-            classMap.put(new Integer(1510), getSWIGCtor("MgDomainException"));
             classMap.put(new Integer(10257), getSWIGCtor("MgDoubleProperty"));
             classMap.put(new Integer(30700), getSWIGCtor("MgDrawingService"));
-            classMap.put(new Integer(1511), getSWIGCtor("MgDuplicateDirectoryException"));
-            classMap.put(new Integer(1512), getSWIGCtor("MgDuplicateFileException"));
-            classMap.put(new Integer(30005), getSWIGCtor("MgDuplicateGroupException"));
-            classMap.put(new Integer(30006), getSWIGCtor("MgDuplicateNameException"));
-            classMap.put(new Integer(1513), getSWIGCtor("MgDuplicateObjectException"));
-            classMap.put(new Integer(30007), getSWIGCtor("MgDuplicateParameterException"));
-            classMap.put(new Integer(30008), getSWIGCtor("MgDuplicateRepositoryException"));
-            classMap.put(new Integer(10501), getSWIGCtor("MgDuplicateResourceDataException"));
-            classMap.put(new Integer(10502), getSWIGCtor("MgDuplicateResourceException"));
-            classMap.put(new Integer(30009), getSWIGCtor("MgDuplicateRoleException"));
-            classMap.put(new Integer(30010), getSWIGCtor("MgDuplicateServerException"));
-            classMap.put(new Integer(30011), getSWIGCtor("MgDuplicateSessionException"));
-            classMap.put(new Integer(30012), getSWIGCtor("MgDuplicateUserException"));
-            classMap.put(new Integer(30013), getSWIGCtor("MgDwfException"));
-            classMap.put(new Integer(30014), getSWIGCtor("MgDwfSectionNotFoundException"));
-            classMap.put(new Integer(30015), getSWIGCtor("MgDwfSectionResourceNotFoundException"));
             classMap.put(new Integer(30901), getSWIGCtor("MgDwfVersion"));
-            classMap.put(new Integer(10503), getSWIGCtor("MgEmptyFeatureSetException"));
-            classMap.put(new Integer(1514), getSWIGCtor("MgEncryptionException"));
-            classMap.put(new Integer(30016), getSWIGCtor("MgEndOfStreamException"));
             classMap.put(new Integer(20001), getSWIGCtor("MgEnvelope"));
-            classMap.put(new Integer(1515), getSWIGCtor("MgException"));
-            classMap.put(new Integer(10504), getSWIGCtor("MgFdoException"));
             classMap.put(new Integer(11772), getSWIGCtor("MgFeatureAggregateOptions"));
             classMap.put(new Integer(11774), getSWIGCtor("MgFeatureCommandCollection"));
             classMap.put(new Integer(31001), getSWIGCtor("MgFeatureInformation"));
@@ -162,20 +118,15 @@
             classMap.put(new Integer(11778), getSWIGCtor("MgFeatureSchema"));
             classMap.put(new Integer(11779), getSWIGCtor("MgFeatureSchemaCollection"));
             classMap.put(new Integer(11754), getSWIGCtor("MgFeatureService"));
-            classMap.put(new Integer(10505), getSWIGCtor("MgFeatureServiceException"));
             classMap.put(new Integer(11786), getSWIGCtor("MgFileFeatureSourceParams"));
-            classMap.put(new Integer(1516), getSWIGCtor("MgFileIoException"));
-            classMap.put(new Integer(1517), getSWIGCtor("MgFileNotFoundException"));
             classMap.put(new Integer(20016), getSWIGCtor("MgGeometricEntity"));
             classMap.put(new Integer(11756), getSWIGCtor("MgGeometricPropertyDefinition"));
             classMap.put(new Integer(20019), getSWIGCtor("MgGeometry"));
             classMap.put(new Integer(20020), getSWIGCtor("MgGeometryCollection"));
             classMap.put(new Integer(20021), getSWIGCtor("MgGeometryComponent"));
-            classMap.put(new Integer(21006), getSWIGCtor("MgGeometryException"));
             classMap.put(new Integer(20002), getSWIGCtor("MgGeometryFactory"));
             classMap.put(new Integer(11758), getSWIGCtor("MgGeometryProperty"));
             classMap.put(new Integer(11785), getSWIGCtor("MgGeometryTypeInfo"));
-            classMap.put(new Integer(30018), getSWIGCtor("MgGroupNotFoundException"));
             classMap.put(new Integer(11782), getSWIGCtor("MgGwsFeatureReader"));
             classMap.put(new Integer(40000), getSWIGCtor("MgHttpHeader"));
             classMap.put(new Integer(40006), getSWIGCtor("MgHttpPrimitiveValue"));
@@ -184,41 +135,11 @@
             classMap.put(new Integer(40001), getSWIGCtor("MgHttpRequestParam"));
             classMap.put(new Integer(40005), getSWIGCtor("MgHttpResponse"));
             classMap.put(new Integer(40003), getSWIGCtor("MgHttpResult"));
-            classMap.put(new Integer(1518), getSWIGCtor("MgIndexOutOfRangeException"));
             classMap.put(new Integer(11776), getSWIGCtor("MgInsertFeatures"));
             classMap.put(new Integer(10258), getSWIGCtor("MgInt16Property"));
             classMap.put(new Integer(10259), getSWIGCtor("MgInt32Property"));
             classMap.put(new Integer(10260), getSWIGCtor("MgInt64Property"));
             classMap.put(new Integer(10000), getSWIGCtor("MgIntCollection"));
-            classMap.put(new Integer(1519), getSWIGCtor("MgInvalidArgumentException"));
-            classMap.put(new Integer(1520), getSWIGCtor("MgInvalidCastException"));
-            classMap.put(new Integer(21007), getSWIGCtor("MgInvalidCoordinateSystemException"));
-            classMap.put(new Integer(21008), getSWIGCtor("MgInvalidCoordinateSystemTypeException"));
-            classMap.put(new Integer(21009), getSWIGCtor("MgInvalidCoordinateSystemUnitsException"));
-            classMap.put(new Integer(30019), getSWIGCtor("MgInvalidDwfPackageException"));
-            classMap.put(new Integer(30020), getSWIGCtor("MgInvalidDwfSectionException"));
-            classMap.put(new Integer(30021), getSWIGCtor("MgInvalidFeatureSourceException"));
-            classMap.put(new Integer(30022), getSWIGCtor("MgInvalidIpAddressException"));
-            classMap.put(new Integer(30023), getSWIGCtor("MgInvalidLicenseException"));
-            classMap.put(new Integer(30024), getSWIGCtor("MgInvalidLogEntryException"));
-            classMap.put(new Integer(10507), getSWIGCtor("MgInvalidMapDefinitionException"));
-            classMap.put(new Integer(1522), getSWIGCtor("MgInvalidOperationException"));
-            classMap.put(new Integer(30026), getSWIGCtor("MgInvalidPasswordException"));
-            classMap.put(new Integer(30027), getSWIGCtor("MgInvalidPrintLayoutFontSizeUnitsException"));
-            classMap.put(new Integer(30028), getSWIGCtor("MgInvalidPrintLayoutPositionUnitsException"));
-            classMap.put(new Integer(30029), getSWIGCtor("MgInvalidPrintLayoutSizeUnitsException"));
-            classMap.put(new Integer(1523), getSWIGCtor("MgInvalidPropertyTypeException"));
-            classMap.put(new Integer(10508), getSWIGCtor("MgInvalidRepositoryNameException"));
-            classMap.put(new Integer(10509), getSWIGCtor("MgInvalidRepositoryTypeException"));
-            classMap.put(new Integer(10510), getSWIGCtor("MgInvalidResourceDataNameException"));
-            classMap.put(new Integer(10511), getSWIGCtor("MgInvalidResourceDataTypeException"));
-            classMap.put(new Integer(10512), getSWIGCtor("MgInvalidResourceNameException"));
-            classMap.put(new Integer(10513), getSWIGCtor("MgInvalidResourcePathException"));
-            classMap.put(new Integer(10514), getSWIGCtor("MgInvalidResourcePreProcessingTypeException"));
-            classMap.put(new Integer(10515), getSWIGCtor("MgInvalidResourceTypeException"));
-            classMap.put(new Integer(30031), getSWIGCtor("MgInvalidServerNameException"));
-            classMap.put(new Integer(1524), getSWIGCtor("MgInvalidStreamHeaderException"));
-            classMap.put(new Integer(1525), getSWIGCtor("MgIoException"));
             classMap.put(new Integer(31300), getSWIGCtor("MgKmlService"));
             classMap.put(new Integer(30501), getSWIGCtor("MgLayer"));
             classMap.put(new Integer(12003), getSWIGCtor("MgLayerBase"));
@@ -225,17 +146,12 @@
             classMap.put(new Integer(12002), getSWIGCtor("MgLayerCollection"));
             classMap.put(new Integer(12001), getSWIGCtor("MgLayerGroup"));
             classMap.put(new Integer(12004), getSWIGCtor("MgLayerGroupCollection"));
-            classMap.put(new Integer(10517), getSWIGCtor("MgLayerNotFoundException"));
             classMap.put(new Integer(30904), getSWIGCtor("MgLayout"));
-            classMap.put(new Integer(1526), getSWIGCtor("MgLengthException"));
-            classMap.put(new Integer(30032), getSWIGCtor("MgLicenseException"));
-            classMap.put(new Integer(30033), getSWIGCtor("MgLicenseExpiredException"));
             classMap.put(new Integer(20023), getSWIGCtor("MgLinearRing"));
             classMap.put(new Integer(20053), getSWIGCtor("MgLinearRingCollection"));
             classMap.put(new Integer(20024), getSWIGCtor("MgLinearSegment"));
             classMap.put(new Integer(20042), getSWIGCtor("MgLineString"));
             classMap.put(new Integer(20044), getSWIGCtor("MgLineStringCollection"));
-            classMap.put(new Integer(1527), getSWIGCtor("MgLogicException"));
             classMap.put(new Integer(11766), getSWIGCtor("MgLongTransactionReader"));
             classMap.put(new Integer(30500), getSWIGCtor("MgMap"));
             classMap.put(new Integer(12000), getSWIGCtor("MgMapBase"));
@@ -249,30 +165,15 @@
             classMap.put(new Integer(20032), getSWIGCtor("MgMultiLineString"));
             classMap.put(new Integer(20033), getSWIGCtor("MgMultiPoint"));
             classMap.put(new Integer(20034), getSWIGCtor("MgMultiPolygon"));
-            classMap.put(new Integer(1528), getSWIGCtor("MgNotFiniteNumberException"));
-            classMap.put(new Integer(1529), getSWIGCtor("MgNotImplementedException"));
-            classMap.put(new Integer(1530), getSWIGCtor("MgNullArgumentException"));
-            classMap.put(new Integer(1531), getSWIGCtor("MgNullPropertyValueException"));
-            classMap.put(new Integer(1532), getSWIGCtor("MgNullReferenceException"));
-            classMap.put(new Integer(1533), getSWIGCtor("MgObjectNotFoundException"));
             classMap.put(new Integer(11759), getSWIGCtor("MgObjectPropertyDefinition"));
-            classMap.put(new Integer(30035), getSWIGCtor("MgOperationProcessingException"));
-            classMap.put(new Integer(1534), getSWIGCtor("MgOutOfMemoryException"));
-            classMap.put(new Integer(1535), getSWIGCtor("MgOutOfRangeException"));
-            classMap.put(new Integer(1536), getSWIGCtor("MgOverflowException"));
             classMap.put(new Integer(30604), getSWIGCtor("MgPackageStatusInformation"));
             classMap.put(new Integer(11788), getSWIGCtor("MgParameter"));
             classMap.put(new Integer(10004), getSWIGCtor("MgParameterCollection"));
-            classMap.put(new Integer(30036), getSWIGCtor("MgParameterNotFoundException"));
-            classMap.put(new Integer(30037), getSWIGCtor("MgPathTooLongException"));
-            classMap.put(new Integer(1537), getSWIGCtor("MgPlatformNotSupportedException"));
             classMap.put(new Integer(30902), getSWIGCtor("MgPlotSpecification"));
             classMap.put(new Integer(20000), getSWIGCtor("MgPoint"));
             classMap.put(new Integer(20045), getSWIGCtor("MgPointCollection"));
             classMap.put(new Integer(20035), getSWIGCtor("MgPolygon"));
             classMap.put(new Integer(20046), getSWIGCtor("MgPolygonCollection"));
-            classMap.put(new Integer(30039), getSWIGCtor("MgPortNotAvailableException"));
-            classMap.put(new Integer(30040), getSWIGCtor("MgPrintToScaleModeNotSelectedException"));
             classMap.put(new Integer(31400), getSWIGCtor("MgProfilingService"));
             classMap.put(new Integer(2000), getSWIGCtor("MgProperty"));
             classMap.put(new Integer(1002), getSWIGCtor("MgPropertyCollection"));
@@ -285,32 +186,14 @@
             classMap.put(new Integer(20037), getSWIGCtor("MgRegion"));
             classMap.put(new Integer(31002), getSWIGCtor("MgRenderingOptions"));
             classMap.put(new Integer(31000), getSWIGCtor("MgRenderingService"));
-            classMap.put(new Integer(30041), getSWIGCtor("MgRepositoryCreationFailedException"));
-            classMap.put(new Integer(30042), getSWIGCtor("MgRepositoryNotFoundException"));
-            classMap.put(new Integer(30043), getSWIGCtor("MgRepositoryNotOpenException"));
-            classMap.put(new Integer(30044), getSWIGCtor("MgRepositoryOpenFailedException"));
             classMap.put(new Integer(11526), getSWIGCtor("MgResource"));
-            classMap.put(new Integer(10518), getSWIGCtor("MgResourceBusyException"));
-            classMap.put(new Integer(10519), getSWIGCtor("MgResourceDataNotFoundException"));
             classMap.put(new Integer(11500), getSWIGCtor("MgResourceIdentifier"));
-            classMap.put(new Integer(10520), getSWIGCtor("MgResourceNotFoundException"));
             classMap.put(new Integer(11501), getSWIGCtor("MgResourceService"));
-            classMap.put(new Integer(1538), getSWIGCtor("MgResourcesException"));
-            classMap.put(new Integer(1539), getSWIGCtor("MgResourcesLoadFailedException"));
-            classMap.put(new Integer(1540), getSWIGCtor("MgResourceTagNotFoundException"));
             classMap.put(new Integer(20038), getSWIGCtor("MgRing"));
-            classMap.put(new Integer(30045), getSWIGCtor("MgRoleNotFoundException"));
-            classMap.put(new Integer(1541), getSWIGCtor("MgRuntimeException"));
             classMap.put(new Integer(30502), getSWIGCtor("MgSelection"));
             classMap.put(new Integer(12007), getSWIGCtor("MgSelectionBase"));
             classMap.put(new Integer(30607), getSWIGCtor("MgServerAdmin"));
-            classMap.put(new Integer(30046), getSWIGCtor("MgServerNotFoundException"));
-            classMap.put(new Integer(30047), getSWIGCtor("MgServerNotOnlineException"));
             classMap.put(new Integer(11251), getSWIGCtor("MgService"));
-            classMap.put(new Integer(10521), getSWIGCtor("MgServiceNotAvailableException"));
-            classMap.put(new Integer(10522), getSWIGCtor("MgServiceNotSupportedException"));
-            classMap.put(new Integer(30048), getSWIGCtor("MgSessionExpiredException"));
-            classMap.put(new Integer(30052), getSWIGCtor("MgSessionNotFoundException"));
             classMap.put(new Integer(10261), getSWIGCtor("MgSingleProperty"));
             classMap.put(new Integer(30605), getSWIGCtor("MgSite"));
             classMap.put(new Integer(30601), getSWIGCtor("MgSiteConnection"));
@@ -317,24 +200,13 @@
             classMap.put(new Integer(30608), getSWIGCtor("MgSiteInfo"));
             classMap.put(new Integer(11761), getSWIGCtor("MgSpatialContextReader"));
             classMap.put(new Integer(11762), getSWIGCtor("MgSqlDataReader"));
-            classMap.put(new Integer(1542), getSWIGCtor("MgStreamIoException"));
             classMap.put(new Integer(1003), getSWIGCtor("MgStringCollection"));
             classMap.put(new Integer(2001), getSWIGCtor("MgStringProperty"));
             classMap.put(new Integer(10003), getSWIGCtor("MgStringPropertyCollection"));
-            classMap.put(new Integer(1543), getSWIGCtor("MgSystemException"));
-            classMap.put(new Integer(1544), getSWIGCtor("MgTemporaryFileNotAvailableException"));
-            classMap.put(new Integer(1545), getSWIGCtor("MgThirdPartyException"));
             classMap.put(new Integer(31200), getSWIGCtor("MgTileService"));
             classMap.put(new Integer(11787), getSWIGCtor("MgTransaction"));
-            classMap.put(new Integer(30049), getSWIGCtor("MgUnauthorizedAccessException"));
-            classMap.put(new Integer(1547), getSWIGCtor("MgUnclassifiedException"));
-            classMap.put(new Integer(1548), getSWIGCtor("MgUnderflowException"));
-            classMap.put(new Integer(30056), getSWIGCtor("MgUnknownTileProviderException"));
-            classMap.put(new Integer(30057), getSWIGCtor("MgUnsupportedTileProviderException"));
             classMap.put(new Integer(11777), getSWIGCtor("MgUpdateFeatures"));
-            classMap.put(new Integer(30050), getSWIGCtor("MgUriFormatException"));
             classMap.put(new Integer(30606), getSWIGCtor("MgUserInformation"));
-            classMap.put(new Integer(10523), getSWIGCtor("MgUserNotFoundException"));
             classMap.put(new Integer(11257), getSWIGCtor("MgWarnings"));
             classMap.put(new Integer(50005), getSWIGCtor("MgWebBufferCommand"));
             classMap.put(new Integer(50000), getSWIGCtor("MgWebCommand"));
@@ -364,9 +236,6 @@
             classMap.put(new Integer(50013), getSWIGCtor("MgWebWidget"));
             classMap.put(new Integer(50018), getSWIGCtor("MgWebWidgetCollection"));
             classMap.put(new Integer(20040), getSWIGCtor("MgWktReaderWriter"));
-            classMap.put(new Integer(1549), getSWIGCtor("MgXmlException"));
-            classMap.put(new Integer(1550), getSWIGCtor("MgXmlParserException"));
-
         }
         catch(Exception e)
         {
@@ -377,7 +246,13 @@
     private static Constructor getSWIGCtor(String className) throws ClassNotFoundException, Exception
     {
         Constructor swigCtor = null;
-        Constructor[] cons = Class.forName("org.osgeo.mapguide." + className).getDeclaredConstructors();
+        String typeName = "org.osgeo.mapguide." + className;
+        Class type = Class.forName(typeName);
+        if (type == null)
+        {
+            throw new Exception("Could not find proxy class: " + typeName);
+        }
+        Constructor[] cons = type.getDeclaredConstructors();
         for (int i = 0; i < cons.length; i++)
         {
             Class[] parameterTypes = cons[i].getParameterTypes();

Modified: sandbox/jng/vanilla_swig/Bindings/src/Test/DotNet/src/TestMisc/Program.cs
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Test/DotNet/src/TestMisc/Program.cs	2020-11-14 14:54:14 UTC (rev 9785)
+++ sandbox/jng/vanilla_swig/Bindings/src/Test/DotNet/src/TestMisc/Program.cs	2020-11-14 15:46:53 UTC (rev 9786)
@@ -142,7 +142,7 @@
             Console.WriteLine("[dotnet]: MgException caught");
             Console.WriteLine($"[dotnet]: MgException - Message: {ex.GetExceptionMessage()}");
             Console.WriteLine($"[dotnet]: MgException - Details: {ex.GetDetails()}");
-            Console.WriteLine($"[dotnet]: MgException - Stack: {ex.GetStackTrace()}");
+            Console.WriteLine($"[dotnet]: MgException - Stack:\n{ex.StackTrace}");
         }
 
         static void Main(string[] args)

Modified: sandbox/jng/vanilla_swig/Bindings/src/Test/Java/build.xml
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Test/Java/build.xml	2020-11-14 14:54:14 UTC (rev 9785)
+++ sandbox/jng/vanilla_swig/Bindings/src/Test/Java/build.xml	2020-11-14 15:46:53 UTC (rev 9786)
@@ -39,6 +39,7 @@
   <target name="initwin" if="windows">
     <echo message="Init build environment for Windows" />
     <echo message="  dist                = ${dist}" />
+    <echo message="  binsrc.common       = ${binsrc.common}" />
     <echo message="  binsrc.web          = ${binsrc.web}" />
     <echo message="  jarsrc.web          = ${jarsrc.web}" />
     <echo message="  mapguide.res.src    = ${mapguide.res.src}" />

Modified: sandbox/jng/vanilla_swig/Bindings/src/Test/Java/src/org/osgeo/mapguide/test/common/TestResult.java
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Test/Java/src/org/osgeo/mapguide/test/common/TestResult.java	2020-11-14 14:54:14 UTC (rev 9785)
+++ sandbox/jng/vanilla_swig/Bindings/src/Test/Java/src/org/osgeo/mapguide/test/common/TestResult.java	2020-11-14 15:46:53 UTC (rev 9786)
@@ -148,7 +148,7 @@
     public static TestResult FromMgException(MgException ex)
     {
         //Need to be lowercase to satisfy a PHP-ism. Ugh!
-        TestResult result = new TestResult(CommonUtility.GetTypeName(ex).toLowerCase(), "text/plain");
+        TestResult result = new TestResult(ex.getExceptionCode().toLowerCase(), "text/plain");
         result.IsException = true;
         return result;
     }



More information about the mapguide-commits mailing list