Skip to content

Commit

Permalink
Return null instead of throwing exception for unrecognized class.
Browse files Browse the repository at this point in the history
I think returning null is probably better than throwing an exception,
since it might be not so exceptional case, when destinationType of MessageDrivenBean is not recognized.
  • Loading branch information
klinki committed Feb 3, 2017
1 parent fdcf387 commit 98d2b48
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -69,7 +69,8 @@ public JmsDestinationModel createUnique(Set<ProjectModel> applications, String j

/**
* Gets JmsDestinationType from java class name
* @throws RuntimeException When class is not recognized
*
* Returns null for unrecognized class
*/
public static JmsDestinationType getTypeFromClass(String aClass)
{
Expand All @@ -83,7 +84,7 @@ else if (StringUtils.equals(aClass, "javax.jms.Topic") || StringUtils.equals(aC
}
else
{
throw new RuntimeException("Unrecognized class");
return null;
}
}
}

0 comments on commit 98d2b48

Please sign in to comment.