diff options
author | Benoit Lamarche <benoitlamarche@google.com> | 2014-11-28 18:13:34 +0100 |
---|---|---|
committer | Benoit Lamarche <benoitlamarche@google.com> | 2014-11-28 18:13:34 +0100 |
commit | 75d24293b664edbcf73f24c0ad1d2160e643594e (patch) | |
tree | baa53bbcbbe6d7fe7107033089c58d8535e0a21a /jack/src | |
parent | ad68bb3c5eb0398acb1184650cab65e5e2c9dd60 (diff) | |
download | toolchain_jack-75d24293b664edbcf73f24c0ad1d2160e643594e.zip toolchain_jack-75d24293b664edbcf73f24c0ad1d2160e643594e.tar.gz toolchain_jack-75d24293b664edbcf73f24c0ad1d2160e643594e.tar.bz2 |
Replace getRootDir() by getRootInputVDir(), getRootOutputVDir()...
Also add getRootInputOutputVDir().
This is due to a bug with Javac 6 which does not support this kind
of double interface inheritence with a common factor return type.
Change-Id: Iaee73b316562b1201771eafa2f88c2851386bc45
Diffstat (limited to 'jack/src')
11 files changed, 25 insertions, 23 deletions
diff --git a/jack/src/com/android/jack/backend/ResourceWriter.java b/jack/src/com/android/jack/backend/ResourceWriter.java index 2284951..4b9fd7d 100644 --- a/jack/src/com/android/jack/backend/ResourceWriter.java +++ b/jack/src/com/android/jack/backend/ResourceWriter.java @@ -66,7 +66,7 @@ public class ResourceWriter implements RunnableSchedulable<JSession> { for (Resource resource : resources) { InputVFile inputFile = resource.getVFile(); VPath path = resource.getPath(); - OutputVFile outputFile = outputVDir.getRootDir().createOutputVFile(path); + OutputVFile outputFile = outputVDir.getRootOutputVDir().createOutputVFile(path); InputStream is = inputFile.openRead(); OutputStream os = outputFile.openWrite(); try { diff --git a/jack/src/com/android/jack/backend/dex/DexWritingTool.java b/jack/src/com/android/jack/backend/dex/DexWritingTool.java index be9c037..8aa4aa3 100644 --- a/jack/src/com/android/jack/backend/dex/DexWritingTool.java +++ b/jack/src/com/android/jack/backend/dex/DexWritingTool.java @@ -113,7 +113,7 @@ public abstract class DexWritingTool { dexName = DexFileWriter.DEX_PREFIX + dexCount + FileType.DEX.getFileExtension(); } try { - return outputVfs.getRootDir().createOutputVFile(new VPath(dexName, '/')); + return outputVfs.getRootOutputVDir().createOutputVFile(new VPath(dexName, '/')); } catch (CannotCreateFileException e) { throw new DexWritingException(e); } @@ -165,7 +165,8 @@ public abstract class DexWritingTool { inputVFile = jackOutputLibrary.getFile(FileType.DEX, new VPath(BinaryQualifiedNameFormatter.getFormatter().getName(type), '/')); } else { - inputVFile = getIntermediateDexDir().getRootDir().getInputVFile(DexWriter.getFilePath(type)); + inputVFile = + getIntermediateDexDir().getRootInputVDir().getInputVFile(DexWriter.getFilePath(type)); } return inputVFile; diff --git a/jack/src/com/android/jack/backend/dex/IntermediateDexPerTypeWriter.java b/jack/src/com/android/jack/backend/dex/IntermediateDexPerTypeWriter.java index 1794c5a..67ea05f 100644 --- a/jack/src/com/android/jack/backend/dex/IntermediateDexPerTypeWriter.java +++ b/jack/src/com/android/jack/backend/dex/IntermediateDexPerTypeWriter.java @@ -99,7 +99,7 @@ public class IntermediateDexPerTypeWriter extends DexWriter implements new VPath(BinaryQualifiedNameFormatter.getFormatter().getName(type), '/')); } else { assert intermediateDexDir != null; - vFile = intermediateDexDir.getRootDir().createOutputVFile(getFilePath(type)); + vFile = intermediateDexDir.getRootInputOutputVDir().createOutputVFile(getFilePath(type)); } InputStream is = in.openRead(); @@ -134,7 +134,7 @@ public class IntermediateDexPerTypeWriter extends DexWriter implements new VPath(BinaryQualifiedNameFormatter.getFormatter().getName(type), '/')); } else { assert intermediateDexDir != null; - vFile = intermediateDexDir.getRootDir().createOutputVFile(getFilePath(type)); + vFile = intermediateDexDir.getRootInputOutputVDir().createOutputVFile(getFilePath(type)); } } catch (IOException e) { throw new JackIOException("Could not create Dex file in output " diff --git a/jack/src/com/android/jack/backend/dex/SingleDexWritingTool.java b/jack/src/com/android/jack/backend/dex/SingleDexWritingTool.java index d6c6a4a..060750c 100644 --- a/jack/src/com/android/jack/backend/dex/SingleDexWritingTool.java +++ b/jack/src/com/android/jack/backend/dex/SingleDexWritingTool.java @@ -55,7 +55,7 @@ public class SingleDexWritingTool extends DexWritingTool { inputVFileIt = jackOutputLibrary.iterator(FileType.DEX); } else { List<InputVFile> dexList = new ArrayList<InputVFile>(); - getAllDexFilesFromDir(getIntermediateDexDir().getRootDir(), dexList); + getAllDexFilesFromDir(getIntermediateDexDir().getRootInputVDir(), dexList); inputVFileIt = dexList.iterator(); } diff --git a/jack/src/com/android/jack/experimental/incremental/CompilerState.java b/jack/src/com/android/jack/experimental/incremental/CompilerState.java index 3b79d56..eeba8ee 100644 --- a/jack/src/com/android/jack/experimental/incremental/CompilerState.java +++ b/jack/src/com/android/jack/experimental/incremental/CompilerState.java @@ -141,7 +141,7 @@ public final class CompilerState { try { OutputVFile compilerStateFile = - outputVDir.getRootDir().createOutputVFile(new VPath(COMPILER_STATE_FILENAME, '/')); + outputVDir.getRootOutputVDir().createOutputVFile(new VPath(COMPILER_STATE_FILENAME, '/')); StringBuffer sb = new StringBuffer(); writeMap(sb, javaFileToTypeNamePath); diff --git a/jack/src/com/android/jack/library/JackLibraryFactory.java b/jack/src/com/android/jack/library/JackLibraryFactory.java index 7e6d96b..00e7ac5 100644 --- a/jack/src/com/android/jack/library/JackLibraryFactory.java +++ b/jack/src/com/android/jack/library/JackLibraryFactory.java @@ -88,7 +88,8 @@ public abstract class JackLibraryFactory { Properties libraryProperties = new Properties(); try { - InputVFile libProp = vfs.getRootDir().getInputVFile(JackLibrary.LIBRARY_PROPERTIES_VPATH); + InputVFile libProp = + vfs.getRootInputVDir().getInputVFile(JackLibrary.LIBRARY_PROPERTIES_VPATH); libraryProperties.load(libProp.openRead()); } catch (IOException e) { logger.log(Level.SEVERE, "Fails to read " diff --git a/jack/src/com/android/jack/library/v0000/InputJackLibraryImpl.java b/jack/src/com/android/jack/library/v0000/InputJackLibraryImpl.java index 9a568cb..bd0c7df 100644 --- a/jack/src/com/android/jack/library/v0000/InputJackLibraryImpl.java +++ b/jack/src/com/android/jack/library/v0000/InputJackLibraryImpl.java @@ -102,7 +102,7 @@ public class InputJackLibraryImpl extends InputJackLibrary { try { VPath clonedPath = typePath.clone(); clonedPath.addSuffix(fileType.getFileExtension()); - return vfs.getRootDir().getInputVFile(clonedPath); + return vfs.getRootInputVDir().getInputVFile(clonedPath); } catch (NotFileOrDirectoryException e) { throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType); } catch (NoSuchFileException e) { @@ -115,7 +115,7 @@ public class InputJackLibraryImpl extends InputJackLibrary { public InputVDir getDir(@Nonnull FileType fileType, @Nonnull VPath typePath) throws FileTypeDoesNotExistException { try { - return vfs.getRootDir().getInputVDir(typePath); + return vfs.getRootInputVDir().getInputVDir(typePath); } catch (NotFileOrDirectoryException e) { throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType); } catch (NoSuchFileException e) { @@ -131,7 +131,7 @@ public class InputJackLibraryImpl extends InputJackLibrary { } List<InputVFile> inputVFiles = new ArrayList<InputVFile>(); - fillFiles(vfs.getRootDir(), fileType, inputVFiles); + fillFiles(vfs.getRootInputVDir(), fileType, inputVFiles); return inputVFiles.iterator(); } diff --git a/jack/src/com/android/jack/library/v0000/OutputJackLibraryImpl.java b/jack/src/com/android/jack/library/v0000/OutputJackLibraryImpl.java index f7bcffb..e315534 100644 --- a/jack/src/com/android/jack/library/v0000/OutputJackLibraryImpl.java +++ b/jack/src/com/android/jack/library/v0000/OutputJackLibraryImpl.java @@ -91,7 +91,7 @@ public class OutputJackLibraryImpl extends OutputJackLibrary { addFileType(fileType); VPath clonedPath = typePath.clone(); clonedPath.addSuffix(fileType.getFileExtension()); - return vfs.getRootDir().createOutputVFile(clonedPath); + return vfs.getRootInputOutputVDir().createOutputVFile(clonedPath); } @Override @@ -109,7 +109,7 @@ public class OutputJackLibraryImpl extends OutputJackLibrary { public void close() throws LibraryIOException { try { OutputVFile libraryPropertiesOut = - vfs.getRootDir().createOutputVFile(LIBRARY_PROPERTIES_VPATH); + vfs.getRootInputOutputVDir().createOutputVFile(LIBRARY_PROPERTIES_VPATH); libraryProperties.store(libraryPropertiesOut.openWrite(), "Library properties"); } catch (CannotCreateFileException e) { throw new LibraryIOException(getLocation(), e); @@ -132,7 +132,7 @@ public class OutputJackLibraryImpl extends OutputJackLibrary { @Nonnull public Iterator<InputVFile> iterator(@Nonnull FileType fileType) { List<InputVFile> inputVFiles = new ArrayList<InputVFile>(); - fillFiles(vfs.getRootDir(), fileType, inputVFiles); + fillFiles(vfs.getRootInputOutputVDir(), fileType, inputVFiles); return inputVFiles.listIterator(); } @@ -141,7 +141,7 @@ public class OutputJackLibraryImpl extends OutputJackLibrary { public InputVFile getFile(@Nonnull FileType fileType, @Nonnull VPath typePath) throws FileTypeDoesNotExistException { try { - return vfs.getRootDir().getInputVFile(fileType.buildFileVPath(typePath)); + return vfs.getRootInputOutputVDir().getInputVFile(fileType.buildFileVPath(typePath)); } catch (NotFileOrDirectoryException e) { throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType); } catch (NoSuchFileException e) { diff --git a/jack/src/com/android/jack/library/v0001/InputJackLibraryImpl.java b/jack/src/com/android/jack/library/v0001/InputJackLibraryImpl.java index b21e43a..9a25ee7 100644 --- a/jack/src/com/android/jack/library/v0001/InputJackLibraryImpl.java +++ b/jack/src/com/android/jack/library/v0001/InputJackLibraryImpl.java @@ -100,7 +100,7 @@ public class InputJackLibraryImpl extends InputJackLibrary { public InputVFile getFile(@Nonnull FileType fileType, @Nonnull VPath typePath) throws FileTypeDoesNotExistException { try { - return vfs.getRootDir().getInputVFile(fileType.buildFileVPath(typePath)); + return vfs.getRootInputVDir().getInputVFile(fileType.buildFileVPath(typePath)); } catch (NotFileOrDirectoryException e) { throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType); } catch (NoSuchFileException e) { @@ -114,7 +114,7 @@ public class InputJackLibraryImpl extends InputJackLibrary { public InputVDir getDir(@Nonnull FileType fileType, @Nonnull VPath typePath) throws FileTypeDoesNotExistException { try { - return vfs.getRootDir().getInputVDir(fileType.buildDirVPath(typePath)); + return vfs.getRootInputVDir().getInputVDir(fileType.buildDirVPath(typePath)); } catch (NotFileOrDirectoryException e) { throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType); } catch (NoSuchFileException e) { @@ -131,7 +131,7 @@ public class InputJackLibraryImpl extends InputJackLibrary { List<InputVFile> inputVFiles = new ArrayList<InputVFile>(); try { - fillFiles(vfs.getRootDir().getInputVDir(fileType.buildDirVPath(VPath.ROOT)), fileType, + fillFiles(vfs.getRootInputVDir().getInputVDir(fileType.buildDirVPath(VPath.ROOT)), fileType, inputVFiles); } catch (NotFileOrDirectoryException e) { throw new AssertionError( diff --git a/jack/src/com/android/jack/library/v0001/OutputJackLibraryImpl.java b/jack/src/com/android/jack/library/v0001/OutputJackLibraryImpl.java index a84fc01..cbdad89 100644 --- a/jack/src/com/android/jack/library/v0001/OutputJackLibraryImpl.java +++ b/jack/src/com/android/jack/library/v0001/OutputJackLibraryImpl.java @@ -89,7 +89,7 @@ public class OutputJackLibraryImpl extends OutputJackLibrary { throws CannotCreateFileException { putProperty(fileType.buildPropertyName(null /*suffix*/), String.valueOf(true)); addFileType(fileType); - return vfs.getRootDir().createOutputVFile(fileType.buildFileVPath(typePath)); + return vfs.getRootInputOutputVDir().createOutputVFile(fileType.buildFileVPath(typePath)); } @Override @@ -108,7 +108,7 @@ public class OutputJackLibraryImpl extends OutputJackLibrary { OutputStream os = null; try { OutputVFile libraryPropertiesOut = - vfs.getRootDir().createOutputVFile(LIBRARY_PROPERTIES_VPATH); + vfs.getRootInputOutputVDir().createOutputVFile(LIBRARY_PROPERTIES_VPATH); os = libraryPropertiesOut.openWrite(); libraryProperties.store(os, "Library properties"); } catch (CannotCreateFileException e) { @@ -140,7 +140,7 @@ public class OutputJackLibraryImpl extends OutputJackLibrary { @Nonnull public Iterator<InputVFile> iterator(@Nonnull FileType fileType) { List<InputVFile> inputVFiles = new ArrayList<InputVFile>(); - fillFiles(vfs.getRootDir(), fileType, inputVFiles); + fillFiles(vfs.getRootInputOutputVDir(), fileType, inputVFiles); return inputVFiles.listIterator(); } @@ -149,7 +149,7 @@ public class OutputJackLibraryImpl extends OutputJackLibrary { public InputVFile getFile(@Nonnull FileType fileType, @Nonnull VPath typePath) throws FileTypeDoesNotExistException { try { - return vfs.getRootDir().getInputVFile(fileType.buildFileVPath(typePath)); + return vfs.getRootInputOutputVDir().getInputVFile(fileType.buildFileVPath(typePath)); } catch (NotFileOrDirectoryException e) { throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType); } catch (NoSuchFileException e) { diff --git a/jack/src/com/android/jack/resource/ResourceOrMetaImporter.java b/jack/src/com/android/jack/resource/ResourceOrMetaImporter.java index c5c9e04..386190b 100644 --- a/jack/src/com/android/jack/resource/ResourceOrMetaImporter.java +++ b/jack/src/com/android/jack/resource/ResourceOrMetaImporter.java @@ -44,7 +44,7 @@ public abstract class ResourceOrMetaImporter { public void doImport(@Nonnull JSession session) { for (InputVFS resourceDir : resourceDirs) { - importResourceDirElement(resourceDir.getRootDir().list(), session, ""); + importResourceDirElement(resourceDir.getRootInputVDir().list(), session, ""); } } |