Skip to content

Commit

Permalink
WINDUP-137 Use "// @Formatter:off" —— "// @Formatter:on" around the g…
Browse files Browse the repository at this point in the history
…etConfiguration() methods in rule providers

Task #WINDUP-137 - use "// @Formatter:off"  —— "// @Formatter:on" around the getConfiguration() methods in rule providers
  • Loading branch information
OndraZizka committed Jul 23, 2014
1 parent e7dbfc4 commit 10dbcad
Show file tree
Hide file tree
Showing 33 changed files with 195 additions and 162 deletions.
Expand Up @@ -50,6 +50,7 @@ public void enhanceMetadata(Context context)
context.put(RuleMetadata.CATEGORY, "Java");
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
Expand Down
Expand Up @@ -34,6 +34,7 @@ public RulePhase getPhase()
return RulePhase.DISCOVERY;
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
Expand Down Expand Up @@ -74,6 +75,8 @@ public void perform(GraphRewrite event, EvaluationContext context)
);
return configuration;
}
// @formatter:on


public List<MavenProjectModel> getSearchResults()
{
Expand Down
Expand Up @@ -46,6 +46,7 @@ public RulePhase getPhase()
return RulePhase.DISCOVERY;
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
Expand Down
Expand Up @@ -38,6 +38,7 @@ public RulePhase getPhase()
return RulePhase.DISCOVERY;
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
Expand Down
Expand Up @@ -33,6 +33,7 @@ public RulePhase getPhase()
return RulePhase.DISCOVERY;
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
Expand All @@ -59,6 +60,7 @@ public void perform(GraphRewrite event, EvaluationContext context)
);
return configuration;
}
// @formatter:on

public List<XmlMetaFacetModel> getTypeSearchResults()
{
Expand Down
Expand Up @@ -33,11 +33,11 @@ public RulePhase getPhase()
return RulePhase.DISCOVERY;
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
Configuration configuration = ConfigurationBuilder
.begin()
Configuration configuration = ConfigurationBuilder.begin()
.addRule()
.when(Query.find(XmlMetaFacetModel.class)
.withProperty(XmlMetaFacetModel.PROPERTY_ROOT_TAG_NAME,
Expand All @@ -59,6 +59,7 @@ public void perform(GraphRewrite event, EvaluationContext context)
);
return configuration;
}
// @formatter:on

public List<XmlMetaFacetModel> getTypeSearchResults()
{
Expand Down
Expand Up @@ -35,6 +35,7 @@ public boolean handles(Object payload)
return payload instanceof GraphContext;
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
Expand Down
Expand Up @@ -28,15 +28,17 @@ public RulePhase getPhase()
return RulePhase.REPORT_GENERATION;
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
ConditionBuilder findProjectModels = Query
.find(WindupConfigurationModel.class)
.as(CONFIGURATION_MODELS);

AbstractIterationOperation<WindupConfigurationModel> addApplicationReport = new AbstractIterationOperation<WindupConfigurationModel>(
WindupConfigurationModel.class, CONFIGURATION_MODEL)
AbstractIterationOperation<WindupConfigurationModel> addApplicationReport =
new AbstractIterationOperation<WindupConfigurationModel>(
WindupConfigurationModel.class, CONFIGURATION_MODEL)
{
@Override
public void perform(GraphRewrite event, EvaluationContext context, WindupConfigurationModel payload)
Expand All @@ -56,12 +58,13 @@ public void perform(GraphRewrite event, EvaluationContext context, WindupConfigu
.addRule()
.when(findProjectModels)
.perform(
Iteration.over(CONFIGURATION_MODELS).as(CONFIGURATION_MODEL)
.perform(addApplicationReport).endIteration()
Iteration.over(CONFIGURATION_MODELS).as(CONFIGURATION_MODEL)
.perform(addApplicationReport).endIteration()
);

}
// @formatter:on


private ApplicationReportModel createApplicationReport(GraphContext context, ProjectModel projectModel)
{
ApplicationReportModel applicationReportModel = context.getFramed().addVertex(null,
Expand Down
Expand Up @@ -45,6 +45,7 @@ public RulePhase getPhase()
return RulePhase.REPORT_GENERATION;
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
Expand All @@ -57,8 +58,7 @@ public Configuration getConfiguration(GraphContext context)

GraphOperation addSourceReport = new AbstractIterationOperation<FileModel>(FileModel.class, "fileModel")
{
public void perform(GraphRewrite event, EvaluationContext context,
FileModel payload)
public void perform(GraphRewrite event, EvaluationContext context, FileModel payload)
{
SourceReportModel sm = sourceReportService.create();
ReportFileModel reportFileModel = GraphService.addTypeToModel(event.getGraphContext(), payload,
Expand All @@ -69,15 +69,16 @@ public void perform(GraphRewrite event, EvaluationContext context,
}
};

return ConfigurationBuilder
.begin()
.addRule()
.when(finder)
.perform(
Iteration.over("fileModels")
.as("fileModel")
.perform(addSourceReport).endIteration());
return ConfigurationBuilder.begin()
.addRule()
.when(finder)
.perform(
Iteration.over("fileModels").as("fileModel")
.perform(addSourceReport).endIteration()
);
}
// @formatter:on


private String resolveSourceType(FileModel f)
{
Expand Down
Expand Up @@ -38,6 +38,7 @@ public RulePhase getPhase()
return RulePhase.REPORT_RENDERING;
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
Expand All @@ -63,6 +64,7 @@ public void perform(GraphRewrite event,
);
return configuration;
}
// @formatter:on

private void copyCssResourcesToOutput(String outputDir)
{
Expand Down
Expand Up @@ -44,6 +44,7 @@ public RulePhase getPhase()
return RulePhase.REPORT_RENDERING;
}

// @formatter:off
@Override
public List<Class<? extends WindupRuleProvider>> getClassDependencies()
{
Expand All @@ -53,8 +54,9 @@ public List<Class<? extends WindupRuleProvider>> getClassDependencies()
@Override
public Configuration getConfiguration(GraphContext context)
{
AbstractIterationOperation<ApplicationReportModel> setupTemplateOperation = new AbstractIterationOperation<ApplicationReportModel>(
ApplicationReportModel.class, APP_REPORT_VAR)
AbstractIterationOperation<ApplicationReportModel> setupTemplateOperation =
new AbstractIterationOperation<ApplicationReportModel>(
ApplicationReportModel.class, APP_REPORT_VAR)
{
@Override
public void perform(GraphRewrite event, EvaluationContext context, ApplicationReportModel payload)
Expand All @@ -70,11 +72,13 @@ public void perform(GraphRewrite event, EvaluationContext context, ApplicationRe
FreeMarkerIterationOperation reportOperation = FreeMarkerIterationOperation.create(furnace, APP_REPORT_VAR);

return ConfigurationBuilder
.begin()
.addRule()
.when(Query.find(ApplicationReportModel.class).as(APP_REPORTS_VAR))
.perform(Iteration.over(APP_REPORTS_VAR).as(APP_REPORT_VAR)
.perform(setupTemplateOperation.and(reportOperation))
.endIteration());
.begin()
.addRule()
.when(Query.find(ApplicationReportModel.class).as(APP_REPORTS_VAR))
.perform(
Iteration.over(APP_REPORTS_VAR).as(APP_REPORT_VAR)
.perform(setupTemplateOperation.and(reportOperation))
.endIteration());
}
// @formatter:on
}
Expand Up @@ -42,17 +42,17 @@ public List<Class<? extends WindupRuleProvider>> getClassDependencies()
return generateDependencies(RenderApplicationReportRuleProvider.class);
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
FreeMarkerOperation generateReportOperation = FreeMarkerOperation.create(furnace, TEMPLATE_PATH,
OUTPUT_FILENAME,
VAR_APPLICATION_REPORTS);

return ConfigurationBuilder
.begin()
.addRule()
.when(Query.find(ApplicationReportModel.class).as(VAR_APPLICATION_REPORTS))
.perform(generateReportOperation);
FreeMarkerOperation generateReportOperation =
FreeMarkerOperation.create(TEMPLATE_PATH, OUTPUT_FILENAME, VAR_APPLICATION_REPORTS);

return ConfigurationBuilder.begin()
.addRule()
.when(Query.find(ApplicationReportModel.class).as(VAR_APPLICATION_REPORTS))
.perform(generateReportOperation);
}
// @formatter:on
}
Expand Up @@ -43,6 +43,7 @@ public RulePhase getPhase()
return RulePhase.REPORT_RENDERING;
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
Expand Down Expand Up @@ -76,4 +77,5 @@ public void perform(GraphRewrite event, EvaluationContext context, final SourceR
.create(furnace, "sourceReport"))).endIteration()
);
}
// @formatter:on
}
Expand Up @@ -17,19 +17,19 @@ public RulePhase getPhase()
return RulePhase.INITIAL_ANALYSIS;
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
return ConfigurationBuilder.begin()
.addRule()
.when(
Query.find(ArchiveModel.class).as("allUnzippedArchives")
).perform(
Iteration.over("allUnzippedArchives").as(ArchiveModel.class, "archive")
.perform(new ProcyonDecompilerOperation("archive"))
.endIteration()
);

.addRule()
.when(
Query.find(ArchiveModel.class).as("allUnzippedArchives")
).perform(
Iteration.over("allUnzippedArchives").as(ArchiveModel.class, "archive")
.perform(new ProcyonDecompilerOperation("archive"))
.endIteration()
);
}

// @formatter:on
}
Expand Up @@ -32,6 +32,7 @@ public void enhanceMetadata(Context context)
context.put(RuleMetadata.CATEGORY, "Java");
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
Expand Down Expand Up @@ -107,4 +108,5 @@ public Configuration getConfiguration(GraphContext context)

return configuration;
}
// @formatter:on
}
Expand Up @@ -30,6 +30,7 @@ public void enhanceMetadata(Context context)
context.put(RuleMetadata.CATEGORY, "Java");
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
Expand Down Expand Up @@ -266,4 +267,5 @@ public Configuration getConfiguration(GraphContext context)

return configuration;
}
// @formatter:on
}
Expand Up @@ -31,6 +31,7 @@ public void enhanceMetadata(Context context)
context.put(RuleMetadata.CATEGORY, "Java");
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
Expand All @@ -51,4 +52,5 @@ public Configuration getConfiguration(GraphContext context)
.addRule().perform(new ASTEventEvaluatorsBufferOperation().add(classifications).add(hints));
return configuration;
}
// @formatter:on
}
Expand Up @@ -29,6 +29,7 @@ public void enhanceMetadata(Context context)
context.put(RuleMetadata.CATEGORY, "Java");
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
Expand All @@ -39,6 +40,6 @@ public Configuration getConfiguration(GraphContext context)
Configuration configuration = ConfigurationBuilder.begin()
.addRule().perform(new ASTEventEvaluatorsBufferOperation().add(classifications));
return configuration;

}
// @formatter:on
}
Expand Up @@ -29,6 +29,7 @@ public void enhanceMetadata(Context context)
context.put(RuleMetadata.CATEGORY, "Java");
}

// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
Expand Down Expand Up @@ -210,6 +211,6 @@ public Configuration getConfiguration(GraphContext context)
Configuration configuration = ConfigurationBuilder.begin()
.addRule().perform(new ASTEventEvaluatorsBufferOperation().add(hints));
return configuration;

}
// @formatter:on
}

0 comments on commit 10dbcad

Please sign in to comment.