Lines 57-63
Link Here
|
57 |
import java.util.LinkedList; |
57 |
import java.util.LinkedList; |
58 |
import java.util.List; |
58 |
import java.util.List; |
59 |
import java.util.Set; |
59 |
import java.util.Set; |
60 |
import java.util.Stack; |
|
|
61 |
import java.util.logging.Level; |
60 |
import java.util.logging.Level; |
62 |
import java.util.logging.Logger; |
61 |
import java.util.logging.Logger; |
63 |
import javax.tools.FileObject; |
62 |
import javax.tools.FileObject; |
Lines 65-70
Link Here
|
65 |
import javax.tools.JavaFileObject; |
64 |
import javax.tools.JavaFileObject; |
66 |
import javax.tools.StandardLocation; |
65 |
import javax.tools.StandardLocation; |
67 |
import org.netbeans.api.annotations.common.NonNull; |
66 |
import org.netbeans.api.annotations.common.NonNull; |
|
|
67 |
import org.netbeans.api.annotations.common.NullAllowed; |
68 |
import org.netbeans.modules.java.source.util.Iterators; |
68 |
import org.netbeans.modules.java.source.util.Iterators; |
69 |
|
69 |
|
70 |
/** |
70 |
/** |
Lines 97-102
Link Here
|
97 |
private final JavaFileManager aptSources; |
97 |
private final JavaFileManager aptSources; |
98 |
private final MemoryFileManager memoryFileManager; |
98 |
private final MemoryFileManager memoryFileManager; |
99 |
private final JavaFileManager outputhPath; |
99 |
private final JavaFileManager outputhPath; |
|
|
100 |
private final JavaFileManager aptOutput; |
100 |
private final GeneratedFileMarker marker; |
101 |
private final GeneratedFileMarker marker; |
101 |
private final SiblingSource siblings; |
102 |
private final SiblingSource siblings; |
102 |
private JavaFileObject lastInfered; |
103 |
private JavaFileObject lastInfered; |
Lines 107-123
Link Here
|
107 |
|
108 |
|
108 |
|
109 |
|
109 |
/** Creates a new instance of ProxyFileManager */ |
110 |
/** Creates a new instance of ProxyFileManager */ |
110 |
public ProxyFileManager(final JavaFileManager bootPath, |
111 |
public ProxyFileManager( |
111 |
final JavaFileManager classPath, |
112 |
final @NonNull JavaFileManager bootPath, |
112 |
final JavaFileManager sourcePath, |
113 |
final @NonNull JavaFileManager classPath, |
113 |
final JavaFileManager aptSources, |
114 |
final @NullAllowed JavaFileManager sourcePath, |
114 |
final JavaFileManager outputhPath, |
115 |
final @NullAllowed JavaFileManager aptSources, |
115 |
final MemoryFileManager memoryFileManager, |
116 |
final @NullAllowed JavaFileManager aptOutput, |
116 |
final GeneratedFileMarker marker, |
117 |
final @NullAllowed JavaFileManager outputhPath, |
117 |
final SiblingSource siblings) { |
118 |
final @NullAllowed MemoryFileManager memoryFileManager, |
|
|
119 |
final @NonNull GeneratedFileMarker marker, |
120 |
final @NonNull SiblingSource siblings) { |
118 |
assert bootPath != null; |
121 |
assert bootPath != null; |
119 |
assert classPath != null; |
122 |
assert classPath != null; |
120 |
assert memoryFileManager == null || sourcePath != null; |
123 |
assert memoryFileManager == null || sourcePath != null; |
|
|
124 |
assert (aptOutput != null && aptSources != null && sourcePath != null) || (aptOutput == null && aptSources == null); |
121 |
assert marker != null; |
125 |
assert marker != null; |
122 |
assert siblings != null; |
126 |
assert siblings != null; |
123 |
this.bootPath = bootPath; |
127 |
this.bootPath = bootPath; |
Lines 126-131
Link Here
|
126 |
this.aptSources = aptSources; |
130 |
this.aptSources = aptSources; |
127 |
this.memoryFileManager = memoryFileManager; |
131 |
this.memoryFileManager = memoryFileManager; |
128 |
this.outputhPath = outputhPath; |
132 |
this.outputhPath = outputhPath; |
|
|
133 |
this.aptOutput = aptOutput; |
129 |
this.marker = marker; |
134 |
this.marker = marker; |
130 |
this.siblings = siblings; |
135 |
this.siblings = siblings; |
131 |
} |
136 |
} |
Lines 135-178
Link Here
|
135 |
return this.outputhPath == null ? |
140 |
return this.outputhPath == null ? |
136 |
new JavaFileManager[] {this.classPath} : |
141 |
new JavaFileManager[] {this.classPath} : |
137 |
new JavaFileManager[] {this.classPath, this.outputhPath}; |
142 |
new JavaFileManager[] {this.classPath, this.outputhPath}; |
138 |
} |
143 |
} else if (location == StandardLocation.PLATFORM_CLASS_PATH) { |
139 |
else if (location == StandardLocation.PLATFORM_CLASS_PATH) { |
|
|
140 |
return new JavaFileManager[] {this.bootPath}; |
144 |
return new JavaFileManager[] {this.bootPath}; |
141 |
} |
145 |
} else if (location == StandardLocation.SOURCE_PATH && this.sourcePath != null) { |
142 |
else if (location == StandardLocation.SOURCE_PATH && this.sourcePath != null) { |
146 |
final List<JavaFileManager> fms = new ArrayList<JavaFileManager>(4); |
|
|
147 |
fms.add(this.sourcePath); |
148 |
if (this.aptSources != null) { |
149 |
fms.add(this.aptSources); |
150 |
} |
143 |
if (this.memoryFileManager != null) { |
151 |
if (this.memoryFileManager != null) { |
144 |
if (this.aptSources != null) { |
152 |
fms.add(this.memoryFileManager); |
145 |
return new JavaFileManager[] { |
|
|
146 |
this.sourcePath, |
147 |
this.aptSources, |
148 |
this.memoryFileManager |
149 |
}; |
150 |
} |
151 |
else { |
152 |
return new JavaFileManager[] { |
153 |
this.sourcePath, |
154 |
this.memoryFileManager |
155 |
}; |
156 |
} |
157 |
} |
153 |
} |
158 |
else { |
154 |
if (this.aptOutput != null) { |
159 |
if (this.aptSources != null) { |
155 |
fms.add(this.aptOutput); |
160 |
return new JavaFileManager[] {this.sourcePath, this.aptSources}; |
|
|
161 |
} else { |
162 |
return new JavaFileManager[] {this.sourcePath}; |
163 |
} |
164 |
} |
156 |
} |
165 |
} |
157 |
return fms.toArray(new JavaFileManager[fms.size()]); |
166 |
else if (location == StandardLocation.CLASS_OUTPUT && this.outputhPath != null) { |
158 |
} else if (location == StandardLocation.CLASS_OUTPUT && this.outputhPath != null) { |
167 |
return new JavaFileManager[] {this.outputhPath}; |
159 |
return new JavaFileManager[] {this.outputhPath}; |
168 |
} |
160 |
} else if (location == StandardLocation.SOURCE_OUTPUT && this.aptSources != null) { |
169 |
else if (location == StandardLocation.SOURCE_OUTPUT && this.aptSources != null) { |
|
|
170 |
return new JavaFileManager[] {this.aptSources}; |
161 |
return new JavaFileManager[] {this.aptSources}; |
171 |
} |
162 |
} else if (location == SOURCE_PATH_WRITE) { |
172 |
else if (location == SOURCE_PATH_WRITE) { |
|
|
173 |
return new JavaFileManager[] {this.sourcePath}; |
163 |
return new JavaFileManager[] {this.sourcePath}; |
174 |
} |
164 |
} else if (location == ALL) { |
175 |
else if (location == ALL) { |
|
|
176 |
return getAllFileManagers(); |
165 |
return getAllFileManagers(); |
177 |
} |
166 |
} |
178 |
return new JavaFileManager[0]; |
167 |
return new JavaFileManager[0]; |
Lines 189-194
Link Here
|
189 |
if (this.memoryFileManager != null) { |
178 |
if (this.memoryFileManager != null) { |
190 |
result.add(this.memoryFileManager); |
179 |
result.add(this.memoryFileManager); |
191 |
} |
180 |
} |
|
|
181 |
if (this.aptOutput != null) { |
182 |
result.add(this.aptOutput); |
183 |
} |
192 |
result.add(this.bootPath); |
184 |
result.add(this.bootPath); |
193 |
result.add (this.classPath); |
185 |
result.add (this.classPath); |
194 |
if (this.outputhPath!=null) { |
186 |
if (this.outputhPath!=null) { |