Package org.eclim.command

Examples of org.eclim.command.Error


    if(buildfile != null){
      try{
        IClasspathEntry[] entries = mergeWithBuildfile(javaProject, buildfile);
        errors = setClasspath(javaProject, entries, dotclasspath);
      }catch(IllegalStateException ise){
        errors.add(new Error(ise.getMessage(), buildfile, 1, 1, false));
      }

    // .classpath updated.
    }else{
      // if an exception occurs reading the classpath then eclipse will return a
      // default classpath which we would otherwise then write back into the
      // .classpath file. This hack prevents that and will return a relevent
      // error message as a validation error.
      try{
        ((JavaProject)javaProject).readFileEntriesWithException(null);
      } catch(Exception e) {
        errors.add(new Error(e.getMessage(), dotclasspath, 1, 1, false));
        return errors;
      }

      IClasspathEntry[] entries = javaProject.readRawClasspath();
      errors = setClasspath(javaProject, entries, dotclasspath);
View Full Code Here


      javaProject.setRawClasspath(entries, null);
      javaProject.makeConsistent(null);
    //}

    if(!status.isOK()){
      errors.add(new Error(status.getMessage(), classpath, 1, 1, false));
    }
    return errors;
  }
View Full Code Here

      int[] position = offsets.offsetToLineColumn(matcher.start());
      line = position[0];
      col = position[1];
    }

    return new Error(status.getMessage(), filename, line, col, false);
  }
View Full Code Here

            if(pkg == null){
              IType type = project.findType(name);
              if(type == null || !type.exists()){
                String message =
                  Services.getMessage("log4j.logger.name.invalid", name);
                errors.add(new Error(
                      message, file, locator.getLineNumber(), 1, false
                ));
              }
            }
          }
        }else if(PRIORITY.equals(localName) || LEVEL.equals(localName)){
          String value = atts.getValue(VALUE);
          if(atts.getValue(CLASS) == null && value != null){
            if(!LEVELS.contains(value.trim().toLowerCase())){
              String message =
                Services.getMessage("log4j.level.name.invalid", value);
              errors.add(new Error(
                    message, file, locator.getLineNumber(), 1, false
              ));
            }
          }
        }

        // validate any class attributes.
        String classname = atts.getValue(CLASS);
        if(classname != null){
          IType type = project.findType(classname);
          if(type == null || !type.exists()){
            String message = Services.getMessage("type.not.found",
                project.getElementName(), classname);
            errors.add(new Error(
                  message, file, locator.getLineNumber(), 1, false
            ));
          }
        }
      }catch(Exception e){
View Full Code Here

    List<IProblem> problems = requestor.getProblems();
    FileOffsets offsets = FileOffsets.compile(filepath);
    for (IProblem problem : problems){
      int[] lineColumn = offsets.offsetToLineColumn(problem.getOffset());
      Error error = new Error(
        problem.getUnmodifiedMessage(), filepath,
        lineColumn[0], lineColumn[1],
        problem.isWarning());
      if(!errors.contains(error)){
        errors.add(error);
View Full Code Here

        // one day vim might support ability to mark the offending text.
        /*int[] endLineColumn =
          offsets.offsetToLineColumn(problem.getSourceEnd());*/

        errors.add(new Error(
            problem.getMessage(),
            filename,
            lineColumn[0],
            lineColumn[1],
            problem.isWarning()));
View Full Code Here

        if (problem.getID() == IProblem.Task){
          continue;
        }

        int[] lineColumn = offsets.offsetToLineColumn(problem.getSourceStart());
        errors.add(new Error(
            problem.getMessage(),
            filename,
            lineColumn[0],
            lineColumn[1],
            problem.isWarning()));
View Full Code Here

    ArrayList<Error> results = new ArrayList<Error>();
    String[] lines = StringUtils.split(out.toString(), '\n');
    for (int ii = 0; ii < lines.length; ii++){
      if(accept(lines[ii])){
        Error error = parseError(file, lines[ii]);
        if(error != null){
          results.add(error);
        }
      }
    }
View Full Code Here

    String[] parts = StringUtils.split(line, ':');

    if (parts.length == 5){
      int lnum = Integer.parseInt(parts[1].replaceAll(",", ""));
      int cnum = Integer.parseInt(parts[2].replaceAll(",", ""));
      return new Error(
        parts[4].trim(), file, lnum, cnum,
        parts[3].trim().equals("Warning")
      );
    }
    return null;
View Full Code Here

      for (Object o : messages[ii].getNestedMessages()){
        ValidationMessage nested = (ValidationMessage)o;
        message.append(' ').append(nested.getMessage());
      }

      results.add(new Error(
            message.toString(),
            toFile(messages[ii].getUri()),
            messages[ii].getLineNumber(),
            messages[ii].getColumnNumber(),
            false//messages[ii].getSeverity() != ValidationMessage.SEV_HIGH
View Full Code Here

TOP

Related Classes of org.eclim.command.Error

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.