@@ -66,12 +66,8 @@ static Resource createResourceRaw(
6666 return (Resource ) result ;
6767 }
6868 }
69- } catch (NoSuchMethodException nme ) {
70- logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , nme );
71- } catch (IllegalAccessException iae ) {
72- logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , iae );
73- } catch (InvocationTargetException ite ) {
74- logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , ite );
69+ } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e ) {
70+ logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , e );
7571 }
7672 // Fall back to non-entity behavior?
7773 logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" );
@@ -86,12 +82,8 @@ public static ResourceBuilder addEntity(ResourceBuilder rb, Entity e) {
8682 method .setAccessible (true );
8783 method .invoke (rb , e );
8884 }
89- } catch (NoSuchMethodException nme ) {
90- logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , nme );
91- } catch (IllegalAccessException iae ) {
92- logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , iae );
93- } catch (InvocationTargetException ite ) {
94- logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , ite );
85+ } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex ) {
86+ logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , ex );
9587 }
9688 return rb ;
9789 }
@@ -104,12 +96,8 @@ public static ResourceBuilder addAllEntity(ResourceBuilder rb, Collection<Entity
10496 method .setAccessible (true );
10597 method .invoke (rb , e );
10698 }
107- } catch (NoSuchMethodException nme ) {
108- logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , nme );
109- } catch (IllegalAccessException iae ) {
110- logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , iae );
111- } catch (InvocationTargetException ite ) {
112- logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , ite );
99+ } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex ) {
100+ logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , ex );
113101 }
114102 return rb ;
115103 }
@@ -127,12 +115,8 @@ public static Collection<Entity> getEntities(Resource r) {
127115 method .setAccessible (true );
128116 return (Collection <Entity >) method .invoke (r );
129117 }
130- } catch (NoSuchMethodException nme ) {
131- logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , nme );
132- } catch (IllegalAccessException iae ) {
133- logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , iae );
134- } catch (InvocationTargetException ite ) {
135- logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , ite );
118+ } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e ) {
119+ logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , e );
136120 }
137121 return Collections .emptyList ();
138122 }
@@ -149,12 +133,8 @@ public static Attributes getRawAttributes(Resource r) {
149133 method .setAccessible (true );
150134 return (Attributes ) method .invoke (r );
151135 }
152- } catch (NoSuchMethodException nme ) {
153- logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , nme );
154- } catch (IllegalAccessException iae ) {
155- logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , iae );
156- } catch (InvocationTargetException ite ) {
157- logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , ite );
136+ } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e ) {
137+ logger .log (Level .WARNING , "Attempting to use entities with unsupported resource" , e );
158138 }
159139 return Attributes .empty ();
160140 }
0 commit comments