Error cod data section too large

by Retired ‎02-16-2010 11:34 AM - edited ‎02-16-2010 11:45 AM (1,564 Views)

Summary


This article applies to the BlackBerry® Java™ Development Environment (JDE).


Problem


You receive the following error:

cod data section too large


Cause


A class definition contains too many string literals.


Resolution


Instead of splitting up the project into libraries, associate some of the strings with other class definitions.


Refer to the following examples:


Original definition


class S1 {
final static string FOO = "abcdefg";
}

class S2 {
final static string BAR = "hijklmn";
}

public class A {
String foo() {
return S2.FOO;
}

String bar() {
return S2.BAR;
}
}

 Modified definitions


class S1 {
     final static string FOO = "abcdefg";
}

class S2 {
     final static string BAR = "hijklmn";
}

public class A {
     String foo() {
          return S2.FOO;
     }

     String bar() {
          return S2.BAR;
     }
}

 


Thus, the string definitions are associated with separate classes, which the RAPC compiler (rapc.exe) can distribute amongst the siblings.