void (@NotNull File dir, final JavaSourceRootType rootType) { SourceFolder folder = myModel.getSourceFolder(dir); if (!myModel.hasRegisteredSourceSubfolder(dir) || folder != null && !isGenerated(folder)) { myModel.addGeneratedJavaSourceFolder(dir.getPath(), rootType); } }