Issue Automated g4 rollback of changelist
*** Reason for rollback ***
This change breaks use of --no-package-directories flag.
*** Original change description ***
Always generate package-based header paths for library imports.
@@ -165,11 +165,7 @@ public class HeaderMap {
String name = inferSourceName(type);
PackageElement pkg = ElementUtil.getPackage(type);
- String pkgDir = outputDirFromPackage(pkg);
- if (pkgDir.isEmpty() && pkg != null && !pkg.isUnnamed()) {
- pkgDir = outputDirFromPackage(pkg, OutputStyleOption.PACKAGE);
- }
- return pkgDir + name + ".h";
+ return outputDirFromPackage(pkg) + name + ".h";
}
/**
@@ -210,13 +206,12 @@ public class HeaderMap {
// mapping.
style = OutputStyleOption.PACKAGE;
}
- return outputDirFromPackage(pkg, style);
+ switch (style) {
+ case PACKAGE:
+ return ElementUtil.getName(pkg).replace('.', File.separatorChar) + File.separatorChar;
+ default:
+ return "";
}
-
- private String outputDirFromPackage(PackageElement pkg, OutputStyleOption style) {
- return style == OutputStyleOption.PACKAGE
- ? ElementUtil.getName(pkg).replace('.', File.separatorChar) + File.separatorChar
- : "";
}
public void put(String qualifiedName, String header) {
