@@ -64,8 +64,7 @@ public static List<String> getSupportedVersions() {
64
64
}
65
65
66
66
/**
67
- * Fetch supported versions dynamically from Packagist.
68
- * <p>
67
+ * Fetch supported versions dynamically from Packagist
69
68
* This method performs an HTTP GET request to fetch version data in JSON format
70
69
* from a predefined URL and parses it into a list of version strings.
71
70
*
@@ -84,11 +83,15 @@ public static List<String> fetchSupportedVersions() throws Exception {
84
83
connection .setRequestProperty ("Accept" , "application/json" );
85
84
86
85
if (connection .getResponseCode () != 200 ) {
87
- throw new Exception ("Failed to fetch data, HTTP response code: " + connection .getResponseCode ());
86
+ throw new Exception (
87
+ "Failed to fetch data, HTTP response code: " + connection .getResponseCode ()
88
+ );
88
89
}
89
90
90
91
// Read JSON response
91
- try (BufferedReader reader = new BufferedReader (new InputStreamReader (connection .getInputStream ()))) {
92
+ try (BufferedReader reader = new BufferedReader (
93
+ new InputStreamReader (connection .getInputStream ()))
94
+ ) {
92
95
StringBuilder response = new StringBuilder ();
93
96
String line ;
94
97
while ((line = reader .readLine ()) != null ) {
@@ -114,7 +117,10 @@ public static List<String> fetchSupportedVersions() throws Exception {
114
117
}
115
118
}
116
119
} catch (Exception e ) {
117
- throw new Exception ("Error fetching or parsing supported versions: " + e .getMessage (), e );
120
+ throw new Exception (
121
+ "Error fetching or parsing supported versions: " + e .getMessage (),
122
+ e
123
+ );
118
124
} finally {
119
125
if (connection != null ) {
120
126
connection .disconnect ();
0 commit comments