Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
View | Details | Raw Unified | Return to bug 196104 | Differences between
and this patch

Collapse All | Expand All

(-)a/java.source/src/org/netbeans/api/java/source/ClasspathInfo.java (-6 / +11 lines)
 Lines 82-87    Link Here 
82
import org.netbeans.modules.java.source.classpath.AptCacheForSourceQuery;
82
import org.netbeans.modules.java.source.classpath.AptCacheForSourceQuery;
83
import org.netbeans.modules.java.source.classpath.SourcePath;
83
import org.netbeans.modules.java.source.classpath.SourcePath;
84
import org.netbeans.modules.java.source.indexing.JavaIndex;
84
import org.netbeans.modules.java.source.indexing.JavaIndex;
85
import org.netbeans.modules.java.source.parsing.AptOutputFileManager;
85
import org.netbeans.modules.java.source.parsing.AptSourceFileManager;
86
import org.netbeans.modules.java.source.parsing.AptSourceFileManager;
86
import org.netbeans.modules.java.source.parsing.FileObjects;
87
import org.netbeans.modules.java.source.parsing.FileObjects;
87
import org.netbeans.modules.java.source.parsing.GeneratedFileMarker;
88
import org.netbeans.modules.java.source.parsing.GeneratedFileMarker;
 Lines 126-131    Link Here 
126
    private final ClassPath cachedUserSrcClassPath;
127
    private final ClassPath cachedUserSrcClassPath;
127
    private final ClassPath cachedAptSrcClassPath;
128
    private final ClassPath cachedAptSrcClassPath;
128
    private final ClassPath cachedSrcClassPath; // = cachedUserSrcClassPath + cachedAptSrcClassPath
129
    private final ClassPath cachedSrcClassPath; // = cachedUserSrcClassPath + cachedAptSrcClassPath
130
    private final ClassPath cachedAptOutputClassPath;
131
    private final ClassPath cachedUserAndGenSrcClassPath;
129
    private final ClassPath cachedBootClassPath;
132
    private final ClassPath cachedBootClassPath;
130
    private final ClassPath cachedCompileClassPath;
133
    private final ClassPath cachedCompileClassPath;
131
    private ClassPath outputClassPath;
134
    private ClassPath outputClassPath;
 Lines 165-181    Link Here 
165
	this.cachedBootClassPath.addPropertyChangeListener(WeakListeners.propertyChange(this.cpListener,this.cachedBootClassPath));
168
	this.cachedBootClassPath.addPropertyChangeListener(WeakListeners.propertyChange(this.cpListener,this.cachedBootClassPath));
166
	this.cachedCompileClassPath.addPropertyChangeListener(WeakListeners.propertyChange(this.cpListener,this.cachedCompileClassPath));
169
	this.cachedCompileClassPath.addPropertyChangeListener(WeakListeners.propertyChange(this.cpListener,this.cachedCompileClassPath));
167
        if (srcCp == null) {
170
        if (srcCp == null) {
168
            this.cachedAptSrcClassPath = null;
171
            this.cachedAptSrcClassPath = this.cachedAptOutputClassPath = null;
169
            this.cachedSrcClassPath = this.srcClassPath = this.cachedUserSrcClassPath = EMPTY_PATH;
172
            this.cachedSrcClassPath = this.srcClassPath = this.cachedUserSrcClassPath = this.cachedUserAndGenSrcClassPath = EMPTY_PATH;
170
            this.outputClassPath = EMPTY_PATH;
173
            this.outputClassPath = EMPTY_PATH;
171
        }
174
        } else {
172
        else {
173
            this.srcClassPath = srcCp;
175
            this.srcClassPath = srcCp;
174
            final boolean allowAptRoots = true; //todo: Set by PROCESSOR_PATH != null
176
            final boolean allowAptRoots = true; //todo: Set by PROCESSOR_PATH != null
175
            this.cachedUserSrcClassPath = SourcePath.sources(srcCp, backgroundCompilation);
177
            this.cachedUserSrcClassPath = SourcePath.sources(srcCp, backgroundCompilation);
176
            this.cachedAptSrcClassPath = allowAptRoots ? SourcePath.apt(srcCp, backgroundCompilation) : null;
178
            this.cachedAptSrcClassPath = allowAptRoots ? SourcePath.apt(srcCp, backgroundCompilation) : null;
179
            this.cachedAptOutputClassPath = allowAptRoots ? SourcePath.aptOputput(srcCp, backgroundCompilation) : null;
180
            this.cachedUserAndGenSrcClassPath = allowAptRoots ? ClassPathSupport.createProxyClassPath(this.cachedUserSrcClassPath,this.cachedAptOutputClassPath) : this.cachedUserSrcClassPath;
177
            this.cachedSrcClassPath =    allowAptRoots ? ClassPathSupport.createProxyClassPath(this.cachedUserSrcClassPath,this.cachedAptSrcClassPath) : this.cachedUserSrcClassPath;
181
            this.cachedSrcClassPath =    allowAptRoots ? ClassPathSupport.createProxyClassPath(this.cachedUserSrcClassPath,this.cachedAptSrcClassPath) : this.cachedUserSrcClassPath;
178
            this.outputClassPath = CacheClassPath.forSourcePath (this.cachedUserSrcClassPath);
182
            this.outputClassPath = CacheClassPath.forSourcePath (this.cachedUserAndGenSrcClassPath);
179
	    this.cachedSrcClassPath.addPropertyChangeListener(WeakListeners.propertyChange(this.cpListener,this.cachedSrcClassPath));
183
	    this.cachedSrcClassPath.addPropertyChangeListener(WeakListeners.propertyChange(this.cpListener,this.cachedSrcClassPath));
180
        }
184
        }
181
        this.backgroundCompilation = backgroundCompilation;
185
        this.backgroundCompilation = backgroundCompilation;
 Lines 401-407    Link Here 
401
                hasSources ? (!useModifiedFiles ? new CachingFileManager (this.archiveProvider, this.cachedSrcClassPath, filter, false, ignoreExcludes)
405
                hasSources ? (!useModifiedFiles ? new CachingFileManager (this.archiveProvider, this.cachedSrcClassPath, filter, false, ignoreExcludes)
402
                    : new SourceFileManager (this.cachedUserSrcClassPath, ignoreExcludes)) : null,
406
                    : new SourceFileManager (this.cachedUserSrcClassPath, ignoreExcludes)) : null,
403
                cachedAptSrcClassPath != null ? new AptSourceFileManager(this.cachedUserSrcClassPath, this.cachedAptSrcClassPath, siblings.getProvider()) : null,
407
                cachedAptSrcClassPath != null ? new AptSourceFileManager(this.cachedUserSrcClassPath, this.cachedAptSrcClassPath, siblings.getProvider()) : null,
404
                hasSources ? outFileManager = new OutputFileManager (this.archiveProvider, this.outputClassPath, this.cachedUserSrcClassPath, this.cachedAptSrcClassPath, siblings.getProvider()) : null,
408
                cachedAptOutputClassPath != null ? new AptOutputFileManager(this.cachedAptOutputClassPath, this.cachedAptSrcClassPath) : null,
409
                hasSources ? outFileManager = new OutputFileManager (this.archiveProvider, this.outputClassPath, this.cachedUserAndGenSrcClassPath, this.cachedAptSrcClassPath, siblings.getProvider()) : null,
405
                this.memoryFileManager,
410
                this.memoryFileManager,
406
                marker,
411
                marker,
407
                siblings);
412
                siblings);
(-)a/java.source/src/org/netbeans/modules/java/source/indexing/APTUtils.java (-9 / +14 lines)
 Lines 56-65    Link Here 
56
import java.util.Collections;
56
import java.util.Collections;
57
import java.util.Enumeration;
57
import java.util.Enumeration;
58
import java.util.HashMap;
58
import java.util.HashMap;
59
import java.util.HashSet;
59
import java.util.Iterator;
60
import java.util.Iterator;
60
import java.util.LinkedList;
61
import java.util.LinkedList;
61
import java.util.List;
62
import java.util.List;
62
import java.util.Map;
63
import java.util.Map;
64
import java.util.Set;
63
import java.util.WeakHashMap;
65
import java.util.WeakHashMap;
64
import java.util.logging.Level;
66
import java.util.logging.Level;
65
import java.util.logging.Logger;
67
import java.util.logging.Logger;
 Lines 96-101    Link Here 
96
    private static final Map<URL, APTUtils> knownSourceRootsMap = new HashMap<URL, APTUtils>();
98
    private static final Map<URL, APTUtils> knownSourceRootsMap = new HashMap<URL, APTUtils>();
97
    private static final Map<FileObject, Reference<APTUtils>> auxiliarySourceRootsMap = new WeakHashMap<FileObject, Reference<APTUtils>>();
99
    private static final Map<FileObject, Reference<APTUtils>> auxiliarySourceRootsMap = new WeakHashMap<FileObject, Reference<APTUtils>>();
98
    private static final Lookup HARDCODED_PROCESSORS = Lookups.forPath("Editors/text/x-java/AnnotationProcessors");
100
    private static final Lookup HARDCODED_PROCESSORS = Lookups.forPath("Editors/text/x-java/AnnotationProcessors");
101
    private static final Set<String> blackList = new HashSet<String>() {{add("org.netbeans.modules.openide.util.NbBundleProcessor");}}; //NOI18N
99
    private final FileObject root;
102
    private final FileObject root;
100
    private final ClassPath processorPath;
103
    private final ClassPath processorPath;
101
    private final AnnotationProcessingQuery.Result aptOptions;
104
    private final AnnotationProcessingQuery.Result aptOptions;
 Lines 235-250    Link Here 
235
        }
238
        }
236
        List<Processor> result = new LinkedList<Processor>();
239
        List<Processor> result = new LinkedList<Processor>();
237
        for (String name : processorNames) {
240
        for (String name : processorNames) {
238
            try {
241
            if (!blackList.contains(name)) {
239
                Class<?> clazz = Class.forName(name, true, cl);
242
                try {
240
                Object instance = clazz.newInstance();
243
                    Class<?> clazz = Class.forName(name, true, cl);
241
                if (instance instanceof Processor) {
244
                    Object instance = clazz.newInstance();
242
                    result.add((Processor) instance);
245
                    if (instance instanceof Processor) {
246
                        result.add((Processor) instance);
247
                    }
248
                } catch (ThreadDeath td) {
249
                    throw td;
250
                } catch (Throwable t) {
251
                    LOG.log(Level.FINE, null, t);
243
                }
252
                }
244
            } catch (ThreadDeath td) {
245
                throw td;
246
            } catch (Throwable t) {
247
                LOG.log(Level.FINE, null, t);
248
            }
253
            }
249
        }
254
        }
250
        if (!onScan)
255
        if (!onScan)
(-)a/java.source/src/org/netbeans/modules/java/source/indexing/JavaCustomIndexer.java (-1 / +1 lines)
 Lines 151-157    Link Here 
151
            }
151
            }
152
            if (isAptBuildGeneratedFolder(context.getRootURI(),sourcePath)) {
152
            if (isAptBuildGeneratedFolder(context.getRootURI(),sourcePath)) {
153
                JavaIndex.LOG.fine("Ignoring annotation processor build generated folder"); //NOI18N
153
                JavaIndex.LOG.fine("Ignoring annotation processor build generated folder"); //NOI18N
154
                return;
154
//                return;
155
            }
155
            }
156
            final List<Indexable> javaSources = new ArrayList<Indexable>();
156
            final List<Indexable> javaSources = new ArrayList<Indexable>();
157
            final Collection<? extends CompileTuple> virtualSourceTuples = translateVirtualSources (
157
            final Collection<? extends CompileTuple> virtualSourceTuples = translateVirtualSources (
(-)a/java.source/src/org/netbeans/modules/java/source/parsing/AptOutputFileManager.java (+77 lines)
Line 0    Link Here 
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2011 Sun Microsystems, Inc.
41
 */
42
43
package org.netbeans.modules.java.source.parsing;
44
45
import org.netbeans.api.annotations.common.NonNull;
46
import org.netbeans.api.java.classpath.ClassPath;
47
48
/**
49
 *
50
 * @author Tomas Zezula
51
 */
52
public class AptOutputFileManager extends SourceFileManager {
53
    public AptOutputFileManager(
54
        @NonNull final ClassPath aptOutput,
55
        @NonNull final ClassPath aptCache) {
56
        super(aptOutput, true, new RejectDuplicates(aptCache));
57
    }
58
59
    private static class RejectDuplicates implements Predicate<SourceFileObject> {
60
61
        private final ClassPath aptCache;
62
63
        private RejectDuplicates(@NonNull final ClassPath aptCache) {
64
            assert aptCache != null;
65
            this.aptCache = aptCache;
66
        }
67
68
        @Override
69
        public boolean apply(final @NonNull SourceFileObject file) {
70
            final String path = file.handle.getRelativePath();
71
            if (path == null) {
72
                return false;
73
            }
74
            return aptCache.findResource(path) == null;
75
        }
76
    }
77
}
(-)a/java.source/src/org/netbeans/modules/java/source/parsing/ProxyFileManager.java (-40 / +32 lines)
 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) {
(-)a/java.source/src/org/netbeans/modules/java/source/parsing/SourceFileManager.java (-2 / +28 lines)
 Lines 58-63    Link Here 
58
import javax.tools.JavaFileManager.Location;
58
import javax.tools.JavaFileManager.Location;
59
import javax.tools.JavaFileObject;
59
import javax.tools.JavaFileObject;
60
import javax.tools.StandardLocation;
60
import javax.tools.StandardLocation;
61
import org.netbeans.api.annotations.common.NonNull;
61
import org.netbeans.api.java.classpath.ClassPath;
62
import org.netbeans.api.java.classpath.ClassPath;
62
import org.openide.filesystems.FileObject;
63
import org.openide.filesystems.FileObject;
63
import org.openide.filesystems.FileUtil;
64
import org.openide.filesystems.FileUtil;
 Lines 71-82    Link Here 
71
    
72
    
72
    final ClassPath sourceRoots;
73
    final ClassPath sourceRoots;
73
    private final boolean ignoreExcludes;
74
    private final boolean ignoreExcludes;
75
    private final Predicate<SourceFileObject> filter;
74
    private static final Logger LOG = Logger.getLogger(SourceFileManager.class.getName());
76
    private static final Logger LOG = Logger.getLogger(SourceFileManager.class.getName());
75
    
77
    
76
    /** Creates a new instance of SourceFileManager */
78
    /** Creates a new instance of SourceFileManager */
77
    public SourceFileManager (final ClassPath sourceRoots, final boolean ignoreExcludes) {
79
    public SourceFileManager (final ClassPath sourceRoots, final boolean ignoreExcludes) {
80
        this(sourceRoots,ignoreExcludes, new AcceptAll());
81
    }
82
83
    protected SourceFileManager(
84
            @NonNull final ClassPath sourceRoots,
85
            final boolean ignoreExcludes,
86
            @NonNull final Predicate<SourceFileObject> filter) {
87
        assert sourceRoots != null;
88
        assert filter != null;
78
        this.sourceRoots = sourceRoots;
89
        this.sourceRoots = sourceRoots;
79
        this.ignoreExcludes = ignoreExcludes;
90
        this.ignoreExcludes = ignoreExcludes;
91
        this.filter = filter;
80
    }
92
    }
81
93
82
    @Override
94
    @Override
 Lines 98-105    Link Here 
98
                            FileObject file = files.nextElement();
110
                            FileObject file = files.nextElement();
99
                            if (ignoreExcludes || entry.includes(file)) {
111
                            if (ignoreExcludes || entry.includes(file)) {
100
                                final JavaFileObject.Kind kind = FileObjects.getKind(file.getExt());                                
112
                                final JavaFileObject.Kind kind = FileObjects.getKind(file.getExt());                                
101
                                if (kinds.contains(kind)) {                        
113
                                if (kinds.contains(kind)) {
102
                                    result.add (SourceFileObject.create(file, root));
114
                                    final SourceFileObject source = SourceFileObject.create(file, root);
115
                                    if (filter.apply(source)) {
116
                                        result.add (source);
117
                                    }
103
                                }
118
                                }
104
                            }
119
                            }
105
                        }
120
                        }
 Lines 257-260    Link Here 
257
        }
272
        }
258
        return null;
273
        return null;
259
    }
274
    }
275
276
    protected static interface Predicate<P> {
277
        boolean apply(P param);
278
    }
279
280
    private static final class AcceptAll implements Predicate<SourceFileObject> {
281
        @Override
282
        public boolean apply(SourceFileObject param) {
283
            return true;
284
        }
285
    }
260
}
286
}

Return to bug 196104
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo