File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed
src/main/java/jenkins/plugins/slack/workflow Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change 2323import jenkins .plugins .slack .StandardSlackService ;
2424import jenkins .plugins .slack .StandardSlackServiceBuilder ;
2525import jenkins .plugins .slack .user .SlackUserIdResolver ;
26- import net .sf .json .JSON ;
2726import net .sf .json .JSONArray ;
2827import net .sf .json .JSONException ;
2928import net .sf .json .JSONObject ;
30- import net .sf .json .groovy .JsonSlurper ;
3129import org .jenkinsci .plugins .workflow .steps .Step ;
3230import org .jenkinsci .plugins .workflow .steps .StepContext ;
3331import org .jenkinsci .plugins .workflow .steps .StepDescriptor ;
@@ -408,19 +406,12 @@ JSONArray getBlocksAsJSONArray() throws Exception {
408406 }
409407
410408 private JSONArray convertStringToJsonArray (TaskListener listener , String jsonString , String fieldType ) {
411- JsonSlurper jsonSlurper = new JsonSlurper ();
412- JSON json ;
413409 try {
414- json = jsonSlurper . parseText (jsonString );
410+ return JSONArray . fromObject (jsonString );
415411 } catch (JSONException e ) {
416412 listener .error (Messages .notificationFailedWithException (e ));
417413 return null ;
418414 }
419- if (!(json instanceof JSONArray )) {
420- listener .error (Messages .notificationFailedWithException (new IllegalArgumentException (fieldType + " must be JSONArray" )));
421- return null ;
422- }
423- return (JSONArray ) json ;
424415 }
425416
426417 JSONArray getAttachmentsAsJSONArray () throws Exception {
You can’t perform that action at this time.
0 commit comments