Project

Profile

Help

Revision 4fe46919

Added by Michael Kay almost 11 years ago

Fix bug 3140874 AIOOB in TinyTree.addNamespace() in 9.2 and 9.3. Fix bug 3138542 Command line messages have wrong link to online docs in 9.3

View differences:

latest9.2/hej/net/sf/saxon/tinytree/TinyTree.java
304 304
    private void ensureNamespaceCapacity() {
305 305
        if (namespaceParent.length < numberOfNamespaces+1) {
306 306
            int k = numberOfNamespaces*2;
307
            if (k==0) {
308
                k = 10;
309
            }
307 310

  
308 311
            int[] namespaceParent2 = new int[k];
309 312
            int[] namespaceCode2 = new int[k];
......
1315 1318

  
1316 1319
    private void updateStatistics() {
1317 1320
        int n0 = treesCreated;
1318
        int n1 = treesCreated + 1;
1319
        treesCreated = n1;
1320
        averageNodes = ((averageNodes * n0) + numberOfNodes) / n1;
1321
        if (averageNodes < 10.0) {
1322
            averageNodes = 10.0;
1323
        }
1324
        averageAttributes = ((averageAttributes * n0) + numberOfAttributes) / n1;
1325
        if (averageAttributes < 10.0) {
1326
            averageAttributes = 10.0;
1327
        }
1328
        averageNamespaces = ((averageNamespaces * n0) + numberOfNamespaces) / n1;
1329
        if (averageNamespaces < 5.0) {
1330
            averageNamespaces = 5.0;
1331
        }
1332
        averageCharacters = ((averageCharacters * n0) + charBuffer.length()) / n1;
1333
        if (averageCharacters < 100.0) {
1334
            averageCharacters = 100.0;
1321
        if (n0 < 1000000) {
1322
            int n1 = treesCreated + 1;
1323
            treesCreated = n1;
1324
            averageNodes = ((averageNodes * n0) + numberOfNodes) / n1;
1325
            if (averageNodes < 10.0) {
1326
                averageNodes = 10.0;
1327
            }
1328
            averageAttributes = ((averageAttributes * n0) + numberOfAttributes) / n1;
1329
            if (averageAttributes < 10.0) {
1330
                averageAttributes = 10.0;
1331
            }
1332
            averageNamespaces = ((averageNamespaces * n0) + numberOfNamespaces) / n1;
1333
            if (averageNamespaces < 5.0) {
1334
                averageNamespaces = 5.0;
1335
            }
1336
            averageCharacters = ((averageCharacters * n0) + charBuffer.length()) / n1;
1337
            if (averageCharacters < 100.0) {
1338
                averageCharacters = 100.0;
1339
            }
1335 1340
        }
1336

  
1337 1341
    }
1338 1342

  
1339 1343
    /**
latest9.3/hej/net/sf/saxon/Query.java
862 862
        if (!showTime) {
863 863
            System.err.println(config.getProductTitle());
864 864
        }
865
        System.err.println("Usage: see http://www.saxonica.com/documentation/using-xsl/commandline.html");
865
        System.err.println("Usage: see http://www.saxonica.com/documentation/using-xquery/commandline.xml");
866 866
        System.err.println("Format: " + getClass().getName() + " options params");
867 867
        CommandLineOptions options = new CommandLineOptions();
868 868
        setPermittedOptions(options);
latest9.3/hej/net/sf/saxon/Transform.java
976 976
        if (!showTime) {
977 977
            System.err.println(config.getProductTitle());
978 978
        }
979
        System.err.println("Usage: see http://www.saxonica.com/documentation/using-xsl/commandline.html");
979
        System.err.println("Usage: see http://www.saxonica.com/documentation/using-xsl/commandline.xml");
980 980
        System.err.println("Format: " + getClass().getName() + " options params");
981 981
        CommandLineOptions options = new CommandLineOptions();
982 982
        setPermittedOptions(options);
latest9.3/hej/net/sf/saxon/tree/tiny/TinyTree.java
307 307
    private void ensureNamespaceCapacity() {
308 308
        if (namespaceParent.length < numberOfNamespaces+1) {
309 309
            int k = numberOfNamespaces*2;
310
            if (k==0) {
311
                k = 10;
312
            }
310 313

  
311 314
            int[] namespaceParent2 = new int[k];
312 315
            int[] namespaceCode2 = new int[k];
......
1278 1281

  
1279 1282
    private void updateStatistics() {
1280 1283
        int n0 = treesCreated;
1281
        int n1 = treesCreated + 1;
1282
        treesCreated = n1;
1283
        averageNodes = ((averageNodes * n0) + numberOfNodes) / n1;
1284
        if (averageNodes < 10.0) {
1285
            averageNodes = 10.0;
1286
        }
1287
        averageAttributes = ((averageAttributes * n0) + numberOfAttributes) / n1;
1288
        if (averageAttributes < 10.0) {
1289
            averageAttributes = 10.0;
1290
        }
1291
        averageNamespaces = ((averageNamespaces * n0) + numberOfNamespaces) / n1;
1292
        if (averageNamespaces < 5.0) {
1293
            averageNamespaces = 5.0;
1294
        }
1295
        averageCharacters = ((averageCharacters * n0) + charBuffer.length()) / n1;
1296
        if (averageCharacters < 100.0) {
1297
            averageCharacters = 100.0;
1284
        if (n0 < 1000000) {
1285
            int n1 = treesCreated + 1;
1286
            treesCreated = n1;
1287
            averageNodes = ((averageNodes * n0) + numberOfNodes) / n1;
1288
            if (averageNodes < 10.0) {
1289
                averageNodes = 10.0;
1290
            }
1291
            averageAttributes = ((averageAttributes * n0) + numberOfAttributes) / n1;
1292
            if (averageAttributes < 10.0) {
1293
                averageAttributes = 10.0;
1294
            }
1295
            averageNamespaces = ((averageNamespaces * n0) + numberOfNamespaces) / n1;
1296
            if (averageNamespaces < 5.0) {
1297
                averageNamespaces = 5.0;
1298
            }
1299
            averageCharacters = ((averageCharacters * n0) + charBuffer.length()) / n1;
1300
            if (averageCharacters < 100.0) {
1301
                averageCharacters = 100.0;
1302
            }
1298 1303
        }
1299 1304

  
1300 1305
    }

Also available in: Unified diff