Examples of SMInputCursor


Examples of org.codehaus.staxmate.in.SMInputCursor

          }
          catch(com.ctc.wstx.exc.WstxEOFException eofExc){
            throw new EmptyReportException();
          }

          SMInputCursor fileCursor = rootCursor.childElementCursor("file");
          while (fileCursor.getNext() != null) {
            String name = fileCursor.getAttrValue("name");

            CxxUtils.LOG.info("Vera++ processes file = " + name);
            SMInputCursor errorCursor = fileCursor.childElementCursor("error");
            while (errorCursor.getNext() != null) {
              if (!name.equals("error")) {
                String line = errorCursor.getAttrValue("line");
                String message = errorCursor.getAttrValue("message");
                String source = errorCursor.getAttrValue("source");

                saveUniqueViolation(project, context, CxxVeraxxRuleRepository.KEY,
                                    name, line, source, message);
              } else {
                CxxUtils.LOG.debug("Error in file '{}', with message '{}'",
                    errorCursor.getAttrValue("line"),
                    errorCursor.getAttrValue("message"));
              }
            }
          }
        }
      });
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

  };

  private ValgrindError parseErrorTag(SMInputCursor error)
      throws javax.xml.stream.XMLStreamException
  {
    SMInputCursor child = error.childElementCursor();

    String kind = null;
    String text = null;
    ValgrindStack stack = null;
    while (child.getNext() != null) {
      String tagName = child.getLocalName();
      if ("kind".equalsIgnoreCase(tagName)) {
        kind = child.getElemStringValue();
      } else if ("xwhat".equalsIgnoreCase(tagName)) {
        text = child.childElementCursor("text").advance().getElemStringValue();
      } else if ("what".equalsIgnoreCase(tagName)) {
        text = child.getElemStringValue();
      } else if ("stack".equalsIgnoreCase(tagName)) {
        stack = parseStackTag(child);
      }
    }

    if (text == null || kind == null || stack == null) {
      String msg = "Valgrind error is incomplete: we require all of 'kind', '*what.text' and 'stack'";
      child.throwStreamException(msg);
    }

    return new ValgrindError(kind, text, stack);
  }
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

  private ValgrindStack parseStackTag(SMInputCursor child)
      throws javax.xml.stream.XMLStreamException
  {
    ValgrindStack stack = new ValgrindStack();
    SMInputCursor frameCursor = child.childElementCursor("frame");
    while (frameCursor.getNext() != null) {

      SMInputCursor frameChild = frameCursor.childElementCursor();

      String ip = null;
      String obj = null;
      String fn = null;
      String dir = null;
      String file = null;
      String line = null;

      while (frameChild.getNext() != null) {
        String tagName = frameChild.getLocalName();

        if ("ip".equalsIgnoreCase(tagName)) {
          ip = frameChild.getElemStringValue();
        } else if ("obj".equalsIgnoreCase(tagName)) {
          obj = frameChild.getElemStringValue();
        } else if ("fn".equalsIgnoreCase(tagName)) {
          fn = frameChild.getElemStringValue();
        } else if ("dir".equalsIgnoreCase(tagName)) {
          dir = frameChild.getElemStringValue();
        } else if ("file".equalsIgnoreCase(tagName)) {
          file = frameChild.getElemStringValue();
        } else if ("line".equalsIgnoreCase(tagName)) {
          line = frameChild.getElemStringValue();
        }
      }
      stack.addFrame(new ValgrindFrame(ip, obj, fn, dir, file, line));
    }
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

      }
      catch(com.ctc.wstx.exc.WstxEOFException eofExc){
        throw new EmptyReportException();
      }

      SMInputCursor errorCursor = rootCursor.childElementCursor("error");

      while (errorCursor.getNext() != null) {
        valgrindErrors.add(parseErrorTag(errorCursor));
      }
    }
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

    }
  } 
 
  private void recTreeTopWalk(File fileName, SMInputCursor folder, final Map<String, CoverageMeasuresBuilder> coverageData)
      throws XMLStreamException {
    SMInputCursor child = folder.childElementCursor();
    while (child.getNext() != null) {
        CoverageMeasuresBuilder fileMeasuresBuilderIn = CoverageMeasuresBuilder.create();
               
        funcWalk(child, fileMeasuresBuilderIn);
           
        String normalPath = CxxUtils.normalizePath(fileName.getPath());
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

    updateMeasures(kind, event, line, fileMeasuresBuilderIn);
    prevLine = line;
  }

  private void funcWalk(SMInputCursor func, CoverageMeasuresBuilder fileMeasuresBuilderIn) throws XMLStreamException {
    SMInputCursor prob = func.childElementCursor();
    while (prob.getNext() != null) {
      probWalk(prob, fileMeasuresBuilderIn);
    }
    saveConditions(fileMeasuresBuilderIn);
  }
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

    }
    saveConditions(fileMeasuresBuilderIn);
  }

  private void fileWalk(SMInputCursor file, CoverageMeasuresBuilder fileMeasuresBuilderIn) throws XMLStreamException {
    SMInputCursor func = file.childElementCursor();
    while (func.getNext() != null) {
      funcWalk(func, fileMeasuresBuilderIn);
    }
  }
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

  private void recTreeWalk(String refPath, SMInputCursor folder, List<String> path, final Map<String, CoverageMeasuresBuilder> coverageData)
      throws XMLStreamException {
   
    refPath = ensureRefPathIsCorrect(refPath);
   
    SMInputCursor child = folder.childElementCursor();
    while (child.getNext() != null) {
      String folderChildName = child.getLocalName();
      String name = child.getAttrValue("name");
      path.add(name);
      if (folderChildName.equalsIgnoreCase("src")) {
        String fileName = "";
        Iterator<String> iterator = path.iterator();
        while (iterator.hasNext()) {
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

    }
  }

  private void handleModuleItems(SMInputCursor module, Map<String, CoverageMeasuresBuilder> coverageData)
    throws XMLStreamException {
    SMInputCursor child = module.childElementCursor();
    while (child.getNext() != null) {
      String name = child.getLocalName();
      if (name.equalsIgnoreCase("functions")) {
        collectFunctionMeasures(child, coverageData);
      } else if (name.equalsIgnoreCase("source_files")) {
        collectSourceFileMeasures(child, coverageData);
      }
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

    }
  }

  private void collectSourceFileMeasures(SMInputCursor sourceFiles, Map<String, CoverageMeasuresBuilder> coverageData)
    throws XMLStreamException {
    SMInputCursor sourceFile = sourceFiles.childElementCursor("source_file");
    while (sourceFile.getNext() != null) {
      String id = sourceFile.getAttrValue("id");
      String normalPath = CxxUtils.normalizePath(sourceFile.getAttrValue("path"));
      CoverageMeasuresBuilder builder = coverageData.remove(id);
      if (normalPath != null) {
        coverageData.put(normalPath, builder); // replace id with path
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.