Skip to content

Commit

Permalink
Merge pull request #7216 from matthiasblaesing/jsf
Browse files Browse the repository at this point in the history
JsfVersion might not be known, so null case must be handled
  • Loading branch information
matthiasblaesing committed Apr 8, 2024
2 parents 87016c5 + 4ad9fe2 commit d1fac36
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ public Collection<ImplicitObject> getImplicitObjects(FileObject file) {
return Collections.<ImplicitObject>emptyList();
}
final Project project = FileOwnerQuery.getOwner(file);
if (project == null || JsfVersionUtils.forProject(project).isAtLeast(JsfVersion.JSF_3_0)) {
final JsfVersion jsfVersion = JsfVersionUtils.forProject(project);
if (project == null || jsfVersion == null || jsfVersion.isAtLeast(JsfVersion.JSF_3_0)) {
return getImplicitObjectsJakarta();
} else {
return getImplicitObjects();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ public List<String> getPropertyNames(final Project project, final String entityC
}
try {
//check web beans
if(JsfVersionUtils.forProject(project).isAtLeast(JsfVersion.JSF_3_0)) {
JsfVersion jsfVersion = JsfVersionUtils.forProject(project);
if(jsfVersion != null && jsfVersion.isAtLeast(JsfVersion.JSF_3_0)) {
jakartaMetaModelSupport.getMetaModel().runReadAction(new MetadataModelAction<org.netbeans.modules.jakarta.web.beans.api.model.WebBeansModel, Void>() {
@Override
public Void run(org.netbeans.modules.jakarta.web.beans.api.model.WebBeansModel metadata) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ public class JSFClientGenerator {

public static void generateJSFPages(ProgressContributor progressContributor, ProgressPanel progressPanel, final Project project, final String entityClass, String jsfFolderBase, String jsfFolderName, final String controllerPackage, final String controllerClass, FileObject pkg, FileObject controllerFileObject, final EmbeddedPkSupport embeddedPkSupport, final List<String> entities, final boolean ajaxify, String jpaControllerPackage, FileObject jpaControllerFileObject, FileObject converterFileObject, final boolean genSessionBean, int progressIndex) throws IOException {
final boolean isInjection = Util.isContainerManaged(project); //Util.isSupportedJavaEEVersion(project);
final boolean jakartaJsfPackages = JsfVersionUtils.forProject(project).isAtLeast(JsfVersion.JSF_3_0);
JsfVersion jsfVersion = JsfVersionUtils.forProject(project);
final boolean jakartaJsfPackages = jsfVersion != null && jsfVersion.isAtLeast(JsfVersion.JSF_3_0);

String simpleControllerName = controllerFileObject.getName();

Expand Down

0 comments on commit d1fac36

Please sign in to comment.