I want to re-format the given piece of code with the new class. I was trying to initialize new InputComponent but it is not accepting. Can anyone help me with this?
RuleViolation rv1 = (RuleViolation) itr.next();
Rule rule1 = rv1.getRule();
RuleKey ruleKey = (RuleKey) resultActiveRules.get(rule1.getRuleSetName() + "/" + rule1.getName());
org.sonar.api.resources.File resource1 = org.sonar.api.resources.File.create(rv1.getFilename());
NewIssue newIssue = (NewIssue)this.resourcePerspectives.as(NewIssue.class, resource1);
if(newIssue != null) {
Issue issue = issuable.forRule(ruleKey).line(rv1.getBeginLine() == 0?null:Integer.valueOf(rv1.getBeginLine())).message(rv1.getDescription()).build();
issuable.addIusse(issue);
}