Removed contact application support prints 88/1988/2
authorMiro Richard Eklund <miro.eklund@semantum.fi>
Fri, 3 Aug 2018 13:05:09 +0000 (16:05 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sat, 4 Aug 2018 14:45:50 +0000 (17:45 +0300)
Unnecessary contact application support on error messages removed.

gitlab #76

Change-Id: I6f3940fa5443e52eb7c9e21c7578579158b468c3

15 files changed:
bundles/org.simantics.acorn/src/org/simantics/acorn/cluster/ClusterSmall.java
bundles/org.simantics.acorn/src/org/simantics/acorn/internal/ClusterChange.java
bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ReadGraphImpl.java
bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsImpl.java
bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsSearcherBase.java
bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterChange.java
bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterTable.java
bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionImplSocket.java
bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/State.java
bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/CCSParser.java
bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterChangeSet.java
bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterSmall.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/StageEditHandler.java
bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/SynchroniseAllHandler.java
bundles/org.simantics.ui/src/org/simantics/ui/WorkbenchWindowSessionContextProviderSource.java

index a964c90c98fbbb5bb64842d43563df7d54f76053..d20ddae6cf53d765314cad11250a0a460c7731c5 100644 (file)
@@ -596,7 +596,7 @@ final public class ClusterSmall extends ClusterImpl {
                 support.setStreamOff(false);
             ClusterI cluster2 = cluster.addRelation(sResourceKey, pResourceKey, oResourceKey, support);
             if (cluster != cluster2)
-                throw new DatabaseException("Internal error. Contact application support.");
+                throw new DatabaseException("Internal error, cluster mismatch.");
             return cluster;
         }
 //        check();
@@ -642,7 +642,7 @@ final public class ClusterSmall extends ClusterImpl {
                 support.setStreamOff(false);
             ClusterI cluster2 = cluster.addRelation(sResourceKey, pResourceKey, oResourceKey, support);
             if (cluster != cluster2)
-                throw new DatabaseException("Internal error. Contact application support.");
+                throw new DatabaseException("Internal error, cluster mismatch.");
             return cluster;
         }
 //        check();
index b1fbb5d9cd66ebc0674fa0c5bf276bc38384bd21..780ea4e053de836ab5f4f4fa45daf4799eba6581 100644 (file)
@@ -198,7 +198,7 @@ public final class ClusterChange {
         }
         if (0 != foreign) {
             if (foreign > 256)
-                throw new RuntimeDatabaseException("Internal error, contact application support." +
+                throw new RuntimeDatabaseException("Internal error." +
                 "Too big foreing index=" + foreign + " max=256");
             --foreign;
             bytes[byteIndex++] = foreign;
@@ -211,7 +211,7 @@ public final class ClusterChange {
             if (DEBUG_STAT)
                 info.sForeign = foreignTable.size();
             if (clusterUID.equals(ClusterUID.Null))
-                throw new RuntimeDatabaseException("Internal error, contact application support." +
+                throw new RuntimeDatabaseException("Internal error." +
                 "Cluster unique id not defined for foreing cluster.");
             addForeignLong(resourceIndex, clusterUID);
             return ClusterEnum.ForeignLong;
index b5da0b92f7bae6521487e2fa0907ca2b96a3c09b..4ef46e6c681e35e5b041387e21942a0908793869 100644 (file)
@@ -5638,7 +5638,7 @@ public class ReadGraphImpl implements AsyncReadGraph {
         * Internal routines
         */
 
-       protected static String INTERNAL_ERROR_STRING = "Transaction aborted due to internal client error. Contact application support.";
+       protected static String INTERNAL_ERROR_STRING = "Transaction aborted due to internal client error.";
 
        /*
         * callerThread is the currently running thread state.syncThread is blocking for
index 390c0d17fce817225bde69d07e4515408fee4229..60e824cad0bf4f84592e25dbeda6b0a1b4939112 100644 (file)
@@ -174,9 +174,8 @@ public class IndexedRelationsImpl implements IndexedRelations {
                // 3. something was wrong, but the index has been successfully cleaned
        }
 
-               if(!searcher.checkState(State.NONE)) 
-                       throw new IndexException("Illegal searcher state, contact application support.");
-       
+       searcher.assertState(State.NONE);
+
         // We loop until the index is loaded
         while(true) {
                
@@ -240,7 +239,7 @@ public class IndexedRelationsImpl implements IndexedRelations {
                                                                if(!loaded) {
                                                                        
                                                                if(!searcher.checkState(State.NONE)) 
-                                                                       throw new DatabaseException("Illegal searcher state, contact application support.");                                                            
+                                                                       throw new DatabaseException("Illegal searcher state " + searcher.state());
 
                                                                        try {
                                                                            SerialisationSupport ss = graph.getService(SerialisationSupport.class);
@@ -273,7 +272,7 @@ public class IndexedRelationsImpl implements IndexedRelations {
                        }
                        
                        if(!success)
-                               throw new IndexException("Did not manage to load index. Contact application support.");
+                               throw new IndexException("Did not manage to load index.");
                
                // Try again
 
@@ -283,7 +282,7 @@ public class IndexedRelationsImpl implements IndexedRelations {
                        if (searcher.isIndexAvailable()) {
                                searcher.startAccess(progress.newChild(50), processor.getSession(), false);
                                if(searcher.hasAccess(false)) return lock;
-                               throw new IndexException("Illegal searcher state, contact application support.");
+                               throw new IndexException("Illegal searcher state " + searcher.state());
                        }
                        
                }
index 1d5001c64ec15f728cfee967f19d75dcc2123dbb..82f4abdd905d570600a9a10871e4d7f7e43cb414 100644 (file)
@@ -64,6 +64,7 @@ import org.simantics.db.common.utils.NameUtils;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.indexing.internal.IndexingJob;
 import org.simantics.db.layer0.adapter.GenericRelation;
+import org.simantics.db.layer0.genericrelation.IndexException;
 import org.simantics.db.request.Read;
 import org.simantics.db.service.CollectionSupport;
 import org.simantics.db.service.SerialisationSupport;
@@ -115,14 +116,18 @@ abstract public class IndexedRelationsSearcherBase {
        this.state = State.READY;
     }
     
+    public State state() {
+       return state;
+    }
+    
     protected boolean checkState(State state) {
        return this.state == state;
     }
     
-    protected void assertState(State state) throws AssertionError {
-
-       if(this.state != state) throw new AssertionError("Illegal state, expected " + state.name() + " but was in " + this.state.name());
-       
+    protected void assertState(State state) throws IndexException {
+        State s = this.state;
+        if (s != state)
+            throw new IndexException("Illegal index searcher state, expected " + state.name() + " but state was " + s.name());
     }
     
     public void changeState(IProgressMonitor monitor, Session session, State state) {
index 5a1dea2b9dc7117f343397aba07eb00e908bcac2..880bfd00d3e88a225ae10130978cde4f43b5bf76 100644 (file)
@@ -201,8 +201,8 @@ public final class ClusterChange {
         }
         if (0 != foreign) {
             if (foreign > 256)
-                throw new RuntimeDatabaseException("Internal error, contact application support." +
-                "Too big foreing index=" + foreign + " max=256");
+                throw new RuntimeDatabaseException("Internal error." +
+                "Too big foreign index=" + foreign + " max=256");
             --foreign;
             bytes[byteIndex++] = foreign;
             return ClusterEnum.ForeignShort;
@@ -214,8 +214,8 @@ public final class ClusterChange {
             if (DEBUG_STAT)
                 info.sForeign = foreignTable.size();
             if (clusterUID.equals(ClusterUID.Null))
-                throw new RuntimeDatabaseException("Internal error, contact application support." +
-                "Cluster unique id not defined for foreing cluster.");
+                throw new RuntimeDatabaseException("Internal error." +
+                "Cluster unique id not defined for foreign cluster.");
             addForeignLong(resourceIndex, clusterUID);
             return ClusterEnum.ForeignLong;
         }
index df3b6904f3beb27060b094e6a604f57449d0ce38..6cab018a6f4beadde5859f94fc86de4b75638a92 100644 (file)
@@ -135,7 +135,7 @@ public final class ClusterTable implements IClusterTable {
             int clusterKey = hashMap.size();
             ClusterSmall sentinel = new ClusterSmall(clusterUID, clusterKey, ClusterTable.this, sessionImpl.clusterTranslator);
             if (sentinel.clusterId != sentinel.clusterUID.second)
-                throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                throw new RuntimeDatabaseException("ClusterTable corrupted.");
             create(sentinel);
             return sentinel;
         }
@@ -144,25 +144,25 @@ public final class ClusterTable implements IClusterTable {
             create(proxy);
             if (null != old) {
                 if (old.clusterKey != proxy.clusterKey)
-                    throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                    throw new RuntimeDatabaseException("ClusterTable corrupted.");
                 if (old.clusterId != proxy.clusterId)
-                    throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                    throw new RuntimeDatabaseException("ClusterTable corrupted.");
                 if (!old.clusterUID.equals(proxy.clusterUID))
-                    throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                    throw new RuntimeDatabaseException("ClusterTable corrupted.");
             }
         }
         private ClusterSmall freeProxy(ClusterImpl proxy) {
             ClusterImpl clusterImpl = hashMap.get(proxy.clusterId);
             if (null == clusterImpl)
-                throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                throw new RuntimeDatabaseException("ClusterTable corrupted.");
 //            ClusterUID clusterUID = ClusterUID.make(0, proxy.clusterId);
 //            ClusterImpl clusterImpl2 = clusterU2I.get(clusterUID );
 //            if (clusterImpl != clusterImpl2)
-//                throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+//                throw new RuntimeDatabaseException("ClusterTable corrupted.");
             if (proxy.clusterId != clusterImpl.clusterId)
-                throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                throw new RuntimeDatabaseException("ClusterTable corrupted.");
             if (proxy.clusterKey != clusterImpl.clusterKey)
-                throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                throw new RuntimeDatabaseException("ClusterTable corrupted.");
             ClusterSmall sentinel = new ClusterSmall(makeClusterUID(proxy.clusterId) , proxy.clusterKey, ClusterTable.this, sessionImpl.clusterTranslator);
             return (ClusterSmall)create(sentinel);
         }
@@ -595,7 +595,7 @@ public final class ClusterTable implements IClusterTable {
     void removeWriteOnlyClusters() {
         for (ClusterI proxy : writeOnlyClusters) {
             if (!(proxy instanceof ClusterImpl))
-                throw new RuntimeDatabaseException("ClusterTable corrupted. Contact application support.");
+                throw new RuntimeDatabaseException("ClusterTable corrupted.");
             clusters.freeProxy((ClusterImpl)proxy);
         }
         writeOnlyClusters.clear();
index f5b6611b7e72b53a1ae9fbe2c40095d5dbac1e5e..30e0dde5244de43dbd11ff9582015dad0d831f76 100644 (file)
@@ -506,7 +506,7 @@ public abstract class SessionImplSocket implements Session, WriteRequestSchedule
 //                        state.cancelCommit(context, clusterStream);
 //                        if (!empty) {
 //                            if (!context.isOk()) // this is a blocking operation
-//                                throw new InternalException("Cancel failed. This should never happen. Contact application support.");
+//                                throw new InternalException("Cancel failed. This should never happen.");
 //                            getQueryProvider2().performDirtyUpdates(writeState.getGraph());
 //                        }
 //                        state.cancelCommit2(context, clusterStream);
index efd82b6ca8f2822ab59871793c515d8a5a4f8e80..e0d8eee8a3ddb9d304d6b0109b752e66d0ca46f1 100644 (file)
@@ -287,7 +287,7 @@ class State {
                     try {
                         final boolean undo = false;
                         if (!context.isOk(undo)) // this is a blocking operation
-                            throw new InternalException("Cancel failed. This should never happen. Contact application support.");
+                            throw new InternalException("Cancel failed. This should never happen.");
 //                        System.out.println("session cs: " + session.clientChanges);
 //                        System.out.println("reverse cs: " + cs);
                         queryProvider.performDirtyUpdates(graph);
index 6581a4b6584365376d8c96e470d8ee859dff0478..1b715e343c693b09a67a049dcb477088ab4ee456 100644 (file)
@@ -163,7 +163,7 @@ class CCSParser {
                 args.removeRelation(ri, pdata.resource, pdata.clusterUID, odata.resource, odata.clusterUID);
                 break;
             default:
-                new RuntimeException("Internal error. Contact application support.");
+                new RuntimeException("Internal error, unrecognized StmEnum value encountered: " + stmEnum);
         }
         return ap;
     }
index 1582273538c9a4eb892bcd3249162d2aa7e0e29c..3afb92fc862b8e43be09ea58161494e17399dab0 100644 (file)
@@ -309,7 +309,7 @@ public class ClusterChangeSet implements ClusterChangeSetI {
                     p = CCSParser.parseStm(StmEnum.Add, args, bytes, p, 4, ReferenceType.ForeignLong, ReferenceType.ForeignShort);
                     break;
                 default:
-                    throw new RuntimeException("Internal error, contact application support.");
+                    throw new RuntimeException("Internal error in cluster stream (v=" + kraa + ")");
             }
         }
         return p - pb;
index 6063dc8d5dde24a8026ae742d20b573553973367..b24862a67ba190fbda07166346724a934c2e8d64 100644 (file)
@@ -576,7 +576,7 @@ final public class ClusterSmall extends ClusterImpl {
                 support.setStreamOff(false);
             ClusterI cluster2 = cluster.addRelation(sResourceKey, pResourceKey, oResourceKey, support);
             if (cluster != cluster2)
-                throw new DatabaseException("Internal error. Contact application support.");
+                throw new DatabaseException("Internal error, cluster mismatch.");
             return cluster;
         }
 //        check();
index 63c2f0ac9dd658ab8d8d4be67066a13a76abd155..3a8f025737d6a17ccaa9045759655e22c7e22088 100644 (file)
@@ -79,7 +79,7 @@ public class StageEditHandler extends AbstractPreferenceHandler {
                     msg = new String(data, Charset.defaultCharset());
                 }
                 if (msg.isEmpty() || msg.matches(" *"))
-                    msg = "Staging crashed. Contact application support.";
+                    msg = "Staging crashed.";
                 ShowError.showError("Staging failed, errorcode="+result.getExitValue(), msg, new Exception());
             }
             if (result.getMessageLog() != null) {
index cb24def8cda50d546ea9bd22a536b7f569006800..6463ccbb2f58808c217643c342f6e7e3ecc2ffe8 100644 (file)
@@ -112,7 +112,7 @@ public class SynchroniseAllHandler extends AbstractPreferenceHandler {
                     msg = new String(data, Charset.defaultCharset());
                 }
                 if (msg.isEmpty() || msg.matches(" *"))
-                    msg = "Staging crashed and burned. Contact application support.";
+                    msg = "Staging crashed and burned.";
                 ShowError.showError("Staging failed, errorcode="+result.getExitValue(), msg, new Exception());
             }
             if (result.getMessageLog() != null) {
index 76085143243c793fb9737a595ba7ee73a094d9ce..8274facefd89adbdd76168654bf0902c5a2047f8 100644 (file)
@@ -161,7 +161,7 @@ public class WorkbenchWindowSessionContextProviderSource implements ISessionCont
         synchronized (providers) {
             if (providers.put(context, p) != null) {
                 // This is a bug, should never happen.
-                throw new Error("Bug encountered, contact application support with stack trace.");
+                throw new Error("Unexpected bug, this should never happen!");
             }
             allProviders = providers.values().toArray(ZERO);
         }
@@ -172,7 +172,7 @@ public class WorkbenchWindowSessionContextProviderSource implements ISessionCont
             ISessionContextProvider provider = providers.remove(context);
             if (provider == null) {
                 // This is a bug, should never happen.
-                throw new Error("Bug encountered, contact application support with stack trace.");
+                throw new Error("Unexpected bug, this should never happen!");
             }
             allProviders = providers.values().toArray(ZERO);