void checkFile(IResource resource) {
   if (resource instanceof IFile) {
     IFile file = (IFile) resource;
     if (file.getName().endsWith("xfm.xmi")) {
       String thisUri = resource.getFullPath().toString();
       featureModelUri = getFeatureModelUri(file.getProject());
       if (thisUri.equals(featureModelUri)) refreshFeatureModel(file.getProject());
     }
     if (file.getName().endsWith(".v")) {
       builder.deleteMarkers(file);
       checkFilenameDepenency(file);
       checkFileContents(file);
     }
     if (file.getName().endsWith(".java")) {
       try {
         builder.deleteMarkers(file);
         List<CommentStructure> comments = buildCommentsStructure(loadFile(file));
         if (comments.size() > 0) {
           for (CommentStructure c : comments) {
             IParseResult result =
                 injector
                     .getInstance(FeaturesParser.class)
                     .parse("FeatureClause", new ByteArrayInputStream(c.clause.getBytes()));
             if (result.getParseErrors().size() > 0) {
               String message = "";
               for (SyntaxError err : result.getParseErrors()) message += err.getMessage() + "\n";
               Exception e = new RuntimeException("parse error: " + message);
               log.error("error while parsing feature clause", e);
             }
             EObject clause = result.getRootASTElement();
             if (clause instanceof Feature) {
               String feature =
                   clause.eGet(clause.eClass().getEStructuralFeature("feature")).toString();
               if (!isFeatureDefined(file, feature)) addMarkerIfNotDefined(feature, file, c.line);
             } else
               for (EObject e : EcoreUtil2.eAllContentsAsList(clause)) {
                 if (e instanceof Feature || e instanceof Atom) {
                   String feature = e.eGet(e.eClass().getEStructuralFeature("feature")).toString();
                   if (!isFeatureDefined(file, feature))
                     addMarkerIfNotDefined(feature, file, c.line);
                 }
               }
           }
         }
       } catch (ResourceException e) {
         log.error("error loading file", e);
       } catch (Throwable e) {
         log.error("error loading file", e);
       }
     }
   }
 }