File tree Expand file tree Collapse file tree
fourth-app/src/main/java/com/fourthcompany/app
src/main/java/com/mycompany/app
third-app/src/main/java/com/thirdcompany/app Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33public class Fourth {
44 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+
511}
Original file line number Diff line number Diff line change 2424 <artifactId >other-app</artifactId >
2525 <version >1.1</version >
2626 </dependency >
27+ <dependency >
28+ <groupId >com.fourthcompany.app</groupId >
29+ <artifactId >fourth-app</artifactId >
30+ <version >1.0</version >
31+ </dependency >
2732 <dependency >
2833 <groupId >junit</groupId >
2934 <artifactId >junit</artifactId >
Original file line number Diff line number Diff line change 11package com .mycompany .app ;
22import com .othercompany .app .Second ;
3+ import com .fourthcompany .app .Fourth ;
34
45public class App {
56 public static void main (String ... args ) {
67 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 ();
711 System .out .println (message );
12+
813 }
914}
Original file line number Diff line number Diff line change 33
44public class Third {
55 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 ();
78 }
89}
You can’t perform that action at this time.
0 commit comments