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 221178
Collapse All | Expand All

(-)a/websvc.rest/src/org/netbeans/modules/websvc/rest/editor/RestConfigurationTask.java (-2 / +2 lines)
Lines 69-77 Link Here
69
     */
69
     */
70
    @Override
70
    @Override
71
    public void run( CompilationInfo info ) throws Exception {
71
    public void run( CompilationInfo info ) throws Exception {
72
        RestScanTask scanTask = new RestScanTask(factory, fileObject, info );
72
        RestScanTask scanTask = new RestScanTask(factory, fileObject );
73
        task.set(scanTask);
73
        task.set(scanTask);
74
        scanTask.run();
74
        scanTask.run(info);
75
        HintsController.setErrors(fileObject, "REST Configuration",         // NOI18N 
75
        HintsController.setErrors(fileObject, "REST Configuration",         // NOI18N 
76
                scanTask.getHints()); 
76
                scanTask.getHints()); 
77
    }
77
    }
(-)a/websvc.rest/src/org/netbeans/modules/websvc/rest/editor/RestScanTask.java (-11 / +9 lines)
Lines 99-114 Link Here
99
class RestScanTask {
99
class RestScanTask {
100
100
101
    RestScanTask( RestConfigurationEditorAwareTaskFactory factory,
101
    RestScanTask( RestConfigurationEditorAwareTaskFactory factory,
102
            FileObject fileObject, CompilationInfo info )
102
            FileObject fileObject)
103
    {
103
    {
104
        this.factory = factory;
104
        this.factory = factory;
105
        this.fileObject = fileObject;
105
        this.fileObject = fileObject;
106
        this.info = info;
107
        hints = new LinkedList<ErrorDescription>();
106
        hints = new LinkedList<ErrorDescription>();
108
        stop = new AtomicBoolean( false );
107
        stop = new AtomicBoolean( false );
109
    }
108
    }
110
109
111
    void run(){
110
    void run(CompilationInfo info){
112
       Project project = FileOwnerQuery.getOwner(fileObject);
111
       Project project = FileOwnerQuery.getOwner(fileObject);
113
       if ( project == null ){
112
       if ( project == null ){
114
           return;
113
           return;
Lines 132-141 Link Here
132
                }
131
                }
133
            }
132
            }
134
            if (needConfiguration) {
133
            if (needConfiguration) {
135
                configureRest(project, support);
134
                configureRest(project, support, info);
136
            }
135
            }
137
            else {
136
            else {
138
                checkApplicationConfiguration(project, support);
137
                checkApplicationConfiguration(project, support, info);
139
            }
138
            }
140
       }
139
       }
141
       catch(IOException e ){
140
       catch(IOException e ){
Lines 158-171 Link Here
158
    }
157
    }
159
    
158
    
160
    private void checkApplicationConfiguration( Project project,
159
    private void checkApplicationConfiguration( Project project,
161
            WebRestSupport support ) throws MetadataModelException,IOException, 
160
            WebRestSupport support, CompilationInfo info ) throws MetadataModelException,IOException, 
162
            InterruptedException, ExecutionException
161
            InterruptedException, ExecutionException
163
    {
162
    {
164
        List<RestApplication> applications = support.getRestApplications();
163
        List<RestApplication> applications = support.getRestApplications();
165
        if ( applications.isEmpty() ){
164
        if ( applications.isEmpty() ){
166
            return;
165
            return;
167
        }
166
        }
168
        List<TypeElement> restResources = getRestResources(support);
167
        List<TypeElement> restResources = getRestResources(support, info);
169
        for (TypeElement typeElement : restResources) {
168
        for (TypeElement typeElement : restResources) {
170
            String fqn = typeElement.getQualifiedName().toString();
169
            String fqn = typeElement.getQualifiedName().toString();
171
            if ( !support.hasApplicationResourceClass(fqn ) ){
170
            if ( !support.hasApplicationResourceClass(fqn ) ){
Lines 187-197 Link Here
187
        }
186
        }
188
    }
187
    }
189
    
188
    
190
    private void configureRest( Project project, WebRestSupport support ) 
189
    private void configureRest( Project project, WebRestSupport support, CompilationInfo info ) 
191
            throws MetadataModelException,IOException, 
190
            throws MetadataModelException,IOException, 
192
            InterruptedException, ExecutionException
191
            InterruptedException, ExecutionException
193
    {
192
    {
194
        List<TypeElement> rest = getRestResources(support);
193
        List<TypeElement> rest = getRestResources(support, info);
195
        if ( rest.isEmpty() ){
194
        if ( rest.isEmpty() ){
196
            return;
195
            return;
197
        }
196
        }
Lines 209-215 Link Here
209
        hints.add(description);
208
        hints.add(description);
210
    }
209
    }
211
    
210
    
212
    private List<TypeElement> getRestResources(WebRestSupport support) 
211
    private List<TypeElement> getRestResources(WebRestSupport support, CompilationInfo info) 
213
            throws MetadataModelException,IOException, 
212
            throws MetadataModelException,IOException, 
214
            InterruptedException, ExecutionException
213
            InterruptedException, ExecutionException
215
    {
214
    {
Lines 309-315 Link Here
309
    
308
    
310
    private FileObject fileObject;
309
    private FileObject fileObject;
311
    private RestConfigurationEditorAwareTaskFactory factory;
310
    private RestConfigurationEditorAwareTaskFactory factory;
312
    private CompilationInfo info;
313
    private List<ErrorDescription> hints;
311
    private List<ErrorDescription> hints;
314
    private AtomicBoolean stop;
312
    private AtomicBoolean stop;
315
}
313
}

Return to bug 221178