You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by mb...@apache.org on 2022/12/05 12:49:40 UTC

[netbeans] branch master updated: bump large file warning from 1 to 5MB.

This is an automated email from the ASF dual-hosted git repository.

mbien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 4a0f97ca11 bump large file warning from 1 to 5MB.
     new be973c80a8 Merge pull request #4949 from mbien/defaults-bump-file-size-warn-limit
4a0f97ca11 is described below

commit 4a0f97ca1142afc52a51c6d156a468cf33494ff2
Author: Michael Bien <mb...@gmail.com>
AuthorDate: Wed Nov 9 03:40:39 2022 +0100

    bump large file warning from 1 to 5MB.
---
 ide/csl.api/src/org/netbeans/modules/csl/spi/GsfUtilities.java     | 7 ++++++-
 .../openide.loaders/src/org/openide/text/DataEditorSupport.java    | 4 ++--
 .../unit/src/org/openide/text/FileSizeThreshholdExceptionTest.java | 2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/ide/csl.api/src/org/netbeans/modules/csl/spi/GsfUtilities.java b/ide/csl.api/src/org/netbeans/modules/csl/spi/GsfUtilities.java
index 35d7cda4af..e00de36b2b 100644
--- a/ide/csl.api/src/org/netbeans/modules/csl/spi/GsfUtilities.java
+++ b/ide/csl.api/src/org/netbeans/modules/csl/spi/GsfUtilities.java
@@ -251,6 +251,11 @@ public final class GsfUtilities {
         return getDocument(fileObject, openIfNecessary, false);
     }
 
+    /**
+     * see org.openide.text.DataEditorSupport#BIG_FILE_THRESHOLD_MB
+     */
+    private static final long BIG_FILE_THRESHOLD_MB = Integer.getInteger("org.openide.text.big.file.size", 5) * 1024 * 1024;
+
     /**
      * Load the document for the given fileObject.
      * @param fileObject the file whose document we want to obtain
@@ -275,7 +280,7 @@ public final class GsfUtilities {
             // (see issue http://www.netbeans.org/issues/show_bug.cgi?id=148702 )
             // but for many cases, the user probably doesn't want really large files as indicated
             // by the skipLarge parameter).
-            if (fileObject.getSize () > 1024 * 1024) {
+            if (fileObject.getSize () > BIG_FILE_THRESHOLD_MB) {
                 return null;
             }
         }
diff --git a/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java b/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
index adbd1b6d70..a05c8c757b 100644
--- a/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
+++ b/platform/openide.loaders/src/org/openide/text/DataEditorSupport.java
@@ -837,9 +837,9 @@ public class DataEditorSupport extends CloneableEditorSupport {
         }
         
         /**
-         * default threshold for big file to warn user (default is 1MB)
+         * default threshold for big file to warn user (default is 5MB)
          */
-        private final transient long BIG_FILE_THRESHOLD_MB = Integer.getInteger("org.openide.text.big.file.size", 1) * 1024 * 1024;
+        private final transient long BIG_FILE_THRESHOLD_MB = Integer.getInteger("org.openide.text.big.file.size", 5) * 1024 * 1024;
         
         /** Obtains the input stream.
         * @exception IOException if an I/O error occurs
diff --git a/platform/openide.loaders/test/unit/src/org/openide/text/FileSizeThreshholdExceptionTest.java b/platform/openide.loaders/test/unit/src/org/openide/text/FileSizeThreshholdExceptionTest.java
index 8c2f2b472c..7b38ac821a 100644
--- a/platform/openide.loaders/test/unit/src/org/openide/text/FileSizeThreshholdExceptionTest.java
+++ b/platform/openide.loaders/test/unit/src/org/openide/text/FileSizeThreshholdExceptionTest.java
@@ -126,7 +126,7 @@ public class FileSizeThreshholdExceptionTest extends NbTestCase {
     
     public void testThreshholdDefaultValue() throws Exception {
         System.getProperties().remove(BIG_FILE_PROP);
-        doTestThreshholdValue(1);
+        doTestThreshholdValue(5);
     }
     
     public void testThreshholdNotDefaultValue() throws Exception {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists