compiler limitation -- static { } block is too large -- need refactoring
------------------------------------------------------------------------

         Key: SPRING-95
         URL: http://jira.andromda.org/browse/SPRING-95
     Project: Spring Cartridge
        Type: Improvement
    Versions: 3.1RC1    
 Environment: Win2KSP4, JDK1.5 (JRE, HOTSPOT JVM, build 1.5.0_01-b08), Ant 
1.6.2, Maven 1.0.2. Intel P4 2.1GH, 2GB RAM.
    Reporter: Safaa Hashim
 Assigned to: Chad Brandon 
    Priority: Critical


The following is abstracted from the forum.androMDA.org, Project Generator 
topic area:

The project generator gave me the following error, which seems to be a size 
issue with the code generator in Andromda. I have a model with over 1300 
objects and about 14,000 associations. 

====================== 

java:compile: 
[echo] Compiling to C:\cvs_work\i\core/target/classes 
[echo] 
========================================================== 

NOTE: Targetting JVM 1.5, classes 
will not run on earlier JVMs 

========================================================== 

[javac] Compiling 3362 source files to C:\cvs_work\i\core\target\classes 
C:\cvs_work\i\core\target\src\com\dialektos\com\CriteriaSearchProperties.java:17
 
: code too large 
private static final java.util.Map embeddedValuesByType = new java.util.Hash 
Map(); 
^ 
Note: Some input files use unchecked or unsafe operations. 
Note: Recompile with -Xlint:unchecked for details. 
1 error 

BUILD FAILED 
File...... C:\Documents and Settings\Safaa 
Hashim\.maven\cache\maven-multiprojec 
t-plugin-1.3.1\plugin.jelly 
Element... maven:reactor 
Line...... 217 
Column.... 9 
Unable to obtain goal [multiproject:install-callback] -- C:\Documents and 
Settin 
gs\Safaa Hashim\.maven\cache\maven-java-plugin-1.5\plugin.jelly:63:48: 
<ant:java 
c> Compile failed; see the compiler error output for details. 
INFO [App] Total time: 3 minutes 47 seconds 
INFO [App] Finished at: Thu Aug 04 22:35:15 PDT 2005 
INFO [App] 
C:\cvs_work\i> 

=============================

Input from Chad and Wouter:

(1)[EMAIL PROTECTED] wrote: 

That package is where utility classes are generated (that class is used by the 
Hibernate Criteria support). As this error seems to happen as well in large JSP 
files (when compiled into a servlet), its a compiler limitation, I think the 
only solution is to generate multiple instead of one big file...or generate a 
properties file and read in the configuration I have in there. So if you would, 
please file a JIRA issue in the Spring cartridge. 
 
(2) [EMAIL PROTECTED] wrote: 
I think the problem is that the static { } block is too large, I've seen that 
behavior also within Websphere when the contents of a try/catch were lengthy 

I'm pretty sure simply doing multiple static blocks instead of one will solve 
the problem, I've never heard of a thing such as a class file size limit 

(3) Richard Kunze
[EMAIL PROTECTED] wrote: "I think the problem is that the static { } block is 
too large"


That's very probably the cause - there is definitely a limit (64K if I recall 
correctly and if it hasn't changed since JDK 1.3) on the size of the bytecode 
for a single method/constructor/initializer block. I've encountered this 
problem in another code generator (XMLC, generates presentation layer Java code 
from plain HTML/XML pages), and solved it by splitting large methods into 
multiple smaller ones which were then called in sequence. 





-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.andromda.org/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Andromda-devel mailing list
Andromda-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/andromda-devel

Reply via email to