/** * This essentially ensures that we only store a single Vertex for each unique "Set" of tags. */ public TagSetModel getOrCreate(GraphRewrite event, Set<String> tags) { Map<Set<String>, Vertex> cache = getCache(event); Vertex vertex = cache.get(tags); if (vertex == null) { TagSetModel model = create(); model.setTags(tags); cache.put(tags, model.getElement()); return model; } else { return frame(vertex); } } }
private void createParseFailureClassification(GraphRewrite event, EvaluationContext context, XmlFileModel sourceFile) { sourceFile.setGenerateSourceReport(true); ClassificationService classificationService = new ClassificationService(event.getGraphContext()); ClassificationModel model = classificationService.attachClassification(event, context, sourceFile, XmlFileModel.NOT_VALID_XML, null); model.setEffort(0); // do not rely on default 0 value and set it that transparently IssueCategoryRegistry issueCategoryRegistry = IssueCategoryRegistry.instance(event.getRewriteContext()); model.setIssueCategory(issueCategoryRegistry.loadFromGraph(event.getGraphContext(), IssueCategoryRegistry.POTENTIAL)); TagSetService tagSetService = new TagSetService(event.getGraphContext()); model.setTagModel(tagSetService.getOrCreate(event, Collections.singleton(NOT_VALID_XML_TAG))); } }
private void createParseFailureClassification(GraphRewrite event, EvaluationContext context, XmlFileModel sourceFile) { sourceFile.setGenerateSourceReport(true); ClassificationService classificationService = new ClassificationService(event.getGraphContext()); ClassificationModel model = classificationService.attachClassification(event, context, sourceFile, XmlFileModel.NOT_VALID_XML, null); model.setEffort(0); // do not rely on default 0 value and set it that transparently IssueCategoryRegistry issueCategoryRegistry = IssueCategoryRegistry.instance(event.getRewriteContext()); model.setIssueCategory(issueCategoryRegistry.loadFromGraph(event.getGraphContext(), IssueCategoryRegistry.POTENTIAL)); TagSetService tagSetService = new TagSetService(event.getGraphContext()); model.setTagModel(tagSetService.getOrCreate(event, Collections.singleton(NOT_VALID_XML_TAG))); } }
if (tagModel == null) tagModel = new TagSetService(event.getGraphContext()).getOrCreate(event, this.tags); stats.setTagModel(tagModel); tagModel = new TagSetService(event.getGraphContext()).getOrCreate(event, this.tags); stats.setTagModel(tagModel);
/** * This essentially ensures that we only store a single Vertex for each unique "Set" of tags. */ public TagSetModel getOrCreate(GraphRewrite event, Set<String> tags) { Map<Set<String>, Vertex> cache = getCache(event); Vertex vertex = cache.get(tags); if (vertex == null) { TagSetModel model = create(); model.setTags(tags); cache.put(tags, model.getElement()); return model; } else { return frame(vertex); } } }
if (tagModel == null) tagModel = new TagSetService(event.getGraphContext()).getOrCreate(event, this.tags); stats.setTagModel(tagModel); tagModel = new TagSetService(event.getGraphContext()).getOrCreate(event, this.tags); stats.setTagModel(tagModel);
TagSetService tagSetService = new TagSetService(event.getGraphContext()); classification.setTagModel(tagSetService.getOrCreate(event, tags));
TagSetService tagSetService = new TagSetService(event.getGraphContext()); classification.setTagModel(tagSetService.getOrCreate(event, tags));
TagSetService tagSetService = new TagSetService(event.getGraphContext()); hintModel.setTagModel(tagSetService.getOrCreate(event, tags));
TagSetService tagSetService = new TagSetService(event.getGraphContext()); hintModel.setTagModel(tagSetService.getOrCreate(event, tags));