File tree 4 files changed +18
-1
lines changed
fourth-app/src/main/java/com/fourthcompany/app
src/main/java/com/mycompany/app
third-app/src/main/java/com/thirdcompany/app
4 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
public class Fourth {
4
4
public String getMessage () { return "hello" ; }
5
+
6
+ // new in 1.1 (semver OK)
7
+ public String getMessage (boolean arriving ) {
8
+ return arriving ? "hello" : "bye" ;
9
+ }
10
+
5
11
}
Original file line number Diff line number Diff line change 24
24
<artifactId >other-app</artifactId >
25
25
<version >1.1</version >
26
26
</dependency >
27
+ <dependency >
28
+ <groupId >com.fourthcompany.app</groupId >
29
+ <artifactId >fourth-app</artifactId >
30
+ <version >1.0</version >
31
+ </dependency >
27
32
<dependency >
28
33
<groupId >junit</groupId >
29
34
<artifactId >junit</artifactId >
Original file line number Diff line number Diff line change 1
1
package com .mycompany .app ;
2
2
import com .othercompany .app .Second ;
3
+ import com .fourthcompany .app .Fourth ;
3
4
4
5
public class App {
5
6
public static void main (String ... args ) {
6
7
String message = new Second ().wrapMessageIn ("|" );
8
+ // dev decided to use fourth v1.0 directly, but
9
+ // upgraded to third 1.1, failing to notice it requires fourth 1.1
10
+ message += new Fourth ().getMessage ();
7
11
System .out .println (message );
12
+
8
13
}
9
14
}
Original file line number Diff line number Diff line change 3
3
4
4
public class Third {
5
5
public String upperCaseMessage () {
6
- return new Fourth ().getMessage ().toUpperCase ();
6
+ // the dev decided to use the new method from v1.1!
7
+ return new Fourth ().getMessage (true ).toUpperCase ();
7
8
}
8
9
}
You can’t perform that action at this time.
0 commit comments