Commit 601e60d7a4e00b7a1e6a635421325ddd04b4c359
1 parent
ecc109da
Exists in
master
Formatação do código com base no formatador padrão do projeto
Showing
1 changed file
with
9 additions
and
13 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/util/Beans.java
@@ -90,8 +90,7 @@ public final class Beans { | @@ -90,8 +90,7 @@ public final class Beans { | ||
90 | buffer.append(qualifier.getClass().getCanonicalName()); | 90 | buffer.append(qualifier.getClass().getCanonicalName()); |
91 | } | 91 | } |
92 | 92 | ||
93 | - String message = getBundle() | ||
94 | - .getString("bean-not-found", buffer.toString()); | 93 | + String message = getBundle().getString("bean-not-found", buffer.toString()); |
95 | throw new DemoiselleException(message, cause); | 94 | throw new DemoiselleException(message, cause); |
96 | } | 95 | } |
97 | 96 | ||
@@ -100,32 +99,29 @@ public final class Beans { | @@ -100,32 +99,29 @@ public final class Beans { | ||
100 | 99 | ||
101 | @SuppressWarnings("unchecked") | 100 | @SuppressWarnings("unchecked") |
102 | public static <T> T getReference(final Class<T> beanClass) { | 101 | public static <T> T getReference(final Class<T> beanClass) { |
103 | - | ||
104 | T instance; | 102 | T instance; |
105 | - | 103 | + |
106 | try { | 104 | try { |
107 | instance = (T) getReference(manager.getBeans(beanClass)); | 105 | instance = (T) getReference(manager.getBeans(beanClass)); |
108 | - }catch (NoSuchElementException cause) { | ||
109 | - String message = getBundle() | ||
110 | - .getString("bean-not-found", beanClass.getCanonicalName()); | 106 | + } catch (NoSuchElementException cause) { |
107 | + String message = getBundle().getString("bean-not-found", beanClass.getCanonicalName()); | ||
111 | throw new DemoiselleException(message, cause); | 108 | throw new DemoiselleException(message, cause); |
112 | } | 109 | } |
113 | - | 110 | + |
114 | return instance; | 111 | return instance; |
115 | } | 112 | } |
116 | 113 | ||
117 | @SuppressWarnings("unchecked") | 114 | @SuppressWarnings("unchecked") |
118 | public static <T> T getReference(String beanName) { | 115 | public static <T> T getReference(String beanName) { |
119 | T instance; | 116 | T instance; |
120 | - | 117 | + |
121 | try { | 118 | try { |
122 | instance = (T) getReference(manager.getBeans(beanName)); | 119 | instance = (T) getReference(manager.getBeans(beanName)); |
123 | - }catch (NoSuchElementException cause) { | ||
124 | - String message = getBundle() | ||
125 | - .getString("bean-not-found", beanName); | 120 | + } catch (NoSuchElementException cause) { |
121 | + String message = getBundle().getString("bean-not-found", beanName); | ||
126 | throw new DemoiselleException(message, cause); | 122 | throw new DemoiselleException(message, cause); |
127 | } | 123 | } |
128 | - | 124 | + |
129 | return instance; | 125 | return instance; |
130 | } | 126 | } |
131 | 127 |