This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 194564
Collapse All | Expand All

(-)a/java.source/src/org/netbeans/modules/java/source/tasklist/IncorrectErrorBadges.java (-2 / +1 lines)
Lines 170-177 Link Here
170
            LOG.log(Level.WARNING, "Going to recompute root={0}, files in error={1}.",
170
            LOG.log(Level.WARNING, "Going to recompute root={0}, files in error={1}.",
171
                    new Object[] {FileUtil.getFileDisplayName(root), ErrorsCache.getAllFilesInError(root.getURL())});
171
                    new Object[] {FileUtil.getFileDisplayName(root), ErrorsCache.getAllFilesInError(root.getURL())});
172
172
173
// XXX:            Todo Create API!
173
            IndexingManager.getDefault().refreshIndex(root.getURL(), null, true, true);
174
            RepositoryUpdater.getDefault().addIndexingJob(root.getURL(), null, false, true, false, true, true);
175
        } catch (IOException ex) {
174
        } catch (IOException ex) {
176
            LOG.log(Level.FINE, null, ex);
175
            LOG.log(Level.FINE, null, ex);
177
        }
176
        }
(-)a/parsing.api/apichanges.xml (+15 lines)
Lines 110-115 Link Here
110
<!-- ACTUAL CHANGES BEGIN HERE: -->
110
<!-- ACTUAL CHANGES BEGIN HERE: -->
111
111
112
  <changes>
112
  <changes>
113
  <change id="IndexingManager-refreshIndex-checkEditor">
114
      <api name="ParsingAPI"/>
115
      <summary>Adding refreshIndex method into the IndexingManager allowing to specify if indexers should use modified content of editors</summary>
116
      <version major="1" minor="37"/>
117
      <date day="24" month="1" year="2011"/>
118
      <author login="tzezula"/>
119
      <compatibility source="compatible" binary="compatible" semantic="compatible" deletion="no" addition="yes" modification="no"/>
120
      <description>
121
          <p>
122
              Adding refreshIndex method into the IndexingManager allowing to specify if indexers should use modified content of editors.
123
          </p>
124
      </description>
125
      <class package="org.netbeans.modules.parsing.api.indexing" name="IndexingManager"/>
126
      <issue number="194564"/>
127
  </change>
113
  <change id="parser-cancelling">
128
  <change id="parser-cancelling">
114
      <api name="ParsingAPI"/>
129
      <api name="ParsingAPI"/>
115
      <summary>Adding Parser.cancel method with parameters describing the reason of cancel</summary>
130
      <summary>Adding Parser.cancel method with parameters describing the reason of cancel</summary>
(-)a/parsing.api/nbproject/project.properties (-1 / +1 lines)
Lines 2-5 Link Here
2
javac.source=1.6
2
javac.source=1.6
3
javadoc.apichanges=${basedir}/apichanges.xml
3
javadoc.apichanges=${basedir}/apichanges.xml
4
javadoc.arch=${basedir}/arch.xml
4
javadoc.arch=${basedir}/arch.xml
5
spec.version.base=1.36.0
5
spec.version.base=1.37.0
(-)a/parsing.api/src/org/netbeans/modules/parsing/api/indexing/IndexingManager.java (-2 / +44 lines)
Lines 47-52 Link Here
47
import java.util.Collection;
47
import java.util.Collection;
48
import java.util.concurrent.Callable;
48
import java.util.concurrent.Callable;
49
import javax.swing.SwingUtilities;
49
import javax.swing.SwingUtilities;
50
import org.netbeans.api.annotations.common.NonNull;
51
import org.netbeans.api.annotations.common.NullAllowed;
50
import org.netbeans.modules.parsing.impl.Utilities;
52
import org.netbeans.modules.parsing.impl.Utilities;
51
import org.netbeans.modules.parsing.impl.event.EventSupport;
53
import org.netbeans.modules.parsing.impl.event.EventSupport;
52
import org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater;
54
import org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater;
Lines 101-107 Link Here
101
     *   be reindexed.
103
     *   be reindexed.
102
     */
104
     */
103
    public void refreshIndex(URL root, Collection<? extends URL> files) {
105
    public void refreshIndex(URL root, Collection<? extends URL> files) {
104
        refreshIndex(root, files, true);
106
        refreshIndex(root, files, true, false);
105
    }
107
    }
106
108
107
    /**
109
    /**
Lines 131-137 Link Here
131
     * @since 1.16
133
     * @since 1.16
132
     */
134
     */
133
    public void refreshIndex(URL root, Collection<? extends URL> files, boolean fullRescan) {
135
    public void refreshIndex(URL root, Collection<? extends URL> files, boolean fullRescan) {
134
        RepositoryUpdater.getDefault().addIndexingJob(root, files, false, false, false, fullRescan, true);
136
        refreshIndex(root, files, fullRescan, false);
137
    }
138
    
139
    /**
140
     * Schedules new files for indexing. The set of files passed to this method
141
     * will be scheduled for reindexing. That means that all the indexers appropriate
142
     * for each file will have a chance to update their index.
143
     * 
144
     * <p>If <code>forceRefresh</code> parameter is set to <code>true</code>
145
     * no timestamp checks will be done for the files passed to this method.
146
     * This means that even files that have not been changed since their last indexing
147
     * will be reindexed again. On the other hand if <code>forceRefresh</code> is
148
     * <code>false</code> the infrastructure will check timestamps and will reindex
149
     * only files that have been changed since the last time they were indexed.
150
     *
151
     * <p>IMPORTANT: Please use this with extreme caution. Indexing is generally
152
     * very expensive operation and the more files you ask to reindex the longer the
153
     * job will take.
154
     * 
155
     * <p> If <code>checkEditor</code> is true the indexers will use unsaved content
156
     * of editor documents. Scan is using the file content rather than editor content,
157
     * the editor content is needed only in special cases like error badge recovery.
158
     * Simpler version {@link IndexingManager#refreshIndex(java.net.URL, java.util.Collection, boolean)}
159
     * should be preferred.
160
     *
161
     * @param root The common parent folder of the files that should be reindexed.
162
     * @param filesOrFolders The files to reindex. Can be <code>null</code> or an empty
163
     *   collection in which case <b>all</b> files under the <code>root</code> will
164
     *   be reindexed.
165
     * @param fullRescan If <code>true</code> no timestamps check will be done
166
     *   on the <code>files</code> passed in and they all will be reindexed. If
167
     *   <code>false</code> only changed files will be reindexed.
168
     * @param checkEditor when true the indexers will use content of modified editor
169
     * documents rather than saved files. For scans the indexers should prefer
170
     * content of files. the document content may be useful for example for error badge
171
     * recovery.
172
     *
173
     * @since 1.37
174
     */
175
    public void refreshIndex(@NonNull URL root, @NullAllowed Collection<? extends URL> files, boolean fullRescan, boolean checkEditor) {
176
        RepositoryUpdater.getDefault().addIndexingJob(root, files, false, checkEditor, false, fullRescan, true);
135
    }
177
    }
136
178
137
    /**
179
    /**

Return to bug 194564