Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349992 - static initializer is exceeding the 65535 bytes limit with xtext 2.0
Summary: static initializer is exceeding the 65535 bytes limit with xtext 2.0
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.1   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 critical (vote)
Target Milestone: SR1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-21 16:38 EDT by Raymond Feng CLA
Modified: 2017-10-31 11:30 EDT (History)
5 users (show)

See Also:
sebastian.zarnekow: indigo+


Attachments
Grammar with which the issue raised (11.50 KB, text/plain)
2011-07-05 07:12 EDT, irfan CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raymond Feng CLA 2011-06-21 16:38:36 EDT
Open a bug per Sebastien's comment. Please see details at the following TMF forum thread:
 
http://www.eclipse.org/forums/index.php?t=rview&goto=686141#msg_686141
Comment 1 Sebastian Zarnekow CLA 2011-06-22 02:10:43 EDT
Hi Raymond,

could you please provide a grammar that reproduces the issue? Thanks!
Comment 2 Raymond Feng CLA 2011-06-22 11:57:54 EDT
(In reply to comment #1)
> Hi Raymond,
> 
> could you please provide a grammar that reproduces the issue? Thanks!

Hi,

I can reproduce the problem using the Sculptordsl.xtext:

https://fornax.svn.sourceforge.net/svnroot/fornax/trunk/cartridges/sculptor/org.fornax.cartridges.sculptor.dsl/src/org/fornax/cartridges/sculptor/dsl/Sculptordsl.xtext.

Thanks,
Raymond
Comment 3 irfan CLA 2011-07-05 07:12:09 EDT
Created attachment 199108 [details]
Grammar with which the issue raised

open a bug ...please see detalis at the following TMF forum thread:
http://www.eclipse.org/forums/index.php/m/692811/?srch=too+long#msg_692811

I have also attached the grammar.
Comment 4 irfan CLA 2011-07-05 07:13:01 EDT
open a bug ...please see detalis at the following TMF forum thread:
http://www.eclipse.org/forums/index.php/m/692811/?srch=too+long#msg_692811

In the attachment you can find the grammar.
Comment 5 irfan CLA 2011-07-06 00:40:10 EDT
hi sebastian,
as per your comment i have added the comment with the grammar.
FYI:the platform i am working on is Windows XP..
when can we expect the solution for it.
Comment 6 Sebastian Zarnekow CLA 2011-07-06 01:06:48 EDT
We'll look into this one in the next weeks. Unfortunately I cannot provide a more concrete estimation at the moment.
Comment 7 irfan CLA 2011-07-06 01:26:02 EDT
(In reply to comment #6)
> We'll look into this one in the next weeks. Unfortunately I cannot provide a
> more concrete estimation at the moment.

Thanks Sebastian,
will wait for your post.
Comment 8 irfan CLA 2011-07-11 08:11:54 EDT
(In reply to comment #7)
> (In reply to comment #6)
> > We'll look into this one in the next weeks. Unfortunately I cannot provide a
> > more concrete estimation at the moment.
> 
> Thanks Sebastian,
> will wait for your post.

hi sebastian,
i request you to please delete the file which i have attached as it is not a correct file.
thanks
irfan
Comment 9 Sebastian Zarnekow CLA 2011-07-25 09:52:01 EDT
Pushed to master.
Try 

options {
  classSplitting = true
  
  // lower number means more aggressive splitting
  // default was 2500, is now 1000
  fieldsPerClass = 500 
}

if the problem persists.
Comment 10 Raymond Feng CLA 2011-07-25 14:53:46 EDT
(In reply to comment #9)
> Pushed to master.
> Try 
> 
> options {
>   classSplitting = true
> 
>   // lower number means more aggressive splitting
>   // default was 2500, is now 1000
>   fieldsPerClass = 500 
> }
> 
> if the problem persists.

Thanks for the fix. 

1) I confirm that the latest code fixes the problem by explicitly setting the fieldsPerClass option.

2) It turns out that the fieldsPerClass is a String. So we need to set the option as follows:

fieldsPerClass = "500". 

By looking at the source code, the setter method for fieldsPerClass takes a String while the getter method returns an int. Is it by design?

Raymond
Comment 11 Sebastian Zarnekow CLA 2011-07-25 15:25:00 EDT
(In reply to comment #10)
> 
> By looking at the source code, the setter method for fieldsPerClass takes a
> String while the getter method returns an int. Is it by design?
> 
> Raymond

Yes, it is unfortunately. MWE2 has a bug when it comes to integer properties.
Comment 12 irfan CLA 2011-07-26 01:51:41 EDT
(In reply to comment #11)
> (In reply to comment #10)
> > 
> > By looking at the source code, the setter method for fieldsPerClass takes a
> > String while the getter method returns an int. Is it by design?
> > 
> > Raymond
> 
> Yes, it is unfortunately. MWE2 has a bug when it comes to integer properties.

hey,
i have added the code for the fix but getting this error:
'could'nt resolve reference to JvmIdentifiableElement fieldPerClass'
thanks 
irfan
Comment 13 irfan CLA 2011-07-26 03:45:11 EDT
(In reply to comment #11)
> (In reply to comment #10)
> > 
> > By looking at the source code, the setter method for fieldsPerClass takes a
> > String while the getter method returns an int. Is it by design?
> > 
> > Raymond
> 
> Yes, it is unfortunately. MWE2 has a bug when it comes to integer properties.

hey,
i have added the code for the fix but getting this error:
'could'nt resolve reference to JvmIdentifiableElement fieldPerClass'
thanks 
irfan
Comment 14 Sebastian Zarnekow CLA 2011-07-26 04:12:14 EDT
(In reply to comment #13)
> hey,
> i have added the code for the fix but getting this error:
> 'could'nt resolve reference to JvmIdentifiableElement fieldPerClass'
> thanks 
> irfan

Hi Irfan,

please make sure to use the latest nightly build. The update site is: https://hudson.eclipse.org/hudson/view/Modeling/job/Xtext-nightly-HEAD/lastSuccessfulBuild/artifact/xtext.p2.repository/

Regards,
Sebastian
Comment 15 irfan CLA 2011-07-26 04:34:54 EDT
(In reply to comment #14)
> (In reply to comment #13)
> > hey,
> > i have added the code for the fix but getting this error:
> > 'could'nt resolve reference to JvmIdentifiableElement fieldPerClass'
> > thanks 
> > irfan
> 
> Hi Irfan,
> 
> please make sure to use the latest nightly build. The update site is:
> https://hudson.eclipse.org/hudson/view/Modeling/job/Xtext-nightly-HEAD/lastSuccessfulBuild/artifact/xtext.p2.repository/
> 
> Regards,
> Sebastian
hi sebastian,
thanks for the solution but i am still having the following error:
"Description Resource Path Location Type The code of method specialStateTransition(int, IntStream) is exceeding the 65535 bytes limit	InternalVizJsonLexer.java	/org.xtext.example.vizjson.ui/src-gen/org/xtext/example/vizjson/ui/contentassist/antlr/internal	line 7188	Java Problem"
Comment 16 Sebastian Zarnekow CLA 2011-07-26 04:37:46 EDT
Hi Irfan,

could you please open the lexer class and double check whether the inner class DFA is marked as static? Do you see a large number of specialSTateTransition###(IntStream) methods?

Regards,
Sebastian
Comment 17 irfan CLA 2011-07-26 04:57:38 EDT
(In reply to comment #14)
> (In reply to comment #13)
> > hey,
> > i have added the code for the fix but getting this error:
> > 'could'nt resolve reference to JvmIdentifiableElement fieldPerClass'
> > thanks 
> > irfan
> 
> Hi Irfan,
> 
> please make sure to use the latest nightly build. The update site is:
> https://hudson.eclipse.org/hudson/view/Modeling/job/Xtext-nightly-HEAD/lastSuccessfulBuild/artifact/xtext.p2.repository/
> 
> Regards,
> Sebastian
hi sebastian,
thanks for the solution but i am still having the following error:
"Description Resource Path Location Type The code of method specialStateTransition(int, IntStream) is exceeding the 65535 bytes limit	InternalVizJsonLexer.java	/org.xtext.example.vizjson.ui/src-gen/org/xtext/example/vizjson/ui/contentassist/antlr/internal	line 7188	Java Problem"

(In reply to comment #16)
> Hi Irfan,
> 
> could you please open the lexer class and double check whether the inner class
> DFA is marked as static? Do you see a large number of
> specialSTateTransition###(IntStream) methods?
> 
> Regards,
> Sebastian

hi sebastian,

yes the inner class of DFA is marked as static,and i hvae only one method specialSTateTransition###(IntStream) which has 687 cases in it.
thanks,
irfan.
Comment 18 Sebastian Zarnekow CLA 2011-07-26 05:04:27 EDT
Did you enable backtracking in your workflow?
Comment 19 irfan CLA 2011-07-26 05:06:34 EDT
(In reply to comment #14)
> (In reply to comment #13)
> > hey,
> > i have added the code for the fix but getting this error:
> > 'could'nt resolve reference to JvmIdentifiableElement fieldPerClass'
> > thanks 
> > irfan
> 
> Hi Irfan,
> 
> please make sure to use the latest nightly build. The update site is:
> https://hudson.eclipse.org/hudson/view/Modeling/job/Xtext-nightly-HEAD/lastSuccessfulBuild/artifact/xtext.p2.repository/
> 
> Regards,
> Sebastian
hi sebastian,
thanks for the solution but i am still having the following error:
"Description Resource Path Location Type The code of method specialStateTransition(int, IntStream) is exceeding the 65535 bytes limit	InternalVizJsonLexer.java	/org.xtext.example.vizjson.ui/src-gen/org/xtext/example/vizjson/ui/contentassist/antlr/internal	line 7188	Java Problem"

(In reply to comment #16)
> Hi Irfan,
> 
> could you please open the lexer class and double check whether the inner class
> DFA is marked as static? Do you see a large number of
> specialSTateTransition###(IntStream) methods?
> 
> Regards,
> Sebastian

hi sebastian,

yes the inner class of DFA is marked as static,and i hvae only one method specialSTateTransition###(IntStream) which has 687 cases in it.
thanks,
irfan.(In reply to comment #17)
> (In reply to comment #14)
> > (In reply to comment #13)
> > > hey,
> > > i have added the code for the fix but getting this error:
> > > 'could'nt resolve reference to JvmIdentifiableElement fieldPerClass'
> > > thanks 
> > > irfan
> > 
> > Hi Irfan,
> > 
> > please make sure to use the latest nightly build. The update site is:
> > https://hudson.eclipse.org/hudson/view/Modeling/job/Xtext-nightly-HEAD/lastSuccessfulBuild/artifact/xtext.p2.repository/
> > 
> > Regards,
> > Sebastian
> hi sebastian,
> thanks for the solution but i am still having the following error:
> "Description Resource Path Location Type The code of method
> specialStateTransition(int, IntStream) is exceeding the 65535 bytes limit   
> InternalVizJsonLexer.java   
> /org.xtext.example.vizjson.ui/src-gen/org/xtext/example/vizjson/ui/contentassist/antlr/internal
>    line 7188    Java Problem"
> 
> (In reply to comment #16)
> > Hi Irfan,
> > 
> > could you please open the lexer class and double check whether the inner class
> > DFA is marked as static? Do you see a large number of
> > specialSTateTransition###(IntStream) methods?
> > 
> > Regards,
> > Sebastian
> 
> hi sebastian,
> 
> yes the inner class of DFA is marked as static,and i hvae only one method
> specialSTateTransition###(IntStream) which has 687 cases in it.
> thanks,
> irfan.

Hi sebastian,
the error is generating under the following project:
"org.xtext.example.vizjson.ui.contentassist.antlr.internal" and not in this project "org.xtext.example.vizjson.parser.antlr.internal"....?????
Comment 20 irfan CLA 2011-07-26 05:09:44 EDT
(In reply to comment #18)
> Did you enable backtracking in your workflow?

hi,
i have tried both....
thanks 
irfan.
Comment 21 Sebastian Zarnekow CLA 2011-07-26 05:11:37 EDT
Irfan,

Please attach the workflow and the grammar if possible. Otherwise, I'd be more than happy if you could send me both files attached to a mail.

Which OS do you use?
Comment 22 irfan CLA 2011-07-26 05:17:20 EDT
(In reply to comment #20)
> (In reply to comment #18)
> > Did you enable backtracking in your workflow?
> 
> hi,
> i have tried both....
> thanks 
> irfan.


Hi sebastian,

thanks for the replies,the issue is been resolved.....
i need to put the code:
" options = {
              classSplitting=true
	      fieldsPerClass = "500" 
				}"
twice in the workflow
once in the " fragment = parser.antlr.XtextAntlrGeneratorFragment "
and again in the "fragment = parser.antlr.XtextAntlrUiGeneratorFragment"
the one which i missed...
thanks once again
Irfan.
Comment 23 Sebastian Zarnekow CLA 2011-07-26 05:19:14 EDT
Thanks for the update. I'll close this one again.
Comment 24 Alex Ruiz CLA 2011-08-30 17:10:13 EDT
Thanks so much for the fix. I tried several nightly builds. FYI, The latest
ones simply don't work. 

I finally got a good one:
https://hudson.eclipse.org/hudson/view/Modeling/job/Xtext-nightly-HEAD/1325/

Cheers,
-Alex
Comment 25 Puneet Patwari CLA 2015-01-29 04:13:22 EST
Hi All,

I am getting the same error "The code of method init(IGrammarAccess) is exceeding the 65535 bytes limit" for the java file located at : /com.iaea.mnc.dsl/src-gen/com/iaea/mnc/dsl/serializer/AbstractMncSyntacticSequencer.java

I have tried the method of classSplitting and fieldsPerClass as suggested by Sebastian but still not able to make it work. 

Any help will be solicited.

Regards
Puneet Patwari
Comment 26 Moritz Eysholdt CLA 2015-01-29 04:24:10 EST
hi Puneet,

this is bug is about the parser. What you're looking at is an issue with the serializer. Let's handle it in bug 458705.
Comment 27 Eclipse Webmaster CLA 2017-10-31 11:30:56 EDT
Requested via bug 522520.

-M.