@@ -185,18 +185,16 @@ private static JavaMethod findMethod(String methodName, String modelName, String
185
185
186
186
// Search for method declaration
187
187
if (endMatcher .find (offset )) {
188
- if (offset == endMatcher .start ()) {
189
- offset = endMatcher .end () - 1 ;
190
- if (offset > bodyEnd ) return null ;
191
-
192
- if (withoutBody && ';' == source .charAt (offset )) return new JavaMethod (methodName , methodSignature , source , nameStart , -1 , -1 ); // NOI18N
188
+ offset = endMatcher .end () - 1 ;
189
+ if (offset > bodyEnd ) return null ;
193
190
194
- // Search for method body
195
- int [] bodyOffsets = JavaSourceUtils .getBlockBounds (source , offset , '{' , '}' ); // NOI18N
196
- if (bodyOffsets [0 ] == -1 || bodyOffsets [1 ] == -1 || bodyOffsets [1 ] > bodyEnd ) return null ;
191
+ if (withoutBody && ';' == source .charAt (offset )) return new JavaMethod (methodName , methodSignature , source , nameStart , -1 , -1 ); // NOI18N
197
192
198
- return new JavaMethod (modelName , methodSignature , source , nameStart , bodyOffsets [0 ], bodyOffsets [1 ]); // NOI18N
199
- }
193
+ // Search for method body
194
+ int [] bodyOffsets = JavaSourceUtils .getBlockBounds (source , offset , '{' , '}' ); // NOI18N
195
+ if (bodyOffsets [0 ] == -1 || bodyOffsets [1 ] == -1 || bodyOffsets [1 ] > bodyEnd ) return null ;
196
+
197
+ return new JavaMethod (modelName , methodSignature , source , nameStart , bodyOffsets [0 ], bodyOffsets [1 ]); // NOI18N
200
198
}
201
199
}
202
200
0 commit comments