-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WINDUP-680: Java API Incorrectly Processes Interfaces & WINDUP-681: J…
…ava API Should Provide Marker for Type: Interface, Class
- Loading branch information
Showing
26 changed files
with
574 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
java-ast/tests/src/test/resources/testclasses/simple/EventServer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package testclasses.simple; | ||
|
||
import java.rmi.Remote; | ||
import java.rmi.RemoteException; | ||
|
||
public interface EventServer extends Remote | ||
{ | ||
public String processEvent(String event) throws RemoteException; | ||
|
||
} |
73 changes: 73 additions & 0 deletions
73
...a/org/jboss/windup/reporting/rules/generation/CreateProblemCentricReportRuleProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package org.jboss.windup.reporting.rules.generation; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.jboss.windup.config.AbstractRuleProvider; | ||
import org.jboss.windup.config.GraphRewrite; | ||
import org.jboss.windup.config.metadata.MetadataBuilder; | ||
import org.jboss.windup.config.operation.GraphOperation; | ||
import org.jboss.windup.config.phase.ReportGenerationPhase; | ||
import org.jboss.windup.graph.GraphContext; | ||
import org.jboss.windup.graph.model.ProjectModel; | ||
import org.jboss.windup.graph.model.WindupVertexFrame; | ||
import org.jboss.windup.graph.service.WindupConfigurationService; | ||
import org.jboss.windup.reporting.model.ApplicationReportModel; | ||
import org.jboss.windup.reporting.model.TemplateType; | ||
import org.jboss.windup.reporting.service.ApplicationReportService; | ||
import org.jboss.windup.reporting.service.ReportService; | ||
import org.ocpsoft.rewrite.config.Configuration; | ||
import org.ocpsoft.rewrite.config.ConfigurationBuilder; | ||
import org.ocpsoft.rewrite.context.EvaluationContext; | ||
|
||
/** | ||
* @author <a href="mailto:jesse.sightler@gmail.com">Jesse Sightler</a> | ||
*/ | ||
public class CreateProblemCentricReportRuleProvider extends AbstractRuleProvider | ||
{ | ||
|
||
public static final String TEMPLATE_PATH = "/reports/templates/problem-centric-report.ftl"; | ||
|
||
public CreateProblemCentricReportRuleProvider() | ||
{ | ||
super(MetadataBuilder.forProvider(CreateProblemCentricReportRuleProvider.class) | ||
.setPhase(ReportGenerationPhase.class)); | ||
} | ||
|
||
@Override | ||
public Configuration getConfiguration(GraphContext context) | ||
{ | ||
return ConfigurationBuilder.begin() | ||
.addRule() | ||
.perform(new CreateProblemCentricReportOperation()); | ||
} | ||
|
||
private class CreateProblemCentricReportOperation extends GraphOperation | ||
{ | ||
@Override | ||
public void perform(GraphRewrite event, EvaluationContext context) | ||
{ | ||
// get all classifications | ||
// get all hints | ||
// group them by a title of some kind (classification and hint title) | ||
// do something interesting with this information :) | ||
|
||
ApplicationReportService applicationReportService = new ApplicationReportService(event.getGraphContext()); | ||
ApplicationReportModel report = applicationReportService.create(); | ||
report.setReportPriority(110); | ||
report.setDisplayInApplicationReportIndex(true); | ||
report.setReportName("Migration Issues"); | ||
report.setTemplatePath(TEMPLATE_PATH); | ||
report.setTemplateType(TemplateType.FREEMARKER); | ||
|
||
ProjectModel projectModel = WindupConfigurationService.getConfigurationModel(event.getGraphContext()).getInputPath().getProjectModel(); | ||
report.setProjectModel(projectModel); | ||
|
||
Map<String, WindupVertexFrame> additionalData = new HashMap<>(4); | ||
report.setRelatedResource(additionalData); | ||
|
||
ReportService reportService = new ReportService(event.getGraphContext()); | ||
reportService.setUniqueFilename(report, "problem_centric_report", "html"); | ||
} | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
reporting/impl/src/main/resources/reports/templates/problem-centric-report.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<#assign applicationReportIndexModel = reportModel.applicationReportIndexModel> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>${reportModel.projectModel.name} - Migration Issues</title> | ||
<link href="resources/css/bootstrap.min.css" rel="stylesheet"> | ||
<link href="resources/css/windup.css" rel="stylesheet" media="screen"> | ||
<link href="resources/css/windup.java.css" rel="stylesheet" media="screen"> | ||
</head> | ||
<body role="document"> | ||
<!-- Navbar --> | ||
<div class="navbar navbar-default navbar-fixed-top"> | ||
<div class="navbar-header"> | ||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse"> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
</button> | ||
</div> | ||
|
||
<div class="navbar-collapse collapse navbar-responsive-collapse"> | ||
<ul class="nav navbar-nav"> | ||
<#include "include/navbar.ftl"> | ||
</ul> | ||
</div><!-- /.nav-collapse --> | ||
</div> | ||
<!-- / Navbar --> | ||
|
||
<div class="container-fluid" role="main"> | ||
<div class="row"> | ||
<div class="page-header page-header-no-border"> | ||
<h1>Application Report <span class="slash">/</span><small style="margin-left: 20px; font-weight: 100;">${reportModel.projectModel.name}</small></h1> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<!-- Breadcrumbs --> | ||
<div class="container-fluid"> | ||
<ol class="breadcrumb top-menu"> | ||
<li><a href="../index.html">All Applications</a></li> | ||
<#include "include/breadcrumbs.ftl"> | ||
</ol> | ||
</div> | ||
<!-- / Breadcrumbs --> | ||
</div> | ||
|
||
<div class="row"> | ||
Proprietary IBM JMS Class | ||
</div> | ||
<div class="row"> | ||
Number of incidents | ||
</div> | ||
|
||
<script src="resources/js/jquery-1.10.1.min.js"></script> | ||
<script src="resources/js/bootstrap.min.js"></script> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 9 additions & 7 deletions
16
...n/src/main/java/org/jboss/windup/rules/apps/javaee/model/EnvironmentReferenceTagType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
package org.jboss.windup.rules.apps.javaee.model; | ||
|
||
public enum EnvironmentReferenceTagType | ||
{ | ||
RESOURCE_ENV_REF("resource-env-ref"), RESOURCE_REF("resource-ref"), EJB_REF("ejb-ref"), EJB_LOCAL_REF("ejb-local-ref"), MSG_DESTINATION_REF( | ||
"message-destination-ref"); | ||
|
||
public enum EnvironmentReferenceTagType { | ||
RESOURCE_ENV_REF("resource-env-ref"), RESOURCE_REF("resource-ref"), EJB_REF("ejb-ref"), EJB_LOCAL_REF("ejb-local-ref"), MSG_DESTINATION_REF("message-destination-ref"); | ||
|
||
private final String tag; | ||
|
||
private EnvironmentReferenceTagType(String tag) | ||
{ | ||
this.tag = tag; | ||
} | ||
|
||
public String getTag() | ||
{ | ||
return tag; | ||
} | ||
|
||
public String toString() { | ||
|
||
public String toString() | ||
{ | ||
return name(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.