Skip to content

Commit

Permalink
Fixes issue #38 - Fix code smells (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem committed Mar 25, 2023
1 parent 01f2f08 commit f91c741
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ private ActionQueryParameter getActionQueryParameterAnnotation(Annotation[] anno
ActionQueryParameter result = null;
if (annotations != null && annotations.length > 0) {
for (Annotation annotation : annotations) {
if (annotation instanceof ActionQueryParameter) {
result = (ActionQueryParameter) annotation;
if (annotation instanceof ActionQueryParameter actionQueryParameter) {
result = actionQueryParameter;
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public class DefaultActionResponseHandler implements ActionResponseHandler {
* Get the default lifecycle.
*
* <p>
* FIXME - This method lazily gets the default lifecycle as FactoryFinder is
* not properly re-entrant. We should be able to initialize the
* defaultLifecycle variable in the constructor of this class. See
* NOTE - This method lazily gets the default lifecycle as FactoryFinder is
* not properly re-entrant (as of 20230324). We should be able to initialize
* the defaultLifecycle variable in the constructor of this class. See
* https://github.com/eclipse-ee4j/mojarra/issues/4379
* </p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,14 @@ public BeanManager getBeanManager() {
InitialContext initialContext = new InitialContext();
beanManager = (BeanManager) initialContext.lookup("java:comp/BeanManager");
} catch (NamingException ne) {
// swallowing this on purpose.
}
if (beanManager == null) {
try {
InitialContext initialContext = new InitialContext();
beanManager = (BeanManager) initialContext.lookup("java:comp/env/BeanManager");
} catch (NamingException ne) {
// swallowing this on purpose.
}
}
return beanManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class RestMappingMatch {
/**
* Stores the bean.
*/
private Bean<? extends Object> bean;
private Bean bean;

/**
* Stores the method.
Expand All @@ -61,7 +61,7 @@ public class RestMappingMatch {
*
* @return the bean.
*/
public Bean<? extends Object> getBean() {
public Bean getBean() {
return bean;
}

Expand Down Expand Up @@ -106,7 +106,7 @@ public String getRestPath() {
*
* @param bean the bean.
*/
public void setBean(Bean<? extends Object> bean) {
public void setBean(Bean bean) {
this.bean = bean;
}

Expand Down

0 comments on commit f91c741

Please sign in to comment.