[JBoss JIRA] (FORGE-2648) XML Attribute not "saved" in the pom.xml
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2648?page=com.atlassian.jira.plugin... ]
George Gastaldi updated FORGE-2648:
-----------------------------------
Description:
I've an addon that generates a Maven plugin configuration for the maven-shade-plugin. This plugin configuration requires XML attributes:
{code:xml}
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource></transformer>
</transformers>
{code}
I create a configuration object that should contain these attributes:
{code:java}
public static Configuration getShadeConfiguration() {
PluginElement manifestTransformer = ConfigurationElementBuilder.create()
.setName("transformer")
.addAttribute("implementation", "org.apache.maven.plugins.shade.resource.ManifestResourceTransformer")
.setText("<manifestEntries>" +
"<Main-Class>io.vertx.core.Launcher</Main-Class>" +
"<Main-Verticle>${verticle.main}</Main-Verticle>" +
"</manifestEntries>");
PluginElement appendingTransformer = ConfigurationElementBuilder.create()
.setName("transformer")
.addAttribute("implementation", "org.apache.maven.plugins.shade.resource.AppendingTransformer")
.setText("<resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>");
ConfigurationElement transformers = ConfigurationElementBuilder.create().setName("transformers")
.addChild(manifestTransformer)
.addChild(appendingTransformer);
Configuration configuration = ConfigurationBuilder.create();
configuration.addConfigurationElement(ConfigurationElementBuilder.create().setName("outputFile").setText("${project" +
".build.directory}/${project.artifactId}-${project.version}-fat.jar"));
configuration.addConfigurationElement(transformers);
return configuration;
}
{code}
But when this configuration is _persisted_ in the Maven `pom.xml` file, the attributes are missing. The rest of the metadata are present.
For completeness here are how is configured the plugin:
{code:java}
builder.addExecution(ExecutionBuilder.create().addGoal("shade").setPhase("package").setId("package-fat-jar").setConfig(configuration));
pluginFacet.addPlugin(builder);
{code}
and in the `pom.xml` file I got only:
{code:xml}
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>package-fat-jar</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<outputFile>${project.build.directory}/${project.artifactId}-${project.version}-fat.jar</outputFile>
<transformers>
<transformer>
<manifestEntries>
<Main-Class>io.vertx.core.Launcher</Main-Class>
<Main-Verticle>${verticle.main}</Main-Verticle>
</manifestEntries>
</transformer>
<transformer>
<resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
{code}
It was working with Forge 2.20.1.Final.
was:
I've an addon that generates a Maven plugin configuration for the maven-shade-plugin. This plugin configuration requires XML attributes:
```
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource></transformer>
</transformers>
```
I create a configuration object that should contain these attributes:
```
public static Configuration getShadeConfiguration() {
PluginElement manifestTransformer = ConfigurationElementBuilder.create()
.setName("transformer")
.addAttribute("implementation", "org.apache.maven.plugins.shade.resource.ManifestResourceTransformer")
.setText("<manifestEntries>" +
"<Main-Class>io.vertx.core.Launcher</Main-Class>" +
"<Main-Verticle>${verticle.main}</Main-Verticle>" +
"</manifestEntries>");
PluginElement appendingTransformer = ConfigurationElementBuilder.create()
.setName("transformer")
.addAttribute("implementation", "org.apache.maven.plugins.shade.resource.AppendingTransformer")
.setText("<resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>");
ConfigurationElement transformers = ConfigurationElementBuilder.create().setName("transformers")
.addChild(manifestTransformer)
.addChild(appendingTransformer);
Configuration configuration = ConfigurationBuilder.create();
configuration.addConfigurationElement(ConfigurationElementBuilder.create().setName("outputFile").setText("${project" +
".build.directory}/${project.artifactId}-${project.version}-fat.jar"));
configuration.addConfigurationElement(transformers);
return configuration;
}
```
But when this configuration is _persisted_ in the Maven `pom.xml` file, the attributes are missing. The rest of the metadata are present.
For completeness here are how is configured the plugin:
```
builder.addExecution(ExecutionBuilder.create().addGoal("shade").setPhase("package").setId("package-fat-jar").setConfig(configuration));
pluginFacet.addPlugin(builder);
```
and in the `pom.xml` file I got only:
```
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>package-fat-jar</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<outputFile>${project.build.directory}/${project.artifactId}-${project.version}-fat.jar</outputFile>
<transformers>
<transformer>
<manifestEntries>
<Main-Class>io.vertx.core.Launcher</Main-Class>
<Main-Verticle>${verticle.main}</Main-Verticle>
</manifestEntries>
</transformer>
<transformer>
<resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
```
It was working with Forge 2.20.1.Final.
> XML Attribute not "saved" in the pom.xml
> ----------------------------------------
>
> Key: FORGE-2648
> URL: https://issues.jboss.org/browse/FORGE-2648
> Project: Forge
> Issue Type: Bug
> Components: Build Tools - Maven
> Affects Versions: 3.2.0.Final
> Reporter: Clement Escoffier
> Fix For: 3.2.1.Final
>
>
> I've an addon that generates a Maven plugin configuration for the maven-shade-plugin. This plugin configuration requires XML attributes:
> {code:xml}
> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
> <resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource></transformer>
> </transformers>
> {code}
> I create a configuration object that should contain these attributes:
> {code:java}
> public static Configuration getShadeConfiguration() {
> PluginElement manifestTransformer = ConfigurationElementBuilder.create()
> .setName("transformer")
> .addAttribute("implementation", "org.apache.maven.plugins.shade.resource.ManifestResourceTransformer")
> .setText("<manifestEntries>" +
> "<Main-Class>io.vertx.core.Launcher</Main-Class>" +
> "<Main-Verticle>${verticle.main}</Main-Verticle>" +
> "</manifestEntries>");
> PluginElement appendingTransformer = ConfigurationElementBuilder.create()
> .setName("transformer")
> .addAttribute("implementation", "org.apache.maven.plugins.shade.resource.AppendingTransformer")
> .setText("<resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>");
> ConfigurationElement transformers = ConfigurationElementBuilder.create().setName("transformers")
> .addChild(manifestTransformer)
> .addChild(appendingTransformer);
> Configuration configuration = ConfigurationBuilder.create();
> configuration.addConfigurationElement(ConfigurationElementBuilder.create().setName("outputFile").setText("${project" +
> ".build.directory}/${project.artifactId}-${project.version}-fat.jar"));
> configuration.addConfigurationElement(transformers);
> return configuration;
> }
> {code}
> But when this configuration is _persisted_ in the Maven `pom.xml` file, the attributes are missing. The rest of the metadata are present.
> For completeness here are how is configured the plugin:
> {code:java}
> builder.addExecution(ExecutionBuilder.create().addGoal("shade").setPhase("package").setId("package-fat-jar").setConfig(configuration));
> pluginFacet.addPlugin(builder);
> {code}
> and in the `pom.xml` file I got only:
> {code:xml}
> <plugin>
> <artifactId>maven-shade-plugin</artifactId>
> <version>2.3</version>
> <executions>
> <execution>
> <id>package-fat-jar</id>
> <phase>package</phase>
> <goals>
> <goal>shade</goal>
> </goals>
> <configuration>
> <outputFile>${project.build.directory}/${project.artifactId}-${project.version}-fat.jar</outputFile>
> <transformers>
> <transformer>
> <manifestEntries>
> <Main-Class>io.vertx.core.Launcher</Main-Class>
> <Main-Verticle>${verticle.main}</Main-Verticle>
> </manifestEntries>
> </transformer>
> <transformer>
> <resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>
> </transformer>
> </transformers>
> </configuration>
> </execution>
> </executions>
> </plugin>
> {code}
> It was working with Forge 2.20.1.Final.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 8 months
[JBoss JIRA] (FORGE-2648) XML Attribute not "saved" in the pom.xml
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2648?page=com.atlassian.jira.plugin... ]
George Gastaldi updated FORGE-2648:
-----------------------------------
Issue Type: Bug (was: Feature Request)
> XML Attribute not "saved" in the pom.xml
> ----------------------------------------
>
> Key: FORGE-2648
> URL: https://issues.jboss.org/browse/FORGE-2648
> Project: Forge
> Issue Type: Bug
> Components: Build Tools - Maven
> Affects Versions: 3.2.0.Final
> Reporter: Clement Escoffier
> Fix For: 3.2.1.Final
>
>
> I've an addon that generates a Maven plugin configuration for the maven-shade-plugin. This plugin configuration requires XML attributes:
> ```
> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
> <resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource></transformer>
> </transformers>
> ```
> I create a configuration object that should contain these attributes:
> ```
> public static Configuration getShadeConfiguration() {
> PluginElement manifestTransformer = ConfigurationElementBuilder.create()
> .setName("transformer")
> .addAttribute("implementation", "org.apache.maven.plugins.shade.resource.ManifestResourceTransformer")
> .setText("<manifestEntries>" +
> "<Main-Class>io.vertx.core.Launcher</Main-Class>" +
> "<Main-Verticle>${verticle.main}</Main-Verticle>" +
> "</manifestEntries>");
> PluginElement appendingTransformer = ConfigurationElementBuilder.create()
> .setName("transformer")
> .addAttribute("implementation", "org.apache.maven.plugins.shade.resource.AppendingTransformer")
> .setText("<resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>");
> ConfigurationElement transformers = ConfigurationElementBuilder.create().setName("transformers")
> .addChild(manifestTransformer)
> .addChild(appendingTransformer);
> Configuration configuration = ConfigurationBuilder.create();
> configuration.addConfigurationElement(ConfigurationElementBuilder.create().setName("outputFile").setText("${project" +
> ".build.directory}/${project.artifactId}-${project.version}-fat.jar"));
> configuration.addConfigurationElement(transformers);
> return configuration;
> }
> ```
> But when this configuration is _persisted_ in the Maven `pom.xml` file, the attributes are missing. The rest of the metadata are present.
> For completeness here are how is configured the plugin:
> ```
> builder.addExecution(ExecutionBuilder.create().addGoal("shade").setPhase("package").setId("package-fat-jar").setConfig(configuration));
> pluginFacet.addPlugin(builder);
> ```
> and in the `pom.xml` file I got only:
> ```
> <plugin>
> <artifactId>maven-shade-plugin</artifactId>
> <version>2.3</version>
> <executions>
> <execution>
> <id>package-fat-jar</id>
> <phase>package</phase>
> <goals>
> <goal>shade</goal>
> </goals>
> <configuration>
> <outputFile>${project.build.directory}/${project.artifactId}-${project.version}-fat.jar</outputFile>
> <transformers>
> <transformer>
> <manifestEntries>
> <Main-Class>io.vertx.core.Launcher</Main-Class>
> <Main-Verticle>${verticle.main}</Main-Verticle>
> </manifestEntries>
> </transformer>
> <transformer>
> <resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>
> </transformer>
> </transformers>
> </configuration>
> </execution>
> </executions>
> </plugin>
> ```
> It was working with Forge 2.20.1.Final.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 8 months
[JBoss JIRA] (FORGE-2648) XML Attribute not "saved" in the pom.xml
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2648?page=com.atlassian.jira.plugin... ]
George Gastaldi updated FORGE-2648:
-----------------------------------
Fix Version/s: 3.2.1.Final
> XML Attribute not "saved" in the pom.xml
> ----------------------------------------
>
> Key: FORGE-2648
> URL: https://issues.jboss.org/browse/FORGE-2648
> Project: Forge
> Issue Type: Feature Request
> Components: Build Tools - Maven
> Affects Versions: 3.2.0.Final
> Reporter: Clement Escoffier
> Fix For: 3.2.1.Final
>
>
> I've an addon that generates a Maven plugin configuration for the maven-shade-plugin. This plugin configuration requires XML attributes:
> ```
> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
> <resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource></transformer>
> </transformers>
> ```
> I create a configuration object that should contain these attributes:
> ```
> public static Configuration getShadeConfiguration() {
> PluginElement manifestTransformer = ConfigurationElementBuilder.create()
> .setName("transformer")
> .addAttribute("implementation", "org.apache.maven.plugins.shade.resource.ManifestResourceTransformer")
> .setText("<manifestEntries>" +
> "<Main-Class>io.vertx.core.Launcher</Main-Class>" +
> "<Main-Verticle>${verticle.main}</Main-Verticle>" +
> "</manifestEntries>");
> PluginElement appendingTransformer = ConfigurationElementBuilder.create()
> .setName("transformer")
> .addAttribute("implementation", "org.apache.maven.plugins.shade.resource.AppendingTransformer")
> .setText("<resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>");
> ConfigurationElement transformers = ConfigurationElementBuilder.create().setName("transformers")
> .addChild(manifestTransformer)
> .addChild(appendingTransformer);
> Configuration configuration = ConfigurationBuilder.create();
> configuration.addConfigurationElement(ConfigurationElementBuilder.create().setName("outputFile").setText("${project" +
> ".build.directory}/${project.artifactId}-${project.version}-fat.jar"));
> configuration.addConfigurationElement(transformers);
> return configuration;
> }
> ```
> But when this configuration is _persisted_ in the Maven `pom.xml` file, the attributes are missing. The rest of the metadata are present.
> For completeness here are how is configured the plugin:
> ```
> builder.addExecution(ExecutionBuilder.create().addGoal("shade").setPhase("package").setId("package-fat-jar").setConfig(configuration));
> pluginFacet.addPlugin(builder);
> ```
> and in the `pom.xml` file I got only:
> ```
> <plugin>
> <artifactId>maven-shade-plugin</artifactId>
> <version>2.3</version>
> <executions>
> <execution>
> <id>package-fat-jar</id>
> <phase>package</phase>
> <goals>
> <goal>shade</goal>
> </goals>
> <configuration>
> <outputFile>${project.build.directory}/${project.artifactId}-${project.version}-fat.jar</outputFile>
> <transformers>
> <transformer>
> <manifestEntries>
> <Main-Class>io.vertx.core.Launcher</Main-Class>
> <Main-Verticle>${verticle.main}</Main-Verticle>
> </manifestEntries>
> </transformer>
> <transformer>
> <resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>
> </transformer>
> </transformers>
> </configuration>
> </execution>
> </executions>
> </plugin>
> ```
> It was working with Forge 2.20.1.Final.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 8 months
[JBoss JIRA] (FORGE-2648) XML Attribute not "saved" in the pom.xml
by Clement Escoffier (JIRA)
Clement Escoffier created FORGE-2648:
----------------------------------------
Summary: XML Attribute not "saved" in the pom.xml
Key: FORGE-2648
URL: https://issues.jboss.org/browse/FORGE-2648
Project: Forge
Issue Type: Feature Request
Components: Build Tools - Maven
Affects Versions: 3.2.0.Final
Reporter: Clement Escoffier
I've an addon that generates a Maven plugin configuration for the maven-shade-plugin. This plugin configuration requires XML attributes:
```
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource></transformer>
</transformers>
```
I create a configuration object that should contain these attributes:
```
public static Configuration getShadeConfiguration() {
PluginElement manifestTransformer = ConfigurationElementBuilder.create()
.setName("transformer")
.addAttribute("implementation", "org.apache.maven.plugins.shade.resource.ManifestResourceTransformer")
.setText("<manifestEntries>" +
"<Main-Class>io.vertx.core.Launcher</Main-Class>" +
"<Main-Verticle>${verticle.main}</Main-Verticle>" +
"</manifestEntries>");
PluginElement appendingTransformer = ConfigurationElementBuilder.create()
.setName("transformer")
.addAttribute("implementation", "org.apache.maven.plugins.shade.resource.AppendingTransformer")
.setText("<resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>");
ConfigurationElement transformers = ConfigurationElementBuilder.create().setName("transformers")
.addChild(manifestTransformer)
.addChild(appendingTransformer);
Configuration configuration = ConfigurationBuilder.create();
configuration.addConfigurationElement(ConfigurationElementBuilder.create().setName("outputFile").setText("${project" +
".build.directory}/${project.artifactId}-${project.version}-fat.jar"));
configuration.addConfigurationElement(transformers);
return configuration;
}
```
But when this configuration is _persisted_ in the Maven `pom.xml` file, the attributes are missing. The rest of the metadata are present.
For completeness here are how is configured the plugin:
```
builder.addExecution(ExecutionBuilder.create().addGoal("shade").setPhase("package").setId("package-fat-jar").setConfig(configuration));
pluginFacet.addPlugin(builder);
```
and in the `pom.xml` file I got only:
```
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>package-fat-jar</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<outputFile>${project.build.directory}/${project.artifactId}-${project.version}-fat.jar</outputFile>
<transformers>
<transformer>
<manifestEntries>
<Main-Class>io.vertx.core.Launcher</Main-Class>
<Main-Verticle>${verticle.main}</Main-Verticle>
</manifestEntries>
</transformer>
<transformer>
<resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
```
It was working with Forge 2.20.1.Final.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 8 months
[JBoss JIRA] (ROASTER-50) Roaster tries to add Generic Type Variable as a java import
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/ROASTER-50?page=com.atlassian.jira.plugin... ]
George Gastaldi commented on ROASTER-50:
----------------------------------------
Thank you for reporting this bug. Can you provide a JUnit test case reproducing this issue?
This should be easy to fix. I'll have a look at it when I get back from vacation in 2 weeks
> Roaster tries to add Generic Type Variable as a java import
> -----------------------------------------------------------
>
> Key: ROASTER-50
> URL: https://issues.jboss.org/browse/ROASTER-50
> Project: Roaster
> Issue Type: Bug
> Reporter: Yusuf Iskenderoglu
> Fix For: 2.x Future
>
>
> When you create a new Method with a Type variable, you cannot use it in a parameter, it crashes with:
> {code}
> Exception in thread "main" java.lang.IllegalArgumentException: Cannot import class without a package [T]
> at org.jboss.forge.roaster.model.impl.AbstractJavaSource.addImport(AbstractJavaSource.java:172)
> at org.jboss.forge.roaster.model.impl.MethodImpl.addParameter(MethodImpl.java:682)
> at de.check24.finance.baufi.roast.main.Roast.parse(Roast.java:225)
> {code}
> This is due to AbstractJavaSource.requiresImport() not returning false for type variables.
> Can you consider this for the next release, too?
> Thanks!
> Related To: ROASTER-48
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 8 months
[JBoss JIRA] (ROASTER-50) Roaster tries to add Generic Type Variable as a java import
by Elis Edlund (JIRA)
[ https://issues.jboss.org/browse/ROASTER-50?page=com.atlassian.jira.plugin... ]
Elis Edlund edited comment on ROASTER-50 at 5/19/16 8:48 AM:
-------------------------------------------------------------
have similar problem but for ReturnType:
{code:java}
MethodSource<JavaClassSource> methodSrc; // public <T> SomeClass<T> methodName(T paramName) {}
MethodSource<JavaClassSource> methodDst; // just an example, I want to create a similar method to above in another generated class.
methodDst.setReturnType(methodSrc.getReturnType()); // Type != JavaType and not castable!
methodDst.setReturnType(methodSrc.getReturnType().getQualifiedNameWithGenerics()); // -> java.lang.IllegalArgumentException: Cannot import class without a package [T]
{code}
BTW this is so critical for me that I will have to replace Roaster with something else as there don't seem exist any workarounds.
basically it seem impossible to create a MethodSource with a return type with generics from scratch,
was (Author: elis.edlund):
have similar problem but for ReturnType:
{code:java}
MethodSource<JavaClassSource> methodSrc; // public <T> SomeClass<T> methodName(T paramName) {}
MethodSource<JavaClassSource> methodDst; // just an example, I want to create a similar method to above in another generated class.
methodDst.setReturnType(methodSrc.getReturnType()); // Type != JavaType and not castable!
methodDst.setReturnType(methodSrc.getReturnType().getQualifiedNameWithGenerics()); // -> java.lang.IllegalArgumentException: Cannot import class without a package [T]
{code}
BTW this is so critical for me that I will have to replace Roaster with something else as there don't seem exist any workarounds.
> Roaster tries to add Generic Type Variable as a java import
> -----------------------------------------------------------
>
> Key: ROASTER-50
> URL: https://issues.jboss.org/browse/ROASTER-50
> Project: Roaster
> Issue Type: Bug
> Reporter: Yusuf Iskenderoglu
> Fix For: 2.x Future
>
>
> When you create a new Method with a Type variable, you cannot use it in a parameter, it crashes with:
> {code}
> Exception in thread "main" java.lang.IllegalArgumentException: Cannot import class without a package [T]
> at org.jboss.forge.roaster.model.impl.AbstractJavaSource.addImport(AbstractJavaSource.java:172)
> at org.jboss.forge.roaster.model.impl.MethodImpl.addParameter(MethodImpl.java:682)
> at de.check24.finance.baufi.roast.main.Roast.parse(Roast.java:225)
> {code}
> This is due to AbstractJavaSource.requiresImport() not returning false for type variables.
> Can you consider this for the next release, too?
> Thanks!
> Related To: ROASTER-48
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 8 months
[JBoss JIRA] (ROASTER-50) Roaster tries to add Generic Type Variable as a java import
by Elis Edlund (JIRA)
[ https://issues.jboss.org/browse/ROASTER-50?page=com.atlassian.jira.plugin... ]
Elis Edlund edited comment on ROASTER-50 at 5/19/16 8:27 AM:
-------------------------------------------------------------
have similar problem but for ReturnType:
{code:java}
MethodSource<JavaClassSource> methodSrc; // public <T> SomeClass<T> methodName(T paramName) {}
MethodSource<JavaClassSource> methodDst; // just an example, I want to create a similar method to above in another generated class.
methodDst.setReturnType(methodSrc.getReturnType()); // Type != JavaType and not castable!
methodDst.setReturnType(methodSrc.getReturnType().getQualifiedNameWithGenerics()); // -> java.lang.IllegalArgumentException: Cannot import class without a package [T]
{code}
BTW this is so critical for me that I will have to replace Roaster with something else as there don't seem exist any workarounds.
was (Author: elis.edlund):
have similar problem but for ReturnType:
MethodSource<JavaClassSource> methodSrc; // public <T> SomeClass<T> methodName(T paramName) {}
MethodSource<JavaClassSource> methodDst; // just an example, I want to create a similar method to above in another generated class.
methodDst.setReturnType(methodSrc.getReturnType()); // Type != JavaType and not castable!
methodDst.setReturnType(methodSrc.getReturnType().getQualifiedNameWithGenerics()); // -> java.lang.IllegalArgumentException: Cannot import class without a package [T]
> Roaster tries to add Generic Type Variable as a java import
> -----------------------------------------------------------
>
> Key: ROASTER-50
> URL: https://issues.jboss.org/browse/ROASTER-50
> Project: Roaster
> Issue Type: Bug
> Reporter: Yusuf Iskenderoglu
> Fix For: 2.x Future
>
>
> When you create a new Method with a Type variable, you cannot use it in a parameter, it crashes with:
> {code}
> Exception in thread "main" java.lang.IllegalArgumentException: Cannot import class without a package [T]
> at org.jboss.forge.roaster.model.impl.AbstractJavaSource.addImport(AbstractJavaSource.java:172)
> at org.jboss.forge.roaster.model.impl.MethodImpl.addParameter(MethodImpl.java:682)
> at de.check24.finance.baufi.roast.main.Roast.parse(Roast.java:225)
> {code}
> This is due to AbstractJavaSource.requiresImport() not returning false for type variables.
> Can you consider this for the next release, too?
> Thanks!
> Related To: ROASTER-48
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 8 months
[JBoss JIRA] (ROASTER-50) Roaster tries to add Generic Type Variable as a java import
by Elis Edlund (JIRA)
[ https://issues.jboss.org/browse/ROASTER-50?page=com.atlassian.jira.plugin... ]
Elis Edlund commented on ROASTER-50:
------------------------------------
have similar problem but for ReturnType:
MethodSource<JavaClassSource> methodSrc; // public <T> SomeClass<T> methodName(T paramName) {}
MethodSource<JavaClassSource> methodDst; // just an example, I want to create a similar method to above in another generated class.
methodDst.setReturnType(methodSrc.getReturnType()); // Type != JavaType and not castable!
methodDst.setReturnType(methodSrc.getReturnType().getQualifiedNameWithGenerics()); // -> java.lang.IllegalArgumentException: Cannot import class without a package [T]
> Roaster tries to add Generic Type Variable as a java import
> -----------------------------------------------------------
>
> Key: ROASTER-50
> URL: https://issues.jboss.org/browse/ROASTER-50
> Project: Roaster
> Issue Type: Bug
> Reporter: Yusuf Iskenderoglu
> Fix For: 2.x Future
>
>
> When you create a new Method with a Type variable, you cannot use it in a parameter, it crashes with:
> {code}
> Exception in thread "main" java.lang.IllegalArgumentException: Cannot import class without a package [T]
> at org.jboss.forge.roaster.model.impl.AbstractJavaSource.addImport(AbstractJavaSource.java:172)
> at org.jboss.forge.roaster.model.impl.MethodImpl.addParameter(MethodImpl.java:682)
> at de.check24.finance.baufi.roast.main.Roast.parse(Roast.java:225)
> {code}
> This is due to AbstractJavaSource.requiresImport() not returning false for type variables.
> Can you consider this for the next release, too?
> Thanks!
> Related To: ROASTER-48
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 8 months
[JBoss JIRA] (FURNACE-114) Dirty checking mechanism
by Sergei Egorov (JIRA)
Sergei Egorov created FURNACE-114:
-------------------------------------
Summary: Dirty checking mechanism
Key: FURNACE-114
URL: https://issues.jboss.org/browse/FURNACE-114
Project: Forge: Furnace
Issue Type: Feature Request
Components: Runtime
Reporter: Sergei Egorov
Right now Furnace by default does two types of dirty checking - version checking and file system watching. These can be extracted, plus dirty checking mechanism can be pluggable, i.e. for non-filesystem implementations of the storage.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 8 months