Buggy code:
@ Class ( extendsType = "ceylon.language.Object" ) public final class String implements Castable < String > , Category , Correspondence < Natural , Character > , Format , Ordered < Character > , Ranged < Natural , String > , Sized , Summable < String > , Comparable < String > { public final java . lang . String value ; private String ( java . lang . String s ) { } public java . lang . String toString ( ) { } public static String instance ( java . lang . String s ) { } public java . lang . String getUppercased ( ) { } public java . lang . String getLowercased ( ) { } @ Override public boolean equals ( @ Name ( "that" ) @ TypeInfo ( "ceylon.language.Equality" ) Object that ) { } @ Override public int hashCode ( ) { } public static String instance ( java . lang . String ... strings ) { } public static String instance ( String ... strings ) { } @ Override public Comparison compare ( @ Name ( "other" ) String other ) { } @ Override public java . lang . String getFormatted ( ) { } @ Override public < CastValue extends String > CastValue castTo ( ) { } @ Override public String plus ( @ Name ( "other" ) String string ) { } @ Override @ TypeInfo ( "ceylon.language.Natural" ) public long getSize ( ) { } @ TypeInfo ( "ceylon.language.Nothing|ceylon.language.Natural" ) public Natural getLastIndex ( ) { } @ Override public boolean getEmpty ( ) { } @ Override public Character item ( @ Name ( "index" ) Natural key ) { } @ Override public boolean defines ( @ Name ( "key" ) Natural key ) { } @ Override public Category getKeys ( ) { } @ Override public boolean definesEvery ( @ Name ( "keys" ) @ TypeInfo ( "ceylon.language.Empty|ceylon.language.Sequence<ceylon.language.Natural>" ) Iterable < ? extends Natural > keys ) { } @ Override public boolean definesAny ( @ Name ( "keys" ) @ TypeInfo ( "ceylon.language.Empty|ceylon.language.Sequence<ceylon.language.Natural>" ) Iterable < ? extends Natural > keys ) { } @ Override @ TypeInfo ( "ceylon.language.Empty|ceylon.language.Sequence<ceylon.language.Character>" ) public Iterable < ? extends Character > items ( @ Name ( "keys" ) @ TypeInfo ( "ceylon.language.Empty|ceylon.language.Sequence<ceylon.language.Natural>" ) Iterable < ? extends Natural > keys ) { } class StringIterator implements Iterator < Character > { private final int offset ; private final int codePoint ; StringIterator ( int offset ) { } @ Override public Character getHead ( ) { } @ Override public Iterator < Character > getTail ( ) { } } @ Override @ TypeInfo ( "ceylon.language.Nothing|ceylon.language.Iterator<ceylon.language.Character>" ) public Iterator < Character > getIterator ( ) { } @ Override public Character getFirst ( ) { } @ TypeInfo ( "ceylon.language.Empty|ceylon.language.Sequence<ceylon.language.Character>" ) public Iterable < ? extends Character > getCharacters ( ) { } @ TypeInfo ( "ceylon.language.Nothing|ceylon.language.Natural" ) public Natural firstOccurrence ( @ Name ( "substring" ) java . lang . String substring ) { } @ TypeInfo ( "ceylon.language.Nothing|ceylon.language.Natural" ) public Natural lastOccurrence ( @ Name ( "substring" ) java . lang . String substring ) { } @ Override public boolean contains ( @ Name ( "element" ) @ TypeInfo ( "ceylon.language.Equality" ) Object element ) { } public boolean startsWith ( @ Name ( "substring" ) java . lang . String substring ) { } public boolean endsWith ( @ Name ( "substring" ) java . lang . String substring ) { } @ Override public boolean containsAny ( @ Sequenced @ Name ( "elements" ) @ TypeInfo ( "ceylon.language.Empty|ceylon.language.Sequence<ceylon.language.Equality>" ) Iterable < ? > elements ) { } @ Override public boolean containsEvery ( @ Sequenced @ Name ( "elements" ) @ TypeInfo ( "ceylon.language.Empty|ceylon.language.Sequence<ceylon.language.Equality>" ) Iterable < ? > elements ) { } public boolean longerThan ( @ TypeInfo ( "ceylon.language.Natural" ) @ Name ( "length" ) long length ) { } public boolean shorterThan ( @ TypeInfo ( "ceylon.language.Natural" ) @ Name ( "length" ) long length ) { } public java . lang . String getTrimmed ( ) { } public java . lang . String getNormalized ( ) { } @ TypeInfo ( "ceylon.language.String" ) public java . lang . String initial ( @ TypeInfo ( "ceylon.language.Natural" ) @ Name ( "length" ) long length ) { } @ TypeInfo ( "ceylon.language.String" ) public java . lang . String terminal ( @ TypeInfo ( "ceylon.language.Natural" ) @ Name ( "length" ) long length ) { <START_BUG> return length > ( value . length ( ) ) ? value : value . substring ( ( ( value . length ( ) ) - 5 ) , value . length ( ) ) ; <END_BUG> } public java . lang . String join ( @ Name ( "strings" ) @ Sequenced @ TypeInfo ( "ceylon.language.Empty|ceylon.language.Sequence<ceylon.language.String>" ) Iterable < ? extends String > strings ) { } @ Override @ TypeInfo ( "ceylon.language.String" ) public String segment ( @ Name ( "from" ) Natural from , @ Name ( "length" ) Natural length ) { } @ Override @ TypeInfo ( "ceylon.language.String" ) public String span ( @ Name ( "from" ) Natural from , @ Name ( "to" ) Natural to ) { } }

Fix:
return length > ( value . length ( ) ) ? value : value . substring ( ( ( value . length ( ) ) - ( ( int ) ( length ) ) ) , value . length ( ) ) ;