id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
116,900 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/listener/SourceHandler.java | SourceHandler.setRequestProperties | private void setRequestProperties() {
inboundRequestMsg.setPipeliningEnabled(pipeliningEnabled); //Value of listener config
String connectionHeaderValue = inboundRequestMsg.getHeader(HttpHeaderNames.CONNECTION.toString());
String httpVersion = (String) inboundRequestMsg.getProperty(Constants.HTT... | java | private void setRequestProperties() {
inboundRequestMsg.setPipeliningEnabled(pipeliningEnabled); //Value of listener config
String connectionHeaderValue = inboundRequestMsg.getHeader(HttpHeaderNames.CONNECTION.toString());
String httpVersion = (String) inboundRequestMsg.getProperty(Constants.HTT... | [
"private",
"void",
"setRequestProperties",
"(",
")",
"{",
"inboundRequestMsg",
".",
"setPipeliningEnabled",
"(",
"pipeliningEnabled",
")",
";",
"//Value of listener config",
"String",
"connectionHeaderValue",
"=",
"inboundRequestMsg",
".",
"getHeader",
"(",
"HttpHeaderNames... | These properties are needed in ballerina side for pipelining checks. | [
"These",
"properties",
"are",
"needed",
"in",
"ballerina",
"side",
"for",
"pipelining",
"checks",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/listener/SourceHandler.java#L249-L255 |
116,901 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/listener/SourceHandler.java | SourceHandler.setPipeliningProperties | private void setPipeliningProperties() {
if (ctx.channel().attr(Constants.MAX_RESPONSES_ALLOWED_TO_BE_QUEUED).get() == null) {
ctx.channel().attr(Constants.MAX_RESPONSES_ALLOWED_TO_BE_QUEUED).set(pipeliningLimit);
}
if (ctx.channel().attr(Constants.RESPONSE_QUEUE).get() == null) {
... | java | private void setPipeliningProperties() {
if (ctx.channel().attr(Constants.MAX_RESPONSES_ALLOWED_TO_BE_QUEUED).get() == null) {
ctx.channel().attr(Constants.MAX_RESPONSES_ALLOWED_TO_BE_QUEUED).set(pipeliningLimit);
}
if (ctx.channel().attr(Constants.RESPONSE_QUEUE).get() == null) {
... | [
"private",
"void",
"setPipeliningProperties",
"(",
")",
"{",
"if",
"(",
"ctx",
".",
"channel",
"(",
")",
".",
"attr",
"(",
"Constants",
".",
"MAX_RESPONSES_ALLOWED_TO_BE_QUEUED",
")",
".",
"get",
"(",
")",
"==",
"null",
")",
"{",
"ctx",
".",
"channel",
"... | Set pipeline related properties. These should be set only once per connection. | [
"Set",
"pipeline",
"related",
"properties",
".",
"These",
"should",
"be",
"set",
"only",
"once",
"per",
"connection",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/listener/SourceHandler.java#L260-L274 |
116,902 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/listener/SourceHandler.java | SourceHandler.setSequenceNumber | private void setSequenceNumber() {
if (LOG.isDebugEnabled()) {
LOG.debug("Sequence id of the request is set to : {}", sequenceId);
}
inboundRequestMsg.setSequenceId(sequenceId);
sequenceId++;
} | java | private void setSequenceNumber() {
if (LOG.isDebugEnabled()) {
LOG.debug("Sequence id of the request is set to : {}", sequenceId);
}
inboundRequestMsg.setSequenceId(sequenceId);
sequenceId++;
} | [
"private",
"void",
"setSequenceNumber",
"(",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Sequence id of the request is set to : {}\"",
",",
"sequenceId",
")",
";",
"}",
"inboundRequestMsg",
".",
"setSequenc... | Sequence number should be incremented per request. | [
"Sequence",
"number",
"should",
"be",
"incremented",
"per",
"request",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/listener/SourceHandler.java#L279-L285 |
116,903 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.shouldEnforceChunkingforHttpOneZero | public static boolean shouldEnforceChunkingforHttpOneZero(ChunkConfig chunkConfig, String httpVersion) {
return chunkConfig == ChunkConfig.ALWAYS && Float.valueOf(httpVersion) >= Constants.HTTP_1_0;
} | java | public static boolean shouldEnforceChunkingforHttpOneZero(ChunkConfig chunkConfig, String httpVersion) {
return chunkConfig == ChunkConfig.ALWAYS && Float.valueOf(httpVersion) >= Constants.HTTP_1_0;
} | [
"public",
"static",
"boolean",
"shouldEnforceChunkingforHttpOneZero",
"(",
"ChunkConfig",
"chunkConfig",
",",
"String",
"httpVersion",
")",
"{",
"return",
"chunkConfig",
"==",
"ChunkConfig",
".",
"ALWAYS",
"&&",
"Float",
".",
"valueOf",
"(",
"httpVersion",
")",
">="... | Returns whether to enforce chunking on HTTP 1.0 requests.
@param chunkConfig Chunking configuration.
@param httpVersion http version string.
@return true if chunking should be enforced else false. | [
"Returns",
"whether",
"to",
"enforce",
"chunking",
"on",
"HTTP",
"1",
".",
"0",
"requests",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L308-L310 |
116,904 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.configureHttpPipelineForSSL | public static SSLEngine configureHttpPipelineForSSL(SocketChannel socketChannel, String host, int port,
SSLConfig sslConfig) throws SSLException {
LOG.debug("adding ssl handler");
SSLEngine sslEngine = null;
SslHandler sslHandler;
ChannelPipeline pipeline = socketChannel.pipe... | java | public static SSLEngine configureHttpPipelineForSSL(SocketChannel socketChannel, String host, int port,
SSLConfig sslConfig) throws SSLException {
LOG.debug("adding ssl handler");
SSLEngine sslEngine = null;
SslHandler sslHandler;
ChannelPipeline pipeline = socketChannel.pipe... | [
"public",
"static",
"SSLEngine",
"configureHttpPipelineForSSL",
"(",
"SocketChannel",
"socketChannel",
",",
"String",
"host",
",",
"int",
"port",
",",
"SSLConfig",
"sslConfig",
")",
"throws",
"SSLException",
"{",
"LOG",
".",
"debug",
"(",
"\"adding ssl handler\"",
"... | Configure outbound HTTP pipeline for SSL configuration.
@param socketChannel Socket channel of outbound connection
@param sslConfig {@link SSLConfig}
@param host host of the connection
@param port port of the connection
@throws SSLException if any error occurs in the SSL connection | [
"Configure",
"outbound",
"HTTP",
"pipeline",
"for",
"SSL",
"configuration",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L321-L357 |
116,905 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.instantiateAndConfigSSL | private static SSLEngine instantiateAndConfigSSL(SSLConfig sslConfig, String host, int port,
boolean hostNameVerificationEnabled, SSLHandlerFactory sslHandlerFactory) {
// set the pipeline factory, which creates the pipeline for each newly created channels
SSLEngine sslEngine = null;
... | java | private static SSLEngine instantiateAndConfigSSL(SSLConfig sslConfig, String host, int port,
boolean hostNameVerificationEnabled, SSLHandlerFactory sslHandlerFactory) {
// set the pipeline factory, which creates the pipeline for each newly created channels
SSLEngine sslEngine = null;
... | [
"private",
"static",
"SSLEngine",
"instantiateAndConfigSSL",
"(",
"SSLConfig",
"sslConfig",
",",
"String",
"host",
",",
"int",
"port",
",",
"boolean",
"hostNameVerificationEnabled",
",",
"SSLHandlerFactory",
"sslHandlerFactory",
")",
"{",
"// set the pipeline factory, which... | Set configurations to create ssl engine.
@param sslConfig ssl related configurations
@param host host of the connection
@param port port of the connection
@param hostNameVerificationEnabled true if host name verification is enabled
@param sslHandlerFactory an instance of sslHandlerFactory
@return ssl engine | [
"Set",
"configurations",
"to",
"create",
"ssl",
"engine",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L382-L395 |
116,906 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.getSystemVariableValue | private static String getSystemVariableValue(String variableName, String defaultValue) {
String value;
if (System.getProperty(variableName) != null) {
value = System.getProperty(variableName);
} else if (System.getenv(variableName) != null) {
value = System.getenv(variabl... | java | private static String getSystemVariableValue(String variableName, String defaultValue) {
String value;
if (System.getProperty(variableName) != null) {
value = System.getProperty(variableName);
} else if (System.getenv(variableName) != null) {
value = System.getenv(variabl... | [
"private",
"static",
"String",
"getSystemVariableValue",
"(",
"String",
"variableName",
",",
"String",
"defaultValue",
")",
"{",
"String",
"value",
";",
"if",
"(",
"System",
".",
"getProperty",
"(",
"variableName",
")",
"!=",
"null",
")",
"{",
"value",
"=",
... | A utility which allows reading variables from the environment or System properties.
If the variable in available in the environment as well as a System property, the System property takes
precedence.
@param variableName System/environment variable name
@param defaultValue default value to be returned if the specified ... | [
"A",
"utility",
"which",
"allows",
"reading",
"variables",
"from",
"the",
"environment",
"or",
"System",
"properties",
".",
"If",
"the",
"variable",
"in",
"available",
"in",
"the",
"environment",
"as",
"well",
"as",
"a",
"System",
"property",
"the",
"System",
... | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L556-L566 |
116,907 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.resetChannelAttributes | public static void resetChannelAttributes(ChannelHandlerContext ctx) {
ctx.channel().attr(Constants.RESPONSE_FUTURE_OF_ORIGINAL_CHANNEL).set(null);
ctx.channel().attr(Constants.ORIGINAL_REQUEST).set(null);
ctx.channel().attr(Constants.REDIRECT_COUNT).set(null);
ctx.channel().attr(Constan... | java | public static void resetChannelAttributes(ChannelHandlerContext ctx) {
ctx.channel().attr(Constants.RESPONSE_FUTURE_OF_ORIGINAL_CHANNEL).set(null);
ctx.channel().attr(Constants.ORIGINAL_REQUEST).set(null);
ctx.channel().attr(Constants.REDIRECT_COUNT).set(null);
ctx.channel().attr(Constan... | [
"public",
"static",
"void",
"resetChannelAttributes",
"(",
"ChannelHandlerContext",
"ctx",
")",
"{",
"ctx",
".",
"channel",
"(",
")",
".",
"attr",
"(",
"Constants",
".",
"RESPONSE_FUTURE_OF_ORIGINAL_CHANNEL",
")",
".",
"set",
"(",
"null",
")",
";",
"ctx",
".",... | Reset channel attributes.
@param ctx Channel handler context | [
"Reset",
"channel",
"attributes",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L584-L591 |
116,908 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.sendAndCloseNoEntityBodyResp | public static void sendAndCloseNoEntityBodyResp(ChannelHandlerContext ctx, HttpResponseStatus status,
HttpVersion httpVersion, String serverName) {
HttpResponse outboundResponse = new DefaultHttpResponse(httpVersion, status);
outboundResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);... | java | public static void sendAndCloseNoEntityBodyResp(ChannelHandlerContext ctx, HttpResponseStatus status,
HttpVersion httpVersion, String serverName) {
HttpResponse outboundResponse = new DefaultHttpResponse(httpVersion, status);
outboundResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);... | [
"public",
"static",
"void",
"sendAndCloseNoEntityBodyResp",
"(",
"ChannelHandlerContext",
"ctx",
",",
"HttpResponseStatus",
"status",
",",
"HttpVersion",
"httpVersion",
",",
"String",
"serverName",
")",
"{",
"HttpResponse",
"outboundResponse",
"=",
"new",
"DefaultHttpResp... | Send back no entity body response and close the connection. This function is mostly used
when we send back error messages.
@param ctx connection
@param status response status
@param httpVersion of the response
@param serverName server name | [
"Send",
"back",
"no",
"entity",
"body",
"response",
"and",
"close",
"the",
"connection",
".",
"This",
"function",
"is",
"mostly",
"used",
"when",
"we",
"send",
"back",
"error",
"messages",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L612-L622 |
116,909 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.checkForResponseWriteStatus | public static void checkForResponseWriteStatus(HttpCarbonMessage inboundRequestMsg,
HttpResponseFuture outboundRespStatusFuture, ChannelFuture channelFuture) {
channelFuture.addListener(writeOperationPromise -> {
Throwable throwable = writeOperationPromise.... | java | public static void checkForResponseWriteStatus(HttpCarbonMessage inboundRequestMsg,
HttpResponseFuture outboundRespStatusFuture, ChannelFuture channelFuture) {
channelFuture.addListener(writeOperationPromise -> {
Throwable throwable = writeOperationPromise.... | [
"public",
"static",
"void",
"checkForResponseWriteStatus",
"(",
"HttpCarbonMessage",
"inboundRequestMsg",
",",
"HttpResponseFuture",
"outboundRespStatusFuture",
",",
"ChannelFuture",
"channelFuture",
")",
"{",
"channelFuture",
".",
"addListener",
"(",
"writeOperationPromise",
... | Checks for status of the response write operation.
@param inboundRequestMsg request message received from the client
@param outboundRespStatusFuture the future of outbound response write operation
@param channelFuture the channel future related to response write operation | [
"Checks",
"for",
"status",
"of",
"the",
"response",
"write",
"operation",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L631-L644 |
116,910 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.addResponseWriteFailureListener | public static void addResponseWriteFailureListener(HttpResponseFuture outboundRespStatusFuture,
ChannelFuture channelFuture) {
channelFuture.addListener(writeOperationPromise -> {
Throwable throwable = writeOperationPromise.cause();
... | java | public static void addResponseWriteFailureListener(HttpResponseFuture outboundRespStatusFuture,
ChannelFuture channelFuture) {
channelFuture.addListener(writeOperationPromise -> {
Throwable throwable = writeOperationPromise.cause();
... | [
"public",
"static",
"void",
"addResponseWriteFailureListener",
"(",
"HttpResponseFuture",
"outboundRespStatusFuture",
",",
"ChannelFuture",
"channelFuture",
")",
"{",
"channelFuture",
".",
"addListener",
"(",
"writeOperationPromise",
"->",
"{",
"Throwable",
"throwable",
"="... | Adds a listener to notify the outbound response future if an error occurs while writing the response message.
@param outboundRespStatusFuture the future of outbound response write operation
@param channelFuture the channel future related to response write operation | [
"Adds",
"a",
"listener",
"to",
"notify",
"the",
"outbound",
"response",
"future",
"if",
"an",
"error",
"occurs",
"while",
"writing",
"the",
"response",
"message",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L652-L663 |
116,911 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.createHTTPCarbonMessage | public static HttpCarbonMessage createHTTPCarbonMessage(HttpMessage httpMessage, ChannelHandlerContext ctx) {
Listener contentListener = new DefaultListener(ctx);
return new HttpCarbonMessage(httpMessage, contentListener);
} | java | public static HttpCarbonMessage createHTTPCarbonMessage(HttpMessage httpMessage, ChannelHandlerContext ctx) {
Listener contentListener = new DefaultListener(ctx);
return new HttpCarbonMessage(httpMessage, contentListener);
} | [
"public",
"static",
"HttpCarbonMessage",
"createHTTPCarbonMessage",
"(",
"HttpMessage",
"httpMessage",
",",
"ChannelHandlerContext",
"ctx",
")",
"{",
"Listener",
"contentListener",
"=",
"new",
"DefaultListener",
"(",
"ctx",
")",
";",
"return",
"new",
"HttpCarbonMessage"... | Creates HTTP carbon message.
@param httpMessage HTTP message
@param ctx Channel handler context
@return HttpCarbonMessage | [
"Creates",
"HTTP",
"carbon",
"message",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L672-L675 |
116,912 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.safelyRemoveHandlers | public static void safelyRemoveHandlers(ChannelPipeline pipeline, String... handlerNames) {
for (String name : handlerNames) {
if (pipeline.get(name) != null) {
pipeline.remove(name);
} else {
LOG.debug("Trying to remove not engaged {} handler from the pip... | java | public static void safelyRemoveHandlers(ChannelPipeline pipeline, String... handlerNames) {
for (String name : handlerNames) {
if (pipeline.get(name) != null) {
pipeline.remove(name);
} else {
LOG.debug("Trying to remove not engaged {} handler from the pip... | [
"public",
"static",
"void",
"safelyRemoveHandlers",
"(",
"ChannelPipeline",
"pipeline",
",",
"String",
"...",
"handlerNames",
")",
"{",
"for",
"(",
"String",
"name",
":",
"handlerNames",
")",
"{",
"if",
"(",
"pipeline",
".",
"get",
"(",
"name",
")",
"!=",
... | Removes handlers from the pipeline if they are present.
@param pipeline the channel pipeline
@param handlerNames names of the handlers to be removed | [
"Removes",
"handlers",
"from",
"the",
"pipeline",
"if",
"they",
"are",
"present",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L683-L691 |
116,913 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.createInboundReqCarbonMsg | public static HttpCarbonMessage createInboundReqCarbonMsg(HttpRequest httpRequestHeaders,
ChannelHandlerContext ctx, SourceHandler sourceHandler) {
HttpCarbonMessage inboundRequestMsg =
new HttpCarbonRequest(httpRequestHeaders, new DefaultListener(ctx));
inboundRequestMsg.se... | java | public static HttpCarbonMessage createInboundReqCarbonMsg(HttpRequest httpRequestHeaders,
ChannelHandlerContext ctx, SourceHandler sourceHandler) {
HttpCarbonMessage inboundRequestMsg =
new HttpCarbonRequest(httpRequestHeaders, new DefaultListener(ctx));
inboundRequestMsg.se... | [
"public",
"static",
"HttpCarbonMessage",
"createInboundReqCarbonMsg",
"(",
"HttpRequest",
"httpRequestHeaders",
",",
"ChannelHandlerContext",
"ctx",
",",
"SourceHandler",
"sourceHandler",
")",
"{",
"HttpCarbonMessage",
"inboundRequestMsg",
"=",
"new",
"HttpCarbonRequest",
"("... | Create a HttpCarbonMessage using the netty inbound http request.
@param httpRequestHeaders of inbound request
@param ctx of the inbound request
@param sourceHandler instance which handled the particular request
@return HttpCarbon message | [
"Create",
"a",
"HttpCarbonMessage",
"using",
"the",
"netty",
"inbound",
"http",
"request",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L700-L737 |
116,914 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.createInboundRespCarbonMsg | public static HttpCarbonMessage createInboundRespCarbonMsg(ChannelHandlerContext ctx,
HttpResponse httpResponseHeaders,
HttpCarbonMessage outboundRequestMsg) {
HttpCarbonMessage inboundR... | java | public static HttpCarbonMessage createInboundRespCarbonMsg(ChannelHandlerContext ctx,
HttpResponse httpResponseHeaders,
HttpCarbonMessage outboundRequestMsg) {
HttpCarbonMessage inboundR... | [
"public",
"static",
"HttpCarbonMessage",
"createInboundRespCarbonMsg",
"(",
"ChannelHandlerContext",
"ctx",
",",
"HttpResponse",
"httpResponseHeaders",
",",
"HttpCarbonMessage",
"outboundRequestMsg",
")",
"{",
"HttpCarbonMessage",
"inboundResponseMsg",
"=",
"new",
"HttpCarbonRe... | Create a HttpCarbonMessage using the netty inbound response message.
@param ctx of the inbound response message
@param httpResponseHeaders of the inbound response message
@param outboundRequestMsg is the correlated outbound request message
@return HttpCarbon message | [
"Create",
"a",
"HttpCarbonMessage",
"using",
"the",
"netty",
"inbound",
"response",
"message",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L746-L762 |
116,915 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.isKeepAlive | public static boolean isKeepAlive(KeepAliveConfig keepAliveConfig, HttpCarbonMessage outboundRequestMsg)
throws ConfigurationException {
switch (keepAliveConfig) {
case AUTO:
return Float.valueOf((String) outboundRequestMsg.getProperty(Constants.HTTP_VERSION)) > Constants.HTTP_1_... | java | public static boolean isKeepAlive(KeepAliveConfig keepAliveConfig, HttpCarbonMessage outboundRequestMsg)
throws ConfigurationException {
switch (keepAliveConfig) {
case AUTO:
return Float.valueOf((String) outboundRequestMsg.getProperty(Constants.HTTP_VERSION)) > Constants.HTTP_1_... | [
"public",
"static",
"boolean",
"isKeepAlive",
"(",
"KeepAliveConfig",
"keepAliveConfig",
",",
"HttpCarbonMessage",
"outboundRequestMsg",
")",
"throws",
"ConfigurationException",
"{",
"switch",
"(",
"keepAliveConfig",
")",
"{",
"case",
"AUTO",
":",
"return",
"Float",
"... | Check whether a connection should alive or not.
@param keepAliveConfig of the connection
@param outboundRequestMsg of this particular transaction
@return true if the connection should be kept alive
@throws ConfigurationException for invalid configurations | [
"Check",
"whether",
"a",
"connection",
"should",
"alive",
"or",
"not",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L771-L786 |
116,916 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.is100ContinueRequest | public static boolean is100ContinueRequest(HttpCarbonMessage inboundRequestMsg) {
return HEADER_VAL_100_CONTINUE.equalsIgnoreCase(
inboundRequestMsg.getHeader(HttpHeaderNames.EXPECT.toString()));
} | java | public static boolean is100ContinueRequest(HttpCarbonMessage inboundRequestMsg) {
return HEADER_VAL_100_CONTINUE.equalsIgnoreCase(
inboundRequestMsg.getHeader(HttpHeaderNames.EXPECT.toString()));
} | [
"public",
"static",
"boolean",
"is100ContinueRequest",
"(",
"HttpCarbonMessage",
"inboundRequestMsg",
")",
"{",
"return",
"HEADER_VAL_100_CONTINUE",
".",
"equalsIgnoreCase",
"(",
"inboundRequestMsg",
".",
"getHeader",
"(",
"HttpHeaderNames",
".",
"EXPECT",
".",
"toString"... | Check whether a particular request is expecting continue.
@param inboundRequestMsg in question
@return true if the request expects 100-continue response | [
"Check",
"whether",
"a",
"particular",
"request",
"is",
"expecting",
"continue",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L793-L796 |
116,917 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.isKeepAliveConnection | public static boolean isKeepAliveConnection(KeepAliveConfig keepAliveConfig, String requestConnectionHeader,
String httpVersion) {
if (keepAliveConfig == null || keepAliveConfig == KeepAliveConfig.AUTO) {
if (Float.valueOf(httpVersion) <= Constants.HTT... | java | public static boolean isKeepAliveConnection(KeepAliveConfig keepAliveConfig, String requestConnectionHeader,
String httpVersion) {
if (keepAliveConfig == null || keepAliveConfig == KeepAliveConfig.AUTO) {
if (Float.valueOf(httpVersion) <= Constants.HTT... | [
"public",
"static",
"boolean",
"isKeepAliveConnection",
"(",
"KeepAliveConfig",
"keepAliveConfig",
",",
"String",
"requestConnectionHeader",
",",
"String",
"httpVersion",
")",
"{",
"if",
"(",
"keepAliveConfig",
"==",
"null",
"||",
"keepAliveConfig",
"==",
"KeepAliveConf... | Decide whether the connection should be kept open.
@param keepAliveConfig Represents keepalive configuration
@param requestConnectionHeader Connection header of the request
@param httpVersion Represents HTTP version
@return A boolean indicating whether to keep the connection open or not | [
"Decide",
"whether",
"the",
"connection",
"should",
"be",
"kept",
"open",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L806-L819 |
116,918 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.setBackPressureListener | public static void setBackPressureListener(boolean passthrough, BackPressureHandler backpressureHandler,
ChannelHandlerContext inContext) {
if (backpressureHandler != null) {
if (inContext != null && passthrough) {
backpressureHandler.ge... | java | public static void setBackPressureListener(boolean passthrough, BackPressureHandler backpressureHandler,
ChannelHandlerContext inContext) {
if (backpressureHandler != null) {
if (inContext != null && passthrough) {
backpressureHandler.ge... | [
"public",
"static",
"void",
"setBackPressureListener",
"(",
"boolean",
"passthrough",
",",
"BackPressureHandler",
"backpressureHandler",
",",
"ChannelHandlerContext",
"inContext",
")",
"{",
"if",
"(",
"backpressureHandler",
"!=",
"null",
")",
"{",
"if",
"(",
"inContex... | Sets the backPressure listener the to the Observable of the handler.
@param passthrough true if passthrough
@param backpressureHandler the handler that checks for writability.
@param inContext {@link ChannelHandlerContext} of a handler in the incoming channel. | [
"Sets",
"the",
"backPressure",
"listener",
"the",
"to",
"the",
"Observable",
"of",
"the",
"handler",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L852-L863 |
116,919 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.checkUnWritabilityAndNotify | public static void checkUnWritabilityAndNotify(ChannelHandlerContext context,
BackPressureHandler backpressureHandler) {
if (backpressureHandler != null) {
Channel channel = context.channel();
if (!channel.isWritable() && channel.isActiv... | java | public static void checkUnWritabilityAndNotify(ChannelHandlerContext context,
BackPressureHandler backpressureHandler) {
if (backpressureHandler != null) {
Channel channel = context.channel();
if (!channel.isWritable() && channel.isActiv... | [
"public",
"static",
"void",
"checkUnWritabilityAndNotify",
"(",
"ChannelHandlerContext",
"context",
",",
"BackPressureHandler",
"backpressureHandler",
")",
"{",
"if",
"(",
"backpressureHandler",
"!=",
"null",
")",
"{",
"Channel",
"channel",
"=",
"context",
".",
"chann... | Checks if channel is unWritable and notifies BackPressure observable.
@param context The context on which to check writablity.
@param backpressureHandler The back pressure handler with the observable. | [
"Checks",
"if",
"channel",
"is",
"unWritable",
"and",
"notifies",
"BackPressure",
"observable",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L871-L879 |
116,920 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/HttpClientChannelInitializer.java | HttpClientChannelInitializer.configureProxyServer | private void configureProxyServer(ChannelPipeline clientPipeline) {
if (proxyServerConfiguration != null && sslConfig != null) {
if (proxyServerConfiguration.getProxyUsername() != null
&& proxyServerConfiguration.getProxyPassword() != null) {
clientPipeline.addLas... | java | private void configureProxyServer(ChannelPipeline clientPipeline) {
if (proxyServerConfiguration != null && sslConfig != null) {
if (proxyServerConfiguration.getProxyUsername() != null
&& proxyServerConfiguration.getProxyPassword() != null) {
clientPipeline.addLas... | [
"private",
"void",
"configureProxyServer",
"(",
"ChannelPipeline",
"clientPipeline",
")",
"{",
"if",
"(",
"proxyServerConfiguration",
"!=",
"null",
"&&",
"sslConfig",
"!=",
"null",
")",
"{",
"if",
"(",
"proxyServerConfiguration",
".",
"getProxyUsername",
"(",
")",
... | Use netty proxy handler only if scheme is https | [
"Use",
"netty",
"proxy",
"handler",
"only",
"if",
"scheme",
"is",
"https"
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/HttpClientChannelInitializer.java#L150-L163 |
116,921 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/HttpClientChannelInitializer.java | HttpClientChannelInitializer.configureHttp2UpgradePipeline | private void configureHttp2UpgradePipeline(ChannelPipeline pipeline, HttpClientCodec sourceCodec,
TargetHandler targetHandler) {
pipeline.addLast(sourceCodec);
addCommonHandlers(pipeline);
Http2ClientUpgradeCodec upgradeCodec = new Http2ClientUpgrad... | java | private void configureHttp2UpgradePipeline(ChannelPipeline pipeline, HttpClientCodec sourceCodec,
TargetHandler targetHandler) {
pipeline.addLast(sourceCodec);
addCommonHandlers(pipeline);
Http2ClientUpgradeCodec upgradeCodec = new Http2ClientUpgrad... | [
"private",
"void",
"configureHttp2UpgradePipeline",
"(",
"ChannelPipeline",
"pipeline",
",",
"HttpClientCodec",
"sourceCodec",
",",
"TargetHandler",
"targetHandler",
")",
"{",
"pipeline",
".",
"addLast",
"(",
"sourceCodec",
")",
";",
"addCommonHandlers",
"(",
"pipeline"... | Creates the pipeline for handing http2 upgrade.
@param pipeline the client channel pipeline
@param sourceCodec the source codec handler
@param targetHandler the target handler | [
"Creates",
"the",
"pipeline",
"for",
"handing",
"http2",
"upgrade",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/HttpClientChannelInitializer.java#L214-L223 |
116,922 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/HttpClientChannelInitializer.java | HttpClientChannelInitializer.configureHttp2Pipeline | private void configureHttp2Pipeline(ChannelPipeline pipeline) {
pipeline.addLast(Constants.CONNECTION_HANDLER, http2ConnectionHandler);
pipeline.addLast(Constants.HTTP2_TARGET_HANDLER, http2TargetHandler);
pipeline.addLast(Constants.DECOMPRESSOR_HANDLER, new HttpContentDecompressor());
} | java | private void configureHttp2Pipeline(ChannelPipeline pipeline) {
pipeline.addLast(Constants.CONNECTION_HANDLER, http2ConnectionHandler);
pipeline.addLast(Constants.HTTP2_TARGET_HANDLER, http2TargetHandler);
pipeline.addLast(Constants.DECOMPRESSOR_HANDLER, new HttpContentDecompressor());
} | [
"private",
"void",
"configureHttp2Pipeline",
"(",
"ChannelPipeline",
"pipeline",
")",
"{",
"pipeline",
".",
"addLast",
"(",
"Constants",
".",
"CONNECTION_HANDLER",
",",
"http2ConnectionHandler",
")",
";",
"pipeline",
".",
"addLast",
"(",
"Constants",
".",
"HTTP2_TAR... | Creates the pipeline for http2 requests which does not involve a connection upgrade.
@param pipeline the client channel pipeline | [
"Creates",
"the",
"pipeline",
"for",
"http2",
"requests",
"which",
"does",
"not",
"involve",
"a",
"connection",
"upgrade",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/HttpClientChannelInitializer.java#L230-L234 |
116,923 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/HttpClientChannelInitializer.java | HttpClientChannelInitializer.configureHttpPipeline | public void configureHttpPipeline(ChannelPipeline pipeline, TargetHandler targetHandler) {
pipeline.addLast(Constants.HTTP_CLIENT_CODEC, new HttpClientCodec());
addCommonHandlers(pipeline);
pipeline.addLast(Constants.BACK_PRESSURE_HANDLER, new BackPressureHandler());
pipeline.addLast(Con... | java | public void configureHttpPipeline(ChannelPipeline pipeline, TargetHandler targetHandler) {
pipeline.addLast(Constants.HTTP_CLIENT_CODEC, new HttpClientCodec());
addCommonHandlers(pipeline);
pipeline.addLast(Constants.BACK_PRESSURE_HANDLER, new BackPressureHandler());
pipeline.addLast(Con... | [
"public",
"void",
"configureHttpPipeline",
"(",
"ChannelPipeline",
"pipeline",
",",
"TargetHandler",
"targetHandler",
")",
"{",
"pipeline",
".",
"addLast",
"(",
"Constants",
".",
"HTTP_CLIENT_CODEC",
",",
"new",
"HttpClientCodec",
"(",
")",
")",
";",
"addCommonHandl... | Creates pipeline for http requests.
@param pipeline the client channel pipeline
@param targetHandler the target handler | [
"Creates",
"pipeline",
"for",
"http",
"requests",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/HttpClientChannelInitializer.java#L242-L247 |
116,924 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/HttpClientChannelInitializer.java | HttpClientChannelInitializer.addCommonHandlers | private void addCommonHandlers(ChannelPipeline pipeline) {
pipeline.addLast(Constants.DECOMPRESSOR_HANDLER, new HttpContentDecompressor());
if (httpTraceLogEnabled) {
pipeline.addLast(Constants.HTTP_TRACE_LOG_HANDLER,
new HttpTraceLoggingHandler(Constants.TRACE_LOG_UPSTRE... | java | private void addCommonHandlers(ChannelPipeline pipeline) {
pipeline.addLast(Constants.DECOMPRESSOR_HANDLER, new HttpContentDecompressor());
if (httpTraceLogEnabled) {
pipeline.addLast(Constants.HTTP_TRACE_LOG_HANDLER,
new HttpTraceLoggingHandler(Constants.TRACE_LOG_UPSTRE... | [
"private",
"void",
"addCommonHandlers",
"(",
"ChannelPipeline",
"pipeline",
")",
"{",
"pipeline",
".",
"addLast",
"(",
"Constants",
".",
"DECOMPRESSOR_HANDLER",
",",
"new",
"HttpContentDecompressor",
"(",
")",
")",
";",
"if",
"(",
"httpTraceLogEnabled",
")",
"{",
... | Add common handlers used in both http2 and http.
@param pipeline the client channel pipeline | [
"Add",
"common",
"handlers",
"used",
"in",
"both",
"http2",
"and",
"http",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/HttpClientChannelInitializer.java#L254-L260 |
116,925 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/OutboundMsgHolder.java | OutboundMsgHolder.addPushResponse | public void addPushResponse(int streamId, HttpCarbonResponse pushResponse) {
pushResponsesMap.put(streamId, pushResponse);
responseFuture.notifyPushResponse(streamId, pushResponse);
} | java | public void addPushResponse(int streamId, HttpCarbonResponse pushResponse) {
pushResponsesMap.put(streamId, pushResponse);
responseFuture.notifyPushResponse(streamId, pushResponse);
} | [
"public",
"void",
"addPushResponse",
"(",
"int",
"streamId",
",",
"HttpCarbonResponse",
"pushResponse",
")",
"{",
"pushResponsesMap",
".",
"put",
"(",
"streamId",
",",
"pushResponse",
")",
";",
"responseFuture",
".",
"notifyPushResponse",
"(",
"streamId",
",",
"pu... | Adds a push response message.
@param streamId id of the stream in which the push response received
@param pushResponse push response message | [
"Adds",
"a",
"push",
"response",
"message",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/OutboundMsgHolder.java#L106-L109 |
116,926 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/ocsp/OCSPCache.java | OCSPCache.init | public void init(int size, int delay) {
if (cacheManager == null) {
synchronized (OCSPCache.class) {
if (cacheManager == null) {
cacheManager = new CacheManager(cache, size, delay);
CacheController mbean = new CacheController(cache, cacheM... | java | public void init(int size, int delay) {
if (cacheManager == null) {
synchronized (OCSPCache.class) {
if (cacheManager == null) {
cacheManager = new CacheManager(cache, size, delay);
CacheController mbean = new CacheController(cache, cacheM... | [
"public",
"void",
"init",
"(",
"int",
"size",
",",
"int",
"delay",
")",
"{",
"if",
"(",
"cacheManager",
"==",
"null",
")",
"{",
"synchronized",
"(",
"OCSPCache",
".",
"class",
")",
"{",
"if",
"(",
"cacheManager",
"==",
"null",
")",
"{",
"cacheManager",... | This lazy initializes the cache with a CacheManager. If this method is not called,
a cache manager will not be used.
@param size max size of the cache
@param delay defines how frequently the CacheManager will be started | [
"This",
"lazy",
"initializes",
"the",
"cache",
"with",
"a",
"CacheManager",
".",
"If",
"this",
"method",
"is",
"not",
"called",
"a",
"cache",
"manager",
"will",
"not",
"be",
"used",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/ocsp/OCSPCache.java#L78-L88 |
116,927 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/DefaultHttpWsConnectorFactory.java | DefaultHttpWsConnectorFactory.shutdownNow | public void shutdownNow() {
allChannels.close();
workerGroup.shutdownGracefully();
bossGroup.shutdownGracefully();
clientGroup.shutdownGracefully();
if (pipeliningGroup != null) {
pipeliningGroup.shutdownGracefully();
}
} | java | public void shutdownNow() {
allChannels.close();
workerGroup.shutdownGracefully();
bossGroup.shutdownGracefully();
clientGroup.shutdownGracefully();
if (pipeliningGroup != null) {
pipeliningGroup.shutdownGracefully();
}
} | [
"public",
"void",
"shutdownNow",
"(",
")",
"{",
"allChannels",
".",
"close",
"(",
")",
";",
"workerGroup",
".",
"shutdownGracefully",
"(",
")",
";",
"bossGroup",
".",
"shutdownGracefully",
"(",
")",
";",
"clientGroup",
".",
"shutdownGracefully",
"(",
")",
";... | This method is for shutting down the connectors without a delay. | [
"This",
"method",
"is",
"for",
"shutting",
"down",
"the",
"connectors",
"without",
"a",
"delay",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/DefaultHttpWsConnectorFactory.java#L176-L184 |
116,928 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/crl/CRLVerifier.java | CRLVerifier.downloadCRLFromWeb | protected X509CRL downloadCRLFromWeb(String crlURL) throws IOException, CertificateVerificationException {
URL url = new URL(crlURL);
try (InputStream crlStream = url.openStream()) {
CertificateFactory cf = CertificateFactory.getInstance(Constants.X_509);
return (X509CRL) cf.... | java | protected X509CRL downloadCRLFromWeb(String crlURL) throws IOException, CertificateVerificationException {
URL url = new URL(crlURL);
try (InputStream crlStream = url.openStream()) {
CertificateFactory cf = CertificateFactory.getInstance(Constants.X_509);
return (X509CRL) cf.... | [
"protected",
"X509CRL",
"downloadCRLFromWeb",
"(",
"String",
"crlURL",
")",
"throws",
"IOException",
",",
"CertificateVerificationException",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"crlURL",
")",
";",
"try",
"(",
"InputStream",
"crlStream",
"=",
"url",
".",
... | Downloads CRL from the crlUrl. Does not support HTTPS.
@param crlURL URL of the CRL distribution point.
@return Downloaded CRL.
@throws IOException If an error occurs while downloading the CRL from web.
@throws CertificateVerificationException If an error occurs in CRL download process. | [
"Downloads",
"CRL",
"from",
"the",
"crlUrl",
".",
"Does",
"not",
"support",
"HTTPS",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/crl/CRLVerifier.java#L124-L138 |
116,929 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/crl/CRLVerifier.java | CRLVerifier.getCrlDistributionPoints | private List<String> getCrlDistributionPoints(X509Certificate cert) throws CertificateVerificationException {
//Gets the DER-encoded OCTET string for the extension value for CRLDistributionPoints.
byte[] crlDPExtensionValue = cert.getExtensionValue(Extension.cRLDistributionPoints.getId());
... | java | private List<String> getCrlDistributionPoints(X509Certificate cert) throws CertificateVerificationException {
//Gets the DER-encoded OCTET string for the extension value for CRLDistributionPoints.
byte[] crlDPExtensionValue = cert.getExtensionValue(Extension.cRLDistributionPoints.getId());
... | [
"private",
"List",
"<",
"String",
">",
"getCrlDistributionPoints",
"(",
"X509Certificate",
"cert",
")",
"throws",
"CertificateVerificationException",
"{",
"//Gets the DER-encoded OCTET string for the extension value for CRLDistributionPoints.\r",
"byte",
"[",
"]",
"crlDPExtensionVa... | Extracts all CRL distribution point URLs from the "CRL Distribution Point"
extension in a X.509 certificate. If CRL distribution point extension is
unavailable, returns an empty list. | [
"Extracts",
"all",
"CRL",
"distribution",
"point",
"URLs",
"from",
"the",
"CRL",
"Distribution",
"Point",
"extension",
"in",
"a",
"X",
".",
"509",
"certificate",
".",
"If",
"CRL",
"distribution",
"point",
"extension",
"is",
"unavailable",
"returns",
"an",
"emp... | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/crl/CRLVerifier.java#L145-L195 |
116,930 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/listener/OCSPResponseBuilder.java | OCSPResponseBuilder.getKeyStore | public static KeyStore getKeyStore(File keyStoreFile, String keyStorePassword, String tlsStoreType)
throws IOException {
KeyStore keyStore = null;
if (keyStoreFile != null && keyStorePassword != null) {
try (InputStream inputStream = new FileInputStream(keyStoreFile)) {
... | java | public static KeyStore getKeyStore(File keyStoreFile, String keyStorePassword, String tlsStoreType)
throws IOException {
KeyStore keyStore = null;
if (keyStoreFile != null && keyStorePassword != null) {
try (InputStream inputStream = new FileInputStream(keyStoreFile)) {
... | [
"public",
"static",
"KeyStore",
"getKeyStore",
"(",
"File",
"keyStoreFile",
",",
"String",
"keyStorePassword",
",",
"String",
"tlsStoreType",
")",
"throws",
"IOException",
"{",
"KeyStore",
"keyStore",
"=",
"null",
";",
"if",
"(",
"keyStoreFile",
"!=",
"null",
"&... | Method to create a keystore and return.
@param keyStoreFile keyStore file
@param keyStorePassword keyStore password
@param tlsStoreType PKCS12
@return keystore
@throws IOException Occurs if it fails to create the keystore. | [
"Method",
"to",
"create",
"a",
"keystore",
"and",
"return",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/listener/OCSPResponseBuilder.java#L141-L153 |
116,931 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/listener/OCSPResponseBuilder.java | OCSPResponseBuilder.getAIALocations | public static List<String> getAIALocations(X509Certificate userCertificate)
throws CertificateVerificationException {
List<String> locations;
//List the AIA locations from the certificate. Those are the URL's of CA s.
try {
locations = OCSPVerifier.getAIALocations(userCer... | java | public static List<String> getAIALocations(X509Certificate userCertificate)
throws CertificateVerificationException {
List<String> locations;
//List the AIA locations from the certificate. Those are the URL's of CA s.
try {
locations = OCSPVerifier.getAIALocations(userCer... | [
"public",
"static",
"List",
"<",
"String",
">",
"getAIALocations",
"(",
"X509Certificate",
"userCertificate",
")",
"throws",
"CertificateVerificationException",
"{",
"List",
"<",
"String",
">",
"locations",
";",
"//List the AIA locations from the certificate. Those are the UR... | List Certificate authority url information.
@param userCertificate User's own certificate.
@return AIA Locations
@throws CertificateVerificationException If an error occurs while getting the AIA locations from the certificate. | [
"List",
"Certificate",
"authority",
"url",
"information",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/listener/OCSPResponseBuilder.java#L162-L172 |
116,932 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/listener/OCSPResponseBuilder.java | OCSPResponseBuilder.getOCSPResponse | public static OCSPResp getOCSPResponse(List<String> locations, OCSPReq request, X509Certificate userCertificate,
OCSPCache ocspCache) throws CertificateVerificationException {
SingleResp[] responses;
BasicOCSPResp basicResponse;
CertificateStatus certificateStatus;
for (Strin... | java | public static OCSPResp getOCSPResponse(List<String> locations, OCSPReq request, X509Certificate userCertificate,
OCSPCache ocspCache) throws CertificateVerificationException {
SingleResp[] responses;
BasicOCSPResp basicResponse;
CertificateStatus certificateStatus;
for (Strin... | [
"public",
"static",
"OCSPResp",
"getOCSPResponse",
"(",
"List",
"<",
"String",
">",
"locations",
",",
"OCSPReq",
"request",
",",
"X509Certificate",
"userCertificate",
",",
"OCSPCache",
"ocspCache",
")",
"throws",
"CertificateVerificationException",
"{",
"SingleResp",
... | Get OCSP response from cache.
@param locations CA locations
@param request OCSP request
@param userCertificate User's certificate
@param ocspCache cache to store ocsp responses
@return Ocsp response
@throws CertificateVerificationException If an error occurs while getting the response. | [
"Get",
"OCSP",
"response",
"from",
"cache",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/listener/OCSPResponseBuilder.java#L184-L220 |
116,933 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/RevocationVerificationManager.java | RevocationVerificationManager.verifyRevocationStatus | public boolean verifyRevocationStatus(javax.security.cert.X509Certificate[] peerCertificates)
throws CertificateVerificationException {
X509Certificate[] convertedCertificates = convert(peerCertificates);
long start = System.currentTimeMillis();
// If not set by the user, def... | java | public boolean verifyRevocationStatus(javax.security.cert.X509Certificate[] peerCertificates)
throws CertificateVerificationException {
X509Certificate[] convertedCertificates = convert(peerCertificates);
long start = System.currentTimeMillis();
// If not set by the user, def... | [
"public",
"boolean",
"verifyRevocationStatus",
"(",
"javax",
".",
"security",
".",
"cert",
".",
"X509Certificate",
"[",
"]",
"peerCertificates",
")",
"throws",
"CertificateVerificationException",
"{",
"X509Certificate",
"[",
"]",
"convertedCertificates",
"=",
"convert",... | This method first tries to verify the given certificate chain using OCSP since OCSP verification is
faster. If that fails it tries to do the verification using CRL.
@param peerCertificates javax.security.cert.X509Certificate[] array of peer certificate chain from peer/client.
@throws CertificateVerificationException O... | [
"This",
"method",
"first",
"tries",
"to",
"verify",
"the",
"given",
"certificate",
"chain",
"using",
"OCSP",
"since",
"OCSP",
"verification",
"is",
"faster",
".",
"If",
"that",
"fails",
"it",
"tries",
"to",
"do",
"the",
"verification",
"using",
"CRL",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/RevocationVerificationManager.java#L65-L95 |
116,934 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/RevocationVerificationManager.java | RevocationVerificationManager.convert | private X509Certificate[] convert(javax.security.cert.X509Certificate[] certs)
throws CertificateVerificationException {
X509Certificate[] certChain = new X509Certificate[certs.length];
Throwable exceptionThrown;
for (int i = 0; i < certs.length; i++) {
try {
... | java | private X509Certificate[] convert(javax.security.cert.X509Certificate[] certs)
throws CertificateVerificationException {
X509Certificate[] certChain = new X509Certificate[certs.length];
Throwable exceptionThrown;
for (int i = 0; i < certs.length; i++) {
try {
... | [
"private",
"X509Certificate",
"[",
"]",
"convert",
"(",
"javax",
".",
"security",
".",
"cert",
".",
"X509Certificate",
"[",
"]",
"certs",
")",
"throws",
"CertificateVerificationException",
"{",
"X509Certificate",
"[",
"]",
"certChain",
"=",
"new",
"X509Certificate... | Convert certificates and create a certificate chain.
@param certs array of javax.security.cert.X509Certificate[] s.
@return the converted array of java.security.cert.X509Certificate[] s.
@throws CertificateVerificationException If an error occurs while converting certificates
from java to javax | [
"Convert",
"certificates",
"and",
"create",
"a",
"certificate",
"chain",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/RevocationVerificationManager.java#L104-L121 |
116,935 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/message/Http2PushPromise.java | Http2PushPromise.addHeader | public void addHeader(String name, String value) {
httpRequest.headers().add(name, value);
} | java | public void addHeader(String name, String value) {
httpRequest.headers().add(name, value);
} | [
"public",
"void",
"addHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"httpRequest",
".",
"headers",
"(",
")",
".",
"add",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Adds a header to the push promise.
This will not replace the value of an already exists header.
@param name the header name
@param value value of the header | [
"Adds",
"a",
"header",
"to",
"the",
"push",
"promise",
".",
"This",
"will",
"not",
"replace",
"the",
"value",
"of",
"an",
"already",
"exists",
"header",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/message/Http2PushPromise.java#L98-L100 |
116,936 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/message/Http2PushPromise.java | Http2PushPromise.getHeaders | public String[] getHeaders(String name) {
List<String> headerList = httpRequest.headers().getAll(name);
return headerList.toArray(new String[0]);
} | java | public String[] getHeaders(String name) {
List<String> headerList = httpRequest.headers().getAll(name);
return headerList.toArray(new String[0]);
} | [
"public",
"String",
"[",
"]",
"getHeaders",
"(",
"String",
"name",
")",
"{",
"List",
"<",
"String",
">",
"headerList",
"=",
"httpRequest",
".",
"headers",
"(",
")",
".",
"getAll",
"(",
"name",
")",
";",
"return",
"headerList",
".",
"toArray",
"(",
"new... | Gets all header values for a given header name.
@param name name of the header
@return array of header values | [
"Gets",
"all",
"header",
"values",
"for",
"a",
"given",
"header",
"name",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/message/Http2PushPromise.java#L128-L131 |
116,937 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/message/Http2PushPromise.java | Http2PushPromise.setHeader | public void setHeader(String name, String value) {
httpRequest.headers().set(name, value);
} | java | public void setHeader(String name, String value) {
httpRequest.headers().set(name, value);
} | [
"public",
"void",
"setHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"httpRequest",
".",
"headers",
"(",
")",
".",
"set",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Sets a header value for a given header name.
This replaces the value of an already existing header.
@param name name of the header
@param value value of the header | [
"Sets",
"a",
"header",
"value",
"for",
"a",
"given",
"header",
"name",
".",
"This",
"replaces",
"the",
"value",
"of",
"an",
"already",
"existing",
"header",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/message/Http2PushPromise.java#L140-L142 |
116,938 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/cache/CacheManager.java | CacheManager.start | private boolean start() {
if (scheduledFuture == null || scheduledFuture.isCancelled()) {
scheduledFuture = scheduler.scheduleWithFixedDelay(cacheManagingTask, delay, delay, TimeUnit.MINUTES);
if (LOG.isDebugEnabled()) {
LOG.debug("{} Cache Manager Started.", cache.ge... | java | private boolean start() {
if (scheduledFuture == null || scheduledFuture.isCancelled()) {
scheduledFuture = scheduler.scheduleWithFixedDelay(cacheManagingTask, delay, delay, TimeUnit.MINUTES);
if (LOG.isDebugEnabled()) {
LOG.debug("{} Cache Manager Started.", cache.ge... | [
"private",
"boolean",
"start",
"(",
")",
"{",
"if",
"(",
"scheduledFuture",
"==",
"null",
"||",
"scheduledFuture",
".",
"isCancelled",
"(",
")",
")",
"{",
"scheduledFuture",
"=",
"scheduler",
".",
"scheduleWithFixedDelay",
"(",
"cacheManagingTask",
",",
"delay",... | To Start the CacheManager, it needs to be called only once. Because of that calls in constructor.
CacheManager will run its TimerTask every "delay" number of seconds. | [
"To",
"Start",
"the",
"CacheManager",
"it",
"needs",
"to",
"be",
"called",
"only",
"once",
".",
"Because",
"of",
"that",
"calls",
"in",
"constructor",
".",
"CacheManager",
"will",
"run",
"its",
"TimerTask",
"every",
"delay",
"number",
"of",
"seconds",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/cache/CacheManager.java#L68-L77 |
116,939 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/cache/CacheManager.java | CacheManager.stop | public boolean stop() {
if (scheduledFuture != null && !scheduledFuture.isCancelled()) {
scheduledFuture.cancel(DO_NOT_INTERRUPT_IF_RUNNING);
if (LOG.isDebugEnabled()) {
LOG.debug("{} Cache Manager stopped.", cache.getClass().getSimpleName());
}
... | java | public boolean stop() {
if (scheduledFuture != null && !scheduledFuture.isCancelled()) {
scheduledFuture.cancel(DO_NOT_INTERRUPT_IF_RUNNING);
if (LOG.isDebugEnabled()) {
LOG.debug("{} Cache Manager stopped.", cache.getClass().getSimpleName());
}
... | [
"public",
"boolean",
"stop",
"(",
")",
"{",
"if",
"(",
"scheduledFuture",
"!=",
"null",
"&&",
"!",
"scheduledFuture",
".",
"isCancelled",
"(",
")",
")",
"{",
"scheduledFuture",
".",
"cancel",
"(",
"DO_NOT_INTERRUPT_IF_RUNNING",
")",
";",
"if",
"(",
"LOG",
... | Gracefully stop cacheManager.
@return true if successfully cancel the scheduled future. | [
"Gracefully",
"stop",
"cacheManager",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/cache/CacheManager.java#L118-L127 |
116,940 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/ForwardedHeaderUpdater.java | ForwardedHeaderUpdater.setForwardedHeader | public void setForwardedHeader() {
StringBuilder headerValue = new StringBuilder();
if (forwardedHeader == null) {
Object remoteAddressProperty = httpOutboundRequest.getProperty(Constants.REMOTE_ADDRESS);
if (remoteAddressProperty != null) {
String remoteAddress =... | java | public void setForwardedHeader() {
StringBuilder headerValue = new StringBuilder();
if (forwardedHeader == null) {
Object remoteAddressProperty = httpOutboundRequest.getProperty(Constants.REMOTE_ADDRESS);
if (remoteAddressProperty != null) {
String remoteAddress =... | [
"public",
"void",
"setForwardedHeader",
"(",
")",
"{",
"StringBuilder",
"headerValue",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"forwardedHeader",
"==",
"null",
")",
"{",
"Object",
"remoteAddressProperty",
"=",
"httpOutboundRequest",
".",
"getPropert... | Set forwarded header to outbound request.
@see <a href="https://tools.ietf.org/html/rfc7239">rfc7239</a> | [
"Set",
"forwarded",
"header",
"to",
"outbound",
"request",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/ForwardedHeaderUpdater.java#L88-L140 |
116,941 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/Http2TargetHandler.java | Http2TargetHandler.resetStream | void resetStream(ChannelHandlerContext ctx, int streamId, Http2Error http2Error) {
encoder.writeRstStream(ctx, streamId, http2Error.code(), ctx.newPromise());
http2ClientChannel.getDataEventListeners()
.forEach(dataEventListener -> dataEventListener.onStreamReset(streamId));
ctx.... | java | void resetStream(ChannelHandlerContext ctx, int streamId, Http2Error http2Error) {
encoder.writeRstStream(ctx, streamId, http2Error.code(), ctx.newPromise());
http2ClientChannel.getDataEventListeners()
.forEach(dataEventListener -> dataEventListener.onStreamReset(streamId));
ctx.... | [
"void",
"resetStream",
"(",
"ChannelHandlerContext",
"ctx",
",",
"int",
"streamId",
",",
"Http2Error",
"http2Error",
")",
"{",
"encoder",
".",
"writeRstStream",
"(",
"ctx",
",",
"streamId",
",",
"http2Error",
".",
"code",
"(",
")",
",",
"ctx",
".",
"newPromi... | Terminates a stream.
@param streamId stream to be terminated
@param http2Error cause for the termination | [
"Terminates",
"a",
"stream",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/Http2TargetHandler.java#L90-L95 |
116,942 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java | Http2StateUtil.notifyRequestListener | public static void notifyRequestListener(Http2SourceHandler http2SourceHandler, HttpCarbonMessage httpRequestMsg,
int streamId) {
if (http2SourceHandler.getServerConnectorFuture() != null) {
try {
ServerConnectorFuture outboundRespFuture =... | java | public static void notifyRequestListener(Http2SourceHandler http2SourceHandler, HttpCarbonMessage httpRequestMsg,
int streamId) {
if (http2SourceHandler.getServerConnectorFuture() != null) {
try {
ServerConnectorFuture outboundRespFuture =... | [
"public",
"static",
"void",
"notifyRequestListener",
"(",
"Http2SourceHandler",
"http2SourceHandler",
",",
"HttpCarbonMessage",
"httpRequestMsg",
",",
"int",
"streamId",
")",
"{",
"if",
"(",
"http2SourceHandler",
".",
"getServerConnectorFuture",
"(",
")",
"!=",
"null",
... | Notifies the registered listeners which listen for the incoming carbon messages.
@param http2SourceHandler the HTTP2 source handler
@param httpRequestMsg the http request message
@param streamId the id of the stream | [
"Notifies",
"the",
"registered",
"listeners",
"which",
"listen",
"for",
"the",
"incoming",
"carbon",
"messages",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java#L85-L102 |
116,943 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java | Http2StateUtil.writeHttp2Headers | public static void writeHttp2Headers(ChannelHandlerContext ctx, Http2ConnectionEncoder encoder,
HttpResponseFuture outboundRespStatusFuture, int streamId,
Http2Headers http2Headers, boolean endStream) throws Http2Exception {
Chann... | java | public static void writeHttp2Headers(ChannelHandlerContext ctx, Http2ConnectionEncoder encoder,
HttpResponseFuture outboundRespStatusFuture, int streamId,
Http2Headers http2Headers, boolean endStream) throws Http2Exception {
Chann... | [
"public",
"static",
"void",
"writeHttp2Headers",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Http2ConnectionEncoder",
"encoder",
",",
"HttpResponseFuture",
"outboundRespStatusFuture",
",",
"int",
"streamId",
",",
"Http2Headers",
"http2Headers",
",",
"boolean",
"endStream",
... | Writes HTTP2 headers to outbound response.
@param ctx the channel handler context
@param encoder the HTTP2 connection encoder
@param outboundRespStatusFuture the future of outbound response write operation
@param streamId the id of the stream
@param http2Headers ... | [
"Writes",
"HTTP2",
"headers",
"to",
"outbound",
"response",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java#L147-L155 |
116,944 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java | Http2StateUtil.writeHttp2Promise | public static void writeHttp2Promise(Http2PushPromise pushPromise, ChannelHandlerContext ctx, Http2Connection conn,
Http2ConnectionEncoder encoder, HttpCarbonMessage inboundRequestMsg,
HttpResponseFuture outboundRespStatusFuture,
... | java | public static void writeHttp2Promise(Http2PushPromise pushPromise, ChannelHandlerContext ctx, Http2Connection conn,
Http2ConnectionEncoder encoder, HttpCarbonMessage inboundRequestMsg,
HttpResponseFuture outboundRespStatusFuture,
... | [
"public",
"static",
"void",
"writeHttp2Promise",
"(",
"Http2PushPromise",
"pushPromise",
",",
"ChannelHandlerContext",
"ctx",
",",
"Http2Connection",
"conn",
",",
"Http2ConnectionEncoder",
"encoder",
",",
"HttpCarbonMessage",
"inboundRequestMsg",
",",
"HttpResponseFuture",
... | Writes an HTTP2 promise.
@param pushPromise HTTP/2 promise message
@param ctx the channel handler context
@param conn HTTP2 connection
@param encoder the HTTP2 connection encoder
@param inboundRequestMsg request message received from the cli... | [
"Writes",
"an",
"HTTP2",
"promise",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java#L169-L189 |
116,945 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java | Http2StateUtil.validatePromisedStreamState | public static void validatePromisedStreamState(int originalStreamId, int streamId, Http2Connection conn,
HttpCarbonMessage inboundRequestMsg) throws Http2Exception {
if (streamId == originalStreamId) { // Not a promised stream, no need to validate
r... | java | public static void validatePromisedStreamState(int originalStreamId, int streamId, Http2Connection conn,
HttpCarbonMessage inboundRequestMsg) throws Http2Exception {
if (streamId == originalStreamId) { // Not a promised stream, no need to validate
r... | [
"public",
"static",
"void",
"validatePromisedStreamState",
"(",
"int",
"originalStreamId",
",",
"int",
"streamId",
",",
"Http2Connection",
"conn",
",",
"HttpCarbonMessage",
"inboundRequestMsg",
")",
"throws",
"Http2Exception",
"{",
"if",
"(",
"streamId",
"==",
"origin... | Validates the state of promised stream with the original stream id and given stream id.
@param originalStreamId the original id of the stream
@param streamId the id of the stream to be validated
@param conn HTTP2 connection
@param inboundRequestMsg request message received from the client
@throw... | [
"Validates",
"the",
"state",
"of",
"promised",
"stream",
"with",
"the",
"original",
"stream",
"id",
"and",
"given",
"stream",
"id",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java#L200-L210 |
116,946 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java | Http2StateUtil.writeHttp2Headers | public static void writeHttp2Headers(ChannelHandlerContext ctx, OutboundMsgHolder outboundMsgHolder,
Http2ClientChannel http2ClientChannel, Http2ConnectionEncoder encoder,
int streamId, HttpHeaders headers, Http2Headers http2Headers,
... | java | public static void writeHttp2Headers(ChannelHandlerContext ctx, OutboundMsgHolder outboundMsgHolder,
Http2ClientChannel http2ClientChannel, Http2ConnectionEncoder encoder,
int streamId, HttpHeaders headers, Http2Headers http2Headers,
... | [
"public",
"static",
"void",
"writeHttp2Headers",
"(",
"ChannelHandlerContext",
"ctx",
",",
"OutboundMsgHolder",
"outboundMsgHolder",
",",
"Http2ClientChannel",
"http2ClientChannel",
",",
"Http2ConnectionEncoder",
"encoder",
",",
"int",
"streamId",
",",
"HttpHeaders",
"heade... | Writes HTTP2 headers.
@param ctx the channel handler context
@param outboundMsgHolder the outbound message holder
@param http2ClientChannel the client channel related to the handler
@param encoder the HTTP2 connection encoder
@param streamId the id of the stream
@param headers ... | [
"Writes",
"HTTP2",
"headers",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java#L267-L287 |
116,947 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java | Http2StateUtil.initiateStream | public static int initiateStream(ChannelHandlerContext ctx, Http2Connection connection,
Http2ClientChannel http2ClientChannel,
OutboundMsgHolder outboundMsgHolder) throws Http2Exception {
int streamId = getNextStreamId(connection);
... | java | public static int initiateStream(ChannelHandlerContext ctx, Http2Connection connection,
Http2ClientChannel http2ClientChannel,
OutboundMsgHolder outboundMsgHolder) throws Http2Exception {
int streamId = getNextStreamId(connection);
... | [
"public",
"static",
"int",
"initiateStream",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Http2Connection",
"connection",
",",
"Http2ClientChannel",
"http2ClientChannel",
",",
"OutboundMsgHolder",
"outboundMsgHolder",
")",
"throws",
"Http2Exception",
"{",
"int",
"streamId",
... | Initiates a HTTP2 stream.
@param ctx the channel handler context
@param connection the HTTP2 connection
@param http2ClientChannel the client channel related to the handler
@param outboundMsgHolder the outbound message holder
@return stream id of next stream
@throws Http2Exception if a protocol-... | [
"Initiates",
"a",
"HTTP2",
"stream",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java#L299-L308 |
116,948 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java | Http2StateUtil.createStream | private static synchronized void createStream(Http2Connection conn, int streamId) throws Http2Exception {
conn.local().createStream(streamId, false);
if (LOG.isDebugEnabled()) {
LOG.debug("Stream created streamId: {}", streamId);
}
} | java | private static synchronized void createStream(Http2Connection conn, int streamId) throws Http2Exception {
conn.local().createStream(streamId, false);
if (LOG.isDebugEnabled()) {
LOG.debug("Stream created streamId: {}", streamId);
}
} | [
"private",
"static",
"synchronized",
"void",
"createStream",
"(",
"Http2Connection",
"conn",
",",
"int",
"streamId",
")",
"throws",
"Http2Exception",
"{",
"conn",
".",
"local",
"(",
")",
".",
"createStream",
"(",
"streamId",
",",
"false",
")",
";",
"if",
"("... | Creates a stream with given stream id.
@param conn the HTTP2 connection
@param streamId the id of the stream
@throws Http2Exception if a protocol-related error occurred | [
"Creates",
"a",
"stream",
"with",
"given",
"stream",
"id",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java#L327-L332 |
116,949 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java | Http2StateUtil.onPushPromiseRead | public static void onPushPromiseRead(Http2PushPromise http2PushPromise, Http2ClientChannel http2ClientChannel,
OutboundMsgHolder outboundMsgHolder) {
int streamId = http2PushPromise.getStreamId();
int promisedStreamId = http2PushPromise.getPromisedStreamId();
... | java | public static void onPushPromiseRead(Http2PushPromise http2PushPromise, Http2ClientChannel http2ClientChannel,
OutboundMsgHolder outboundMsgHolder) {
int streamId = http2PushPromise.getStreamId();
int promisedStreamId = http2PushPromise.getPromisedStreamId();
... | [
"public",
"static",
"void",
"onPushPromiseRead",
"(",
"Http2PushPromise",
"http2PushPromise",
",",
"Http2ClientChannel",
"http2ClientChannel",
",",
"OutboundMsgHolder",
"outboundMsgHolder",
")",
"{",
"int",
"streamId",
"=",
"http2PushPromise",
".",
"getStreamId",
"(",
")"... | Adds a push promise message.
@param http2PushPromise the HTTP2 push promise
@param http2ClientChannel the client channel related to the handler
@param outboundMsgHolder the outbound message holder | [
"Adds",
"a",
"push",
"promise",
"message",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java#L341-L358 |
116,950 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/Http2ConnectionManager.java | Http2ConnectionManager.getOrCreateEventLoopPool | private EventLoopPool getOrCreateEventLoopPool(EventLoop eventLoop) {
final EventLoopPool pool = eventLoopPools.get(eventLoop);
if (pool != null) {
return pool;
}
return eventLoopPools.computeIfAbsent(eventLoop, e -> new EventLoopPool());
} | java | private EventLoopPool getOrCreateEventLoopPool(EventLoop eventLoop) {
final EventLoopPool pool = eventLoopPools.get(eventLoop);
if (pool != null) {
return pool;
}
return eventLoopPools.computeIfAbsent(eventLoop, e -> new EventLoopPool());
} | [
"private",
"EventLoopPool",
"getOrCreateEventLoopPool",
"(",
"EventLoop",
"eventLoop",
")",
"{",
"final",
"EventLoopPool",
"pool",
"=",
"eventLoopPools",
".",
"get",
"(",
"eventLoop",
")",
";",
"if",
"(",
"pool",
"!=",
"null",
")",
"{",
"return",
"pool",
";",
... | Get or create the pool that is bound to the given eventloop.
@param eventLoop netty event loop
@return EventLoopPool | [
"Get",
"or",
"create",
"the",
"pool",
"that",
"is",
"bound",
"to",
"the",
"given",
"eventloop",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/Http2ConnectionManager.java#L78-L84 |
116,951 | wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/Http2ConnectionManager.java | Http2ConnectionManager.getOrCreatePerRoutePool | private EventLoopPool.PerRouteConnectionPool getOrCreatePerRoutePool(EventLoopPool eventLoopPool, String key) {
final EventLoopPool.PerRouteConnectionPool perRouteConnectionPool = eventLoopPool.fetchPerRoutePool(key);
if (perRouteConnectionPool != null) {
return perRouteConnectionPool;
... | java | private EventLoopPool.PerRouteConnectionPool getOrCreatePerRoutePool(EventLoopPool eventLoopPool, String key) {
final EventLoopPool.PerRouteConnectionPool perRouteConnectionPool = eventLoopPool.fetchPerRoutePool(key);
if (perRouteConnectionPool != null) {
return perRouteConnectionPool;
... | [
"private",
"EventLoopPool",
".",
"PerRouteConnectionPool",
"getOrCreatePerRoutePool",
"(",
"EventLoopPool",
"eventLoopPool",
",",
"String",
"key",
")",
"{",
"final",
"EventLoopPool",
".",
"PerRouteConnectionPool",
"perRouteConnectionPool",
"=",
"eventLoopPool",
".",
"fetchP... | Get or creat the per route pool.
@param eventLoopPool the pool that is bound to the eventloop
@param key the route key
@return PerRouteConnectionPool | [
"Get",
"or",
"creat",
"the",
"per",
"route",
"pool",
"."
] | c51aa715b473db6c1b82a7d7b22f6e65f74df4c9 | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/Http2ConnectionManager.java#L93-L102 |
116,952 | facebookarchive/nifty | nifty-ssl/src/main/java/com/facebook/nifty/ssl/NettyTcNativeLoader.java | NettyTcNativeLoader.overrideExceptionValue | private static void overrideExceptionValue() {
Field exceptionField = null;
Field modifiersField = null;
int originalModifiers = 0;
boolean setModifiers = false;
try {
exceptionField = OpenSsl.class.getDeclaredField("UNAVAILABILITY_CAUSE");
exceptionField... | java | private static void overrideExceptionValue() {
Field exceptionField = null;
Field modifiersField = null;
int originalModifiers = 0;
boolean setModifiers = false;
try {
exceptionField = OpenSsl.class.getDeclaredField("UNAVAILABILITY_CAUSE");
exceptionField... | [
"private",
"static",
"void",
"overrideExceptionValue",
"(",
")",
"{",
"Field",
"exceptionField",
"=",
"null",
";",
"Field",
"modifiersField",
"=",
"null",
";",
"int",
"originalModifiers",
"=",
"0",
";",
"boolean",
"setModifiers",
"=",
"false",
";",
"try",
"{",... | the library. | [
"the",
"library",
"."
] | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-ssl/src/main/java/com/facebook/nifty/ssl/NettyTcNativeLoader.java#L109-L143 |
116,953 | facebookarchive/nifty | nifty-client/src/main/java/com/facebook/nifty/client/socks/Socks4ClientBootstrap.java | Socks4ClientBootstrap.getPipelineFactory | @Override
public ChannelPipelineFactory getPipelineFactory()
{
return new ChannelPipelineFactory()
{
@Override
public ChannelPipeline getPipeline()
throws Exception
{
final ChannelPipeline cp = Channels.pipeline();
... | java | @Override
public ChannelPipelineFactory getPipelineFactory()
{
return new ChannelPipelineFactory()
{
@Override
public ChannelPipeline getPipeline()
throws Exception
{
final ChannelPipeline cp = Channels.pipeline();
... | [
"@",
"Override",
"public",
"ChannelPipelineFactory",
"getPipelineFactory",
"(",
")",
"{",
"return",
"new",
"ChannelPipelineFactory",
"(",
")",
"{",
"@",
"Override",
"public",
"ChannelPipeline",
"getPipeline",
"(",
")",
"throws",
"Exception",
"{",
"final",
"ChannelPi... | Hijack super class's pipelineFactory and return our own that
does the connect to SOCKS proxy and does the handshake. | [
"Hijack",
"super",
"class",
"s",
"pipelineFactory",
"and",
"return",
"our",
"own",
"that",
"does",
"the",
"connect",
"to",
"SOCKS",
"proxy",
"and",
"does",
"the",
"handshake",
"."
] | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-client/src/main/java/com/facebook/nifty/client/socks/Socks4ClientBootstrap.java#L66-L81 |
116,954 | facebookarchive/nifty | nifty-client/src/main/java/com/facebook/nifty/client/socks/Socks4ClientBootstrap.java | Socks4ClientBootstrap.connect | @Override
public ChannelFuture connect(final SocketAddress remoteAddress)
{
if (!(remoteAddress instanceof InetSocketAddress)) {
throw new IllegalArgumentException("expecting InetSocketAddress");
}
final SettableChannelFuture settableChannelFuture = new SettableChannelFuture(... | java | @Override
public ChannelFuture connect(final SocketAddress remoteAddress)
{
if (!(remoteAddress instanceof InetSocketAddress)) {
throw new IllegalArgumentException("expecting InetSocketAddress");
}
final SettableChannelFuture settableChannelFuture = new SettableChannelFuture(... | [
"@",
"Override",
"public",
"ChannelFuture",
"connect",
"(",
"final",
"SocketAddress",
"remoteAddress",
")",
"{",
"if",
"(",
"!",
"(",
"remoteAddress",
"instanceof",
"InetSocketAddress",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"expecting Ine... | Hijack the connect method to connect to socks proxy and then
send the connection handshake once connection to proxy is established.
@return returns a ChannelFuture, it will be ready once the connection to
socks and the remote address is established ( i.e. after the handshake completes ) | [
"Hijack",
"the",
"connect",
"method",
"to",
"connect",
"to",
"socks",
"proxy",
"and",
"then",
"send",
"the",
"connection",
"handshake",
"once",
"connection",
"to",
"proxy",
"is",
"established",
"."
] | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-client/src/main/java/com/facebook/nifty/client/socks/Socks4ClientBootstrap.java#L90-L126 |
116,955 | facebookarchive/nifty | nifty-client/src/main/java/com/facebook/nifty/client/socks/Socks4ClientBootstrap.java | Socks4ClientBootstrap.socksConnect | private static ChannelFuture socksConnect(Channel channel, InetSocketAddress remoteAddress)
{
channel.write(createHandshake(remoteAddress));
return ((Socks4HandshakeHandler) channel.getPipeline().get("handshake")).getChannelFuture();
} | java | private static ChannelFuture socksConnect(Channel channel, InetSocketAddress remoteAddress)
{
channel.write(createHandshake(remoteAddress));
return ((Socks4HandshakeHandler) channel.getPipeline().get("handshake")).getChannelFuture();
} | [
"private",
"static",
"ChannelFuture",
"socksConnect",
"(",
"Channel",
"channel",
",",
"InetSocketAddress",
"remoteAddress",
")",
"{",
"channel",
".",
"write",
"(",
"createHandshake",
"(",
"remoteAddress",
")",
")",
";",
"return",
"(",
"(",
"Socks4HandshakeHandler",
... | try to look at the remoteAddress and decide to use SOCKS4 or SOCKS4a handshake
packet. | [
"try",
"to",
"look",
"at",
"the",
"remoteAddress",
"and",
"decide",
"to",
"use",
"SOCKS4",
"or",
"SOCKS4a",
"handshake",
"packet",
"."
] | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-client/src/main/java/com/facebook/nifty/client/socks/Socks4ClientBootstrap.java#L133-L137 |
116,956 | facebookarchive/nifty | nifty-core/src/main/java/com/facebook/nifty/core/NettyConfigBuilderBase.java | NettyConfigBuilderBase.setNiftyName | protected T setNiftyName(String niftyName)
{
Preconditions.checkNotNull(niftyName, "niftyName cannot be null");
this.niftyName = niftyName;
return (T) this;
} | java | protected T setNiftyName(String niftyName)
{
Preconditions.checkNotNull(niftyName, "niftyName cannot be null");
this.niftyName = niftyName;
return (T) this;
} | [
"protected",
"T",
"setNiftyName",
"(",
"String",
"niftyName",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"niftyName",
",",
"\"niftyName cannot be null\"",
")",
";",
"this",
".",
"niftyName",
"=",
"niftyName",
";",
"return",
"(",
"T",
")",
"this",
";"... | Sets an identifier which will be added to all thread created by the boss and worker
executors.
@param niftyName
@return | [
"Sets",
"an",
"identifier",
"which",
"will",
"be",
"added",
"to",
"all",
"thread",
"created",
"by",
"the",
"boss",
"and",
"worker",
"executors",
"."
] | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-core/src/main/java/com/facebook/nifty/core/NettyConfigBuilderBase.java#L75-L80 |
116,957 | facebookarchive/nifty | nifty-core/src/main/java/com/facebook/nifty/core/ThriftServerDefBuilderBase.java | ThriftServerDefBuilderBase.withProcessor | public T withProcessor(final NiftyProcessor processor)
{
this.niftyProcessorFactory = new NiftyProcessorFactory() {
@Override
public NiftyProcessor getProcessor(TTransport transport)
{
return processor;
}
};
return (T) this;
... | java | public T withProcessor(final NiftyProcessor processor)
{
this.niftyProcessorFactory = new NiftyProcessorFactory() {
@Override
public NiftyProcessor getProcessor(TTransport transport)
{
return processor;
}
};
return (T) this;
... | [
"public",
"T",
"withProcessor",
"(",
"final",
"NiftyProcessor",
"processor",
")",
"{",
"this",
".",
"niftyProcessorFactory",
"=",
"new",
"NiftyProcessorFactory",
"(",
")",
"{",
"@",
"Override",
"public",
"NiftyProcessor",
"getProcessor",
"(",
"TTransport",
"transpor... | Specify the TProcessor. | [
"Specify",
"the",
"TProcessor",
"."
] | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-core/src/main/java/com/facebook/nifty/core/ThriftServerDefBuilderBase.java#L140-L150 |
116,958 | facebookarchive/nifty | nifty-core/src/main/java/com/facebook/nifty/core/ThriftServerDefBuilderBase.java | ThriftServerDefBuilderBase.build | public ThriftServerDef build()
{
checkState(niftyProcessorFactory != null || thriftProcessorFactory != null,
"Processor not defined!");
checkState(niftyProcessorFactory == null || thriftProcessorFactory == null,
"TProcessors will be automatically adapted to Nift... | java | public ThriftServerDef build()
{
checkState(niftyProcessorFactory != null || thriftProcessorFactory != null,
"Processor not defined!");
checkState(niftyProcessorFactory == null || thriftProcessorFactory == null,
"TProcessors will be automatically adapted to Nift... | [
"public",
"ThriftServerDef",
"build",
"(",
")",
"{",
"checkState",
"(",
"niftyProcessorFactory",
"!=",
"null",
"||",
"thriftProcessorFactory",
"!=",
"null",
",",
"\"Processor not defined!\"",
")",
";",
"checkState",
"(",
"niftyProcessorFactory",
"==",
"null",
"||",
... | Build the ThriftServerDef | [
"Build",
"the",
"ThriftServerDef"
] | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-core/src/main/java/com/facebook/nifty/core/ThriftServerDefBuilderBase.java#L271-L300 |
116,959 | facebookarchive/nifty | nifty-ssl/src/main/java/com/facebook/nifty/ssl/PollingMultiFileWatcher.java | PollingMultiFileWatcher.start | @Override public void start(Set<File> files, Consumer<Set<File>> callback) {
if (isStarted()) {
throw new IllegalStateException("start() should not be called more than once");
}
Set<File> filesCopy = ImmutableSet.copyOf(files);
Preconditions.checkArgument(filesCopy.size() > 0... | java | @Override public void start(Set<File> files, Consumer<Set<File>> callback) {
if (isStarted()) {
throw new IllegalStateException("start() should not be called more than once");
}
Set<File> filesCopy = ImmutableSet.copyOf(files);
Preconditions.checkArgument(filesCopy.size() > 0... | [
"@",
"Override",
"public",
"void",
"start",
"(",
"Set",
"<",
"File",
">",
"files",
",",
"Consumer",
"<",
"Set",
"<",
"File",
">",
">",
"callback",
")",
"{",
"if",
"(",
"isStarted",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"... | Starts polling the watched files for changes.
@param files a set of one or more files to watch for changes.
@param callback the callback to call with the set of files that changed since the last time. | [
"Starts",
"polling",
"the",
"watched",
"files",
"for",
"changes",
"."
] | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-ssl/src/main/java/com/facebook/nifty/ssl/PollingMultiFileWatcher.java#L92-L106 |
116,960 | facebookarchive/nifty | nifty-ssl/src/main/java/com/facebook/nifty/ssl/PollingMultiFileWatcher.java | PollingMultiFileWatcher.shutdown | @Override public void shutdown() {
if (isStarted()) {
future.cancel(true);
executorService.shutdown();
future = null;
executorService = null;
watchedFiles = ImmutableSet.of();
callback = null;
metadataCacheRef.set(ImmutableMap.o... | java | @Override public void shutdown() {
if (isStarted()) {
future.cancel(true);
executorService.shutdown();
future = null;
executorService = null;
watchedFiles = ImmutableSet.of();
callback = null;
metadataCacheRef.set(ImmutableMap.o... | [
"@",
"Override",
"public",
"void",
"shutdown",
"(",
")",
"{",
"if",
"(",
"isStarted",
"(",
")",
")",
"{",
"future",
".",
"cancel",
"(",
"true",
")",
";",
"executorService",
".",
"shutdown",
"(",
")",
";",
"future",
"=",
"null",
";",
"executorService",
... | Stops polling the files for changes. Should be called during server shutdown or when this watcher is no
longer needed to make sure the background thread is stopped. | [
"Stops",
"polling",
"the",
"files",
"for",
"changes",
".",
"Should",
"be",
"called",
"during",
"server",
"shutdown",
"or",
"when",
"this",
"watcher",
"is",
"no",
"longer",
"needed",
"to",
"make",
"sure",
"the",
"background",
"thread",
"is",
"stopped",
"."
] | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-ssl/src/main/java/com/facebook/nifty/ssl/PollingMultiFileWatcher.java#L119-L130 |
116,961 | facebookarchive/nifty | nifty-ssl/src/main/java/com/facebook/nifty/ssl/PollingMultiFileWatcher.java | PollingMultiFileWatcher.scanFilesForChanges | private void scanFilesForChanges() {
MessageDigest digest;
try {
digest = MessageDigest.getInstance("SHA-256");
}
catch (NoSuchAlgorithmException e) {
// This should never happen, all JVM implementations must support SHA-256 according to Oracle docs.
t... | java | private void scanFilesForChanges() {
MessageDigest digest;
try {
digest = MessageDigest.getInstance("SHA-256");
}
catch (NoSuchAlgorithmException e) {
// This should never happen, all JVM implementations must support SHA-256 according to Oracle docs.
t... | [
"private",
"void",
"scanFilesForChanges",
"(",
")",
"{",
"MessageDigest",
"digest",
";",
"try",
"{",
"digest",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"\"SHA-256\"",
")",
";",
"}",
"catch",
"(",
"NoSuchAlgorithmException",
"e",
")",
"{",
"// This should n... | Scans the watched files for changes. If any changes are detected, calls the user callback with the
set of all files that were modified since the last successful update attempt. Note that when a watched
file is deleted, it will not be considered modified.
Changes are tracked by watching certain file attributes (mtime, ... | [
"Scans",
"the",
"watched",
"files",
"for",
"changes",
".",
"If",
"any",
"changes",
"are",
"detected",
"calls",
"the",
"user",
"callback",
"with",
"the",
"set",
"of",
"all",
"files",
"that",
"were",
"modified",
"since",
"the",
"last",
"successful",
"update",
... | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-ssl/src/main/java/com/facebook/nifty/ssl/PollingMultiFileWatcher.java#L163-L224 |
116,962 | facebookarchive/nifty | nifty-ssl/src/main/java/com/facebook/nifty/ssl/PollingMultiFileWatcher.java | PollingMultiFileWatcher.computeFileHash | private static String computeFileHash(File file, MessageDigest md) throws IOException {
md.reset();
return BaseEncoding.base16().encode(md.digest(Files.toByteArray(file)));
} | java | private static String computeFileHash(File file, MessageDigest md) throws IOException {
md.reset();
return BaseEncoding.base16().encode(md.digest(Files.toByteArray(file)));
} | [
"private",
"static",
"String",
"computeFileHash",
"(",
"File",
"file",
",",
"MessageDigest",
"md",
")",
"throws",
"IOException",
"{",
"md",
".",
"reset",
"(",
")",
";",
"return",
"BaseEncoding",
".",
"base16",
"(",
")",
".",
"encode",
"(",
"md",
".",
"di... | Computes a hash of the given file's contents using the provided MessageDigest.
@param file the file.
@param md the message digest.
@return the hash of the file contents.
@throws IOException if the file contents cannot be read. | [
"Computes",
"a",
"hash",
"of",
"the",
"given",
"file",
"s",
"contents",
"using",
"the",
"provided",
"MessageDigest",
"."
] | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-ssl/src/main/java/com/facebook/nifty/ssl/PollingMultiFileWatcher.java#L234-L237 |
116,963 | facebookarchive/nifty | nifty-ssl/src/main/java/com/facebook/nifty/ssl/CryptoUtil.java | CryptoUtil.extract | private static byte[] extract(byte[] salt, byte[] inputKeyingMaterial) {
return initHmacSha256(salt == null ? NULL_SALT : salt).doFinal(inputKeyingMaterial);
} | java | private static byte[] extract(byte[] salt, byte[] inputKeyingMaterial) {
return initHmacSha256(salt == null ? NULL_SALT : salt).doFinal(inputKeyingMaterial);
} | [
"private",
"static",
"byte",
"[",
"]",
"extract",
"(",
"byte",
"[",
"]",
"salt",
",",
"byte",
"[",
"]",
"inputKeyingMaterial",
")",
"{",
"return",
"initHmacSha256",
"(",
"salt",
"==",
"null",
"?",
"NULL_SALT",
":",
"salt",
")",
".",
"doFinal",
"(",
"in... | The "extract" stage of the extract-then-expand HKDF algorithm.
@param salt an optional salt value. If null, will use the all-zeros constant NULL_SALT.
@param inputKeyingMaterial input keying material. Must not be null.
@return a pseudo-random key of length SHA256_OUTPUT_BYTES to be used by the expand() stage. | [
"The",
"extract",
"stage",
"of",
"the",
"extract",
"-",
"then",
"-",
"expand",
"HKDF",
"algorithm",
"."
] | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-ssl/src/main/java/com/facebook/nifty/ssl/CryptoUtil.java#L72-L74 |
116,964 | facebookarchive/nifty | nifty-client/src/main/java/com/facebook/nifty/client/TNiftyClientTransport.java | TNiftyClientTransport.read | private int read(byte[] bytes, int offset, int length, Duration receiveTimeout)
throws InterruptedException, TTransportException
{
long timeRemaining = receiveTimeout.roundTo(TimeUnit.NANOSECONDS);
lock.lock();
try {
while (!closed) {
int bytesAvailabl... | java | private int read(byte[] bytes, int offset, int length, Duration receiveTimeout)
throws InterruptedException, TTransportException
{
long timeRemaining = receiveTimeout.roundTo(TimeUnit.NANOSECONDS);
lock.lock();
try {
while (!closed) {
int bytesAvailabl... | [
"private",
"int",
"read",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"length",
",",
"Duration",
"receiveTimeout",
")",
"throws",
"InterruptedException",
",",
"TTransportException",
"{",
"long",
"timeRemaining",
"=",
"receiveTimeout",
".",
... | yeah, mimicking sync with async is just horrible | [
"yeah",
"mimicking",
"sync",
"with",
"async",
"is",
"just",
"horrible"
] | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-client/src/main/java/com/facebook/nifty/client/TNiftyClientTransport.java#L114-L151 |
116,965 | facebookarchive/nifty | nifty-core/src/main/java/com/facebook/nifty/core/TChannelBufferOutputTransport.java | TChannelBufferOutputTransport.resetOutputBuffer | public void resetOutputBuffer()
{
int shrunkenSize = shrinkBufferSize();
if (outputBuffer.writerIndex() < shrunkenSize) {
// Less than the shrunken size of the buffer was actually used, so increment
// the under-use counter
++bufferUnderUsedCounter;
}
... | java | public void resetOutputBuffer()
{
int shrunkenSize = shrinkBufferSize();
if (outputBuffer.writerIndex() < shrunkenSize) {
// Less than the shrunken size of the buffer was actually used, so increment
// the under-use counter
++bufferUnderUsedCounter;
}
... | [
"public",
"void",
"resetOutputBuffer",
"(",
")",
"{",
"int",
"shrunkenSize",
"=",
"shrinkBufferSize",
"(",
")",
";",
"if",
"(",
"outputBuffer",
".",
"writerIndex",
"(",
")",
"<",
"shrunkenSize",
")",
"{",
"// Less than the shrunken size of the buffer was actually used... | Resets the state of this transport so it can be used to write more messages | [
"Resets",
"the",
"state",
"of",
"this",
"transport",
"so",
"it",
"can",
"be",
"used",
"to",
"write",
"more",
"messages"
] | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-core/src/main/java/com/facebook/nifty/core/TChannelBufferOutputTransport.java#L90-L111 |
116,966 | facebookarchive/nifty | nifty-ssl/src/main/java/com/facebook/nifty/ssl/TicketSeedFileParser.java | TicketSeedFileParser.parse | public List<SessionTicketKey> parse(File file) throws IOException {
return parseBytes(Files.toByteArray(file));
} | java | public List<SessionTicketKey> parse(File file) throws IOException {
return parseBytes(Files.toByteArray(file));
} | [
"public",
"List",
"<",
"SessionTicketKey",
">",
"parse",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"return",
"parseBytes",
"(",
"Files",
".",
"toByteArray",
"(",
"file",
")",
")",
";",
"}"
] | Returns a list of tickets parsed from the ticket file. The keys are returned in a format suitable for use
with netty. The first keys are the current keys, following that are the new keys and old keys.
@param file the ticket seed file.
@return a list of ticket keys. Current keys are first, then new keys, then old keys.... | [
"Returns",
"a",
"list",
"of",
"tickets",
"parsed",
"from",
"the",
"ticket",
"file",
".",
"The",
"keys",
"are",
"returned",
"in",
"a",
"format",
"suitable",
"for",
"use",
"with",
"netty",
".",
"The",
"first",
"keys",
"are",
"the",
"current",
"keys",
"foll... | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-ssl/src/main/java/com/facebook/nifty/ssl/TicketSeedFileParser.java#L118-L120 |
116,967 | facebookarchive/nifty | nifty-ssl/src/main/java/com/facebook/nifty/ssl/TicketSeedFileParser.java | TicketSeedFileParser.parseBytes | public List<SessionTicketKey> parseBytes(byte[] json) throws IOException {
List<String> allSeeds = TicketSeeds.parseFromJSONBytes(json, objectMapper).getAllSeeds();
return allSeeds.stream().map(this::deriveKeyFromSeed).collect(Collectors.toList());
} | java | public List<SessionTicketKey> parseBytes(byte[] json) throws IOException {
List<String> allSeeds = TicketSeeds.parseFromJSONBytes(json, objectMapper).getAllSeeds();
return allSeeds.stream().map(this::deriveKeyFromSeed).collect(Collectors.toList());
} | [
"public",
"List",
"<",
"SessionTicketKey",
">",
"parseBytes",
"(",
"byte",
"[",
"]",
"json",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"allSeeds",
"=",
"TicketSeeds",
".",
"parseFromJSONBytes",
"(",
"json",
",",
"objectMapper",
")",
".",... | Returns a list of tickets parsed from the given JSON bytes. The keys are returned in a format suitable for
use with netty. The first keys are the current keys, following that are the new keys and old keys.
@param json the JSON bytes containing ticket seed data.
@return a list of ticket keys. Current keys are first, th... | [
"Returns",
"a",
"list",
"of",
"tickets",
"parsed",
"from",
"the",
"given",
"JSON",
"bytes",
".",
"The",
"keys",
"are",
"returned",
"in",
"a",
"format",
"suitable",
"for",
"use",
"with",
"netty",
".",
"The",
"first",
"keys",
"are",
"the",
"current",
"keys... | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-ssl/src/main/java/com/facebook/nifty/ssl/TicketSeedFileParser.java#L131-L134 |
116,968 | facebookarchive/nifty | nifty-core/src/main/java/com/facebook/nifty/ssl/SslPlaintextHandler.java | SslPlaintextHandler.looksLikeTLS | private static boolean looksLikeTLS(ChannelBuffer buffer) {
// TLS starts as
// 0: 0x16 - handshake protocol magic
// 1: 0x03 - SSL version major
// 2: 0x00 to 0x03 - SSL version minor (SSLv3 or TLS1.0 through TLS1.2)
// 3-4: length (2 bytes)
// 5: 0x01 - handshake type (... | java | private static boolean looksLikeTLS(ChannelBuffer buffer) {
// TLS starts as
// 0: 0x16 - handshake protocol magic
// 1: 0x03 - SSL version major
// 2: 0x00 to 0x03 - SSL version minor (SSLv3 or TLS1.0 through TLS1.2)
// 3-4: length (2 bytes)
// 5: 0x01 - handshake type (... | [
"private",
"static",
"boolean",
"looksLikeTLS",
"(",
"ChannelBuffer",
"buffer",
")",
"{",
"// TLS starts as",
"// 0: 0x16 - handshake protocol magic",
"// 1: 0x03 - SSL version major",
"// 2: 0x00 to 0x03 - SSL version minor (SSLv3 or TLS1.0 through TLS1.2)",
"// 3-4: length (2 bytes)",
... | Requires 9 bytes of input. | [
"Requires",
"9",
"bytes",
"of",
"input",
"."
] | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-core/src/main/java/com/facebook/nifty/ssl/SslPlaintextHandler.java#L63-L100 |
116,969 | facebookarchive/nifty | nifty-core/src/main/java/com/facebook/nifty/core/TInputOutputCompositeTransport.java | TInputOutputCompositeTransport.read | @Override
public int read(byte[] buf, int off, int len) throws TTransportException
{
return inputTransport.read(buf, off, len);
} | java | @Override
public int read(byte[] buf, int off, int len) throws TTransportException
{
return inputTransport.read(buf, off, len);
} | [
"@",
"Override",
"public",
"int",
"read",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"TTransportException",
"{",
"return",
"inputTransport",
".",
"read",
"(",
"buf",
",",
"off",
",",
"len",
")",
";",
"}"
] | Delegate input methods | [
"Delegate",
"input",
"methods"
] | ccacff7f0a723abe0b9ed399bcc3bc85784e7396 | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-core/src/main/java/com/facebook/nifty/core/TInputOutputCompositeTransport.java#L37-L41 |
116,970 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/annotations/AnnotationProperties.java | AnnotationProperties.putArrayValues | public void putArrayValues(String name, Set<String> values) {
arrayValues.put(name, values);
} | java | public void putArrayValues(String name, Set<String> values) {
arrayValues.put(name, values);
} | [
"public",
"void",
"putArrayValues",
"(",
"String",
"name",
",",
"Set",
"<",
"String",
">",
"values",
")",
"{",
"arrayValues",
".",
"put",
"(",
"name",
",",
"values",
")",
";",
"}"
] | Adds the content of an array value property.
@param name The name of the array value property.
@param values The content of the array value property. | [
"Adds",
"the",
"content",
"of",
"an",
"array",
"value",
"property",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/annotations/AnnotationProperties.java#L40-L42 |
116,971 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/PrefabValues.java | PrefabValues.giveTuple | public <T> Tuple<T> giveTuple(TypeTag tag) {
realizeCacheFor(tag, emptyStack());
return cache.getTuple(tag);
} | java | public <T> Tuple<T> giveTuple(TypeTag tag) {
realizeCacheFor(tag, emptyStack());
return cache.getTuple(tag);
} | [
"public",
"<",
"T",
">",
"Tuple",
"<",
"T",
">",
"giveTuple",
"(",
"TypeTag",
"tag",
")",
"{",
"realizeCacheFor",
"(",
"tag",
",",
"emptyStack",
"(",
")",
")",
";",
"return",
"cache",
".",
"getTuple",
"(",
"tag",
")",
";",
"}"
] | Returns a tuple of two different prefabricated values of the specified
type.
@param <T> The returned tuple will have this generic type.
@param tag A description of the desired type, including generic
parameters.
@return A tuple of two different values of the given type. | [
"Returns",
"a",
"tuple",
"of",
"two",
"different",
"prefabricated",
"values",
"of",
"the",
"specified",
"type",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/PrefabValues.java#L88-L91 |
116,972 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/PrefabValues.java | PrefabValues.giveOther | public <T> T giveOther(TypeTag tag, T value) {
Class<T> type = tag.getType();
if (value != null && !type.isAssignableFrom(value.getClass()) && !wraps(type, value.getClass())) {
throw new ReflectionException("TypeTag does not match value.");
}
Tuple<T> tuple = giveTuple(tag);... | java | public <T> T giveOther(TypeTag tag, T value) {
Class<T> type = tag.getType();
if (value != null && !type.isAssignableFrom(value.getClass()) && !wraps(type, value.getClass())) {
throw new ReflectionException("TypeTag does not match value.");
}
Tuple<T> tuple = giveTuple(tag);... | [
"public",
"<",
"T",
">",
"T",
"giveOther",
"(",
"TypeTag",
"tag",
",",
"T",
"value",
")",
"{",
"Class",
"<",
"T",
">",
"type",
"=",
"tag",
".",
"getType",
"(",
")",
";",
"if",
"(",
"value",
"!=",
"null",
"&&",
"!",
"type",
".",
"isAssignableFrom"... | Returns a prefabricated value of the specified type, that is different
from the specified value.
@param <T> The type of the value.
@param tag A description of the desired type, including generic
parameters.
@param value A value that is different from the value that will be
returned.
@return A value that is different f... | [
"Returns",
"a",
"prefabricated",
"value",
"of",
"the",
"specified",
"type",
"that",
"is",
"different",
"from",
"the",
"specified",
"value",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/PrefabValues.java#L104-L121 |
116,973 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/PrefabValues.java | PrefabValues.realizeCacheFor | public <T> void realizeCacheFor(TypeTag tag, LinkedHashSet<TypeTag> typeStack) {
if (!cache.contains(tag)) {
Tuple<T> tuple = createTuple(tag, typeStack);
addToCache(tag, tuple);
}
} | java | public <T> void realizeCacheFor(TypeTag tag, LinkedHashSet<TypeTag> typeStack) {
if (!cache.contains(tag)) {
Tuple<T> tuple = createTuple(tag, typeStack);
addToCache(tag, tuple);
}
} | [
"public",
"<",
"T",
">",
"void",
"realizeCacheFor",
"(",
"TypeTag",
"tag",
",",
"LinkedHashSet",
"<",
"TypeTag",
">",
"typeStack",
")",
"{",
"if",
"(",
"!",
"cache",
".",
"contains",
"(",
"tag",
")",
")",
"{",
"Tuple",
"<",
"T",
">",
"tuple",
"=",
... | Makes sure that values for the specified type are present in the cache,
but doesn't return them.
@param <T> The desired type.
@param tag A description of the desired type, including generic
parameters.
@param typeStack Keeps track of recursion in the type. | [
"Makes",
"sure",
"that",
"values",
"for",
"the",
"specified",
"type",
"are",
"present",
"in",
"the",
"cache",
"but",
"doesn",
"t",
"return",
"them",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/PrefabValues.java#L145-L150 |
116,974 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/FactoryCache.java | FactoryCache.put | public <T> void put(Class<?> type, PrefabValueFactory<T> factory) {
if (type != null) {
cache.put(type.getName(), factory);
}
} | java | public <T> void put(Class<?> type, PrefabValueFactory<T> factory) {
if (type != null) {
cache.put(type.getName(), factory);
}
} | [
"public",
"<",
"T",
">",
"void",
"put",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"PrefabValueFactory",
"<",
"T",
">",
"factory",
")",
"{",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"cache",
".",
"put",
"(",
"type",
".",
"getName",
"(",
")",
"... | Adds the given factory to the cache and associates it with the given
type.
@param <T> The type of the factory.
@param type The type to associate with the factory.
@param factory The factory to associate with the type. | [
"Adds",
"the",
"given",
"factory",
"to",
"the",
"cache",
"and",
"associates",
"it",
"with",
"the",
"given",
"type",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/FactoryCache.java#L27-L31 |
116,975 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/FactoryCache.java | FactoryCache.put | public <T> void put(String typeName, PrefabValueFactory<T> factory) {
if (typeName != null) {
cache.put(typeName, factory);
}
} | java | public <T> void put(String typeName, PrefabValueFactory<T> factory) {
if (typeName != null) {
cache.put(typeName, factory);
}
} | [
"public",
"<",
"T",
">",
"void",
"put",
"(",
"String",
"typeName",
",",
"PrefabValueFactory",
"<",
"T",
">",
"factory",
")",
"{",
"if",
"(",
"typeName",
"!=",
"null",
")",
"{",
"cache",
".",
"put",
"(",
"typeName",
",",
"factory",
")",
";",
"}",
"}... | Adds the given factory to the cache and associates it with the given
type name.
@param <T> Should match {@code typeName}.
@param typeName The fully qualified name of the type.
@param factory The factory to associate with {@code typeName} | [
"Adds",
"the",
"given",
"factory",
"to",
"the",
"cache",
"and",
"associates",
"it",
"with",
"the",
"given",
"type",
"name",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/FactoryCache.java#L41-L45 |
116,976 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/FactoryCache.java | FactoryCache.get | @SuppressWarnings("unchecked")
public <T> PrefabValueFactory<T> get(Class<T> type) {
if (type == null) {
return null;
}
return (PrefabValueFactory<T>)cache.get(type.getName());
} | java | @SuppressWarnings("unchecked")
public <T> PrefabValueFactory<T> get(Class<T> type) {
if (type == null) {
return null;
}
return (PrefabValueFactory<T>)cache.get(type.getName());
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"PrefabValueFactory",
"<",
"T",
">",
"get",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
... | Retrieves the factory from the cache for the given type.
What happens when there is no factory, is undefined. Always call
{@link #contains(Class)} first.
@param <T> The returned factory will have this as generic type.
@param type The type for which a factory is needed.
@return A factory for the given type, or {@code ... | [
"Retrieves",
"the",
"factory",
"from",
"the",
"cache",
"for",
"the",
"given",
"type",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/FactoryCache.java#L58-L64 |
116,977 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/FactoryCache.java | FactoryCache.iterator | @Override
public Iterator<Map.Entry<String, PrefabValueFactory<?>>> iterator() {
return cache.entrySet().iterator();
} | java | @Override
public Iterator<Map.Entry<String, PrefabValueFactory<?>>> iterator() {
return cache.entrySet().iterator();
} | [
"@",
"Override",
"public",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"PrefabValueFactory",
"<",
"?",
">",
">",
">",
"iterator",
"(",
")",
"{",
"return",
"cache",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"}"
] | Provides an iterator over all available factories. | [
"Provides",
"an",
"iterator",
"over",
"all",
"available",
"factories",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/FactoryCache.java#L98-L101 |
116,978 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/util/ListBuilders.java | ListBuilders.buildListOfAtLeastOne | @SafeVarargs
public static <T> List<T> buildListOfAtLeastOne(T first, T... more) {
if (first == null) {
throw new IllegalArgumentException("First example is null.");
}
List<T> result = new ArrayList<>();
result.add(first);
addArrayElementsToList(result, more);
... | java | @SafeVarargs
public static <T> List<T> buildListOfAtLeastOne(T first, T... more) {
if (first == null) {
throw new IllegalArgumentException("First example is null.");
}
List<T> result = new ArrayList<>();
result.add(first);
addArrayElementsToList(result, more);
... | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"buildListOfAtLeastOne",
"(",
"T",
"first",
",",
"T",
"...",
"more",
")",
"{",
"if",
"(",
"first",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\... | Builds a list with at least one example.
@param first The first example.
@param more Zero or more additional examples.
@param <T> The type of example.
@return A list with at least one example. | [
"Builds",
"a",
"list",
"with",
"at",
"least",
"one",
"example",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/util/ListBuilders.java#L21-L32 |
116,979 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/util/ListBuilders.java | ListBuilders.buildListOfAtLeastTwo | @SafeVarargs
public static <T> List<T> buildListOfAtLeastTwo(T first, T second, T... more) {
if (first == null) {
throw new IllegalArgumentException("First example is null.");
}
if (second == null) {
throw new IllegalArgumentException("Second example is null.");
... | java | @SafeVarargs
public static <T> List<T> buildListOfAtLeastTwo(T first, T second, T... more) {
if (first == null) {
throw new IllegalArgumentException("First example is null.");
}
if (second == null) {
throw new IllegalArgumentException("Second example is null.");
... | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"buildListOfAtLeastTwo",
"(",
"T",
"first",
",",
"T",
"second",
",",
"T",
"...",
"more",
")",
"{",
"if",
"(",
"first",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgum... | Builds a list with at least two examples.
@param first The first example.
@param second The second example.
@param more Zero or more additional examples.
@param <T> The type of example.
@return A list with at least two examples. | [
"Builds",
"a",
"list",
"with",
"at",
"least",
"two",
"examples",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/util/ListBuilders.java#L43-L58 |
116,980 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/util/ListBuilders.java | ListBuilders.listContainsDuplicates | public static <T> boolean listContainsDuplicates(List<T> list) {
return list.size() != new HashSet<>(list).size();
} | java | public static <T> boolean listContainsDuplicates(List<T> list) {
return list.size() != new HashSet<>(list).size();
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"listContainsDuplicates",
"(",
"List",
"<",
"T",
">",
"list",
")",
"{",
"return",
"list",
".",
"size",
"(",
")",
"!=",
"new",
"HashSet",
"<>",
"(",
"list",
")",
".",
"size",
"(",
")",
";",
"}"
] | Determines whether a list contains the same example more than once.
@param list The list that may or may not contain duplicates.
@param <T> The type of example.
@return Whether the given list contains duplicates. | [
"Determines",
"whether",
"a",
"list",
"contains",
"the",
"same",
"example",
"more",
"than",
"once",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/util/ListBuilders.java#L79-L81 |
116,981 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/util/Assert.java | Assert.assertEquals | public static void assertEquals(Formatter message, Object expected, Object actual) {
if (!expected.equals(actual)) {
throw new AssertionException(message);
}
} | java | public static void assertEquals(Formatter message, Object expected, Object actual) {
if (!expected.equals(actual)) {
throw new AssertionException(message);
}
} | [
"public",
"static",
"void",
"assertEquals",
"(",
"Formatter",
"message",
",",
"Object",
"expected",
",",
"Object",
"actual",
")",
"{",
"if",
"(",
"!",
"expected",
".",
"equals",
"(",
"actual",
")",
")",
"{",
"throw",
"new",
"AssertionException",
"(",
"mess... | Asserts that two Objects are equal to one another. Does nothing if they
are; throws an AssertionException if they're not.
@param message Message to be included in the {@link AssertionException}.
@param expected Expected value.
@param actual Actual value.
@throws AssertionException If {@code expected} and {@code actual... | [
"Asserts",
"that",
"two",
"Objects",
"are",
"equal",
"to",
"one",
"another",
".",
"Does",
"nothing",
"if",
"they",
"are",
";",
"throws",
"an",
"AssertionException",
"if",
"they",
"re",
"not",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/util/Assert.java#L24-L28 |
116,982 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/Instantiator.java | Instantiator.instantiateAnonymousSubclass | public T instantiateAnonymousSubclass() {
Class<T> proxyClass = giveDynamicSubclass(type);
return objenesis.newInstance(proxyClass);
} | java | public T instantiateAnonymousSubclass() {
Class<T> proxyClass = giveDynamicSubclass(type);
return objenesis.newInstance(proxyClass);
} | [
"public",
"T",
"instantiateAnonymousSubclass",
"(",
")",
"{",
"Class",
"<",
"T",
">",
"proxyClass",
"=",
"giveDynamicSubclass",
"(",
"type",
")",
";",
"return",
"objenesis",
".",
"newInstance",
"(",
"proxyClass",
")",
";",
"}"
] | Instantiates an anonymous subclass of T. The subclass is
generated dynamically.
@return An instance of an anonymous subclass of T. | [
"Instantiates",
"an",
"anonymous",
"subclass",
"of",
"T",
".",
"The",
"subclass",
"is",
"generated",
"dynamically",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/Instantiator.java#L71-L74 |
116,983 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/Util.java | Util.classForName | @SuppressWarnings("unchecked")
public static <T> Class<T> classForName(String className) {
try {
return (Class<T>)Class.forName(className);
}
catch (ClassNotFoundException | VerifyError e) {
// Catching VerifyError fixes issue #147. I don't know how to unit test it.
... | java | @SuppressWarnings("unchecked")
public static <T> Class<T> classForName(String className) {
try {
return (Class<T>)Class.forName(className);
}
catch (ClassNotFoundException | VerifyError e) {
// Catching VerifyError fixes issue #147. I don't know how to unit test it.
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Class",
"<",
"T",
">",
"classForName",
"(",
"String",
"className",
")",
"{",
"try",
"{",
"return",
"(",
"Class",
"<",
"T",
">",
")",
"Class",
".",
"forName",
"(",
... | Helper method to resolve a Class of a given name.
@param className The fully qualified name of the class to resolve.
@param <T> The type of the class to resolve.
@return The corresponding class if it exists, null otherwise. | [
"Helper",
"method",
"to",
"resolve",
"a",
"Class",
"of",
"a",
"given",
"name",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/Util.java#L19-L28 |
116,984 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/Util.java | Util.objects | public static Object[] objects(Object first, Object second, Object third) {
return new Object[] { first, second, third };
} | java | public static Object[] objects(Object first, Object second, Object third) {
return new Object[] { first, second, third };
} | [
"public",
"static",
"Object",
"[",
"]",
"objects",
"(",
"Object",
"first",
",",
"Object",
"second",
",",
"Object",
"third",
")",
"{",
"return",
"new",
"Object",
"[",
"]",
"{",
"first",
",",
"second",
",",
"third",
"}",
";",
"}"
] | Helper method to create an array of Objects.
@param first The first object to construct an array out of.
@param second The second object in the array.
@param third The third object in the array.
@return An array with the given objects. | [
"Helper",
"method",
"to",
"create",
"an",
"array",
"of",
"Objects",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/Util.java#L78-L80 |
116,985 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/Util.java | Util.setOf | @SafeVarargs
public static <T> Set<T> setOf(T... ts) {
return new HashSet<>(Arrays.asList(ts));
} | java | @SafeVarargs
public static <T> Set<T> setOf(T... ts) {
return new HashSet<>(Arrays.asList(ts));
} | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"Set",
"<",
"T",
">",
"setOf",
"(",
"T",
"...",
"ts",
")",
"{",
"return",
"new",
"HashSet",
"<>",
"(",
"Arrays",
".",
"asList",
"(",
"ts",
")",
")",
";",
"}"
] | Helper method to create a set of object.
@param ts The objects to add to the set.
@param <T> The type of objects to add to the set.
@return A set with the given objets. | [
"Helper",
"method",
"to",
"create",
"a",
"set",
"of",
"object",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/Util.java#L89-L92 |
116,986 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/Cache.java | Cache.put | public <T> void put(TypeTag tag, T red, T black, T redCopy) {
cache.put(tag, new Tuple<>(red, black, redCopy));
} | java | public <T> void put(TypeTag tag, T red, T black, T redCopy) {
cache.put(tag, new Tuple<>(red, black, redCopy));
} | [
"public",
"<",
"T",
">",
"void",
"put",
"(",
"TypeTag",
"tag",
",",
"T",
"red",
",",
"T",
"black",
",",
"T",
"redCopy",
")",
"{",
"cache",
".",
"put",
"(",
"tag",
",",
"new",
"Tuple",
"<>",
"(",
"red",
",",
"black",
",",
"redCopy",
")",
")",
... | Adds a prefabricated value to the cache for the given type.
@param tag A description of the type. Takes generics into account.
@param red A "red" value for the given type.
@param black A "black" value for the given type.
@param redCopy A shallow copy of the given red value. | [
"Adds",
"a",
"prefabricated",
"value",
"to",
"the",
"cache",
"for",
"the",
"given",
"type",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/Cache.java#L21-L23 |
116,987 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/ConfiguredEqualsVerifier.java | ConfiguredEqualsVerifier.forClass | public <T> EqualsVerifierApi<T> forClass(Class<T> type) {
return new EqualsVerifierApi<>(type, EnumSet.copyOf(warningsToSuppress), factoryCache, usingGetClass);
} | java | public <T> EqualsVerifierApi<T> forClass(Class<T> type) {
return new EqualsVerifierApi<>(type, EnumSet.copyOf(warningsToSuppress), factoryCache, usingGetClass);
} | [
"public",
"<",
"T",
">",
"EqualsVerifierApi",
"<",
"T",
">",
"forClass",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"new",
"EqualsVerifierApi",
"<>",
"(",
"type",
",",
"EnumSet",
".",
"copyOf",
"(",
"warningsToSuppress",
")",
",",
"factoryC... | Factory method. For general use.
@param <T> The type.
@param type The class for which the {@code equals} method should be
tested.
@return A fluent API for EqualsVerifier. | [
"Factory",
"method",
".",
"For",
"general",
"use",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/ConfiguredEqualsVerifier.java#L102-L104 |
116,988 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/ObjectAccessor.java | ObjectAccessor.copy | public T copy() {
T copy = Instantiator.of(type).instantiate();
return copyInto(copy);
} | java | public T copy() {
T copy = Instantiator.of(type).instantiate();
return copyInto(copy);
} | [
"public",
"T",
"copy",
"(",
")",
"{",
"T",
"copy",
"=",
"Instantiator",
".",
"of",
"(",
"type",
")",
".",
"instantiate",
"(",
")",
";",
"return",
"copyInto",
"(",
"copy",
")",
";",
"}"
] | Creates a copy of the wrapped object.
Note: it does a "shallow" copy. Reference fields are not copied
recursively.
@return A shallow copy. | [
"Creates",
"a",
"copy",
"of",
"the",
"wrapped",
"object",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/ObjectAccessor.java#L79-L82 |
116,989 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/ObjectAccessor.java | ObjectAccessor.copyIntoSubclass | public <S extends T> S copyIntoSubclass(Class<S> subclass) {
S copy = Instantiator.of(subclass).instantiate();
return copyInto(copy);
} | java | public <S extends T> S copyIntoSubclass(Class<S> subclass) {
S copy = Instantiator.of(subclass).instantiate();
return copyInto(copy);
} | [
"public",
"<",
"S",
"extends",
"T",
">",
"S",
"copyIntoSubclass",
"(",
"Class",
"<",
"S",
">",
"subclass",
")",
"{",
"S",
"copy",
"=",
"Instantiator",
".",
"of",
"(",
"subclass",
")",
".",
"instantiate",
"(",
")",
";",
"return",
"copyInto",
"(",
"cop... | Creates a copy of the wrapped object, where the copy's type is a
specified subclass of the wrapped object's class.
Note: it does a "shallow" copy. Reference fields are not copied
recursively.
@param subclass A subclass of the wrapped object's class.
@param <S> The subclass.
@return A shallow copy. | [
"Creates",
"a",
"copy",
"of",
"the",
"wrapped",
"object",
"where",
"the",
"copy",
"s",
"type",
"is",
"a",
"specified",
"subclass",
"of",
"the",
"wrapped",
"object",
"s",
"class",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/ObjectAccessor.java#L95-L98 |
116,990 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/ObjectAccessor.java | ObjectAccessor.copyIntoAnonymousSubclass | public T copyIntoAnonymousSubclass() {
T copy = Instantiator.of(type).instantiateAnonymousSubclass();
return copyInto(copy);
} | java | public T copyIntoAnonymousSubclass() {
T copy = Instantiator.of(type).instantiateAnonymousSubclass();
return copyInto(copy);
} | [
"public",
"T",
"copyIntoAnonymousSubclass",
"(",
")",
"{",
"T",
"copy",
"=",
"Instantiator",
".",
"of",
"(",
"type",
")",
".",
"instantiateAnonymousSubclass",
"(",
")",
";",
"return",
"copyInto",
"(",
"copy",
")",
";",
"}"
] | Creates a copy of the wrapped object, where the copy type is an
anonymous subclass of the wrapped object's class.
Note: it does a "shallow" copy. Reference fields are not copied
recursively.
@return A shallow copy. | [
"Creates",
"a",
"copy",
"of",
"the",
"wrapped",
"object",
"where",
"the",
"copy",
"type",
"is",
"an",
"anonymous",
"subclass",
"of",
"the",
"wrapped",
"object",
"s",
"class",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/ObjectAccessor.java#L109-L112 |
116,991 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/ObjectAccessor.java | ObjectAccessor.scramble | public void scramble(PrefabValues prefabValues, TypeTag enclosingType) {
for (Field field : FieldIterable.of(type)) {
FieldAccessor accessor = new FieldAccessor(object, field);
accessor.changeField(prefabValues, enclosingType);
}
} | java | public void scramble(PrefabValues prefabValues, TypeTag enclosingType) {
for (Field field : FieldIterable.of(type)) {
FieldAccessor accessor = new FieldAccessor(object, field);
accessor.changeField(prefabValues, enclosingType);
}
} | [
"public",
"void",
"scramble",
"(",
"PrefabValues",
"prefabValues",
",",
"TypeTag",
"enclosingType",
")",
"{",
"for",
"(",
"Field",
"field",
":",
"FieldIterable",
".",
"of",
"(",
"type",
")",
")",
"{",
"FieldAccessor",
"accessor",
"=",
"new",
"FieldAccessor",
... | Modifies all fields of the wrapped object that are declared in T and in
its superclasses.
This method is consistent: given two equal objects; after scrambling
both objects, they remain equal to each other.
It cannot modifiy:
1. static final fields, and
2. final fields that are initialized to a compile-time constant i... | [
"Modifies",
"all",
"fields",
"of",
"the",
"wrapped",
"object",
"that",
"are",
"declared",
"in",
"T",
"and",
"in",
"its",
"superclasses",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/ObjectAccessor.java#L140-L145 |
116,992 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/ObjectAccessor.java | ObjectAccessor.shallowScramble | public void shallowScramble(PrefabValues prefabValues, TypeTag enclosingType) {
for (Field field : FieldIterable.ofIgnoringSuper(type)) {
FieldAccessor accessor = new FieldAccessor(object, field);
accessor.changeField(prefabValues, enclosingType);
}
} | java | public void shallowScramble(PrefabValues prefabValues, TypeTag enclosingType) {
for (Field field : FieldIterable.ofIgnoringSuper(type)) {
FieldAccessor accessor = new FieldAccessor(object, field);
accessor.changeField(prefabValues, enclosingType);
}
} | [
"public",
"void",
"shallowScramble",
"(",
"PrefabValues",
"prefabValues",
",",
"TypeTag",
"enclosingType",
")",
"{",
"for",
"(",
"Field",
"field",
":",
"FieldIterable",
".",
"ofIgnoringSuper",
"(",
"type",
")",
")",
"{",
"FieldAccessor",
"accessor",
"=",
"new",
... | Modifies all fields of the wrapped object that are declared in T, but
not those inherited from superclasses.
This method is consistent: given two equal objects; after scrambling
both objects, they remain equal to each other.
It cannot modifiy:
1. static final fields, and
2. final fields that are initialized to a comp... | [
"Modifies",
"all",
"fields",
"of",
"the",
"wrapped",
"object",
"that",
"are",
"declared",
"in",
"T",
"but",
"not",
"those",
"inherited",
"from",
"superclasses",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/ObjectAccessor.java#L165-L170 |
116,993 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/annotations/NonnullAnnotationVerifier.java | NonnullAnnotationVerifier.fieldIsNonnull | public static boolean fieldIsNonnull(Field field, AnnotationCache annotationCache) {
Class<?> type = field.getDeclaringClass();
if (annotationCache.hasFieldAnnotation(type, field.getName(), NONNULL)) {
return true;
}
if (annotationCache.hasFieldAnnotation(type, field.getName(... | java | public static boolean fieldIsNonnull(Field field, AnnotationCache annotationCache) {
Class<?> type = field.getDeclaringClass();
if (annotationCache.hasFieldAnnotation(type, field.getName(), NONNULL)) {
return true;
}
if (annotationCache.hasFieldAnnotation(type, field.getName(... | [
"public",
"static",
"boolean",
"fieldIsNonnull",
"(",
"Field",
"field",
",",
"AnnotationCache",
"annotationCache",
")",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"field",
".",
"getDeclaringClass",
"(",
")",
";",
"if",
"(",
"annotationCache",
".",
"hasFieldAnno... | Checks whether the given field is marked with an Nonnull annotation,
whether directly, or through some default annotation mechanism.
@param field The field to be checked.
@param annotationCache To provide access to the annotations on the field
and the field's class
@return True if the field is to be treated as Nonnull... | [
"Checks",
"whether",
"the",
"given",
"field",
"is",
"marked",
"with",
"an",
"Nonnull",
"annotation",
"whether",
"directly",
"or",
"through",
"some",
"default",
"annotation",
"mechanism",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/annotations/NonnullAnnotationVerifier.java#L23-L34 |
116,994 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/ClassAccessor.java | ClassAccessor.declaresField | public boolean declaresField(Field field) {
try {
type.getDeclaredField(field.getName());
return true;
}
catch (NoSuchFieldException e) {
return false;
}
} | java | public boolean declaresField(Field field) {
try {
type.getDeclaredField(field.getName());
return true;
}
catch (NoSuchFieldException e) {
return false;
}
} | [
"public",
"boolean",
"declaresField",
"(",
"Field",
"field",
")",
"{",
"try",
"{",
"type",
".",
"getDeclaredField",
"(",
"field",
".",
"getName",
"(",
")",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"NoSuchFieldException",
"e",
")",
"{",
"return... | Determines whether T declares a field. This does not include inherited fields.
@param field The field that we want to detect.
@return True if T declares the field. | [
"Determines",
"whether",
"T",
"declares",
"a",
"field",
".",
"This",
"does",
"not",
"include",
"inherited",
"fields",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/ClassAccessor.java#L59-L67 |
116,995 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/ConditionalInstantiator.java | ConditionalInstantiator.instantiate | @SuppressFBWarnings(value = "DP_DO_INSIDE_DO_PRIVILEGED", justification = "EV is run only from within unit tests")
public <T> T instantiate(Class<?>[] paramTypes, Object[] paramValues) {
try {
Class<T> type = resolve();
if (type == null) {
return null;
}
... | java | @SuppressFBWarnings(value = "DP_DO_INSIDE_DO_PRIVILEGED", justification = "EV is run only from within unit tests")
public <T> T instantiate(Class<?>[] paramTypes, Object[] paramValues) {
try {
Class<T> type = resolve();
if (type == null) {
return null;
}
... | [
"@",
"SuppressFBWarnings",
"(",
"value",
"=",
"\"DP_DO_INSIDE_DO_PRIVILEGED\"",
",",
"justification",
"=",
"\"EV is run only from within unit tests\"",
")",
"public",
"<",
"T",
">",
"T",
"instantiate",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"paramTypes",
",",
"Obj... | Attempts to instantiate the type.
@param <T>
The type to instantiate.
@param paramTypes
The types of the constructor parameters of the constructor
that we want to call.
@param paramValues
The values that we want to pass into the constructor.
@return An instance of the type given in the constructor with the given
param... | [
"Attempts",
"to",
"instantiate",
"the",
"type",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/ConditionalInstantiator.java#L69-L83 |
116,996 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/ConditionalInstantiator.java | ConditionalInstantiator.callFactory | public <T> T callFactory(String factoryMethod, Class<?>[] paramTypes, Object[] paramValues) {
return callFactory(fullyQualifiedClassName, factoryMethod, paramTypes, paramValues);
} | java | public <T> T callFactory(String factoryMethod, Class<?>[] paramTypes, Object[] paramValues) {
return callFactory(fullyQualifiedClassName, factoryMethod, paramTypes, paramValues);
} | [
"public",
"<",
"T",
">",
"T",
"callFactory",
"(",
"String",
"factoryMethod",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"paramTypes",
",",
"Object",
"[",
"]",
"paramValues",
")",
"{",
"return",
"callFactory",
"(",
"fullyQualifiedClassName",
",",
"factoryMethod",... | Attempts to call a static factory method on the type.
@param <T>
The return type of the factory method.
@param factoryMethod
The name of the factory method.
@param paramTypes
The types of the parameters of the specific overload of the
factory method we want to call.
@param paramValues
The values that we want to pass i... | [
"Attempts",
"to",
"call",
"a",
"static",
"factory",
"method",
"on",
"the",
"type",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/ConditionalInstantiator.java#L102-L104 |
116,997 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/ConditionalInstantiator.java | ConditionalInstantiator.callFactory | @SuppressFBWarnings(value = "DP_DO_INSIDE_DO_PRIVILEGED", justification = "EV is run only from within unit tests")
@SuppressWarnings("unchecked")
public <T> T callFactory(String factoryTypeName, String factoryMethod, Class<?>[] paramTypes, Object[] paramValues) {
try {
Class<T> type = resolv... | java | @SuppressFBWarnings(value = "DP_DO_INSIDE_DO_PRIVILEGED", justification = "EV is run only from within unit tests")
@SuppressWarnings("unchecked")
public <T> T callFactory(String factoryTypeName, String factoryMethod, Class<?>[] paramTypes, Object[] paramValues) {
try {
Class<T> type = resolv... | [
"@",
"SuppressFBWarnings",
"(",
"value",
"=",
"\"DP_DO_INSIDE_DO_PRIVILEGED\"",
",",
"justification",
"=",
"\"EV is run only from within unit tests\"",
")",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"callFactory",
"(",
"String",
... | Attempts to call a static factory method on a type.
@param <T>
The return type of the factory method.
@param factoryTypeName
The type that contains the factory method.
@param factoryMethod
The name of the factory method.
@param paramTypes
The types of the parameters of the specific overload of the
factory method we wa... | [
"Attempts",
"to",
"call",
"a",
"static",
"factory",
"method",
"on",
"a",
"type",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/ConditionalInstantiator.java#L125-L141 |
116,998 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/ConditionalInstantiator.java | ConditionalInstantiator.returnConstant | @SuppressFBWarnings(value = "DP_DO_INSIDE_DO_PRIVILEGED", justification = "EV is run only from within unit tests")
@SuppressWarnings("unchecked")
public <T> T returnConstant(String constantName) {
try {
Class<T> type = resolve();
if (type == null) {
return null;
... | java | @SuppressFBWarnings(value = "DP_DO_INSIDE_DO_PRIVILEGED", justification = "EV is run only from within unit tests")
@SuppressWarnings("unchecked")
public <T> T returnConstant(String constantName) {
try {
Class<T> type = resolve();
if (type == null) {
return null;
... | [
"@",
"SuppressFBWarnings",
"(",
"value",
"=",
"\"DP_DO_INSIDE_DO_PRIVILEGED\"",
",",
"justification",
"=",
"\"EV is run only from within unit tests\"",
")",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"returnConstant",
"(",
"String"... | Attempts to resolve a static constant on the type.
@param <T>
The type of the constant.
@param constantName
The name of the constant.
@return The value of the constant, or null if the type does not exist.
@throws ReflectionException
If resolving the constant fails. | [
"Attempts",
"to",
"resolve",
"a",
"static",
"constant",
"on",
"the",
"type",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/ConditionalInstantiator.java#L154-L169 |
116,999 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/Tuple.java | Tuple.of | @SuppressWarnings("unchecked")
public static <U> Tuple<U> of(Object red, Object black, Object redCopy) {
return new Tuple<>((U)red, (U)black, (U)redCopy);
} | java | @SuppressWarnings("unchecked")
public static <U> Tuple<U> of(Object red, Object black, Object redCopy) {
return new Tuple<>((U)red, (U)black, (U)redCopy);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"U",
">",
"Tuple",
"<",
"U",
">",
"of",
"(",
"Object",
"red",
",",
"Object",
"black",
",",
"Object",
"redCopy",
")",
"{",
"return",
"new",
"Tuple",
"<>",
"(",
"(",
"U",
")",... | Factory method that turns three untyped values into a typed tuple.
@param red The red value.
@param black The black value.
@param redCopy A shallow copy of the red value.
@param <U> The assumed type of the values.
@return A typed tuple with the three given values. | [
"Factory",
"method",
"that",
"turns",
"three",
"untyped",
"values",
"into",
"a",
"typed",
"tuple",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/Tuple.java#L33-L36 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.