Skip to content

Commit

Permalink
Revert "Refactored shading of package names to format(Properties,Stri…
Browse files Browse the repository at this point in the history
…ng)"

This reverts commit 675c485.
  • Loading branch information
gastaldi committed Nov 26, 2014
1 parent 675c485 commit e0c9e47
Showing 1 changed file with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ public static String format(String source)
*/
public static String format(Properties prefs, String source)
{
Properties shadedProperties = applyShadedPackageName(prefs);
final CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(shadedProperties);
final CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(prefs);
return _format(source, codeFormatter);
}

Expand Down Expand Up @@ -142,7 +141,15 @@ private static Properties readConfig(File prefs) throws IOException
InputStream stream = new BufferedInputStream(new FileInputStream(prefs));
try
{
return parseConfig(stream);
Properties config = parseConfig(stream);
Properties modified = new Properties();
String shadePackage = JavaCore.class.getPackage().getName().replaceAll("org\\.eclipse.*$", "");
for (Entry<Object, Object> property : config.entrySet())
{
modified.put(shadePackage + property.getKey(), property.getValue());
}

return modified;
}
catch (IOException e)
{
Expand All @@ -158,18 +165,6 @@ private static Properties readConfig(File prefs) throws IOException
return null;
}

private static Properties applyShadedPackageName(Properties config)
{
Properties modified = new Properties();
String shadePackage = JavaCore.class.getPackage().getName().replaceAll("org\\.eclipse.*$", "");
for (Entry<Object, Object> property : config.entrySet())
{
modified.put(shadePackage + property.getKey(), property.getValue());
}

return modified;
}

private static Properties readConfigInternal(String filename)
{
InputStream stream = new BufferedInputStream(org.jboss.forge.roaster.model.util.Formatter.class
Expand Down

0 comments on commit e0c9e47

Please sign in to comment.