langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFileFactory.java
equal
deleted
inserted
replaced
54 */ |
54 */ |
55 static synchronized DocFileFactory getFactory(Configuration configuration) { |
55 static synchronized DocFileFactory getFactory(Configuration configuration) { |
56 DocFileFactory f = factories.get(configuration); |
56 DocFileFactory f = factories.get(configuration); |
57 if (f == null) { |
57 if (f == null) { |
58 JavaFileManager fm = configuration.getFileManager(); |
58 JavaFileManager fm = configuration.getFileManager(); |
59 if (fm instanceof StandardJavaFileManager) |
59 if (fm instanceof StandardJavaFileManager) { |
60 f = new StandardDocFileFactory(configuration); |
60 f = new StandardDocFileFactory(configuration); |
61 else { |
61 } else { |
62 try { |
62 throw new IllegalStateException(); |
63 Class<?> pathFileManagerClass = |
|
64 Class.forName("com.sun.tools.javac.nio.PathFileManager"); |
|
65 if (pathFileManagerClass.isAssignableFrom(fm.getClass())) |
|
66 f = new PathDocFileFactory(configuration); |
|
67 } catch (Throwable t) { |
|
68 throw new IllegalStateException(t); |
|
69 } |
|
70 } |
63 } |
71 factories.put(configuration, f); |
64 factories.put(configuration, f); |
72 } |
65 } |
73 return f; |
66 return f; |
74 } |
67 } |