2222package de .halirutan .mathematica .errorreporting ;
2323
2424import com .intellij .diagnostic .DiagnosticBundle ;
25- import com .intellij .diagnostic .ErrorReportConfigurable ;
2625import com .intellij .diagnostic .IdeErrorsDialog ;
2726import com .intellij .diagnostic .ReportMessages ;
2827import com .intellij .ide .BrowserUtil ;
6362
6463import static com .intellij .openapi .diagnostic .SubmittedReportInfo .SubmissionStatus .*;
6564import static com .intellij .openapi .util .text .StringUtil .isEmpty ;
66- import static com .intellij .openapi .util .text .StringUtil .notNullize ;
6765
6866/**
6967 * Created by IntelliJ IDEA. User: Jon S Akhtar Date: Oct 19, 2010 Time: 11:35:35 AM
@@ -83,28 +81,17 @@ public class YouTrackBugReporter extends ErrorReportSubmitter {
8381 private String myExtraInformation = "" ;
8482 private String myAffectedVersion = null ;
8583
84+ @ NotNull
8685 @ Override
8786 public String getReportActionText () {
8887 return "Report to halirutan" ;
8988 }
9089
91- // @Override
92- // public SubmittedReportInfo submit(IdeaLoggingEvent[] events, Component parentComponent) {
93- // return submit(events, this.myDescription, notNullize(ErrorReportConfigurable.getInstance()
94- // .ITN_LOGIN, "<anonymous>"), parentComponent);
95- // }
96- //
97- // @Override
98- // public void submitAsync(IdeaLoggingEvent[] events, String additionalInfo, Component parentComponent,
99- // Consumer<SubmittedReportInfo> consumer) {
100- //
101- // this.myDescription = additionalInfo;
102- // super.submitAsync(events, additionalInfo, parentComponent, consumer);
103- // }
10490
10591 @ Override
10692 public boolean submit (@ NotNull final IdeaLoggingEvent [] events , @ Nullable final String additionalInfo , @ NotNull final Component parentComponent , @ NotNull final Consumer <SubmittedReportInfo > consumer ) {
107- submit (events , additionalInfo , notNullize (ErrorReportConfigurable .getInstance ().ITN_LOGIN , "<anonymous>" ), parentComponent );
93+ String name = "<anonymous>" ;
94+ submit (events , additionalInfo , name , parentComponent );
10895 return true ;
10996 }
11097
@@ -179,20 +166,18 @@ private SubmittedReportInfo submit(IdeaLoggingEvent[] ideaLoggingEvents, String
179166 // Syntax error in the regular expression
180167 }
181168
182- SubmissionStatus status = NEW_ISSUE ;
183-
184169 if (resultString == null ) {
185170 return new SubmittedReportInfo (SERVER_ISSUE_URL , "" , FAILED );
186171 }
187172
188173
189174 final SubmittedReportInfo reportInfo = new SubmittedReportInfo (SERVER_URL + "issue/" + resultString ,
190- resultString , status );
175+ resultString , NEW_ISSUE );
191176
192177
193178
194179
195- /* Now try to set the autosubmit user using a custom command */
180+ /* Now try to set the auto-submit user using a custom command */
196181 if (user != null ) {
197182 runCommand (resultString , "Autosubmit User " + user );
198183 }
@@ -206,7 +191,7 @@ private SubmittedReportInfo submit(IdeaLoggingEvent[] ideaLoggingEvents, String
206191 return reportInfo ;
207192 }
208193
209- public String submit () {
194+ private String submit () {
210195 if (isEmpty (this .myDescription )) {
211196 throw new RuntimeException (DESCRIPTION );
212197 }
@@ -246,7 +231,7 @@ public String submit() {
246231 }
247232
248233 log .info (response );
249- myCookieManager .storeCookies (conn );
234+ // myCookieManager.storeCookies(conn);
250235
251236 // project=TST&assignee=beto&summary=new issue&myDescription=myDescription of new issue
252237 // #&priority=show-stopper&type=feature&subsystem=UI&state=Reopened&affectsVersion=2.0,
@@ -281,7 +266,7 @@ public String submit() {
281266 conn = url .openConnection ();
282267
283268 conn .setDoOutput (true );
284- myCookieManager .setCookies (conn ); // Use the login from earlier
269+ // myCookieManager.setCookies(conn); // Use the login from earlier
285270
286271 wr = new OutputStreamWriter (conn .getOutputStream ());
287272 wr .write (data );
@@ -294,6 +279,7 @@ public String submit() {
294279 }
295280
296281 } catch (Exception e ) {
282+ e .printStackTrace ();
297283 log .info ("Error creating issue" , e );
298284 }
299285
@@ -334,7 +320,7 @@ private String findExisting(Integer signature) {
334320 }
335321
336322 if (resultString != null ) {
337- log .debug ("could be dumplicate of " + resultString );
323+ log .debug ("could be duplicate of " + resultString );
338324 return resultString ;
339325 }
340326
0 commit comments