This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 213882 - need a way to specify "large file" threshold
Summary: need a way to specify "large file" threshold
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: apireviews
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2012-06-09 16:13 UTC by Vladimir Voskresensky
Modified: 2013-08-30 09:38 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
simple -J-D based patch (1.13 KB, patch)
2012-09-05 11:12 UTC, Vladimir Voskresensky
Details | Diff
Fix, test and apichanges (12.11 KB, patch)
2013-08-23 13:14 UTC, igor_nikiforov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2012-06-09 16:13:23 UTC
DataEditorSupport throws "The file is too big. " exception using logic:
        public InputStream inputStream() throws IOException {
            final FileObject fo = getFileImpl ();
            if (!warnedFiles.contains(fo) && fo.getSize () > 1024 * 1024) {
                throw new ME (fo.getSize ());
            }
            InputStream is = getFileImpl ().getInputStream ();
            return is;
        }

in native space 1Mb file is rather common situation.
Our users are confused that IDE is going to crash with OOM, because by default Studio uses 1G memory heap.

We need a way to replace hardcoded "1024 * 1024" constant.
Branding constant would be great. -J-D flag is OK as well
Comment 1 Jaroslav Tulach 2012-06-10 06:55:35 UTC
I am OK, with -J-D switch as well. Please go through API review, if you want it.
Comment 2 Vladimir Voskresensky 2012-09-05 11:12:23 UTC
Created attachment 123941 [details]
simple -J-D based patch

Have a look at proposed change
Comment 3 Vladimir Voskresensky 2012-09-05 11:13:29 UTC
Do we really need API review process for such change? Do we have somewhere in API notification about exact 1Mb threshold?
Comment 4 Jaroslav Tulach 2012-09-07 10:13:19 UTC
Y01 missing change into openide.loaders/arch.xml to document new property.
Y02 missing test.
Comment 5 Vladimir Voskresensky 2012-09-07 13:49:51 UTC
Jarda, why change of hardcoded value into System property is the API change?
Comment 6 Jaroslav Tulach 2012-09-07 19:34:17 UTC
Because some other module, or some end user need to know the name of the property and meaning of its values. The traditional NetBeans definition of an API is: "everything someone else can depend on". Certainly those who set the property depend on its behavior and as such it is an API and should be documented. We are using arch.xml to document such APIs and to specify their stability.
Comment 7 Vladimir Voskresensky 2013-05-27 10:54:41 UTC
Igor, please, follow up with API change process
Comment 8 igor_nikiforov 2013-08-23 13:14:46 UTC
Created attachment 139139 [details]
Fix, test and apichanges
Comment 9 igor_nikiforov 2013-08-23 13:15:35 UTC
New patch attached with test and apichanges. Please, take a look.
Comment 10 Jaroslav Tulach 2013-08-23 21:00:10 UTC
Looks OK. Please continue with http://wiki.netbeans.org/APIReviewSteps#Step_2_-_Submit_the_Issue
Comment 11 Vladimir Voskresensky 2013-08-27 08:03:00 UTC
Please, review. We'd like to integrate before Code Freeze
Comment 12 igor_nikiforov 2013-08-30 09:38:45 UTC
Have to push the changes earlier to be sure that they will be propagated before code freeze.

Here they are:
  http://hg.netbeans.org/cnd-main/rev/bd53f8d50da7