[JBoss JIRA] (ROASTER-112) Roaster.format(Properties, String) doesn't respect formatting properties
by Jakub Niedermertl (JIRA)
Jakub Niedermertl created ROASTER-112:
-----------------------------------------
Summary: Roaster.format(Properties, String) doesn't respect formatting properties
Key: ROASTER-112
URL: https://issues.jboss.org/browse/ROASTER-112
Project: Roaster
Issue Type: Feature Request
Affects Versions: 2.19.0.Final
Environment: pom.xml:
<roaster.version>2.19.0.Final</roaster.version>
<…
[View More]dependency>
<groupId>org.jboss.forge.roaster</groupId>
<artifactId>roaster-api</artifactId>
<version>${roaster.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.forge.roaster</groupId>
<artifactId>roaster-jdt</artifactId>
<version>${roaster.version}</version>
</dependency>
Reporter: Jakub Niedermertl
Roaster.format(Properties, String) is not compatible with constants from org.jboss.forge.roaster._shade.org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants.
The problem is that org.jboss.forge.roaster.Roaster#getFormatters returns list of one element - instance of org.jboss.forge.roaster.spi.FormatterProviderImpl and org.jboss.forge.roaster.spi.FormatterProviderImpl#format(java.util.Properties, java.lang.String) calls Formatter.applyShadedPackageName(properties) that adds another shading prefix to constants that already have it.
E.g. org.jboss.forge.roaster._shade.org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_TAB_CHAR is resolved as "org.jboss.forge.roaster._shade.org.eclipse.jdt.core.formatter.tabulation.char" and Formatter.applyShadedPackageName call results in "org.jboss.forge.roaster._shade.org.jboss.forge.roaster._shade.org.eclipse.jdt.core.formatter.tabulation.char".
Adding dependency on artifact containing original org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants or using raw strings can be a workaround.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
[View Less]