[forge-issues] [JBoss JIRA] (ROASTER-96) Creating new Java class should have empty line after java imports

George Gastaldi (JIRA) issues at jboss.org
Mon Mar 7 08:31:00 EST 2016


     [ https://issues.jboss.org/browse/ROASTER-96?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

George Gastaldi updated ROASTER-96:
-----------------------------------
    Component/s: Formatter
                 JDT


> Creating new Java class should have empty line after java imports
> -----------------------------------------------------------------
>
>                 Key: ROASTER-96
>                 URL: https://issues.jboss.org/browse/ROASTER-96
>             Project: Roaster
>          Issue Type: Enhancement
>          Components: Formatter, JDT
>    Affects Versions: 2.18.2.Final
>            Reporter: Claus Ibsen
>            Priority: Minor
>
> I have a forge addon that creates a new java class using a wizard. An example of the generated code is below
> {code}
> [foo]$ cat src/main/java/org/foo/MyValidatorComponentFactory.java
> package org.foo;
> import org.springframework.beans.factory.config.BeanDefinition;
> import org.springframework.beans.factory.annotation.Qualifier;
> import org.springframework.context.annotation.Bean;
> import org.springframework.context.annotation.Scope;
> import org.springframework.stereotype.Component;
> import org.apache.camel.component.validator.ValidatorComponent;
> @Component
> public class MyValidatorComponentFactory {
> 	@Qualifier("validator")
> 	@Bean
> 	@Scope(BeanDefinition.SCOPE_SINGLETON)
> 	public ValidatorComponent createMyValidatorComponent() throws Exception {
> 		ValidatorComponent component = new ValidatorComponent();
> 		return component;
> 	}
> }
> {code}
> Notice how there is no empty line between the java imports and the class singnature. It would be great if forge could do this automatic, eg
> {code}
> import org.apache.camel.component.validator.ValidatorComponent;
> @Component
> public class MyValidatorComponentFactory {
> {code}
> Should be
> {code}
> import org.apache.camel.component.validator.ValidatorComponent;
> @Component
> public class MyValidatorComponentFactory {
> {code}
> This is the code that generates that source
> https://github.com/fabric8io/fabric8-forge/blob/master/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCommandsHelper.java#L211
> PS: We have similar for generating code in CDI style instead of spring style.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the forge-issues mailing list