Skip to content
This repository was archived by the owner on Nov 12, 2020. It is now read-only.

Commit 202f28b

Browse files
committed
Switch to java7
1 parent a922c38 commit 202f28b

File tree

3 files changed

+36
-47
lines changed

3 files changed

+36
-47
lines changed

gui/pom.xml

+6
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@
142142
<resource>
143143
<directory>src/main/java</directory>
144144
</resource>
145+
<resource>
146+
<directory>${project.build.directory}/generated-sources/ant</directory>
147+
</resource>
148+
<resource>
149+
<directory>${project.build.directory}/generated-sources/apt</directory>
150+
</resource>
145151
</resources>
146152

147153

pom.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@
9191
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
9292
<ballroom.version>1.5.2.Final</ballroom.version>
9393
<gwt.version>2.5.0</gwt.version>
94+
<<<<<<< HEAD
9495
<gwtp.version>0.7</gwtp.version>
96+
=======
97+
<gwtp.version>1.0-RC-2</gwtp.version>
98+
>>>>>>> Switch to java7
9599
<gwt.maven>2.5.0</gwt.maven>
96100
<gwt-log.version>3.2.1</gwt-log.version>
97101
<gwt-vis.version>1.1.1</gwt-vis.version>
@@ -174,7 +178,6 @@
174178
<plugin>
175179
<groupId>org.bsc.maven</groupId>
176180
<artifactId>maven-processor-plugin</artifactId>
177-
<!--<version>2.1.1</version>-->
178181
<version>2.1.2-SNAPSHOT</version>
179182
</plugin>
180183
<plugin>

spi/src/main/java/org/jboss/as/console/spi/SPIProcessor.java

+26-46
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
import javax.annotation.processing.AbstractProcessor;
1717
import javax.annotation.processing.Filer;
18-
import javax.annotation.processing.Messager;
1918
import javax.annotation.processing.ProcessingEnvironment;
2019
import javax.annotation.processing.RoundEnvironment;
2120
import javax.annotation.processing.SupportedSourceVersion;
@@ -24,7 +23,6 @@
2423
import javax.lang.model.element.Element;
2524
import javax.lang.model.element.PackageElement;
2625
import javax.lang.model.element.TypeElement;
27-
import javax.lang.model.type.TypeMirror;
2826
import javax.tools.FileObject;
2927
import javax.tools.JavaFileObject;
3028
import javax.tools.StandardLocation;
@@ -67,51 +65,32 @@ public class SPIProcessor extends AbstractProcessor {
6765

6866

6967
private Filer filer;
70-
private Messager messager;
7168
private ProcessingEnvironment processingEnv;
7269
private List<String> discoveredExtensions;
7370
private List<ExtensionDeclaration> discoveredBindings;
7471
private List<String> discoveredBeanFactories;
7572
private List<String> categoryClasses;
7673
private List<SubsystemExtensionMetaData> subsystemDeclararions;
7774
private List<RuntimeExtensionMetaData> runtimeExtensions;
78-
private Set<String> modules = new LinkedHashSet<String>();
75+
private Set<String> modules = new LinkedHashSet<>();
7976
private Set<String> nameTokens;
80-
private HashMap<String, String> gwtConfigProps;
8177

8278
@Override
8379
public void init(ProcessingEnvironment env) {
8480
this.processingEnv = env;
8581
this.filer = env.getFiler();
86-
this.messager = env.getMessager();
87-
this.discoveredExtensions = new ArrayList<String>();
88-
this.discoveredBindings= new ArrayList<ExtensionDeclaration>();
89-
this.discoveredBeanFactories = new ArrayList<String>();
90-
this.categoryClasses = new ArrayList<String>();
91-
this.subsystemDeclararions = new ArrayList<SubsystemExtensionMetaData>();
92-
this.runtimeExtensions = new ArrayList<RuntimeExtensionMetaData>();
93-
this.nameTokens = new HashSet<String>();
94-
95-
96-
parseGwtProperties();
97-
}
98-
99-
private void parseGwtProperties() {
100-
// GWT config properties
101-
Map<String, String> options = processingEnv.getOptions();
102-
gwtConfigProps = new HashMap<String, String>();
103-
for(String key : options.keySet())
104-
{
105-
if(key.startsWith("gwt."))
106-
{
107-
gwtConfigProps.put(key.substring(4, key.length()), options.get(key));
108-
}
109-
}
82+
this.discoveredExtensions = new ArrayList<>();
83+
this.discoveredBindings= new ArrayList<>();
84+
this.discoveredBeanFactories = new ArrayList<>();
85+
this.categoryClasses = new ArrayList<>();
86+
this.subsystemDeclararions = new ArrayList<>();
87+
this.runtimeExtensions = new ArrayList<>();
88+
this.nameTokens = new HashSet<>();
11089
}
11190

11291
@Override
11392
public Set<String> getSupportedAnnotationTypes() {
114-
Set<String> types = new HashSet<String>();
93+
Set<String> types = new HashSet<>();
11594
types.add(GinExtension.class.getName());
11695
types.add(GinExtensionBinding.class.getName());
11796
types.add(BeanFactoryExtension.class.getName());
@@ -124,6 +103,7 @@ public Set<String> getSupportedAnnotationTypes() {
124103
public boolean process(Set<? extends TypeElement> typeElements, RoundEnvironment roundEnv) {
125104

126105
if(!roundEnv.processingOver()) {
106+
127107
System.out.println("Begin Components discovery ...");
128108

129109
Set<? extends Element> extensionElements = roundEnv.getElementsAnnotatedWith(GinExtension.class);
@@ -245,6 +225,7 @@ private void handleGinExtensionElement(Element element) {
245225
}
246226
}
247227

228+
@SuppressWarnings("unchecked")
248229
private void handleBeanFactoryElement(Element element) {
249230
List<? extends AnnotationMirror> annotationMirrors = element.getAnnotationMirrors();
250231

@@ -254,7 +235,6 @@ private void handleBeanFactoryElement(Element element) {
254235

255236
if ( annotationType.equals(BeanFactoryExtension.class.getName()) )
256237
{
257-
BeanFactoryExtension factory = element.getAnnotation(BeanFactoryExtension.class);
258238
PackageElement packageElement = processingEnv.getElementUtils().getPackageOf(element);
259239
String fqn = packageElement.getQualifiedName().toString()+"."+
260240
element.getSimpleName().toString();
@@ -264,7 +244,7 @@ private void handleBeanFactoryElement(Element element) {
264244
final Collection<? extends AnnotationValue> values = mirror.getElementValues().values();
265245
if (values.size() > 0) {
266246
for (AnnotationValue categoryClass : (List<? extends AnnotationValue>)values.iterator().next().getValue()) {
267-
categoryClasses.add(((TypeMirror)categoryClass.getValue()).toString());
247+
categoryClasses.add(categoryClass.getValue().toString());
268248
}
269249
}
270250
}
@@ -315,7 +295,7 @@ private void writeFiles() throws Exception {
315295
}
316296

317297
private void writeRuntimeFile() throws Exception {
318-
Map<String, Object> model = new HashMap<String, Object>();
298+
Map<String, Object> model = new HashMap<>();
319299
model.put("runtimeMenuItemExtensions", runtimeExtensions);
320300

321301
JavaFileObject sourceFile = filer.createSourceFile(RUNTIME_FILENAME);
@@ -326,7 +306,7 @@ private void writeRuntimeFile() throws Exception {
326306
}
327307

328308
private void writeSubsystemFile() throws Exception{
329-
Map<String, Object> model = new HashMap<String, Object>();
309+
Map<String, Object> model = new HashMap<>();
330310
model.put("subsystemExtensions", subsystemDeclararions);
331311

332312
JavaFileObject sourceFile = filer.createSourceFile(SUBSYSTEM_FILENAME);
@@ -337,7 +317,7 @@ private void writeSubsystemFile() throws Exception{
337317
}
338318

339319
private void writeBeanFactoryFile() throws Exception{
340-
Map<String, Object> model = new HashMap<String, Object>();
320+
Map<String, Object> model = new HashMap<>();
341321
model.put("extensions", discoveredBeanFactories);
342322
model.put("categoryClasses", categoryClasses);
343323

@@ -350,7 +330,7 @@ private void writeBeanFactoryFile() throws Exception{
350330

351331
private void writeBindingFile() throws Exception {
352332
JavaFileObject sourceFile = filer.createSourceFile(BINDING_FILENAME);
353-
Map<String, Object> model = new HashMap<String, Object>();
333+
Map<String, Object> model = new HashMap<>();
354334
model.put("extensions", discoveredBindings);
355335

356336
OutputStream output = sourceFile.openOutputStream();
@@ -362,7 +342,7 @@ private void writeBindingFile() throws Exception {
362342

363343
private void writeGinjectorFile() throws Exception {
364344

365-
Map<String, Object> model = new HashMap<String, Object>();
345+
Map<String, Object> model = new HashMap<>();
366346
model.put("extensions", discoveredExtensions);
367347

368348
JavaFileObject sourceFile = filer.createSourceFile(EXTENSION_FILENAME);
@@ -377,9 +357,9 @@ private void writeModuleFile() {
377357

378358
try
379359
{
380-
Map<String, Object> model = new HashMap<String, Object>();
360+
Map<String, Object> model = new HashMap<>();
381361
model.put("modules", modules);
382-
model.put("properties", gwtConfigProps);
362+
model.put("properties", processingEnv.getOptions());
383363

384364
FileObject sourceFile = filer.createResource(StandardLocation.SOURCE_OUTPUT, MODULE_PACKAGENAME,
385365
MODULE_FILENAME);
@@ -398,9 +378,9 @@ private void writeDevModuleFile() {
398378

399379
try
400380
{
401-
Map<String, Object> model = new HashMap<String, Object>();
381+
Map<String, Object> model = new HashMap<>();
402382
model.put("modules", modules);
403-
model.put("properties", gwtConfigProps);
383+
model.put("properties", processingEnv.getOptions());
404384

405385
FileObject sourceFile = filer.createResource(StandardLocation.SOURCE_OUTPUT, MODULE_PACKAGENAME,
406386
MODULE_DEV_FILENAME);
@@ -419,9 +399,9 @@ private void writeProductModuleFile() {
419399

420400
try
421401
{
422-
Map<String, Object> model = new HashMap<String, Object>();
402+
Map<String, Object> model = new HashMap<>();
423403
model.put("modules", modules);
424-
model.put("properties", gwtConfigProps);
404+
model.put("properties", processingEnv.getOptions());
425405

426406
FileObject sourceFile = filer.createResource(StandardLocation.SOURCE_OUTPUT, MODULE_PACKAGENAME,
427407
MODULE_PRODUCT_FILENAME);
@@ -441,10 +421,10 @@ private void writeProxyConfigurations() {
441421

442422
try
443423
{
444-
String devHostUrl = gwtConfigProps.get("console.dev.host") != null ?
445-
gwtConfigProps.get("console.dev.host") : "127.0.0.1";
424+
String devHostUrl = processingEnv.getOptions().get("console.dev.host") != null ?
425+
processingEnv.getOptions().get("console.dev.host") : "127.0.0.1";
446426

447-
Map<String, Object> model = new HashMap<String, Object>();
427+
Map<String, Object> model = new HashMap<>();
448428
model.put("devHost", devHostUrl);
449429

450430
FileObject sourceFile = filer.createResource(

0 commit comments

Comments
 (0)