Skip to content

Commit

Permalink
Manual casting fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
yesamer committed Jan 29, 2024
1 parent 9c999a3 commit c1b653d
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public String toString() {
}

private void setErrorLines() {
if( object instanceof CompilationProblem[] cp) {
if( object instanceof CompilationProblem[] ) {
CompilationProblem[] cp = ((CompilationProblem[]) object);
this.errorLines = new int[cp.length];
for( int i = 0; i < cp.length ; i ++ ) {
this.errorLines[i] = cp[i].getStartLine() - this.functionDescr.getOffset() + this.getFunctionDescr().getLine() - 1;
Expand All @@ -70,7 +71,8 @@ private void setErrorLines() {

private String createMessage( String message ) {
StringBuilder detail = new StringBuilder();
if( object instanceof CompilationProblem[] cp) {
if( object instanceof CompilationProblem[] ) {
CompilationProblem[] cp = ((CompilationProblem[]) object);
for( int i = 0; i < cp.length ; i ++ ) {
detail.append( this.functionDescr.getName() );
detail.append( " (line:" );
Expand All @@ -79,7 +81,9 @@ private String createMessage( String message ) {
detail.append( cp[i].getMessage() );
detail.append( "\n" );
}
} else if( object instanceof Exception ex) {
} else if( object instanceof Exception ) {
Exception ex = ((Exception) object);

detail.append( " (line:" );
detail.append( this.errorLines[0] );
detail.append( "): " );
Expand Down

0 comments on commit c1b653d

Please sign in to comment.