UdL-EPS-SoftArch / TextAnnot-API

Written Corpus Annotation tool
GNU General Public License v3.0
1 stars 4 forks source link

Create annotation #75

Closed ricardzm closed 5 years ago

jmgimeno commented 5 years ago

Do you really think this code is acceptable?

       if (annotation.getSample() != null) {
            return annotation.getStart() != null &&
                    annotation.getEnd() != null &&
                    0 <= annotation.getStart() &&
                    annotation.getStart() < annotation.getEnd() &&
                    annotation.getEnd() <= annotation.getSample().getText().length();
        }else{
            return false;
        }

Why do you add an special if to an expression which can evaluate the condition of the if?

Please, simplify the code and commit again.