/* DO NOT EDIT THIS FILE - it is machine generated (JCGO_116) */

#ifdef JCGO_SEPARATED
#define JCGO_116
#include "jcgortl.h"
#include "Main.h"
#endif

#ifdef JCGO_116

#ifdef CHKALL_java_lang_StringBuilder
#include "jcgobchk.h"
#endif

JCGO_NOSEP_STATIC java_lang_StringBuilder CFASTCALL
java_lang_StringBuilder__this__I( java_lang_StringBuilder This, jint
 capacity )
{
 {
  ;
  JCGO_FIELD_NZACCESS(This, bytes)= (jbyteArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jbyte),
   0, capacity);
 }
 return This;
}

JCGO_NOSEP_INLINE java_lang_StringBuilder CFASTCALL
java_lang_StringBuilder__new__I( jint capacity )
{
 return java_lang_StringBuilder__this__I(
  (java_lang_StringBuilder)jcgo_newObject((jvtable)&java_lang_StringBuilder_methods),
  capacity);
}

JCGO_NOSEP_INLINE jboolean CFASTCALL
java_lang_StringBuilder__hasHighByte__CAII( jcharArr chars, jint offset,
 jint count )
{
 {
  count+= offset;
  while (offset < count)
  {
   if ((jint)(JCGO_ARRAY_CACCESS(chars, offset++)) > (jint)255)
   {
    return (jboolean)jtrue;
   }
  }
  return (jboolean)jfalse;
 }
}

JCGO_NOSEP_INLINE void CFASTCALL
java_lang_StringBuilder__copyCharsToBytes__CAIBAII( jcharArr chars,
 jbyteArr bytes2, jint offset, jint offset2, jint count )
{
 {
  while (count-- > 0)
  {
   jObject jcgo_rcvrL1;
   jint jcgo_rcvrI1;
   jbyte jcgo_rcvrB1;
   (jcgo_rcvrL1= (jObject)bytes2, jcgo_rcvrI1= offset2++, jcgo_rcvrB1=
    (jbyte)JCGO_ARRAY_CACCESS(chars, offset++), JCGO_ARRAY_BACCESS((jbyteArr)jcgo_rcvrL1,
    jcgo_rcvrI1)= jcgo_rcvrB1);
  }
 }
}

JCGO_NOSEP_INLINE void CFASTCALL
java_lang_StringBuilder__copyBytesToChars__BAICAII( jbyteArr bytes,
 jcharArr chars2, jint offset, jint offset2, jint count )
{
 {
  while (count-- > 0)
  {
   jObject jcgo_rcvrL1;
   jint jcgo_rcvrI1;
   jchar jcgo_rcvrC1;
   (jcgo_rcvrL1= (jObject)chars2, jcgo_rcvrI1= offset2++, jcgo_rcvrC1=
    (jchar)((jint)((unsigned char)(JCGO_ARRAY_BACCESS(bytes, offset++)))),
    JCGO_ARRAY_CACCESS((jcharArr)jcgo_rcvrL1, jcgo_rcvrI1)= jcgo_rcvrC1);
  }
 }
}

JCGO_NOSEP_FRWINL java_lang_StringBuilder CFASTCALL
java_lang_StringBuilder__this__( java_lang_StringBuilder This )
{
 {
  (java_lang_StringBuilder__this__I((java_lang_StringBuilder)This,
   java_lang_StringBuilder__DEFAULT_CAPACITY));
 }
 return This;
}

JCGO_NOSEP_INLINE java_lang_StringBuilder CFASTCALL
java_lang_StringBuilder__new__( void )
{
 return java_lang_StringBuilder__this__(
  (java_lang_StringBuilder)jcgo_newObject((jvtable)&java_lang_StringBuilder_methods));
}

JCGO_NOSEP_STATIC java_lang_StringBuilder CFASTCALL
java_lang_StringBuilder__this__Ls( java_lang_StringBuilder This, java_lang_String
 str )
{
 {
  java_lang_Object strValue;
  jint count;
  count= (JCGO_CALL_FINALF(str) java_lang_String__length__(
   str));
  strValue= JCGO_FIELD_NZACCESS(str, value);
  if ((JCGO_METHODS_OF(strValue)->jcgo_typeid== OBJT_jbyte+OBJT_jarray))
  {
   jint jcgo_rcvrI1;
   (jcgo_rcvrI1= JCGO_FIELD_NZACCESS(str, offset), java_lang_VMSystem__arraycopy__LoILoII(
    (java_lang_Object)((jbyteArr)strValue), (java_lang_Object)(JCGO_FIELD_NZACCESS(This,
    bytes)= (jbyteArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jbyte),
    0, count + java_lang_StringBuilder__DEFAULT_CAPACITY)), jcgo_rcvrI1,
    0, count));
  }
  else
  {
   jObject jcgo_rcvrL1;
   jint jcgo_rcvrI1;
   (jcgo_rcvrL1= (jObject)((jcharArr)JCGO_CAST_OBJECT0(OBJT_jchar+OBJT_jarray,
    MAXT_jchar+OBJT_jarray, strValue)), jcgo_rcvrI1= JCGO_FIELD_NZACCESS(str,
    offset), java_lang_VMSystem__arraycopy__LoILoII(
    (java_lang_Object)jcgo_rcvrL1, (java_lang_Object)(JCGO_FIELD_NZACCESS(This,
    value)= (jcharArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jchar),
    0, count + java_lang_StringBuilder__DEFAULT_CAPACITY)), jcgo_rcvrI1,
    0, count));
  }
  JCGO_FIELD_NZACCESS(This, count)= count;
 }
 return This;
}

JCGO_NOSEP_INLINE java_lang_StringBuilder CFASTCALL
java_lang_StringBuilder__new__Ls( java_lang_String str )
{
 return java_lang_StringBuilder__this__Ls(
  (java_lang_StringBuilder)jcgo_newObject((jvtable)&java_lang_StringBuilder_methods),
  str);
}

JCGO_NOSEP_FRWINL jint CFASTCALL
java_lang_StringBuilder__length__( java_lang_StringBuilder This )
{
 {
  return JCGO_FIELD_NZACCESS(This, count);
 }
}

JCGO_NOSEP_INLINE void CFASTCALL
java_lang_StringBuilder__setLength__I( java_lang_StringBuilder This,
 jint newLength )
{
 {
  jbyteArr bytes;
  jcharArr chars;
  jint count;
  if (newLength < 0)
  {
   JCGO_THROW_EXC((java_lang_StringIndexOutOfBoundsException__new__I(
    newLength)));
  }
  bytes= JCGO_FIELD_NZACCESS(This, bytes);
  chars= JCGO_FIELD_NZACCESS(This, value);
  (java_lang_StringBuilder__ensureCapacityInner__IZ(
   This, newLength, (jboolean)jfalse));
  count= JCGO_FIELD_NZACCESS(This, count);
  if (newLength > count && JCGO_FIELD_NZACCESS(This, bytes) == bytes &&
   JCGO_FIELD_NZACCESS(This, value) == chars)
  {
   if (bytes != jnull)
   {
    do
    {
     JCGO_ARRAY_NZBACCESS(bytes, count++)= (jbyte)0;
    }
     while (count < newLength);
   }
   else
   {
    do
    {
     JCGO_ARRAY_CACCESS(chars, count++)= (jchar)0;
    }
     while (count < newLength);
   }
  }
  JCGO_FIELD_NZACCESS(This, count)= newLength;
 }
}

JCGO_NOSEP_INLINE java_lang_StringBuilder CFASTCALL
java_lang_StringBuilder__append__Lo( java_lang_StringBuilder This,
 java_lang_Object obj )
{
 {
  return (java_lang_StringBuilder__append__Ls(
   This, obj != jnull? (JCGO_CALL_NZVFUNC(obj)->toString__(
   obj)) : JCGO_STRREF_OF(jcgo_string5_String6D)));
 }
}

JCGO_NOSEP_STATIC java_lang_StringBuilder CFASTCALL
java_lang_StringBuilder__append__Ls( java_lang_StringBuilder This,
 java_lang_String str )
{
 {
  java_lang_Object strValue;
  jbyteArr strBytes;
  jint count;
  jint len;
  jint strOffset;
  jboolean outOfByte;
  if (str == jnull)
  {
   str= JCGO_STRREF_OF(jcgo_string5_String6D);
  }
  count= JCGO_FIELD_NZACCESS(This, count);
  len= (java_lang_String__length__(
   str));
  strValue= JCGO_FIELD_NZACCESS(str, value);
  strOffset= JCGO_FIELD_NZACCESS(str, offset);
  strBytes= (jbyteArr)jnull;
  outOfByte= jfalse;
  if (len > 0)
  {
   if ((JCGO_METHODS_OF(strValue)->jcgo_typeid== OBJT_jbyte+OBJT_jarray))
   {
    strBytes= (jbyteArr)strValue;
   }
   else
   {
    if (JCGO_FIELD_NZACCESS(This, bytes) != jnull && (java_lang_StringBuilder__hasHighByte__CAII(
     (jcharArr)JCGO_CAST_OBJECT0(OBJT_jchar+OBJT_jarray, MAXT_jchar+OBJT_jarray,
     strValue), strOffset, len)))
    {
     outOfByte= (jboolean)jtrue;
    }
   }
  }
  (java_lang_StringBuilder__ensureCapacityInner__IZ(
   This, count + len, (jboolean)outOfByte));
  if (len > 0)
  {
   jbyteArr bytes;
   bytes= JCGO_FIELD_NZACCESS(This, bytes);
   if (bytes != jnull)
   {
    if (strBytes != jnull)
    {
     (java_lang_VMSystem__arraycopy__LoILoII(
      (java_lang_Object)strBytes, (java_lang_Object)bytes, strOffset,
      count, len));
    }
    else
    {
     (java_lang_StringBuilder__copyCharsToBytes__CAIBAII(
      (jcharArr)JCGO_CAST_OBJECT0(OBJT_jchar+OBJT_jarray, MAXT_jchar+OBJT_jarray,
      strValue), bytes, strOffset, count, len));
    }
   }
   else
   {
    if (strBytes != jnull)
    {
     (java_lang_StringBuilder__copyBytesToChars__BAICAII(
      strBytes, JCGO_FIELD_NZACCESS(This, value), strOffset, count,
      len));
    }
    else
    {
     (java_lang_VMSystem__arraycopy__LoILoII(
      strValue, (java_lang_Object)JCGO_FIELD_NZACCESS(This, value),
      strOffset, count, len));
    }
   }
   JCGO_FIELD_NZACCESS(This, count)= count + len;
  }
  return This;
 }
}

JCGO_NOSEP_STATIC java_lang_StringBuilder CFASTCALL
java_lang_StringBuilder__append__C( java_lang_StringBuilder This,
 jchar ch )
{
 {
  jbyteArr bytes;
  jint count;
  count= JCGO_FIELD_NZACCESS(This, count);
  (java_lang_StringBuilder__ensureCapacityInner__IZ(
   This, count + (jint)1, (jboolean)((jint)ch > (jint)255)));
  bytes= JCGO_FIELD_NZACCESS(This, bytes);
  if (bytes != jnull)
  {
   JCGO_ARRAY_NZBACCESS(bytes, count)= ((jbyte)ch);
  }
  else
  {
   JCGO_ARRAY_CACCESS(JCGO_FIELD_NZACCESS(This, value), count)= ch;
  }
  JCGO_FIELD_NZACCESS(This, count)= count + (jint)1;
  return This;
 }
}

JCGO_NOSEP_FRWINL java_lang_StringBuilder CFASTCALL
java_lang_StringBuilder__append__I( java_lang_StringBuilder This,
 jint v )
{
 {
  struct java_lang_String_s jcgo_stackobj1;
  return (java_lang_StringBuilder__append__Ls(
   This, (java_lang_String__valueOf__IX(
   v, JCGO_STACKOBJ_NEW(jcgo_stackobj1, java_lang_String_methods)))));
 }
}

JCGO_NOSEP_FRWINL java_lang_String CFASTCALL
java_lang_StringBuilder__toString__X( java_lang_StringBuilder This,
 java_lang_String jcgo_stackparam )
{
 {
  return (java_lang_String__this__L5dy9e(
   jcgo_stackparam, This));
 }
}

JCGO_NOSEP_FRWINL java_lang_String CFASTCALL
java_lang_StringBuilder__toString__( java_lang_StringBuilder This
 )
{
 return java_lang_StringBuilder__toString__X(This, (java_lang_String)jcgo_newObject((jvtable)&java_lang_String_methods));
}

JCGO_NOSEP_FRWINL java_lang_Object CFASTCALL
java_lang_StringBuilder__value__( java_lang_StringBuilder This )
{
 {
  jbyteArr bytes;
  bytes= JCGO_FIELD_NZACCESS(This, bytes);
  return bytes != jnull? (java_lang_Object)bytes : (java_lang_Object)JCGO_FIELD_NZACCESS(This,
   value);
 }
}

JCGO_NOSEP_FRWINL void CFASTCALL
java_lang_StringBuilder__setShared__( java_lang_StringBuilder This
 )
{
 {
  JCGO_FIELD_NZACCESS(This, shared)= (jboolean)jtrue;
 }
}

JCGO_NOSEP_STATIC void CFASTCALL
java_lang_StringBuilder__ensureCapacityInner__IZ( java_lang_StringBuilder
 This, jint minimumCapacity, jboolean outOfByte )
{
 {
  jbyteArr bytes;
  jcharArr chars;
  jint capacity;
  bytes= JCGO_FIELD_NZACCESS(This, bytes);
  chars= (jcharArr)jnull;
  if (minimumCapacity < 0)
  {
   minimumCapacity= JCGO_USHR_F((-(jint)1), (jint)1);
  }
  capacity= bytes != jnull? JCGO_ARRAY_NZLENGTH(bytes) : JCGO_ARRAY_LENGTH((chars=
   JCGO_FIELD_NZACCESS(This, value)));
  if (capacity < minimumCapacity || JCGO_FIELD_NZACCESS(This, shared) ||
   (outOfByte && bytes != jnull))
  {
   jint newCapacity;
   jint count;
   newCapacity= capacity;
   if (capacity < minimumCapacity)
   {
    newCapacity= JCGO_SHL_F((capacity + (jint)1), (jint)1);
    if (newCapacity <= minimumCapacity)
    {
     newCapacity= minimumCapacity;
    }
   }
   count= JCGO_FIELD_NZACCESS(This, count);
   if (bytes != jnull && !outOfByte)
   {
    jbyteArr newBytes;
    newBytes= (jbyteArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jbyte),
     0, newCapacity);
    if (count > 0)
    {
     (java_lang_VMSystem__arraycopy__LoILoII(
      (java_lang_Object)bytes, (java_lang_Object)newBytes, 0, 0, count));
    }
    JCGO_FIELD_NZACCESS(This, bytes)= newBytes;
   }
   else
   {
    jcharArr newChars;
    newChars= (jcharArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jchar),
     0, newCapacity);
    if (count > 0)
    {
     if (bytes != jnull)
     {
      {
       jint i;
       i= 0;
       for (; i < count; i++)
       {
        jchar jcgo_rcvrC1;
        (jcgo_rcvrC1= (jchar)((jint)((unsigned char)(JCGO_ARRAY_NZBACCESS(bytes,
         i)))), JCGO_ARRAY_NZCACCESS(newChars, i)= jcgo_rcvrC1);
       }
      }
     }
     else
     {
      (java_lang_VMSystem__arraycopy__LoILoII(
       (java_lang_Object)chars, (java_lang_Object)newChars, 0, 0, count));
     }
    }
    JCGO_FIELD_NZACCESS(This, value)= newChars;
    JCGO_FIELD_NZACCESS(This, bytes)= (jbyteArr)jnull;
   }
   JCGO_FIELD_NZACCESS(This, shared)= (jboolean)jfalse;
  }
 }
}

JCGO_NOSEP_DATA CONST struct java_lang_StringBuilder_methods_s java_lang_StringBuilder_methods=
{
 JCGO_CLASSREF_OF(java_lang_StringBuilder__class),
 JCGO_GCJDESCR_INIT(java_lang_StringBuilder_s, bytes)
 OBJT_java_lang_StringBuilder,
 (JCGO_OBJSIZE_T)sizeof(struct java_lang_StringBuilder_s),
 NULL,
 JCGO_CLINIT_INIT(0)
 java_lang_StringBuilder__this__,
 java_lang_Object__equals__Lo,
 java_lang_Object__hashCode__,
 java_lang_StringBuilder__toString__,
 java_lang_Object__finalize__
};

JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_StringBuilder_class_s
 java_lang_StringBuilder__class JCGO_THRD_ATTRNONGC=
{
 {
  &java_lang_Class_methods,
  JCGO_MON_INIT
  JCGO_OBJREF_OF(*(java_lang_Object)&java_lang_StringBuilder_methods),
  JCGO_STRREF_OF(jcgo_string1_StrngBld),
  JCGO_CLASSREF_OF(java_lang_Object__class),
  ((jObjectArr)JCGO_OBJREF_OF(jcgo_array3_Object)),
  0x11
 }
};

JCGO_NOSEP_DATA CONST jcgo_arrtype91_GmCnnctn jcgo_array2_StrngBld=
{
 (jvtable)&jbyteArr_methods,
 JCGO_MON_INIT
 23,
 {
  (jbyte)(jchar)106/*'j'*/, (jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)118/*'v'*/,
   (jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)46/*'.'*/, (jbyte)(jchar)108/*'l'*/,
   (jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)103/*'g'*/,
   (jbyte)(jchar)46/*'.'*/, (jbyte)(jchar)83/*'S'*/, (jbyte)(jchar)116/*'t'*/,
   (jbyte)(jchar)114/*'r'*/, (jbyte)(jchar)105/*'i'*/, (jbyte)(jchar)110/*'n'*/,
   (jbyte)(jchar)103/*'g'*/, (jbyte)(jchar)66/*'B'*/, (jbyte)(jchar)117/*'u'*/,
   (jbyte)(jchar)105/*'i'*/, (jbyte)(jchar)108/*'l'*/, (jbyte)(jchar)100/*'d'*/,
   (jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)114/*'r'*/
 }
};

JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string1_StrngBld
 JCGO_THRD_ATTRNONGC=
{
 &java_lang_String_methods,
 JCGO_MON_INIT
 (java_lang_Object)JCGO_OBJREF_OF(jcgo_array2_StrngBld),
 0, 23, (jint)0xa34c4576L
};

#ifdef CHKALL_java_lang_StringBuilder
#include "jcgochke.h"
#endif

#endif
