private CompilationProblem[] getScalacProblems( Problem[] problems )
    {
        CompilationProblem[] result = new CompilationProblem[problems.length];
        for ( int i = 0; i < problems.length; i++ )
        {
            Problem problem = problems[i];
            Position position = problem.position();

            Maybe<Integer> line = position.line();
            String lineContent = position.lineContent();
            Maybe<Integer> offset = position.offset();
            Maybe<Integer> pointer = position.pointer();
            Maybe<File> sourceFile = position.sourceFile();
            SourcePosition sp =
                new DefaultSourcePosition( line.isDefined() ? line.get().intValue() : -1, lineContent,
                                           offset.isDefined() ? offset.get().intValue() : -1,
                                           pointer.isDefined() ? pointer.get().intValue() : -1,
                                           sourceFile.isDefined() ? sourceFile.get() : null );
            result[i] =
                new DefaultCompilationProblem( problem.category(), problem.message(), sp, problem.severity().name() );
        }
        return result;
    }
private CompilationProblem [ ] getScalacProblems ( Problem [ ] problems ) { CompilationProblem [ ] result = new CompilationProblem [ problems . length ] ; for ( int i = 0 ; i < problems . length ; i ++ ) { Problem problem = problems [ i ] ; Position position = problem . position ( ) ; Maybe < Integer > line = position . line ( ) ; String lineContent = position . lineContent ( ) ; Maybe < Integer > offset = position . offset ( ) ; Maybe < Integer > pointer = position . pointer ( ) ; Maybe < File > sourceFile = position . sourceFile ( ) ; SourcePosition sp = new DefaultSourcePosition ( line . isDefined ( ) ? line . get ( ) . intValue ( ) : - 1 , lineContent , offset . isDefined ( ) ? offset . get ( ) . intValue ( ) : - 1 , pointer . isDefined ( ) ? pointer . get ( ) . intValue ( ) : - 1 , sourceFile . isDefined ( ) ? sourceFile . get ( ) : null ) ; result [ i ] = new DefaultCompilationProblem ( problem . category ( ) , problem . message ( ) , sp , problem . severity ( ) . name ( ) ) ; } return result ; }
scalac problems conversion