48
48
import java .util .Locale ;
49
49
import java .util .Map ;
50
50
import java .util .NoSuchElementException ;
51
- import java .util .logging .Level ;
52
51
import java .util .logging .Logger ;
53
52
import java .util .regex .Matcher ;
54
53
import java .util .regex .Pattern ;
57
56
import javax .annotation .WillClose ;
58
57
59
58
import static java .util .Arrays .asList ;
59
+ import static java .util .logging .Level .FINE ;
60
60
import static org .kohsuke .github .GitHub .*;
61
61
62
62
/**
65
65
* @author Kohsuke Kawaguchi
66
66
*/
67
67
class Requester {
68
- private static final List <String > METHODS_WITHOUT_BODY = asList ("GET" , "DELETE" );
69
-
70
- protected final transient Logger logger = Logger .getLogger (getClass ().getName ());
71
-
72
68
private final GitHub root ;
73
69
private final List <Entry > args = new ArrayList <Entry >();
74
70
private final Map <String ,String > headers = new LinkedHashMap <String , String >();
@@ -530,8 +526,8 @@ private InputStream wrapStream(InputStream in) throws IOException {
530
526
} catch (IOException e2 ) {
531
527
// likely to be a network exception (e.g. SSLHandshakeException),
532
528
// uc.getResponseCode() and any other getter on the response will cause an exception
533
- if (logger .isLoggable (Level . FINE ))
534
- logger .log (Level . FINE , "Silently ignore exception retrieving response code for '" + uc .getURL () + "'" +
529
+ if (LOGGER .isLoggable (FINE ))
530
+ LOGGER .log (FINE , "Silently ignore exception retrieving response code for '" + uc .getURL () + "'" +
535
531
" handling exception " + e , e );
536
532
throw e ;
537
533
}
@@ -557,4 +553,7 @@ private InputStream wrapStream(InputStream in) throws IOException {
557
553
IOUtils .closeQuietly (es );
558
554
}
559
555
}
556
+
557
+ private static final List <String > METHODS_WITHOUT_BODY = asList ("GET" , "DELETE" );
558
+ private static final Logger LOGGER = Logger .getLogger (Requester .class .getName ());
560
559
}
0 commit comments