@@ -186,6 +186,25 @@ public void callingJodaDurationMethodWithDurationOverload_privateMethod() {
186
186
.doTest ();
187
187
}
188
188
189
+ @ Test
190
+ public void callingJodaInstantMethodWithInstantOverload_privateMethod () {
191
+ helper
192
+ .addSourceLines (
193
+ "TestClass.java" ,
194
+ "import java.time.Instant;" ,
195
+ "public class TestClass {" ,
196
+ " private void bar(org.joda.time.Instant i) {" ,
197
+ " }" ,
198
+ " private void bar(Instant i) {" ,
199
+ " }" ,
200
+ " public void foo(org.joda.time.Instant jodaInstant) {" ,
201
+ " // BUG: Diagnostic contains: bar(Instant.ofEpochMilli(jodaInstant.getMillis()));" ,
202
+ " bar(jodaInstant);" ,
203
+ " }" ,
204
+ "}" )
205
+ .doTest ();
206
+ }
207
+
189
208
@ Test
190
209
public void callingJodaDurationMethodWithDurationOverload_privateMethod_jodaDurationMillis () {
191
210
helper
@@ -296,19 +315,19 @@ public void callingJodaDurationMethodWithSupertypeJavaDurationOverload() {
296
315
}
297
316
298
317
@ Test
299
- public void callingJodaReadableDurationMethodWithDurationOverload_privateMethod () {
318
+ public void callingJodaReadableInstantMethodWithInstantOverload_privateMethod () {
300
319
helper
301
320
.addSourceLines (
302
321
"TestClass.java" ,
303
- "import java.time.Duration ;" ,
322
+ "import java.time.Instant ;" ,
304
323
"public class TestClass {" ,
305
- " private void bar(org.joda.time.ReadableDuration d ) {" ,
324
+ " private void bar(org.joda.time.ReadableInstant i ) {" ,
306
325
" }" ,
307
- " private void bar(Duration d ) {" ,
326
+ " private void bar(Instant i ) {" ,
308
327
" }" ,
309
- " public void foo(org.joda.time.Duration jodaDuration ) {" ,
310
- " // BUG: Diagnostic contains: bar(Duration.ofMillis(jodaDuration .getMillis()));" ,
311
- " bar(jodaDuration );" ,
328
+ " public void foo(org.joda.time.Instant jodaInstant ) {" ,
329
+ " // BUG: Diagnostic contains: bar(Instant.ofEpochMilli(jodaInstant .getMillis()));" ,
330
+ " bar(jodaInstant );" ,
312
331
" }" ,
313
332
"}" )
314
333
.doTest ();
0 commit comments