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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
10,600 | gitblit/fathom | fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java | SwaggerBuilder.getControllerTag | protected Tag getControllerTag(Class<? extends Controller> controllerClass) {
if (controllerClass.isAnnotationPresent(ApiOperations.class)) {
ApiOperations annotation = controllerClass.getAnnotation(ApiOperations.class);
io.swagger.models.Tag tag = new io.swagger.models.Tag();
... | java | protected Tag getControllerTag(Class<? extends Controller> controllerClass) {
if (controllerClass.isAnnotationPresent(ApiOperations.class)) {
ApiOperations annotation = controllerClass.getAnnotation(ApiOperations.class);
io.swagger.models.Tag tag = new io.swagger.models.Tag();
... | [
"protected",
"Tag",
"getControllerTag",
"(",
"Class",
"<",
"?",
"extends",
"Controller",
">",
"controllerClass",
")",
"{",
"if",
"(",
"controllerClass",
".",
"isAnnotationPresent",
"(",
"ApiOperations",
".",
"class",
")",
")",
"{",
"ApiOperations",
"annotation",
... | Returns the Tag for a controller.
@param controllerClass
@return a controller tag or null | [
"Returns",
"the",
"Tag",
"for",
"a",
"controller",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java#L946-L964 |
10,601 | gitblit/fathom | fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java | SwaggerBuilder.getModelTag | protected Tag getModelTag(Class<?> modelClass) {
if (modelClass.isAnnotationPresent(ApiModel.class)) {
ApiModel annotation = modelClass.getAnnotation(ApiModel.class);
Tag tag = new Tag();
tag.setName(Optional.fromNullable(Strings.emptyToNull(annotation.name())).or(modelClass.... | java | protected Tag getModelTag(Class<?> modelClass) {
if (modelClass.isAnnotationPresent(ApiModel.class)) {
ApiModel annotation = modelClass.getAnnotation(ApiModel.class);
Tag tag = new Tag();
tag.setName(Optional.fromNullable(Strings.emptyToNull(annotation.name())).or(modelClass.... | [
"protected",
"Tag",
"getModelTag",
"(",
"Class",
"<",
"?",
">",
"modelClass",
")",
"{",
"if",
"(",
"modelClass",
".",
"isAnnotationPresent",
"(",
"ApiModel",
".",
"class",
")",
")",
"{",
"ApiModel",
"annotation",
"=",
"modelClass",
".",
"getAnnotation",
"(",... | Returns the tag of the model.
This ref is either explicitly named or it is generated from the model class name.
@param modelClass
@return the tag of the model | [
"Returns",
"the",
"tag",
"of",
"the",
"model",
".",
"This",
"ref",
"is",
"either",
"explicitly",
"named",
"or",
"it",
"is",
"generated",
"from",
"the",
"model",
"class",
"name",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java#L973-L985 |
10,602 | gitblit/fathom | fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java | SwaggerBuilder.getDescription | protected String getDescription(Parameter parameter) {
if (parameter.isAnnotationPresent(Desc.class)) {
Desc annotation = parameter.getAnnotation(Desc.class);
return translate(annotation.key(), annotation.value());
}
return null;
} | java | protected String getDescription(Parameter parameter) {
if (parameter.isAnnotationPresent(Desc.class)) {
Desc annotation = parameter.getAnnotation(Desc.class);
return translate(annotation.key(), annotation.value());
}
return null;
} | [
"protected",
"String",
"getDescription",
"(",
"Parameter",
"parameter",
")",
"{",
"if",
"(",
"parameter",
".",
"isAnnotationPresent",
"(",
"Desc",
".",
"class",
")",
")",
"{",
"Desc",
"annotation",
"=",
"parameter",
".",
"getAnnotation",
"(",
"Desc",
".",
"c... | Returns the description of a parameter.
@param parameter
@return the parameter description | [
"Returns",
"the",
"description",
"of",
"a",
"parameter",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java#L1017-L1023 |
10,603 | gitblit/fathom | fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java | SwaggerBuilder.isRequired | protected boolean isRequired(Parameter parameter) {
return parameter.isAnnotationPresent(Body.class)
|| parameter.isAnnotationPresent(Required.class)
|| parameter.isAnnotationPresent(NotNull.class);
} | java | protected boolean isRequired(Parameter parameter) {
return parameter.isAnnotationPresent(Body.class)
|| parameter.isAnnotationPresent(Required.class)
|| parameter.isAnnotationPresent(NotNull.class);
} | [
"protected",
"boolean",
"isRequired",
"(",
"Parameter",
"parameter",
")",
"{",
"return",
"parameter",
".",
"isAnnotationPresent",
"(",
"Body",
".",
"class",
")",
"||",
"parameter",
".",
"isAnnotationPresent",
"(",
"Required",
".",
"class",
")",
"||",
"parameter"... | Determines if a parameter is Required or not.
@param parameter
@return true if the parameter is required | [
"Determines",
"if",
"a",
"parameter",
"is",
"Required",
"or",
"not",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java#L1031-L1035 |
10,604 | gitblit/fathom | fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java | SwaggerBuilder.translate | protected String translate(String messageKey, String defaultMessage) {
if (messages == null || Strings.isNullOrEmpty(messageKey)) {
return Strings.emptyToNull(defaultMessage);
}
return Strings.emptyToNull(messages.getWithDefault(messageKey, defaultMessage, defaultLanguage));
} | java | protected String translate(String messageKey, String defaultMessage) {
if (messages == null || Strings.isNullOrEmpty(messageKey)) {
return Strings.emptyToNull(defaultMessage);
}
return Strings.emptyToNull(messages.getWithDefault(messageKey, defaultMessage, defaultLanguage));
} | [
"protected",
"String",
"translate",
"(",
"String",
"messageKey",
",",
"String",
"defaultMessage",
")",
"{",
"if",
"(",
"messages",
"==",
"null",
"||",
"Strings",
".",
"isNullOrEmpty",
"(",
"messageKey",
")",
")",
"{",
"return",
"Strings",
".",
"emptyToNull",
... | Attempts to provide a localized message.
@param messageKey
@param defaultMessage
@return the default message or a localized message or null | [
"Attempts",
"to",
"provide",
"a",
"localized",
"message",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java#L1083-L1088 |
10,605 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/controller/ControllerRegistrar.java | ControllerRegistrar.init | public final void init(String... packageNames) {
Collection<Class<?>> classes = discoverClasses(packageNames);
if (classes.isEmpty()) {
log.warn("No annotated controllers found in package(s) '{}'", Arrays.toString(packageNames));
return;
}
log.debug("Found {} co... | java | public final void init(String... packageNames) {
Collection<Class<?>> classes = discoverClasses(packageNames);
if (classes.isEmpty()) {
log.warn("No annotated controllers found in package(s) '{}'", Arrays.toString(packageNames));
return;
}
log.debug("Found {} co... | [
"public",
"final",
"void",
"init",
"(",
"String",
"...",
"packageNames",
")",
"{",
"Collection",
"<",
"Class",
"<",
"?",
">",
">",
"classes",
"=",
"discoverClasses",
"(",
"packageNames",
")",
";",
"if",
"(",
"classes",
".",
"isEmpty",
"(",
")",
")",
"{... | Scans, identifies, and registers annotated controller methods for the
current runtime settings.
@param packageNames | [
"Scans",
"identifies",
"and",
"registers",
"annotated",
"controller",
"methods",
"for",
"the",
"current",
"runtime",
"settings",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerRegistrar.java#L72-L83 |
10,606 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/controller/ControllerRegistrar.java | ControllerRegistrar.init | public final void init(Class<? extends Controller>... controllers) {
List<Class<?>> classes = Arrays.asList(controllers);
init(classes);
} | java | public final void init(Class<? extends Controller>... controllers) {
List<Class<?>> classes = Arrays.asList(controllers);
init(classes);
} | [
"public",
"final",
"void",
"init",
"(",
"Class",
"<",
"?",
"extends",
"Controller",
">",
"...",
"controllers",
")",
"{",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"classes",
"=",
"Arrays",
".",
"asList",
"(",
"controllers",
")",
";",
"init",
"(",
"cl... | Register all methods in the specified controller classes.
@param controllers | [
"Register",
"all",
"methods",
"in",
"the",
"specified",
"controller",
"classes",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerRegistrar.java#L90-L93 |
10,607 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/controller/ControllerRegistrar.java | ControllerRegistrar.registerControllerMethods | private void registerControllerMethods(Map<Method, Class<? extends Annotation>> discoveredMethods) {
Collection<Method> methods = sortMethods(discoveredMethods.keySet());
Map<Class<? extends Controller>, Set<String>> controllers = new HashMap<>();
for (Method method : methods) {
Cl... | java | private void registerControllerMethods(Map<Method, Class<? extends Annotation>> discoveredMethods) {
Collection<Method> methods = sortMethods(discoveredMethods.keySet());
Map<Class<? extends Controller>, Set<String>> controllers = new HashMap<>();
for (Method method : methods) {
Cl... | [
"private",
"void",
"registerControllerMethods",
"(",
"Map",
"<",
"Method",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
">",
"discoveredMethods",
")",
"{",
"Collection",
"<",
"Method",
">",
"methods",
"=",
"sortMethods",
"(",
"discoveredMethods",
".",
... | Register the controller methods as Routes.
@param discoveredMethods | [
"Register",
"the",
"controller",
"methods",
"as",
"Routes",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerRegistrar.java#L124-L177 |
10,608 | gitblit/fathom | fathom-mailer/src/main/java/fathom/mailer/Mailer.java | Mailer.newTextMailRequest | public MailRequest newTextMailRequest(String subject, String body) {
return createMailRequest(generateRequestId(), false, subject, body);
} | java | public MailRequest newTextMailRequest(String subject, String body) {
return createMailRequest(generateRequestId(), false, subject, body);
} | [
"public",
"MailRequest",
"newTextMailRequest",
"(",
"String",
"subject",
",",
"String",
"body",
")",
"{",
"return",
"createMailRequest",
"(",
"generateRequestId",
"(",
")",
",",
"false",
",",
"subject",
",",
"body",
")",
";",
"}"
] | Creates a plain text MailRequest with the specified subject and body.
A request id is automatically generated.
@param subject
@param body
@return a text mail request | [
"Creates",
"a",
"plain",
"text",
"MailRequest",
"with",
"the",
"specified",
"subject",
"and",
"body",
".",
"A",
"request",
"id",
"is",
"automatically",
"generated",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-mailer/src/main/java/fathom/mailer/Mailer.java#L97-L99 |
10,609 | gitblit/fathom | fathom-mailer/src/main/java/fathom/mailer/Mailer.java | Mailer.newTextMailRequest | public MailRequest newTextMailRequest(String requestId, String subject, String body) {
return createMailRequest(requestId, false, subject, body);
} | java | public MailRequest newTextMailRequest(String requestId, String subject, String body) {
return createMailRequest(requestId, false, subject, body);
} | [
"public",
"MailRequest",
"newTextMailRequest",
"(",
"String",
"requestId",
",",
"String",
"subject",
",",
"String",
"body",
")",
"{",
"return",
"createMailRequest",
"(",
"requestId",
",",
"false",
",",
"subject",
",",
"body",
")",
";",
"}"
] | Creates a plan text MailRequest with the specified subject and body.
The request id is supplied.
@param requestId
@param subject
@param body
@return a text mail request | [
"Creates",
"a",
"plan",
"text",
"MailRequest",
"with",
"the",
"specified",
"subject",
"and",
"body",
".",
"The",
"request",
"id",
"is",
"supplied",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-mailer/src/main/java/fathom/mailer/Mailer.java#L110-L112 |
10,610 | gitblit/fathom | fathom-mailer/src/main/java/fathom/mailer/Mailer.java | Mailer.newHtmlMailRequest | public MailRequest newHtmlMailRequest(String subject, String body) {
return createMailRequest(generateRequestId(), true, subject, body);
} | java | public MailRequest newHtmlMailRequest(String subject, String body) {
return createMailRequest(generateRequestId(), true, subject, body);
} | [
"public",
"MailRequest",
"newHtmlMailRequest",
"(",
"String",
"subject",
",",
"String",
"body",
")",
"{",
"return",
"createMailRequest",
"(",
"generateRequestId",
"(",
")",
",",
"true",
",",
"subject",
",",
"body",
")",
";",
"}"
] | Creates an html MailRequest with the specified subject and body.
The request id is automatically generated.
@param subject
@param body
@return an html mail request | [
"Creates",
"an",
"html",
"MailRequest",
"with",
"the",
"specified",
"subject",
"and",
"body",
".",
"The",
"request",
"id",
"is",
"automatically",
"generated",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-mailer/src/main/java/fathom/mailer/Mailer.java#L122-L124 |
10,611 | gitblit/fathom | fathom-mailer/src/main/java/fathom/mailer/Mailer.java | Mailer.newHtmlMailRequest | public MailRequest newHtmlMailRequest(String requestId, String subject, String body) {
return createMailRequest(requestId, true, subject, body);
} | java | public MailRequest newHtmlMailRequest(String requestId, String subject, String body) {
return createMailRequest(requestId, true, subject, body);
} | [
"public",
"MailRequest",
"newHtmlMailRequest",
"(",
"String",
"requestId",
",",
"String",
"subject",
",",
"String",
"body",
")",
"{",
"return",
"createMailRequest",
"(",
"requestId",
",",
"true",
",",
"subject",
",",
"body",
")",
";",
"}"
] | Creates an html MailRequest with the specified subject and body.
The request id is supplied.
@param requestId
@param subject
@param body
@return an html mail request | [
"Creates",
"an",
"html",
"MailRequest",
"with",
"the",
"specified",
"subject",
"and",
"body",
".",
"The",
"request",
"id",
"is",
"supplied",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-mailer/src/main/java/fathom/mailer/Mailer.java#L135-L137 |
10,612 | gitblit/fathom | fathom-mailer/src/main/java/fathom/mailer/Mailer.java | Mailer.newTextTemplateMailRequest | public MailRequest newTextTemplateMailRequest(String subjectTemplate, String textTemplateName, Map<String, Object> parameters) {
return createTemplateMailRequest(generateRequestId(), subjectTemplate, textTemplateName, false, parameters);
} | java | public MailRequest newTextTemplateMailRequest(String subjectTemplate, String textTemplateName, Map<String, Object> parameters) {
return createTemplateMailRequest(generateRequestId(), subjectTemplate, textTemplateName, false, parameters);
} | [
"public",
"MailRequest",
"newTextTemplateMailRequest",
"(",
"String",
"subjectTemplate",
",",
"String",
"textTemplateName",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"return",
"createTemplateMailRequest",
"(",
"generateRequestId",
"(",
")"... | Creates a MailRequest from the specified template.
The request id is automatically generated.
@param subjectTemplate a string that uses the parameters & TemplateEngine to interpolate values
@param textTemplateName the name of the classpath template resource
@param parameters
@return a text mail request | [
"Creates",
"a",
"MailRequest",
"from",
"the",
"specified",
"template",
".",
"The",
"request",
"id",
"is",
"automatically",
"generated",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-mailer/src/main/java/fathom/mailer/Mailer.java#L155-L157 |
10,613 | gitblit/fathom | fathom-mailer/src/main/java/fathom/mailer/Mailer.java | Mailer.newHtmlTemplateMailRequest | public MailRequest newHtmlTemplateMailRequest(String requestId, String subjectTemplate, String htmlTemplateName, Map<String, Object> parameters) {
return createTemplateMailRequest(requestId, subjectTemplate, htmlTemplateName, true, parameters);
} | java | public MailRequest newHtmlTemplateMailRequest(String requestId, String subjectTemplate, String htmlTemplateName, Map<String, Object> parameters) {
return createTemplateMailRequest(requestId, subjectTemplate, htmlTemplateName, true, parameters);
} | [
"public",
"MailRequest",
"newHtmlTemplateMailRequest",
"(",
"String",
"requestId",
",",
"String",
"subjectTemplate",
",",
"String",
"htmlTemplateName",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"return",
"createTemplateMailRequest",
"(",
... | Creates a MailRequest from the specified template.
The request id is supplied.
@param subjectTemplate a string that uses the parameters & TemplateEngine to interpolate values
@param htmlTemplateName the name of the classpath template resource
@param parameters
@return an html mail request | [
"Creates",
"a",
"MailRequest",
"from",
"the",
"specified",
"template",
".",
"The",
"request",
"id",
"is",
"supplied",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-mailer/src/main/java/fathom/mailer/Mailer.java#L194-L196 |
10,614 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/RestModule.java | RestModule.getPippoSettings | public static PippoSettings getPippoSettings(Settings settings) {
RuntimeMode runtimeMode = RuntimeMode.PROD;
for (RuntimeMode mode : RuntimeMode.values()) {
if (mode.name().equalsIgnoreCase(settings.getMode().toString())) {
runtimeMode = mode;
}
}
... | java | public static PippoSettings getPippoSettings(Settings settings) {
RuntimeMode runtimeMode = RuntimeMode.PROD;
for (RuntimeMode mode : RuntimeMode.values()) {
if (mode.name().equalsIgnoreCase(settings.getMode().toString())) {
runtimeMode = mode;
}
}
... | [
"public",
"static",
"PippoSettings",
"getPippoSettings",
"(",
"Settings",
"settings",
")",
"{",
"RuntimeMode",
"runtimeMode",
"=",
"RuntimeMode",
".",
"PROD",
";",
"for",
"(",
"RuntimeMode",
"mode",
":",
"RuntimeMode",
".",
"values",
"(",
")",
")",
"{",
"if",
... | Convert Fathom Settings into PippoSettings
@param settings
@return PippoSettings | [
"Convert",
"Fathom",
"Settings",
"into",
"PippoSettings"
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/RestModule.java#L86-L113 |
10,615 | gitblit/fathom | fathom-security/src/main/java/fathom/realm/FileRealm.java | FileRealm.readFile | protected synchronized void readFile() {
if (realmFile != null && realmFile.exists() && (realmFile.lastModified() != lastModified)) {
lastModified = realmFile.lastModified();
try {
Preconditions.checkArgument(realmFile.canRead(), "The file '{}' can not be read!", realmFil... | java | protected synchronized void readFile() {
if (realmFile != null && realmFile.exists() && (realmFile.lastModified() != lastModified)) {
lastModified = realmFile.lastModified();
try {
Preconditions.checkArgument(realmFile.canRead(), "The file '{}' can not be read!", realmFil... | [
"protected",
"synchronized",
"void",
"readFile",
"(",
")",
"{",
"if",
"(",
"realmFile",
"!=",
"null",
"&&",
"realmFile",
".",
"exists",
"(",
")",
"&&",
"(",
"realmFile",
".",
"lastModified",
"(",
")",
"!=",
"lastModified",
")",
")",
"{",
"lastModified",
... | Reads the realm file and rebuilds the in-memory lookup tables. | [
"Reads",
"the",
"realm",
"file",
"and",
"rebuilds",
"the",
"in",
"-",
"memory",
"lookup",
"tables",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-security/src/main/java/fathom/realm/FileRealm.java#L81-L92 |
10,616 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/ACE.java | ACE.newInstance | public static ACE newInstance(final AceType type) {
final ACE ace = new ACE();
ace.setType(type);
return ace;
} | java | public static ACE newInstance(final AceType type) {
final ACE ace = new ACE();
ace.setType(type);
return ace;
} | [
"public",
"static",
"ACE",
"newInstance",
"(",
"final",
"AceType",
"type",
")",
"{",
"final",
"ACE",
"ace",
"=",
"new",
"ACE",
"(",
")",
";",
"ace",
".",
"setType",
"(",
"type",
")",
";",
"return",
"ace",
";",
"}"
] | Creates a new ACE instance.
@param type ACE type.
@return ACE. | [
"Creates",
"a",
"new",
"ACE",
"instance",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/ACE.java#L98-L102 |
10,617 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/ACE.java | ACE.parse | int parse(final IntBuffer buff, final int start) {
int pos = start;
byte[] bytes = NumberFacility.getBytes(buff.get(pos));
type = AceType.parseValue(bytes[0]);
flags = AceFlag.parseValue(bytes[1]);
int size = NumberFacility.getInt(bytes[3], bytes[2]);
pos++;
ri... | java | int parse(final IntBuffer buff, final int start) {
int pos = start;
byte[] bytes = NumberFacility.getBytes(buff.get(pos));
type = AceType.parseValue(bytes[0]);
flags = AceFlag.parseValue(bytes[1]);
int size = NumberFacility.getInt(bytes[3], bytes[2]);
pos++;
ri... | [
"int",
"parse",
"(",
"final",
"IntBuffer",
"buff",
",",
"final",
"int",
"start",
")",
"{",
"int",
"pos",
"=",
"start",
";",
"byte",
"[",
"]",
"bytes",
"=",
"NumberFacility",
".",
"getBytes",
"(",
"buff",
".",
"get",
"(",
"pos",
")",
")",
";",
"type... | Load the ACE from the buffer returning the last ACE segment position into the buffer.
@param buff source buffer.
@param start start loading position.
@return last loading position. | [
"Load",
"the",
"ACE",
"from",
"the",
"buffer",
"returning",
"the",
"last",
"ACE",
"segment",
"position",
"into",
"the",
"buffer",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/ACE.java#L111-L159 |
10,618 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/ACE.java | ACE.getApplicationData | public byte[] getApplicationData() {
return this.applicationData == null || this.applicationData.length == 0
? null
: Arrays.copyOf(this.applicationData, this.applicationData.length);
} | java | public byte[] getApplicationData() {
return this.applicationData == null || this.applicationData.length == 0
? null
: Arrays.copyOf(this.applicationData, this.applicationData.length);
} | [
"public",
"byte",
"[",
"]",
"getApplicationData",
"(",
")",
"{",
"return",
"this",
".",
"applicationData",
"==",
"null",
"||",
"this",
".",
"applicationData",
".",
"length",
"==",
"0",
"?",
"null",
":",
"Arrays",
".",
"copyOf",
"(",
"this",
".",
"applica... | Optional application data. The size of the application data is determined by the AceSize field.
@return application data; null if not available. | [
"Optional",
"application",
"data",
".",
"The",
"size",
"of",
"the",
"application",
"data",
"is",
"determined",
"by",
"the",
"AceSize",
"field",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/ACE.java#L186-L190 |
10,619 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/ACE.java | ACE.setApplicationData | public void setApplicationData(final byte[] applicationData) {
this.applicationData = applicationData == null || applicationData.length == 0
? null
: Arrays.copyOf(applicationData, applicationData.length);
} | java | public void setApplicationData(final byte[] applicationData) {
this.applicationData = applicationData == null || applicationData.length == 0
? null
: Arrays.copyOf(applicationData, applicationData.length);
} | [
"public",
"void",
"setApplicationData",
"(",
"final",
"byte",
"[",
"]",
"applicationData",
")",
"{",
"this",
".",
"applicationData",
"=",
"applicationData",
"==",
"null",
"||",
"applicationData",
".",
"length",
"==",
"0",
"?",
"null",
":",
"Arrays",
".",
"co... | Sets application data.
@param applicationData application data. | [
"Sets",
"application",
"data",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/ACE.java#L197-L201 |
10,620 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/ACE.java | ACE.getSize | public int getSize() {
return 8 + (objectFlags == null ? 0 : 4)
+ (objectType == null ? 0 : 16)
+ (inheritedObjectType == null ? 0 : 16)
+ (sid == null ? 0 : sid.getSize())
+ (applicationData == null ? 0 : applicationData.length);
} | java | public int getSize() {
return 8 + (objectFlags == null ? 0 : 4)
+ (objectType == null ? 0 : 16)
+ (inheritedObjectType == null ? 0 : 16)
+ (sid == null ? 0 : sid.getSize())
+ (applicationData == null ? 0 : applicationData.length);
} | [
"public",
"int",
"getSize",
"(",
")",
"{",
"return",
"8",
"+",
"(",
"objectFlags",
"==",
"null",
"?",
"0",
":",
"4",
")",
"+",
"(",
"objectType",
"==",
"null",
"?",
"0",
":",
"16",
")",
"+",
"(",
"inheritedObjectType",
"==",
"null",
"?",
"0",
":"... | An unsigned 16-bit integer that specifies the size, in bytes, of the ACE. The AceSize field can be greater than
the sum of the individual fields, but MUST be a multiple of 4 to ensure alignment on a DWORD boundary. In cases
where the AceSize field encompasses additional data for the callback ACEs types, that data is
im... | [
"An",
"unsigned",
"16",
"-",
"bit",
"integer",
"that",
"specifies",
"the",
"size",
"in",
"bytes",
"of",
"the",
"ACE",
".",
"The",
"AceSize",
"field",
"can",
"be",
"greater",
"than",
"the",
"sum",
"of",
"the",
"individual",
"fields",
"but",
"MUST",
"be",
... | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/ACE.java#L276-L282 |
10,621 | gitblit/fathom | fathom-core/src/main/java/fathom/Module.java | Module.install | protected void install(Module module) {
module.setSettings(settings);
module.setServices(services);
binder().install(module);
} | java | protected void install(Module module) {
module.setSettings(settings);
module.setServices(services);
binder().install(module);
} | [
"protected",
"void",
"install",
"(",
"Module",
"module",
")",
"{",
"module",
".",
"setSettings",
"(",
"settings",
")",
";",
"module",
".",
"setServices",
"(",
"services",
")",
";",
"binder",
"(",
")",
".",
"install",
"(",
"module",
")",
";",
"}"
] | Install a Fathom Module. | [
"Install",
"a",
"Fathom",
"Module",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-core/src/main/java/fathom/Module.java#L79-L83 |
10,622 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/data/AceObjectFlags.java | AceObjectFlags.parseValue | public static AceObjectFlags parseValue(final int value) {
final AceObjectFlags res = new AceObjectFlags();
res.others = value;
for (AceObjectFlags.Flag type : AceObjectFlags.Flag.values()) {
if ((value & type.getValue()) == type.getValue()) {
res.flags.add(type);
... | java | public static AceObjectFlags parseValue(final int value) {
final AceObjectFlags res = new AceObjectFlags();
res.others = value;
for (AceObjectFlags.Flag type : AceObjectFlags.Flag.values()) {
if ((value & type.getValue()) == type.getValue()) {
res.flags.add(type);
... | [
"public",
"static",
"AceObjectFlags",
"parseValue",
"(",
"final",
"int",
"value",
")",
"{",
"final",
"AceObjectFlags",
"res",
"=",
"new",
"AceObjectFlags",
"(",
")",
";",
"res",
".",
"others",
"=",
"value",
";",
"for",
"(",
"AceObjectFlags",
".",
"Flag",
"... | Parse flags given as int value.
@param value flags given as int value.
@return ACE object flags. | [
"Parse",
"flags",
"given",
"as",
"int",
"value",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/data/AceObjectFlags.java#L97-L110 |
10,623 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/data/AceObjectFlags.java | AceObjectFlags.addFlag | public AceObjectFlags addFlag(final Flag flag) {
if (!flags.contains(flag)) {
flags.add(flag);
}
return this;
} | java | public AceObjectFlags addFlag(final Flag flag) {
if (!flags.contains(flag)) {
flags.add(flag);
}
return this;
} | [
"public",
"AceObjectFlags",
"addFlag",
"(",
"final",
"Flag",
"flag",
")",
"{",
"if",
"(",
"!",
"flags",
".",
"contains",
"(",
"flag",
")",
")",
"{",
"flags",
".",
"add",
"(",
"flag",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Adds standard ACE object flag.
@param flag standard ACE object flag.
@return the current ACE object flags. | [
"Adds",
"standard",
"ACE",
"object",
"flag",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/data/AceObjectFlags.java#L127-L132 |
10,624 | gitblit/fathom | fathom-x509/src/main/java/fathom/x509/X509Utils.java | X509Utils.openKeyStore | public static KeyStore openKeyStore(File storeFile, String storePassword) {
String lc = storeFile.getName().toLowerCase();
String type = "JKS";
String provider = null;
if (lc.endsWith(".p12") || lc.endsWith(".pfx")) {
type = "PKCS12";
provider = BC;
}
... | java | public static KeyStore openKeyStore(File storeFile, String storePassword) {
String lc = storeFile.getName().toLowerCase();
String type = "JKS";
String provider = null;
if (lc.endsWith(".p12") || lc.endsWith(".pfx")) {
type = "PKCS12";
provider = BC;
}
... | [
"public",
"static",
"KeyStore",
"openKeyStore",
"(",
"File",
"storeFile",
",",
"String",
"storePassword",
")",
"{",
"String",
"lc",
"=",
"storeFile",
".",
"getName",
"(",
")",
".",
"toLowerCase",
"(",
")",
";",
"String",
"type",
"=",
"\"JKS\"",
";",
"Strin... | Open a keystore. Store type is determined by file extension of name. If
undetermined, JKS is assumed. The keystore does not need to exist.
@param storeFile
@param storePassword
@return a KeyStore | [
"Open",
"a",
"keystore",
".",
"Store",
"type",
"is",
"determined",
"by",
"file",
"extension",
"of",
"name",
".",
"If",
"undetermined",
"JKS",
"is",
"assumed",
".",
"The",
"keystore",
"does",
"not",
"need",
"to",
"exist",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L305-L339 |
10,625 | gitblit/fathom | fathom-x509/src/main/java/fathom/x509/X509Utils.java | X509Utils.saveKeyStore | public static void saveKeyStore(File targetStoreFile, KeyStore store, String password) {
File folder = targetStoreFile.getAbsoluteFile().getParentFile();
if (!folder.exists()) {
folder.mkdirs();
}
File tmpFile = new File(folder, Long.toHexString(System.currentTimeMillis()) + ... | java | public static void saveKeyStore(File targetStoreFile, KeyStore store, String password) {
File folder = targetStoreFile.getAbsoluteFile().getParentFile();
if (!folder.exists()) {
folder.mkdirs();
}
File tmpFile = new File(folder, Long.toHexString(System.currentTimeMillis()) + ... | [
"public",
"static",
"void",
"saveKeyStore",
"(",
"File",
"targetStoreFile",
",",
"KeyStore",
"store",
",",
"String",
"password",
")",
"{",
"File",
"folder",
"=",
"targetStoreFile",
".",
"getAbsoluteFile",
"(",
")",
".",
"getParentFile",
"(",
")",
";",
"if",
... | Saves the keystore to the specified file.
@param targetStoreFile
@param store
@param password | [
"Saves",
"the",
"keystore",
"to",
"the",
"specified",
"file",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L348-L385 |
10,626 | gitblit/fathom | fathom-x509/src/main/java/fathom/x509/X509Utils.java | X509Utils.getCertificate | public static X509Certificate getCertificate(String alias, File storeFile, String storePassword) {
try {
KeyStore store = openKeyStore(storeFile, storePassword);
X509Certificate caCert = (X509Certificate) store.getCertificate(alias);
return caCert;
} catch (Exception ... | java | public static X509Certificate getCertificate(String alias, File storeFile, String storePassword) {
try {
KeyStore store = openKeyStore(storeFile, storePassword);
X509Certificate caCert = (X509Certificate) store.getCertificate(alias);
return caCert;
} catch (Exception ... | [
"public",
"static",
"X509Certificate",
"getCertificate",
"(",
"String",
"alias",
",",
"File",
"storeFile",
",",
"String",
"storePassword",
")",
"{",
"try",
"{",
"KeyStore",
"store",
"=",
"openKeyStore",
"(",
"storeFile",
",",
"storePassword",
")",
";",
"X509Cert... | Retrieves the X509 certificate with the specified alias from the certificate
store.
@param alias
@param storeFile
@param storePassword
@return the certificate | [
"Retrieves",
"the",
"X509",
"certificate",
"with",
"the",
"specified",
"alias",
"from",
"the",
"certificate",
"store",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L396-L404 |
10,627 | gitblit/fathom | fathom-x509/src/main/java/fathom/x509/X509Utils.java | X509Utils.getPrivateKey | public static PrivateKey getPrivateKey(String alias, File storeFile, String storePassword) {
try {
KeyStore store = openKeyStore(storeFile, storePassword);
PrivateKey key = (PrivateKey) store.getKey(alias, storePassword.toCharArray());
return key;
} catch (Exception e... | java | public static PrivateKey getPrivateKey(String alias, File storeFile, String storePassword) {
try {
KeyStore store = openKeyStore(storeFile, storePassword);
PrivateKey key = (PrivateKey) store.getKey(alias, storePassword.toCharArray());
return key;
} catch (Exception e... | [
"public",
"static",
"PrivateKey",
"getPrivateKey",
"(",
"String",
"alias",
",",
"File",
"storeFile",
",",
"String",
"storePassword",
")",
"{",
"try",
"{",
"KeyStore",
"store",
"=",
"openKeyStore",
"(",
"storeFile",
",",
"storePassword",
")",
";",
"PrivateKey",
... | Retrieves the private key for the specified alias from the certificate
store.
@param alias
@param storeFile
@param storePassword
@return the private key | [
"Retrieves",
"the",
"private",
"key",
"for",
"the",
"specified",
"alias",
"from",
"the",
"certificate",
"store",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L415-L423 |
10,628 | gitblit/fathom | fathom-x509/src/main/java/fathom/x509/X509Utils.java | X509Utils.saveCertificate | public static void saveCertificate(X509Certificate cert, File targetFile) {
File folder = targetFile.getAbsoluteFile().getParentFile();
if (!folder.exists()) {
folder.mkdirs();
}
File tmpFile = new File(folder, Long.toHexString(System.currentTimeMillis()) + ".tmp");
t... | java | public static void saveCertificate(X509Certificate cert, File targetFile) {
File folder = targetFile.getAbsoluteFile().getParentFile();
if (!folder.exists()) {
folder.mkdirs();
}
File tmpFile = new File(folder, Long.toHexString(System.currentTimeMillis()) + ".tmp");
t... | [
"public",
"static",
"void",
"saveCertificate",
"(",
"X509Certificate",
"cert",
",",
"File",
"targetFile",
")",
"{",
"File",
"folder",
"=",
"targetFile",
".",
"getAbsoluteFile",
"(",
")",
".",
"getParentFile",
"(",
")",
";",
"if",
"(",
"!",
"folder",
".",
"... | Saves the certificate to the file system. If the destination filename
ends with the pem extension, the certificate is written in the PEM format,
otherwise the certificate is written in the DER format.
@param cert
@param targetFile | [
"Saves",
"the",
"certificate",
"to",
"the",
"file",
"system",
".",
"If",
"the",
"destination",
"filename",
"ends",
"with",
"the",
"pem",
"extension",
"the",
"certificate",
"is",
"written",
"in",
"the",
"PEM",
"format",
"otherwise",
"the",
"certificate",
"is",
... | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L433-L478 |
10,629 | gitblit/fathom | fathom-x509/src/main/java/fathom/x509/X509Utils.java | X509Utils.newKeyPair | private static KeyPair newKeyPair() throws Exception {
KeyPairGenerator kpGen = KeyPairGenerator.getInstance(KEY_ALGORITHM, BC);
kpGen.initialize(KEY_LENGTH, new SecureRandom());
return kpGen.generateKeyPair();
} | java | private static KeyPair newKeyPair() throws Exception {
KeyPairGenerator kpGen = KeyPairGenerator.getInstance(KEY_ALGORITHM, BC);
kpGen.initialize(KEY_LENGTH, new SecureRandom());
return kpGen.generateKeyPair();
} | [
"private",
"static",
"KeyPair",
"newKeyPair",
"(",
")",
"throws",
"Exception",
"{",
"KeyPairGenerator",
"kpGen",
"=",
"KeyPairGenerator",
".",
"getInstance",
"(",
"KEY_ALGORITHM",
",",
"BC",
")",
";",
"kpGen",
".",
"initialize",
"(",
"KEY_LENGTH",
",",
"new",
... | Generate a new keypair.
@return a keypair
@throws Exception | [
"Generate",
"a",
"new",
"keypair",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L486-L490 |
10,630 | gitblit/fathom | fathom-x509/src/main/java/fathom/x509/X509Utils.java | X509Utils.buildDistinguishedName | private static X500Name buildDistinguishedName(X509Metadata metadata) {
X500NameBuilder dnBuilder = new X500NameBuilder(BCStyle.INSTANCE);
setOID(dnBuilder, metadata, "C", null);
setOID(dnBuilder, metadata, "ST", null);
setOID(dnBuilder, metadata, "L", null);
setOID(dnBuilder, me... | java | private static X500Name buildDistinguishedName(X509Metadata metadata) {
X500NameBuilder dnBuilder = new X500NameBuilder(BCStyle.INSTANCE);
setOID(dnBuilder, metadata, "C", null);
setOID(dnBuilder, metadata, "ST", null);
setOID(dnBuilder, metadata, "L", null);
setOID(dnBuilder, me... | [
"private",
"static",
"X500Name",
"buildDistinguishedName",
"(",
"X509Metadata",
"metadata",
")",
"{",
"X500NameBuilder",
"dnBuilder",
"=",
"new",
"X500NameBuilder",
"(",
"BCStyle",
".",
"INSTANCE",
")",
";",
"setOID",
"(",
"dnBuilder",
",",
"metadata",
",",
"\"C\"... | Builds a distinguished name from the X509Metadata.
@return a DN | [
"Builds",
"a",
"distinguished",
"name",
"from",
"the",
"X509Metadata",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L497-L508 |
10,631 | gitblit/fathom | fathom-x509/src/main/java/fathom/x509/X509Utils.java | X509Utils.newSSLCertificate | public static X509Certificate newSSLCertificate(X509Metadata sslMetadata, PrivateKey caPrivateKey, X509Certificate caCert, File targetStoreFile, X509Log x509log) {
try {
KeyPair pair = newKeyPair();
X500Name webDN = buildDistinguishedName(sslMetadata);
X500Name issuerDN = ne... | java | public static X509Certificate newSSLCertificate(X509Metadata sslMetadata, PrivateKey caPrivateKey, X509Certificate caCert, File targetStoreFile, X509Log x509log) {
try {
KeyPair pair = newKeyPair();
X500Name webDN = buildDistinguishedName(sslMetadata);
X500Name issuerDN = ne... | [
"public",
"static",
"X509Certificate",
"newSSLCertificate",
"(",
"X509Metadata",
"sslMetadata",
",",
"PrivateKey",
"caPrivateKey",
",",
"X509Certificate",
"caCert",
",",
"File",
"targetStoreFile",
",",
"X509Log",
"x509log",
")",
"{",
"try",
"{",
"KeyPair",
"pair",
"... | Creates a new SSL certificate signed by the CA private key and stored in
keyStore.
@param sslMetadata
@param caPrivateKey
@param caCert
@param targetStoreFile
@param x509log | [
"Creates",
"a",
"new",
"SSL",
"certificate",
"signed",
"by",
"the",
"CA",
"private",
"key",
"and",
"stored",
"in",
"keyStore",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L542-L595 |
10,632 | gitblit/fathom | fathom-x509/src/main/java/fathom/x509/X509Utils.java | X509Utils.addTrustedCertificate | public static void addTrustedCertificate(String alias, X509Certificate cert, File storeFile, String storePassword) {
try {
KeyStore store = openKeyStore(storeFile, storePassword);
store.setCertificateEntry(alias, cert);
saveKeyStore(storeFile, store, storePassword);
}... | java | public static void addTrustedCertificate(String alias, X509Certificate cert, File storeFile, String storePassword) {
try {
KeyStore store = openKeyStore(storeFile, storePassword);
store.setCertificateEntry(alias, cert);
saveKeyStore(storeFile, store, storePassword);
}... | [
"public",
"static",
"void",
"addTrustedCertificate",
"(",
"String",
"alias",
",",
"X509Certificate",
"cert",
",",
"File",
"storeFile",
",",
"String",
"storePassword",
")",
"{",
"try",
"{",
"KeyStore",
"store",
"=",
"openKeyStore",
"(",
"storeFile",
",",
"storePa... | Imports a certificate into the trust store.
@param alias
@param cert
@param storeFile
@param storePassword | [
"Imports",
"a",
"certificate",
"into",
"the",
"trust",
"store",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L715-L723 |
10,633 | gitblit/fathom | fathom-x509/src/main/java/fathom/x509/X509Utils.java | X509Utils.verifyChain | public static PKIXCertPathBuilderResult verifyChain(X509Certificate testCert, X509Certificate... additionalCerts) {
try {
// Check for self-signed certificate
if (isSelfSigned(testCert)) {
throw new RuntimeException("The certificate is self-signed. Nothing to verify.");
... | java | public static PKIXCertPathBuilderResult verifyChain(X509Certificate testCert, X509Certificate... additionalCerts) {
try {
// Check for self-signed certificate
if (isSelfSigned(testCert)) {
throw new RuntimeException("The certificate is self-signed. Nothing to verify.");
... | [
"public",
"static",
"PKIXCertPathBuilderResult",
"verifyChain",
"(",
"X509Certificate",
"testCert",
",",
"X509Certificate",
"...",
"additionalCerts",
")",
"{",
"try",
"{",
"// Check for self-signed certificate",
"if",
"(",
"isSelfSigned",
"(",
"testCert",
")",
")",
"{",... | Verifies a certificate's chain to ensure that it will function properly.
@param testCert
@param additionalCerts
@return | [
"Verifies",
"a",
"certificate",
"s",
"chain",
"to",
"ensure",
"that",
"it",
"will",
"function",
"properly",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L832-L875 |
10,634 | gitblit/fathom | fathom-x509/src/main/java/fathom/x509/X509Utils.java | X509Utils.isSelfSigned | public static boolean isSelfSigned(X509Certificate cert) {
try {
cert.verify(cert.getPublicKey());
return true;
} catch (SignatureException e) {
return false;
} catch (InvalidKeyException e) {
return false;
} catch (Exception e) {
... | java | public static boolean isSelfSigned(X509Certificate cert) {
try {
cert.verify(cert.getPublicKey());
return true;
} catch (SignatureException e) {
return false;
} catch (InvalidKeyException e) {
return false;
} catch (Exception e) {
... | [
"public",
"static",
"boolean",
"isSelfSigned",
"(",
"X509Certificate",
"cert",
")",
"{",
"try",
"{",
"cert",
".",
"verify",
"(",
"cert",
".",
"getPublicKey",
"(",
")",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"SignatureException",
"e",
")",
"{... | Checks whether given X.509 certificate is self-signed.
@param cert
@return true if the certificate is self-signed | [
"Checks",
"whether",
"given",
"X",
".",
"509",
"certificate",
"is",
"self",
"-",
"signed",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L883-L894 |
10,635 | gitblit/fathom | fathom-security-htpasswd/src/main/java/fathom/realm/htpasswd/HtpasswdRealm.java | HtpasswdRealm.validatePassword | @Override
protected boolean validatePassword(StandardCredentials requestCredentials, StandardCredentials storedCredentials) {
final String storedPassword = storedCredentials.getPassword();
final String username = requestCredentials.getUsername();
final String password = requestCredentials.ge... | java | @Override
protected boolean validatePassword(StandardCredentials requestCredentials, StandardCredentials storedCredentials) {
final String storedPassword = storedCredentials.getPassword();
final String username = requestCredentials.getUsername();
final String password = requestCredentials.ge... | [
"@",
"Override",
"protected",
"boolean",
"validatePassword",
"(",
"StandardCredentials",
"requestCredentials",
",",
"StandardCredentials",
"storedCredentials",
")",
"{",
"final",
"String",
"storedPassword",
"=",
"storedCredentials",
".",
"getPassword",
"(",
")",
";",
"f... | htpasswd supports a few other password encryption schemes than the StandardCredentialsRealm.
@param requestCredentials
@param storedCredentials
@return true if the request password validates against the stored password | [
"htpasswd",
"supports",
"a",
"few",
"other",
"password",
"encryption",
"schemes",
"than",
"the",
"StandardCredentialsRealm",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-security-htpasswd/src/main/java/fathom/realm/htpasswd/HtpasswdRealm.java#L193-L227 |
10,636 | gitblit/fathom | fathom-security-htpasswd/src/main/java/fathom/realm/htpasswd/HtpasswdRealm.java | HtpasswdRealm.readCredentialsFile | protected synchronized void readCredentialsFile() {
if (realmFile != null && realmFile.exists() && (realmFile.lastModified() != lastModified)) {
lastModified = realmFile.lastModified();
try {
Map<String, String> credentials = readCredentialsURL(realmFile.toURI().toURL());... | java | protected synchronized void readCredentialsFile() {
if (realmFile != null && realmFile.exists() && (realmFile.lastModified() != lastModified)) {
lastModified = realmFile.lastModified();
try {
Map<String, String> credentials = readCredentialsURL(realmFile.toURI().toURL());... | [
"protected",
"synchronized",
"void",
"readCredentialsFile",
"(",
")",
"{",
"if",
"(",
"realmFile",
"!=",
"null",
"&&",
"realmFile",
".",
"exists",
"(",
")",
"&&",
"(",
"realmFile",
".",
"lastModified",
"(",
")",
"!=",
"lastModified",
")",
")",
"{",
"lastMo... | Reads the credentials file and rebuilds the in-memory lookup tables. | [
"Reads",
"the",
"credentials",
"file",
"and",
"rebuilds",
"the",
"in",
"-",
"memory",
"lookup",
"tables",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-security-htpasswd/src/main/java/fathom/realm/htpasswd/HtpasswdRealm.java#L232-L243 |
10,637 | gitblit/fathom | fathom-security-htpasswd/src/main/java/fathom/realm/htpasswd/HtpasswdRealm.java | HtpasswdRealm.readCredentialsURL | protected Map<String, String> readCredentialsURL(URL url) {
Map<String, String> credentials = new HashMap<>();
Pattern entry = Pattern.compile("^([^:]+):(.+)");
try (Scanner scanner = new Scanner(url.openStream(), StandardCharsets.UTF_8.name())) {
while (scanner.hasNextLine()) {
... | java | protected Map<String, String> readCredentialsURL(URL url) {
Map<String, String> credentials = new HashMap<>();
Pattern entry = Pattern.compile("^([^:]+):(.+)");
try (Scanner scanner = new Scanner(url.openStream(), StandardCharsets.UTF_8.name())) {
while (scanner.hasNextLine()) {
... | [
"protected",
"Map",
"<",
"String",
",",
"String",
">",
"readCredentialsURL",
"(",
"URL",
"url",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"credentials",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"Pattern",
"entry",
"=",
"Pattern",
".",
"com... | Reads the credentials url. | [
"Reads",
"the",
"credentials",
"url",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-security-htpasswd/src/main/java/fathom/realm/htpasswd/HtpasswdRealm.java#L248-L276 |
10,638 | gitblit/fathom | fathom-core/src/main/java/fathom/Boot.java | Boot.addShutdownHook | public Boot addShutdownHook() {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
Boot.this.stop();
}
});
return this;
} | java | public Boot addShutdownHook() {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
Boot.this.stop();
}
});
return this;
} | [
"public",
"Boot",
"addShutdownHook",
"(",
")",
"{",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"addShutdownHook",
"(",
"new",
"Thread",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"Boot",
".",
"this",
".",
"stop",
"(",
"... | Add a JVM shutdown hook. | [
"Add",
"a",
"JVM",
"shutdown",
"hook",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-core/src/main/java/fathom/Boot.java#L156-L167 |
10,639 | gitblit/fathom | fathom-core/src/main/java/fathom/Boot.java | Boot.start | @Override
public synchronized void start() {
Preconditions.checkNotNull(getServer());
String osName = System.getProperty("os.name");
String osVersion = System.getProperty("os.version");
log.info("Bootstrapping {} ({})", settings.getApplicationName(), settings.getApplicationVersion()... | java | @Override
public synchronized void start() {
Preconditions.checkNotNull(getServer());
String osName = System.getProperty("os.name");
String osVersion = System.getProperty("os.version");
log.info("Bootstrapping {} ({})", settings.getApplicationName(), settings.getApplicationVersion()... | [
"@",
"Override",
"public",
"synchronized",
"void",
"start",
"(",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"getServer",
"(",
")",
")",
";",
"String",
"osName",
"=",
"System",
".",
"getProperty",
"(",
"\"os.name\"",
")",
";",
"String",
"osVersion",... | Starts Fathom synchronously. | [
"Starts",
"Fathom",
"synchronously",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-core/src/main/java/fathom/Boot.java#L184-L228 |
10,640 | gitblit/fathom | fathom-core/src/main/java/fathom/Boot.java | Boot.stop | @Override
public synchronized void stop() {
Preconditions.checkNotNull(getServer());
if (getServer().isRunning()) {
try {
log.info("Stopping...");
getServer().stop();
log.info("STOPPED.");
} catch (Exception e) {
... | java | @Override
public synchronized void stop() {
Preconditions.checkNotNull(getServer());
if (getServer().isRunning()) {
try {
log.info("Stopping...");
getServer().stop();
log.info("STOPPED.");
} catch (Exception e) {
... | [
"@",
"Override",
"public",
"synchronized",
"void",
"stop",
"(",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"getServer",
"(",
")",
")",
";",
"if",
"(",
"getServer",
"(",
")",
".",
"isRunning",
"(",
")",
")",
"{",
"try",
"{",
"log",
".",
"inf... | Stops Fathom synchronously. | [
"Stops",
"Fathom",
"synchronously",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-core/src/main/java/fathom/Boot.java#L233-L246 |
10,641 | gitblit/fathom | fathom-core/src/main/java/fathom/Boot.java | Boot.setupLogback | protected void setupLogback() {
// Check for Logback config file System Property
// http://logback.qos.ch/manual/configuration.html
// -Dlogback.configurationFile=logback_prod.xml
if (System.getProperty(LOGBACK_CONFIGURATION_FILE_PROPERTY) != null) {
// Logback already c... | java | protected void setupLogback() {
// Check for Logback config file System Property
// http://logback.qos.ch/manual/configuration.html
// -Dlogback.configurationFile=logback_prod.xml
if (System.getProperty(LOGBACK_CONFIGURATION_FILE_PROPERTY) != null) {
// Logback already c... | [
"protected",
"void",
"setupLogback",
"(",
")",
"{",
"// Check for Logback config file System Property",
"// http://logback.qos.ch/manual/configuration.html",
"// -Dlogback.configurationFile=logback_prod.xml",
"if",
"(",
"System",
".",
"getProperty",
"(",
"LOGBACK_CONFIGURATION_FILE... | Setup Logback logging by optionally reloading the configuration file. | [
"Setup",
"Logback",
"logging",
"by",
"optionally",
"reloading",
"the",
"configuration",
"file",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-core/src/main/java/fathom/Boot.java#L259-L290 |
10,642 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/data/AceRights.java | AceRights.parseValue | public static AceRights parseValue(final int value) {
final AceRights res = new AceRights();
if (value == 0) {
return res;
}
res.others = value;
for (ObjectRight type : ObjectRight.values()) {
if ((value & type.getValue()) == type.getValue()) {
... | java | public static AceRights parseValue(final int value) {
final AceRights res = new AceRights();
if (value == 0) {
return res;
}
res.others = value;
for (ObjectRight type : ObjectRight.values()) {
if ((value & type.getValue()) == type.getValue()) {
... | [
"public",
"static",
"AceRights",
"parseValue",
"(",
"final",
"int",
"value",
")",
"{",
"final",
"AceRights",
"res",
"=",
"new",
"AceRights",
"(",
")",
";",
"if",
"(",
"value",
"==",
"0",
")",
"{",
"return",
"res",
";",
"}",
"res",
".",
"others",
"=",... | Parse ACE rights.
@param value int value representing rights.
@return ACE rights. | [
"Parse",
"ACE",
"rights",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/data/AceRights.java#L198-L214 |
10,643 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/data/AceRights.java | AceRights.asUInt | public long asUInt() {
long res = others;
for (ObjectRight right : rights) {
res += right.getValue();
}
return res;
} | java | public long asUInt() {
long res = others;
for (ObjectRight right : rights) {
res += right.getValue();
}
return res;
} | [
"public",
"long",
"asUInt",
"(",
")",
"{",
"long",
"res",
"=",
"others",
";",
"for",
"(",
"ObjectRight",
"right",
":",
"rights",
")",
"{",
"res",
"+=",
"right",
".",
"getValue",
"(",
")",
";",
"}",
"return",
"res",
";",
"}"
] | Gets rights as unsigned int.
@return rights as unsigned int. | [
"Gets",
"rights",
"as",
"unsigned",
"int",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/data/AceRights.java#L261-L269 |
10,644 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/controller/ControllerUtil.java | ControllerUtil.getParameterName | public static String getParameterName(Parameter parameter) {
// identify parameter name and pattern from method signature
String methodParameterName = parameter.getName();
if (parameter.isAnnotationPresent(Param.class)) {
Param param = parameter.getAnnotation(Param.class);
... | java | public static String getParameterName(Parameter parameter) {
// identify parameter name and pattern from method signature
String methodParameterName = parameter.getName();
if (parameter.isAnnotationPresent(Param.class)) {
Param param = parameter.getAnnotation(Param.class);
... | [
"public",
"static",
"String",
"getParameterName",
"(",
"Parameter",
"parameter",
")",
"{",
"// identify parameter name and pattern from method signature",
"String",
"methodParameterName",
"=",
"parameter",
".",
"getName",
"(",
")",
";",
"if",
"(",
"parameter",
".",
"isA... | Returns the name of a parameter.
@param parameter
@return the name of a parameter. | [
"Returns",
"the",
"name",
"of",
"a",
"parameter",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerUtil.java#L113-L123 |
10,645 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/controller/ControllerUtil.java | ControllerUtil.getArgumentExtractor | public static Class<? extends ArgumentExtractor> getArgumentExtractor(Parameter parameter) {
for (Annotation annotation : parameter.getAnnotations()) {
if (annotation.annotationType().isAnnotationPresent(ExtractWith.class)) {
ExtractWith with = annotation.annotationType().getAnnotati... | java | public static Class<? extends ArgumentExtractor> getArgumentExtractor(Parameter parameter) {
for (Annotation annotation : parameter.getAnnotations()) {
if (annotation.annotationType().isAnnotationPresent(ExtractWith.class)) {
ExtractWith with = annotation.annotationType().getAnnotati... | [
"public",
"static",
"Class",
"<",
"?",
"extends",
"ArgumentExtractor",
">",
"getArgumentExtractor",
"(",
"Parameter",
"parameter",
")",
"{",
"for",
"(",
"Annotation",
"annotation",
":",
"parameter",
".",
"getAnnotations",
"(",
")",
")",
"{",
"if",
"(",
"annota... | Returns the appropriate ArgumentExtractor to use for the controller method parameter.
@param parameter
@return an argument extractor | [
"Returns",
"the",
"appropriate",
"ArgumentExtractor",
"to",
"use",
"for",
"the",
"controller",
"method",
"parameter",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerUtil.java#L131-L141 |
10,646 | michaelwittig/java-q | src/main/java/info/michaelwittig/javaq/connector/impl/QConnectorFactory.java | QConnectorFactory.create | public static QConnectorSync create(final String host, final int port) {
return create(host, port, true, true);
} | java | public static QConnectorSync create(final String host, final int port) {
return create(host, port, true, true);
} | [
"public",
"static",
"QConnectorSync",
"create",
"(",
"final",
"String",
"host",
",",
"final",
"int",
"port",
")",
"{",
"return",
"create",
"(",
"host",
",",
"port",
",",
"true",
",",
"true",
")",
";",
"}"
] | Reconnect on error and is thread-safe.
@param host Host
@param port Port
@return QConnector | [
"Reconnect",
"on",
"error",
"and",
"is",
"thread",
"-",
"safe",
"."
] | f71fc95b185caa85c6fbdc7179cb4f5f7733b630 | https://github.com/michaelwittig/java-q/blob/f71fc95b185caa85c6fbdc7179cb4f5f7733b630/src/main/java/info/michaelwittig/javaq/connector/impl/QConnectorFactory.java#L89-L91 |
10,647 | threerings/playn | html/src/playn/html/HtmlPlatform.java | HtmlPlatform.register | public static HtmlPlatform register(Config config) {
HtmlPlatform platform = new HtmlPlatform(config);
PlayN.setPlatform(platform);
platform.init();
return platform;
} | java | public static HtmlPlatform register(Config config) {
HtmlPlatform platform = new HtmlPlatform(config);
PlayN.setPlatform(platform);
platform.init();
return platform;
} | [
"public",
"static",
"HtmlPlatform",
"register",
"(",
"Config",
"config",
")",
"{",
"HtmlPlatform",
"platform",
"=",
"new",
"HtmlPlatform",
"(",
"config",
")",
";",
"PlayN",
".",
"setPlatform",
"(",
"platform",
")",
";",
"platform",
".",
"init",
"(",
")",
"... | Prepares the HTML platform for operation.
@param config platform-specific settings. | [
"Prepares",
"the",
"HTML",
"platform",
"for",
"operation",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/html/src/playn/html/HtmlPlatform.java#L92-L97 |
10,648 | threerings/playn | core/src/playn/core/gl/GLShader.java | GLShader.prepareTexture | public GLShader prepareTexture(int tex, int tint) {
// if our GL context has been lost and regained we may need to recreate our core; we don't
// destroy the old core because the underlying resources are gone and destroying using our
// stale handles might result in destroying someone else's newly created r... | java | public GLShader prepareTexture(int tex, int tint) {
// if our GL context has been lost and regained we may need to recreate our core; we don't
// destroy the old core because the underlying resources are gone and destroying using our
// stale handles might result in destroying someone else's newly created r... | [
"public",
"GLShader",
"prepareTexture",
"(",
"int",
"tex",
",",
"int",
"tint",
")",
"{",
"// if our GL context has been lost and regained we may need to recreate our core; we don't",
"// destroy the old core because the underlying resources are gone and destroying using our",
"// stale han... | Prepares this shader to render the specified texture, etc. | [
"Prepares",
"this",
"shader",
"to",
"render",
"the",
"specified",
"texture",
"etc",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/gl/GLShader.java#L115-L133 |
10,649 | threerings/playn | core/src/playn/core/gl/GLShader.java | GLShader.addTriangles | public void addTriangles(InternalTransform local, float[] xys, int xysOffset, int xysLen,
float tw, float th,
int[] indices, int indicesOffset, int indicesLen, int indexBase) {
texCore.addTriangles(
local.m00(), local.m01(), local.m10(), local.m11(), local... | java | public void addTriangles(InternalTransform local, float[] xys, int xysOffset, int xysLen,
float tw, float th,
int[] indices, int indicesOffset, int indicesLen, int indexBase) {
texCore.addTriangles(
local.m00(), local.m01(), local.m10(), local.m11(), local... | [
"public",
"void",
"addTriangles",
"(",
"InternalTransform",
"local",
",",
"float",
"[",
"]",
"xys",
",",
"int",
"xysOffset",
",",
"int",
"xysLen",
",",
"float",
"tw",
",",
"float",
"th",
",",
"int",
"[",
"]",
"indices",
",",
"int",
"indicesOffset",
",",
... | Adds a collection of triangles to the current render operation.
@param xys a list of x/y coordinates as: {@code [x1, y1, x2, y2, ...]}.
@param xysOffset the offset of the coordinates array, must not be negative and no greater than
{@code xys.length}. Note: this is an absolute offset; since {@code xys} contains pairs o... | [
"Adds",
"a",
"collection",
"of",
"triangles",
"to",
"the",
"current",
"render",
"operation",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/gl/GLShader.java#L196-L203 |
10,650 | threerings/playn | robovm/src/playn/robovm/RoboPlatform.java | RoboPlatform.willRotate | void willRotate(UIInterfaceOrientation toOrient, double duration) {
if (orientListener != null) {
orientListener.willRotate(toOrient, duration);
}
} | java | void willRotate(UIInterfaceOrientation toOrient, double duration) {
if (orientListener != null) {
orientListener.willRotate(toOrient, duration);
}
} | [
"void",
"willRotate",
"(",
"UIInterfaceOrientation",
"toOrient",
",",
"double",
"duration",
")",
"{",
"if",
"(",
"orientListener",
"!=",
"null",
")",
"{",
"orientListener",
".",
"willRotate",
"(",
"toOrient",
",",
"duration",
")",
";",
"}",
"}"
] | with iOS for rotation notifications, game loop callbacks, and app lifecycle events | [
"with",
"iOS",
"for",
"rotation",
"notifications",
"game",
"loop",
"callbacks",
"and",
"app",
"lifecycle",
"events"
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/robovm/src/playn/robovm/RoboPlatform.java#L257-L261 |
10,651 | threerings/playn | android/src/playn/android/TouchEventHandler.java | TouchEventHandler.parseMotionEvent | private Touch.Event.Impl[] parseMotionEvent(MotionEvent event, Events.Flags flags) {
int eventPointerCount = event.getPointerCount();
Touch.Event.Impl[] touches = new Touch.Event.Impl[eventPointerCount];
double time = event.getEventTime();
float pressure, size;
int id;
for (int t = 0; t < eventP... | java | private Touch.Event.Impl[] parseMotionEvent(MotionEvent event, Events.Flags flags) {
int eventPointerCount = event.getPointerCount();
Touch.Event.Impl[] touches = new Touch.Event.Impl[eventPointerCount];
double time = event.getEventTime();
float pressure, size;
int id;
for (int t = 0; t < eventP... | [
"private",
"Touch",
".",
"Event",
".",
"Impl",
"[",
"]",
"parseMotionEvent",
"(",
"MotionEvent",
"event",
",",
"Events",
".",
"Flags",
"flags",
")",
"{",
"int",
"eventPointerCount",
"=",
"event",
".",
"getPointerCount",
"(",
")",
";",
"Touch",
".",
"Event"... | Performs the actual parsing of the MotionEvent event.
@param event The MotionEvent to process
@param preventDefault Shared preventDefault state among returned {@link AndroidTouchEventImpl}
@return Processed array of {@link AndroidTouchEventImpl}s which share a preventDefault state. | [
"Performs",
"the",
"actual",
"parsing",
"of",
"the",
"MotionEvent",
"event",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/android/src/playn/android/TouchEventHandler.java#L104-L120 |
10,652 | threerings/playn | core/src/playn/core/Dispatcher.java | Dispatcher.dispatch | <L, E extends Input.Impl> void dispatch(
AbstractLayer layer, Class<L> listenerType, E event, Interaction<L, E> interaction) {
dispatch(layer, listenerType, event, interaction, null);
} | java | <L, E extends Input.Impl> void dispatch(
AbstractLayer layer, Class<L> listenerType, E event, Interaction<L, E> interaction) {
dispatch(layer, listenerType, event, interaction, null);
} | [
"<",
"L",
",",
"E",
"extends",
"Input",
".",
"Impl",
">",
"void",
"dispatch",
"(",
"AbstractLayer",
"layer",
",",
"Class",
"<",
"L",
">",
"listenerType",
",",
"E",
"event",
",",
"Interaction",
"<",
"L",
",",
"E",
">",
"interaction",
")",
"{",
"dispat... | Issues an interact call to a layer and listener with a localized copy of the given event. | [
"Issues",
"an",
"interact",
"call",
"to",
"a",
"layer",
"and",
"listener",
"with",
"a",
"localized",
"copy",
"of",
"the",
"given",
"event",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/Dispatcher.java#L191-L194 |
10,653 | threerings/playn | java/src/playn/java/JavaGraphics.java | JavaGraphics.setSize | public void setSize(int pixelWidth, int pixelHeight, boolean fullscreen) {
setDisplayMode(pixelWidth, pixelHeight, fullscreen);
ctx.setSize(pixelWidth, pixelHeight);
} | java | public void setSize(int pixelWidth, int pixelHeight, boolean fullscreen) {
setDisplayMode(pixelWidth, pixelHeight, fullscreen);
ctx.setSize(pixelWidth, pixelHeight);
} | [
"public",
"void",
"setSize",
"(",
"int",
"pixelWidth",
",",
"int",
"pixelHeight",
",",
"boolean",
"fullscreen",
")",
"{",
"setDisplayMode",
"(",
"pixelWidth",
",",
"pixelHeight",
",",
"fullscreen",
")",
";",
"ctx",
".",
"setSize",
"(",
"pixelWidth",
",",
"pi... | Changes the size of the PlayN window. | [
"Changes",
"the",
"size",
"of",
"the",
"PlayN",
"window",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/java/src/playn/java/JavaGraphics.java#L94-L97 |
10,654 | julianhyde/quidem | src/main/java/net/hydromatic/quidem/Quidem.java | Quidem.main | public static void main(String[] args) {
final PrintWriter out = new PrintWriter(System.out);
final PrintWriter err = new PrintWriter(System.err);
final int code = Launcher.main2(out, err, Arrays.asList(args));
System.exit(code);
} | java | public static void main(String[] args) {
final PrintWriter out = new PrintWriter(System.out);
final PrintWriter err = new PrintWriter(System.err);
final int code = Launcher.main2(out, err, Arrays.asList(args));
System.exit(code);
} | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"final",
"PrintWriter",
"out",
"=",
"new",
"PrintWriter",
"(",
"System",
".",
"out",
")",
";",
"final",
"PrintWriter",
"err",
"=",
"new",
"PrintWriter",
"(",
"System",
".",
... | Entry point from the operating system command line.
<p>Calls {@link System#exit(int)} with the following status codes:
<ul>
<li>0: success</li>
<li>1: invalid arguments</li>
<li>2: help</li>
</ul>
@param args Command-line arguments | [
"Entry",
"point",
"from",
"the",
"operating",
"system",
"command",
"line",
"."
] | 43dae9a1a181a03ed877adf5d612255ce2052972 | https://github.com/julianhyde/quidem/blob/43dae9a1a181a03ed877adf5d612255ce2052972/src/main/java/net/hydromatic/quidem/Quidem.java#L190-L195 |
10,655 | julianhyde/quidem | src/main/java/net/hydromatic/quidem/Quidem.java | Quidem.execute | public void execute() {
try {
Command command = new Parser().parse();
try {
command.execute(new ContextImpl(), execute);
close();
} catch (Exception e) {
throw new RuntimeException(
"Error while executing command " + command, e);
} catch (AssertionError e)... | java | public void execute() {
try {
Command command = new Parser().parse();
try {
command.execute(new ContextImpl(), execute);
close();
} catch (Exception e) {
throw new RuntimeException(
"Error while executing command " + command, e);
} catch (AssertionError e)... | [
"public",
"void",
"execute",
"(",
")",
"{",
"try",
"{",
"Command",
"command",
"=",
"new",
"Parser",
"(",
")",
".",
"parse",
"(",
")",
";",
"try",
"{",
"command",
".",
"execute",
"(",
"new",
"ContextImpl",
"(",
")",
",",
"execute",
")",
";",
"close"... | Executes the commands from the input, writing to the output,
then closing both input and output. | [
"Executes",
"the",
"commands",
"from",
"the",
"input",
"writing",
"to",
"the",
"output",
"then",
"closing",
"both",
"input",
"and",
"output",
"."
] | 43dae9a1a181a03ed877adf5d612255ce2052972 | https://github.com/julianhyde/quidem/blob/43dae9a1a181a03ed877adf5d612255ce2052972/src/main/java/net/hydromatic/quidem/Quidem.java#L212-L238 |
10,656 | julianhyde/quidem | src/main/java/net/hydromatic/quidem/Quidem.java | Quidem.isProbablyDeterministic | public boolean isProbablyDeterministic(String sql) {
final String upperSql = sql.toUpperCase();
if (!upperSql.contains("ORDER BY")) {
return false;
}
final int i = upperSql.lastIndexOf("ORDER BY");
final String tail = upperSql.substring(i);
final int closeCount = tail.length() - tail.repla... | java | public boolean isProbablyDeterministic(String sql) {
final String upperSql = sql.toUpperCase();
if (!upperSql.contains("ORDER BY")) {
return false;
}
final int i = upperSql.lastIndexOf("ORDER BY");
final String tail = upperSql.substring(i);
final int closeCount = tail.length() - tail.repla... | [
"public",
"boolean",
"isProbablyDeterministic",
"(",
"String",
"sql",
")",
"{",
"final",
"String",
"upperSql",
"=",
"sql",
".",
"toUpperCase",
"(",
")",
";",
"if",
"(",
"!",
"upperSql",
".",
"contains",
"(",
"\"ORDER BY\"",
")",
")",
"{",
"return",
"false"... | Returns whether a SQL query is likely to produce results always in the
same order.
<p>If Quidem believes that the order is deterministic, it does not sort
the rows before comparing them.
<p>The result is just a guess. Quidem does not understand the finer points
of SQL semantics.
@param sql SQL query
@return Whether ... | [
"Returns",
"whether",
"a",
"SQL",
"query",
"is",
"likely",
"to",
"produce",
"results",
"always",
"in",
"the",
"same",
"order",
"."
] | 43dae9a1a181a03ed877adf5d612255ce2052972 | https://github.com/julianhyde/quidem/blob/43dae9a1a181a03ed877adf5d612255ce2052972/src/main/java/net/hydromatic/quidem/Quidem.java#L542-L558 |
10,657 | julianhyde/quidem | src/main/java/net/hydromatic/quidem/Quidem.java | Quidem.flush | private static String flush(StringBuilder buf) {
final String s = buf.toString();
buf.setLength(0);
return s;
} | java | private static String flush(StringBuilder buf) {
final String s = buf.toString();
buf.setLength(0);
return s;
} | [
"private",
"static",
"String",
"flush",
"(",
"StringBuilder",
"buf",
")",
"{",
"final",
"String",
"s",
"=",
"buf",
".",
"toString",
"(",
")",
";",
"buf",
".",
"setLength",
"(",
"0",
")",
";",
"return",
"s",
";",
"}"
] | Returns the contents of a StringBuilder and clears it for the next use. | [
"Returns",
"the",
"contents",
"of",
"a",
"StringBuilder",
"and",
"clears",
"it",
"for",
"the",
"next",
"use",
"."
] | 43dae9a1a181a03ed877adf5d612255ce2052972 | https://github.com/julianhyde/quidem/blob/43dae9a1a181a03ed877adf5d612255ce2052972/src/main/java/net/hydromatic/quidem/Quidem.java#L1032-L1036 |
10,658 | threerings/playn | core/src/playn/core/gl/ImageGL.java | ImageGL.createPow2RepTex | protected int createPow2RepTex(int width, int height, boolean repeatX, boolean repeatY,
boolean mipmapped) {
int powtex = ctx.createTexture(width, height, repeatX, repeatY, mipmapped);
updateTexture(powtex);
return powtex;
} | java | protected int createPow2RepTex(int width, int height, boolean repeatX, boolean repeatY,
boolean mipmapped) {
int powtex = ctx.createTexture(width, height, repeatX, repeatY, mipmapped);
updateTexture(powtex);
return powtex;
} | [
"protected",
"int",
"createPow2RepTex",
"(",
"int",
"width",
",",
"int",
"height",
",",
"boolean",
"repeatX",
",",
"boolean",
"repeatY",
",",
"boolean",
"mipmapped",
")",
"{",
"int",
"powtex",
"=",
"ctx",
".",
"createTexture",
"(",
"width",
",",
"height",
... | Creates and populates a texture for use as our power-of-two texture. This is used when our
main image data is already power-of-two-sized. | [
"Creates",
"and",
"populates",
"a",
"texture",
"for",
"use",
"as",
"our",
"power",
"-",
"of",
"-",
"two",
"texture",
".",
"This",
"is",
"used",
"when",
"our",
"main",
"image",
"data",
"is",
"already",
"power",
"-",
"of",
"-",
"two",
"-",
"sized",
"."... | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/gl/ImageGL.java#L87-L92 |
10,659 | iovation/launchkey-java | sdk/src/main/java/com/iovation/launchkey/sdk/crypto/JCECrypto.java | JCECrypto.getRSAPrivateKeyFromPEM | public static RSAPrivateKey getRSAPrivateKeyFromPEM(Provider provider, String pem) {
try {
KeyFactory keyFactory = KeyFactory.getInstance("RSA", provider);
return (RSAPrivateKey) keyFactory.generatePrivate(new PKCS8EncodedKeySpec(getKeyBytesFromPEM(pem)));
} catch (NoSuchAlgorith... | java | public static RSAPrivateKey getRSAPrivateKeyFromPEM(Provider provider, String pem) {
try {
KeyFactory keyFactory = KeyFactory.getInstance("RSA", provider);
return (RSAPrivateKey) keyFactory.generatePrivate(new PKCS8EncodedKeySpec(getKeyBytesFromPEM(pem)));
} catch (NoSuchAlgorith... | [
"public",
"static",
"RSAPrivateKey",
"getRSAPrivateKeyFromPEM",
"(",
"Provider",
"provider",
",",
"String",
"pem",
")",
"{",
"try",
"{",
"KeyFactory",
"keyFactory",
"=",
"KeyFactory",
".",
"getInstance",
"(",
"\"RSA\"",
",",
"provider",
")",
";",
"return",
"(",
... | Get an RSA private key utilizing the provided provider and PEM formatted string
@param provider Provider to generate the key
@param pem PEM formatted key string
@return RSA private key | [
"Get",
"an",
"RSA",
"private",
"key",
"utilizing",
"the",
"provided",
"provider",
"and",
"PEM",
"formatted",
"string"
] | ceecc70b9b04af07ddc14c57d4bcc933a4e0379c | https://github.com/iovation/launchkey-java/blob/ceecc70b9b04af07ddc14c57d4bcc933a4e0379c/sdk/src/main/java/com/iovation/launchkey/sdk/crypto/JCECrypto.java#L96-L105 |
10,660 | iovation/launchkey-java | sdk/src/main/java/com/iovation/launchkey/sdk/crypto/JCECrypto.java | JCECrypto.getRSAPublicKeyFromPEM | public static RSAPublicKey getRSAPublicKeyFromPEM(Provider provider, String pem) {
try {
KeyFactory keyFactory = KeyFactory.getInstance("RSA", provider);
return (RSAPublicKey) keyFactory.generatePublic(new X509EncodedKeySpec(getKeyBytesFromPEM(pem)));
} catch (NoSuchAlgorithmExce... | java | public static RSAPublicKey getRSAPublicKeyFromPEM(Provider provider, String pem) {
try {
KeyFactory keyFactory = KeyFactory.getInstance("RSA", provider);
return (RSAPublicKey) keyFactory.generatePublic(new X509EncodedKeySpec(getKeyBytesFromPEM(pem)));
} catch (NoSuchAlgorithmExce... | [
"public",
"static",
"RSAPublicKey",
"getRSAPublicKeyFromPEM",
"(",
"Provider",
"provider",
",",
"String",
"pem",
")",
"{",
"try",
"{",
"KeyFactory",
"keyFactory",
"=",
"KeyFactory",
".",
"getInstance",
"(",
"\"RSA\"",
",",
"provider",
")",
";",
"return",
"(",
... | Get an RSA public key utilizing the provided provider and PEM formatted string
@param provider Provider to generate the key
@param pem PEM formatted key string
@return RSA public key | [
"Get",
"an",
"RSA",
"public",
"key",
"utilizing",
"the",
"provided",
"provider",
"and",
"PEM",
"formatted",
"string"
] | ceecc70b9b04af07ddc14c57d4bcc933a4e0379c | https://github.com/iovation/launchkey-java/blob/ceecc70b9b04af07ddc14c57d4bcc933a4e0379c/sdk/src/main/java/com/iovation/launchkey/sdk/crypto/JCECrypto.java#L114-L123 |
10,661 | iovation/launchkey-java | sdk/src/main/java/com/iovation/launchkey/sdk/crypto/JCECrypto.java | JCECrypto.getPEMFromRSAPublicKey | public static String getPEMFromRSAPublicKey(RSAPublicKey publicKey) {
StringBuilder builder = new StringBuilder();
builder.append("-----BEGIN PUBLIC KEY-----\n");
String encoded = new String(BASE_64.encode(publicKey.getEncoded()));
int start = 0;
int end = 64;
try {
... | java | public static String getPEMFromRSAPublicKey(RSAPublicKey publicKey) {
StringBuilder builder = new StringBuilder();
builder.append("-----BEGIN PUBLIC KEY-----\n");
String encoded = new String(BASE_64.encode(publicKey.getEncoded()));
int start = 0;
int end = 64;
try {
... | [
"public",
"static",
"String",
"getPEMFromRSAPublicKey",
"(",
"RSAPublicKey",
"publicKey",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"-----BEGIN PUBLIC KEY-----\\n\"",
")",
";",
"String",
"encod... | Get a PEM formatted string from the provided public key
@param publicKey RSA Public Key object
@return PEM formatted public key string | [
"Get",
"a",
"PEM",
"formatted",
"string",
"from",
"the",
"provided",
"public",
"key"
] | ceecc70b9b04af07ddc14c57d4bcc933a4e0379c | https://github.com/iovation/launchkey-java/blob/ceecc70b9b04af07ddc14c57d4bcc933a4e0379c/sdk/src/main/java/com/iovation/launchkey/sdk/crypto/JCECrypto.java#L164-L189 |
10,662 | iovation/launchkey-java | sdk/src/main/java/com/iovation/launchkey/sdk/FactoryFactoryBuilder.java | FactoryFactoryBuilder.build | public FactoryFactory build() {
return new FactoryFactory(
getJceProvider(),
getHttpClient(),
getKeyCache(),
getApiBaseURL(),
getApiIdentifier(),
getRequestExpireSeconds(),
offsetTTL,
... | java | public FactoryFactory build() {
return new FactoryFactory(
getJceProvider(),
getHttpClient(),
getKeyCache(),
getApiBaseURL(),
getApiIdentifier(),
getRequestExpireSeconds(),
offsetTTL,
... | [
"public",
"FactoryFactory",
"build",
"(",
")",
"{",
"return",
"new",
"FactoryFactory",
"(",
"getJceProvider",
"(",
")",
",",
"getHttpClient",
"(",
")",
",",
"getKeyCache",
"(",
")",
",",
"getApiBaseURL",
"(",
")",
",",
"getApiIdentifier",
"(",
")",
",",
"g... | Build a factory based on the currently configured information
@return Client Factory Factory | [
"Build",
"a",
"factory",
"based",
"on",
"the",
"currently",
"configured",
"information"
] | ceecc70b9b04af07ddc14c57d4bcc933a4e0379c | https://github.com/iovation/launchkey-java/blob/ceecc70b9b04af07ddc14c57d4bcc933a4e0379c/sdk/src/main/java/com/iovation/launchkey/sdk/FactoryFactoryBuilder.java#L55-L68 |
10,663 | michaelwittig/java-q | src/main/java/info/michaelwittig/javaq/connector/impl/QConnectorAsyncImpl.java | QConnectorAsyncImpl.throwQException | private void throwQException(final QConnectorException e) {
this.executor.execute(new Runnable() {
@Override
public void run() {
QConnectorAsyncImpl.this.listener.exception(e);
}
});
} | java | private void throwQException(final QConnectorException e) {
this.executor.execute(new Runnable() {
@Override
public void run() {
QConnectorAsyncImpl.this.listener.exception(e);
}
});
} | [
"private",
"void",
"throwQException",
"(",
"final",
"QConnectorException",
"e",
")",
"{",
"this",
".",
"executor",
".",
"execute",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"QConnectorAsyncImpl",
".",
"... | Throw an exception if something happened, that the system can not fix.
@param e Exception | [
"Throw",
"an",
"exception",
"if",
"something",
"happened",
"that",
"the",
"system",
"can",
"not",
"fix",
"."
] | f71fc95b185caa85c6fbdc7179cb4f5f7733b630 | https://github.com/michaelwittig/java-q/blob/f71fc95b185caa85c6fbdc7179cb4f5f7733b630/src/main/java/info/michaelwittig/javaq/connector/impl/QConnectorAsyncImpl.java#L207-L215 |
10,664 | michaelwittig/java-q | src/main/java/info/michaelwittig/javaq/connector/impl/QConnectorAsyncImpl.java | QConnectorAsyncImpl.throwQError | private void throwQError(final QConnectorError e) {
this.executor.execute(new Runnable() {
@Override
public void run() {
QConnectorAsyncImpl.this.listener.error(e);
}
});
} | java | private void throwQError(final QConnectorError e) {
this.executor.execute(new Runnable() {
@Override
public void run() {
QConnectorAsyncImpl.this.listener.error(e);
}
});
} | [
"private",
"void",
"throwQError",
"(",
"final",
"QConnectorError",
"e",
")",
"{",
"this",
".",
"executor",
".",
"execute",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"QConnectorAsyncImpl",
".",
"this",
... | Throw an error if something happened, that the system can fix on his own, but is might important to know.
@param e Error | [
"Throw",
"an",
"error",
"if",
"something",
"happened",
"that",
"the",
"system",
"can",
"fix",
"on",
"his",
"own",
"but",
"is",
"might",
"important",
"to",
"know",
"."
] | f71fc95b185caa85c6fbdc7179cb4f5f7733b630 | https://github.com/michaelwittig/java-q/blob/f71fc95b185caa85c6fbdc7179cb4f5f7733b630/src/main/java/info/michaelwittig/javaq/connector/impl/QConnectorAsyncImpl.java#L222-L230 |
10,665 | michaelwittig/java-q | src/main/java/info/michaelwittig/javaq/connector/impl/QConnectorAsyncImpl.java | QConnectorAsyncImpl.throwResult | private void throwResult(final Result result) {
this.executor.execute(new Runnable() {
@Override
public void run() {
QConnectorAsyncImpl.this.listener.resultReceived("", result);
}
});
} | java | private void throwResult(final Result result) {
this.executor.execute(new Runnable() {
@Override
public void run() {
QConnectorAsyncImpl.this.listener.resultReceived("", result);
}
});
} | [
"private",
"void",
"throwResult",
"(",
"final",
"Result",
"result",
")",
"{",
"this",
".",
"executor",
".",
"execute",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"QConnectorAsyncImpl",
".",
"this",
"."... | Throw result.
@param result Result | [
"Throw",
"result",
"."
] | f71fc95b185caa85c6fbdc7179cb4f5f7733b630 | https://github.com/michaelwittig/java-q/blob/f71fc95b185caa85c6fbdc7179cb4f5f7733b630/src/main/java/info/michaelwittig/javaq/connector/impl/QConnectorAsyncImpl.java#L237-L245 |
10,666 | threerings/playn | core/src/playn/core/GroupLayerImpl.java | GroupLayerImpl.findChild | private int findChild(L child, float depth) {
// findInsertion will find us some element with the same depth as the to-be-removed child
int startIdx = findInsertion(depth);
// search down for our child
for (int ii = startIdx-1; ii >= 0; ii--) {
L c = children.get(ii);
if (c == child) {
... | java | private int findChild(L child, float depth) {
// findInsertion will find us some element with the same depth as the to-be-removed child
int startIdx = findInsertion(depth);
// search down for our child
for (int ii = startIdx-1; ii >= 0; ii--) {
L c = children.get(ii);
if (c == child) {
... | [
"private",
"int",
"findChild",
"(",
"L",
"child",
",",
"float",
"depth",
")",
"{",
"// findInsertion will find us some element with the same depth as the to-be-removed child",
"int",
"startIdx",
"=",
"findInsertion",
"(",
"depth",
")",
";",
"// search down for our child",
"... | uses depth to improve upon a full linear search | [
"uses",
"depth",
"to",
"improve",
"upon",
"a",
"full",
"linear",
"search"
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/GroupLayerImpl.java#L181-L205 |
10,667 | threerings/playn | core/src/playn/core/GroupLayerImpl.java | GroupLayerImpl.findInsertion | private int findInsertion(float depth) {
int low = 0, high = children.size()-1;
while (low <= high) {
int mid = (low + high) >>> 1;
float midDepth = children.get(mid).depth();
if (depth > midDepth) {
low = mid + 1;
} else if (depth < midDepth) {
high = mid - 1;
} el... | java | private int findInsertion(float depth) {
int low = 0, high = children.size()-1;
while (low <= high) {
int mid = (low + high) >>> 1;
float midDepth = children.get(mid).depth();
if (depth > midDepth) {
low = mid + 1;
} else if (depth < midDepth) {
high = mid - 1;
} el... | [
"private",
"int",
"findInsertion",
"(",
"float",
"depth",
")",
"{",
"int",
"low",
"=",
"0",
",",
"high",
"=",
"children",
".",
"size",
"(",
")",
"-",
"1",
";",
"while",
"(",
"low",
"<=",
"high",
")",
"{",
"int",
"mid",
"=",
"(",
"low",
"+",
"hi... | who says you never have to write binary search? | [
"who",
"says",
"you",
"never",
"have",
"to",
"write",
"binary",
"search?"
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/GroupLayerImpl.java#L208-L222 |
10,668 | threerings/playn | core/src/playn/core/gl/AbstractImageGL.java | AbstractImageGL.draw | void draw(GLShader shader, InternalTransform xform, int tint,
float dx, float dy, float dw, float dh) {
draw(shader, xform, tint, dx, dy, dw, dh,
0, 0, (repeatX ? dw : width()), (repeatY ? dh : height()));
} | java | void draw(GLShader shader, InternalTransform xform, int tint,
float dx, float dy, float dw, float dh) {
draw(shader, xform, tint, dx, dy, dw, dh,
0, 0, (repeatX ? dw : width()), (repeatY ? dh : height()));
} | [
"void",
"draw",
"(",
"GLShader",
"shader",
",",
"InternalTransform",
"xform",
",",
"int",
"tint",
",",
"float",
"dx",
",",
"float",
"dy",
",",
"float",
"dw",
",",
"float",
"dh",
")",
"{",
"draw",
"(",
"shader",
",",
"xform",
",",
"tint",
",",
"dx",
... | Draws this image with the supplied transform in the specified target dimensions. | [
"Draws",
"this",
"image",
"with",
"the",
"supplied",
"transform",
"in",
"the",
"specified",
"target",
"dimensions",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/gl/AbstractImageGL.java#L67-L71 |
10,669 | threerings/playn | core/src/playn/core/gl/AbstractImageGL.java | AbstractImageGL.draw | void draw(GLShader shader, InternalTransform xform, int tint,
float dx, float dy, float dw, float dh, float sx, float sy, float sw, float sh) {
float texWidth = width(), texHeight = height();
drawImpl(shader, xform, ensureTexture(), tint, dx, dy, dw, dh,
sx / texWidth, sy / texHeight, (... | java | void draw(GLShader shader, InternalTransform xform, int tint,
float dx, float dy, float dw, float dh, float sx, float sy, float sw, float sh) {
float texWidth = width(), texHeight = height();
drawImpl(shader, xform, ensureTexture(), tint, dx, dy, dw, dh,
sx / texWidth, sy / texHeight, (... | [
"void",
"draw",
"(",
"GLShader",
"shader",
",",
"InternalTransform",
"xform",
",",
"int",
"tint",
",",
"float",
"dx",
",",
"float",
"dy",
",",
"float",
"dw",
",",
"float",
"dh",
",",
"float",
"sx",
",",
"float",
"sy",
",",
"float",
"sw",
",",
"float"... | Draws this image with the supplied transform, and source and target dimensions. | [
"Draws",
"this",
"image",
"with",
"the",
"supplied",
"transform",
"and",
"source",
"and",
"target",
"dimensions",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/gl/AbstractImageGL.java#L76-L81 |
10,670 | julianhyde/quidem | src/main/java/net/hydromatic/quidem/Launcher.java | Launcher.main2 | static int main2(PrintWriter out, PrintWriter err, List<String> args) {
try {
final Launcher launcher = new Launcher(args, out);
final Quidem quidem;
try {
quidem = launcher.parse();
} catch (ParseException e) {
return e.code;
}
quidem.execute();
return 0;
... | java | static int main2(PrintWriter out, PrintWriter err, List<String> args) {
try {
final Launcher launcher = new Launcher(args, out);
final Quidem quidem;
try {
quidem = launcher.parse();
} catch (ParseException e) {
return e.code;
}
quidem.execute();
return 0;
... | [
"static",
"int",
"main2",
"(",
"PrintWriter",
"out",
",",
"PrintWriter",
"err",
",",
"List",
"<",
"String",
">",
"args",
")",
"{",
"try",
"{",
"final",
"Launcher",
"launcher",
"=",
"new",
"Launcher",
"(",
"args",
",",
"out",
")",
";",
"final",
"Quidem"... | Creates a launcher, parses command line arguments, and runs Quidem.
<p>Similar to a {@code main} method, but never calls
{@link System#exit(int)}.
@param out Writer to which to print output
@param args Command-line arguments
@return Operating system error code (0 = success, 1 = invalid arguments,
2 = other error) | [
"Creates",
"a",
"launcher",
"parses",
"command",
"line",
"arguments",
"and",
"runs",
"Quidem",
"."
] | 43dae9a1a181a03ed877adf5d612255ce2052972 | https://github.com/julianhyde/quidem/blob/43dae9a1a181a03ed877adf5d612255ce2052972/src/main/java/net/hydromatic/quidem/Launcher.java#L75-L94 |
10,671 | julianhyde/quidem | src/main/java/net/hydromatic/quidem/LimitWriter.java | LimitWriter.ellipsis | public void ellipsis(String message) {
if (length >= maxLength) {
try {
out.write(message);
out.flush();
} catch (IOException e) {
throw Throwables.propagate(e);
}
}
} | java | public void ellipsis(String message) {
if (length >= maxLength) {
try {
out.write(message);
out.flush();
} catch (IOException e) {
throw Throwables.propagate(e);
}
}
} | [
"public",
"void",
"ellipsis",
"(",
"String",
"message",
")",
"{",
"if",
"(",
"length",
">=",
"maxLength",
")",
"{",
"try",
"{",
"out",
".",
"write",
"(",
"message",
")",
";",
"out",
".",
"flush",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e"... | Appends a message if the limit has been reached or exceeded. | [
"Appends",
"a",
"message",
"if",
"the",
"limit",
"has",
"been",
"reached",
"or",
"exceeded",
"."
] | 43dae9a1a181a03ed877adf5d612255ce2052972 | https://github.com/julianhyde/quidem/blob/43dae9a1a181a03ed877adf5d612255ce2052972/src/main/java/net/hydromatic/quidem/LimitWriter.java#L75-L84 |
10,672 | threerings/playn | html/src/playn/html/HtmlGraphics.java | HtmlGraphics.setSize | public void setSize(int width, int height) {
rootElement.getStyle().setWidth(width, Unit.PX);
rootElement.getStyle().setHeight(height, Unit.PX);
} | java | public void setSize(int width, int height) {
rootElement.getStyle().setWidth(width, Unit.PX);
rootElement.getStyle().setHeight(height, Unit.PX);
} | [
"public",
"void",
"setSize",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"rootElement",
".",
"getStyle",
"(",
")",
".",
"setWidth",
"(",
"width",
",",
"Unit",
".",
"PX",
")",
";",
"rootElement",
".",
"getStyle",
"(",
")",
".",
"setHeight",
"... | Sizes or resizes the root element that contains the PlayN view.
@param width the new width, in pixels, of the view.
@param height the new height, in pixels, of the view. | [
"Sizes",
"or",
"resizes",
"the",
"root",
"element",
"that",
"contains",
"the",
"PlayN",
"view",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/html/src/playn/html/HtmlGraphics.java#L83-L86 |
10,673 | threerings/playn | html/src/playn/html/HtmlInternalTransform.java | HtmlInternalTransform.uniformScale | @Override
public float uniformScale() {
// the square root of the signed area of the parallelogram spanned by the axis vectors
float cp = m00() * m11() - m01() * m10();
return (cp < 0f) ? -FloatMath.sqrt(-cp) : FloatMath.sqrt(cp);
} | java | @Override
public float uniformScale() {
// the square root of the signed area of the parallelogram spanned by the axis vectors
float cp = m00() * m11() - m01() * m10();
return (cp < 0f) ? -FloatMath.sqrt(-cp) : FloatMath.sqrt(cp);
} | [
"@",
"Override",
"public",
"float",
"uniformScale",
"(",
")",
"{",
"// the square root of the signed area of the parallelogram spanned by the axis vectors",
"float",
"cp",
"=",
"m00",
"(",
")",
"*",
"m11",
"(",
")",
"-",
"m01",
"(",
")",
"*",
"m10",
"(",
")",
";... | Pythagoras Transform implementation | [
"Pythagoras",
"Transform",
"implementation"
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/html/src/playn/html/HtmlInternalTransform.java#L44-L49 |
10,674 | threerings/playn | ios/src/playn/ios/IOSGL20.java | IOSGL20.createHandle | private static GCHandle createHandle (Buffer buffer)
{
Object array;
if (buffer instanceof ByteBuffer)
array = ((ByteBuffer)buffer).array();
else if (buffer instanceof ShortBuffer)
array = ((ShortBuffer)buffer).array();
else if (buffer instanceof IntBuffer)
array = ((IntBuffer)buffer... | java | private static GCHandle createHandle (Buffer buffer)
{
Object array;
if (buffer instanceof ByteBuffer)
array = ((ByteBuffer)buffer).array();
else if (buffer instanceof ShortBuffer)
array = ((ShortBuffer)buffer).array();
else if (buffer instanceof IntBuffer)
array = ((IntBuffer)buffer... | [
"private",
"static",
"GCHandle",
"createHandle",
"(",
"Buffer",
"buffer",
")",
"{",
"Object",
"array",
";",
"if",
"(",
"buffer",
"instanceof",
"ByteBuffer",
")",
"array",
"=",
"(",
"(",
"ByteBuffer",
")",
"buffer",
")",
".",
"array",
"(",
")",
";",
"else... | Allocates a pinned GCHandle pointing at a buffer's data. Remember to free it! | [
"Allocates",
"a",
"pinned",
"GCHandle",
"pointing",
"at",
"a",
"buffer",
"s",
"data",
".",
"Remember",
"to",
"free",
"it!"
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/ios/src/playn/ios/IOSGL20.java#L1483-L1499 |
10,675 | threerings/playn | core/src/playn/core/util/CallbackList.java | CallbackList.create | public static <T> CallbackList<T> create(Callback<T> callback) {
CallbackList<T> list = new CallbackList<T>();
list.add(callback);
return list;
} | java | public static <T> CallbackList<T> create(Callback<T> callback) {
CallbackList<T> list = new CallbackList<T>();
list.add(callback);
return list;
} | [
"public",
"static",
"<",
"T",
">",
"CallbackList",
"<",
"T",
">",
"create",
"(",
"Callback",
"<",
"T",
">",
"callback",
")",
"{",
"CallbackList",
"<",
"T",
">",
"list",
"=",
"new",
"CallbackList",
"<",
"T",
">",
"(",
")",
";",
"list",
".",
"add",
... | Creates a callback list, populated with the supplied callback. | [
"Creates",
"a",
"callback",
"list",
"populated",
"with",
"the",
"supplied",
"callback",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/util/CallbackList.java#L33-L37 |
10,676 | threerings/playn | core/src/playn/core/util/CallbackList.java | CallbackList.add | public CallbackList<T> add(Callback<T> callback) {
checkState();
callbacks.add(callback);
return this;
} | java | public CallbackList<T> add(Callback<T> callback) {
checkState();
callbacks.add(callback);
return this;
} | [
"public",
"CallbackList",
"<",
"T",
">",
"add",
"(",
"Callback",
"<",
"T",
">",
"callback",
")",
"{",
"checkState",
"(",
")",
";",
"callbacks",
".",
"add",
"(",
"callback",
")",
";",
"return",
"this",
";",
"}"
] | Adds the supplied callback to the list.
@return this instance for convenient chaining.
@throws IllegalStateException if this callback has already fired. | [
"Adds",
"the",
"supplied",
"callback",
"to",
"the",
"list",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/util/CallbackList.java#L45-L49 |
10,677 | threerings/playn | core/src/playn/core/util/CallbackList.java | CallbackList.onSuccess | @Override
public void onSuccess(T result) {
checkState();
for (Callback<T> cb : callbacks) {
cb.onSuccess(result);
}
callbacks = null; // note that we've fired
} | java | @Override
public void onSuccess(T result) {
checkState();
for (Callback<T> cb : callbacks) {
cb.onSuccess(result);
}
callbacks = null; // note that we've fired
} | [
"@",
"Override",
"public",
"void",
"onSuccess",
"(",
"T",
"result",
")",
"{",
"checkState",
"(",
")",
";",
"for",
"(",
"Callback",
"<",
"T",
">",
"cb",
":",
"callbacks",
")",
"{",
"cb",
".",
"onSuccess",
"(",
"result",
")",
";",
"}",
"callbacks",
"... | Dispatches success to all of the callbacks registered with this list. This may only be called
once.
@throws IllegalStateException if this callback has already fired. | [
"Dispatches",
"success",
"to",
"all",
"of",
"the",
"callbacks",
"registered",
"with",
"this",
"list",
".",
"This",
"may",
"only",
"be",
"called",
"once",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/util/CallbackList.java#L67-L74 |
10,678 | threerings/playn | core/src/playn/core/util/CallbackList.java | CallbackList.onFailure | @Override
public void onFailure(Throwable cause) {
checkState();
for (Callback<T> cb : callbacks) {
cb.onFailure(cause);
}
callbacks = null; // note that we've fired
} | java | @Override
public void onFailure(Throwable cause) {
checkState();
for (Callback<T> cb : callbacks) {
cb.onFailure(cause);
}
callbacks = null; // note that we've fired
} | [
"@",
"Override",
"public",
"void",
"onFailure",
"(",
"Throwable",
"cause",
")",
"{",
"checkState",
"(",
")",
";",
"for",
"(",
"Callback",
"<",
"T",
">",
"cb",
":",
"callbacks",
")",
"{",
"cb",
".",
"onFailure",
"(",
"cause",
")",
";",
"}",
"callbacks... | Dispatches failure to all of the callbacks registered with this list. This may only be called
once.
@throws IllegalStateException if this callback has already fired. | [
"Dispatches",
"failure",
"to",
"all",
"of",
"the",
"callbacks",
"registered",
"with",
"this",
"list",
".",
"This",
"may",
"only",
"be",
"called",
"once",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/util/CallbackList.java#L82-L89 |
10,679 | threerings/playn | html/src/playn/html/HtmlInput.java | HtmlInput.captureEvent | static void captureEvent(final Element elem, String eventName, final EventHandler handler) {
// register regular event handler on the element
HtmlPlatform.captureEvent(elem, eventName, handler);
} | java | static void captureEvent(final Element elem, String eventName, final EventHandler handler) {
// register regular event handler on the element
HtmlPlatform.captureEvent(elem, eventName, handler);
} | [
"static",
"void",
"captureEvent",
"(",
"final",
"Element",
"elem",
",",
"String",
"eventName",
",",
"final",
"EventHandler",
"handler",
")",
"{",
"// register regular event handler on the element",
"HtmlPlatform",
".",
"captureEvent",
"(",
"elem",
",",
"eventName",
",... | Capture events that occur on the target element only. | [
"Capture",
"events",
"that",
"occur",
"on",
"the",
"target",
"element",
"only",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/html/src/playn/html/HtmlInput.java#L47-L50 |
10,680 | threerings/playn | java/src/playn/java/JavaPlatform.java | JavaPlatform.register | public static JavaPlatform register(Config config) {
// guard against multiple-registration (only in headless mode because this can happen when
// running tests in Maven; in non-headless mode, we want to fail rather than silently ignore
// erroneous repeated registration)
if (config.headless && testInst... | java | public static JavaPlatform register(Config config) {
// guard against multiple-registration (only in headless mode because this can happen when
// running tests in Maven; in non-headless mode, we want to fail rather than silently ignore
// erroneous repeated registration)
if (config.headless && testInst... | [
"public",
"static",
"JavaPlatform",
"register",
"(",
"Config",
"config",
")",
"{",
"// guard against multiple-registration (only in headless mode because this can happen when",
"// running tests in Maven; in non-headless mode, we want to fail rather than silently ignore",
"// erroneous repeate... | Registers the Java platform with the specified configuration. | [
"Registers",
"the",
"Java",
"platform",
"with",
"the",
"specified",
"configuration",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/java/src/playn/java/JavaPlatform.java#L104-L117 |
10,681 | Drivemode/TypefaceHelper | TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceCache.java | TypefaceCache.get | public synchronized Typeface get(String name) {
Typeface typeface = mCache.get(name);
if(typeface == null) {
try {
typeface = Typeface.createFromAsset(mApplication.getAssets(), name);
} catch (Exception exp) {
return null;
}
mCache.put(name, typeface);
}
return typeface;
} | java | public synchronized Typeface get(String name) {
Typeface typeface = mCache.get(name);
if(typeface == null) {
try {
typeface = Typeface.createFromAsset(mApplication.getAssets(), name);
} catch (Exception exp) {
return null;
}
mCache.put(name, typeface);
}
return typeface;
} | [
"public",
"synchronized",
"Typeface",
"get",
"(",
"String",
"name",
")",
"{",
"Typeface",
"typeface",
"=",
"mCache",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"typeface",
"==",
"null",
")",
"{",
"try",
"{",
"typeface",
"=",
"Typeface",
".",
"create... | If the cache has an instance for the typeface name, this will return the instance immediately.
Otherwise this method will create typeface instance and put it into the cache and return the instance.
@param name the typeface name.
@return {@link android.graphics.Typeface} instance. | [
"If",
"the",
"cache",
"has",
"an",
"instance",
"for",
"the",
"typeface",
"name",
"this",
"will",
"return",
"the",
"instance",
"immediately",
".",
"Otherwise",
"this",
"method",
"will",
"create",
"typeface",
"instance",
"and",
"put",
"it",
"into",
"the",
"cac... | 86bef9ce16b9626b7076559e846db1b9f043c008 | https://github.com/Drivemode/TypefaceHelper/blob/86bef9ce16b9626b7076559e846db1b9f043c008/TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceCache.java#L34-L45 |
10,682 | Drivemode/TypefaceHelper | TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceCache.java | TypefaceCache.getInstance | public static synchronized TypefaceCache getInstance(Context context) {
if (sInstance == null)
sInstance = new TypefaceCache((Application)context.getApplicationContext());
return sInstance;
} | java | public static synchronized TypefaceCache getInstance(Context context) {
if (sInstance == null)
sInstance = new TypefaceCache((Application)context.getApplicationContext());
return sInstance;
} | [
"public",
"static",
"synchronized",
"TypefaceCache",
"getInstance",
"(",
"Context",
"context",
")",
"{",
"if",
"(",
"sInstance",
"==",
"null",
")",
"sInstance",
"=",
"new",
"TypefaceCache",
"(",
"(",
"Application",
")",
"context",
".",
"getApplicationContext",
"... | Retrieve this cache.
@param context the context.
@return the cache instance. | [
"Retrieve",
"this",
"cache",
"."
] | 86bef9ce16b9626b7076559e846db1b9f043c008 | https://github.com/Drivemode/TypefaceHelper/blob/86bef9ce16b9626b7076559e846db1b9f043c008/TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceCache.java#L52-L56 |
10,683 | threerings/playn | ios/src/playn/ios/IOSPlatform.java | IOSPlatform.register | public static IOSPlatform register(UIApplication app, Config config) {
return register(app, null, config);
} | java | public static IOSPlatform register(UIApplication app, Config config) {
return register(app, null, config);
} | [
"public",
"static",
"IOSPlatform",
"register",
"(",
"UIApplication",
"app",
",",
"Config",
"config",
")",
"{",
"return",
"register",
"(",
"app",
",",
"null",
",",
"config",
")",
";",
"}"
] | Registers your application using the supplied configuration. | [
"Registers",
"your",
"application",
"using",
"the",
"supplied",
"configuration",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/ios/src/playn/ios/IOSPlatform.java#L164-L166 |
10,684 | threerings/playn | ios/src/playn/ios/IOSPlatform.java | IOSPlatform.register | public static IOSPlatform register(UIApplication app, UIWindow window, Config config) {
IOSPlatform platform = new IOSPlatform(app, window, config);
PlayN.setPlatform(platform);
return platform;
} | java | public static IOSPlatform register(UIApplication app, UIWindow window, Config config) {
IOSPlatform platform = new IOSPlatform(app, window, config);
PlayN.setPlatform(platform);
return platform;
} | [
"public",
"static",
"IOSPlatform",
"register",
"(",
"UIApplication",
"app",
",",
"UIWindow",
"window",
",",
"Config",
"config",
")",
"{",
"IOSPlatform",
"platform",
"=",
"new",
"IOSPlatform",
"(",
"app",
",",
"window",
",",
"config",
")",
";",
"PlayN",
".",
... | Registers your application using the supplied configuration and window.
The window is used for a game integrated as a part of application. An iOS application
typically just works on one screen so that the game has to share the window created by other
controllers (typically created by the story board). If no window is ... | [
"Registers",
"your",
"application",
"using",
"the",
"supplied",
"configuration",
"and",
"window",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/ios/src/playn/ios/IOSPlatform.java#L180-L184 |
10,685 | threerings/playn | core/src/playn/core/gl/GLContext.java | GLContext.useShader | public boolean useShader(GLShader shader) {
if (curShader == shader)
return false;
checkGLError("useShader");
flush(true);
curShader = shader;
return true;
} | java | public boolean useShader(GLShader shader) {
if (curShader == shader)
return false;
checkGLError("useShader");
flush(true);
curShader = shader;
return true;
} | [
"public",
"boolean",
"useShader",
"(",
"GLShader",
"shader",
")",
"{",
"if",
"(",
"curShader",
"==",
"shader",
")",
"return",
"false",
";",
"checkGLError",
"(",
"\"useShader\"",
")",
";",
"flush",
"(",
"true",
")",
";",
"curShader",
"=",
"shader",
";",
"... | Makes the supplied shader the current shader, flushing any previous shader. | [
"Makes",
"the",
"supplied",
"shader",
"the",
"current",
"shader",
"flushing",
"any",
"previous",
"shader",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/gl/GLContext.java#L307-L314 |
10,686 | threerings/playn | core/src/playn/core/AbstractLayer.java | AbstractLayer.interact | private <L, E> void interact(Class<L> type, Interaction<L, E> interaction,
Interactor<?> current, E argument) {
if (current == null)
return;
interact(type, interaction, current.next, argument);
if (current.listenerType == type) {
@SuppressWarnings("unchecked") L li... | java | private <L, E> void interact(Class<L> type, Interaction<L, E> interaction,
Interactor<?> current, E argument) {
if (current == null)
return;
interact(type, interaction, current.next, argument);
if (current.listenerType == type) {
@SuppressWarnings("unchecked") L li... | [
"private",
"<",
"L",
",",
"E",
">",
"void",
"interact",
"(",
"Class",
"<",
"L",
">",
"type",
",",
"Interaction",
"<",
"L",
",",
"E",
">",
"interaction",
",",
"Interactor",
"<",
"?",
">",
"current",
",",
"E",
"argument",
")",
"{",
"if",
"(",
"curr... | neither affects, nor conflicts with, the current dispatch | [
"neither",
"affects",
"nor",
"conflicts",
"with",
"the",
"current",
"dispatch"
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/AbstractLayer.java#L385-L394 |
10,687 | threerings/playn | html/src/playn/super/java/nio/LongBuffer.java | LongBuffer.compareTo | public int compareTo (LongBuffer otherBuffer) {
int compareRemaining = (remaining() < otherBuffer.remaining()) ?
remaining() : otherBuffer.remaining();
int thisPos = position;
int otherPos = otherBuffer.position;
// BEGIN android-changed
long thisLong, otherLong;
... | java | public int compareTo (LongBuffer otherBuffer) {
int compareRemaining = (remaining() < otherBuffer.remaining()) ?
remaining() : otherBuffer.remaining();
int thisPos = position;
int otherPos = otherBuffer.position;
// BEGIN android-changed
long thisLong, otherLong;
... | [
"public",
"int",
"compareTo",
"(",
"LongBuffer",
"otherBuffer",
")",
"{",
"int",
"compareRemaining",
"=",
"(",
"remaining",
"(",
")",
"<",
"otherBuffer",
".",
"remaining",
"(",
")",
")",
"?",
"remaining",
"(",
")",
":",
"otherBuffer",
".",
"remaining",
"("... | Compare the remaining longs of this buffer to another long buffer's remaining longs.
@param otherBuffer another long buffer.
@return a negative value if this is less than {@code otherBuffer}; 0 if this equals to
{@code otherBuffer}; a positive value if this is greater than {@code otherBuffer}
@exception ClassCastExcep... | [
"Compare",
"the",
"remaining",
"longs",
"of",
"this",
"buffer",
"to",
"another",
"long",
"buffer",
"s",
"remaining",
"longs",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/html/src/playn/super/java/nio/LongBuffer.java#L107-L126 |
10,688 | michaelwittig/java-q | src/main/java/info/michaelwittig/javaq/connector/impl/CResultHelper.java | CResultHelper.convert | public static Result convert(final Object res) throws QConnectorException {
if (res == null) {
return new EmptyResult();
}
// table
if (res instanceof c.Flip) {
return new FlipResult("", (c.Flip) res);
}
// dict
if (res instanceof c.Dict) {
final c.Dict dict = (c.Dict) res;
if ((dict.x instanc... | java | public static Result convert(final Object res) throws QConnectorException {
if (res == null) {
return new EmptyResult();
}
// table
if (res instanceof c.Flip) {
return new FlipResult("", (c.Flip) res);
}
// dict
if (res instanceof c.Dict) {
final c.Dict dict = (c.Dict) res;
if ((dict.x instanc... | [
"public",
"static",
"Result",
"convert",
"(",
"final",
"Object",
"res",
")",
"throws",
"QConnectorException",
"{",
"if",
"(",
"res",
"==",
"null",
")",
"{",
"return",
"new",
"EmptyResult",
"(",
")",
";",
"}",
"// table",
"if",
"(",
"res",
"instanceof",
"... | Converts an result from the kx c library to a QConnector Result.
@param res Result from q
@return Result
@throws QConnectorException If the result type is not supported | [
"Converts",
"an",
"result",
"from",
"the",
"kx",
"c",
"library",
"to",
"a",
"QConnector",
"Result",
"."
] | f71fc95b185caa85c6fbdc7179cb4f5f7733b630 | https://github.com/michaelwittig/java-q/blob/f71fc95b185caa85c6fbdc7179cb4f5f7733b630/src/main/java/info/michaelwittig/javaq/connector/impl/CResultHelper.java#L30-L64 |
10,689 | threerings/playn | core/src/playn/core/AssetWatcher.java | AssetWatcher.add | public void add(Image image) {
assert !start || listener == null;
++total;
image.addCallback(callback);
} | java | public void add(Image image) {
assert !start || listener == null;
++total;
image.addCallback(callback);
} | [
"public",
"void",
"add",
"(",
"Image",
"image",
")",
"{",
"assert",
"!",
"start",
"||",
"listener",
"==",
"null",
";",
"++",
"total",
";",
"image",
".",
"addCallback",
"(",
"callback",
")",
";",
"}"
] | Adds an image resource to be watched. | [
"Adds",
"an",
"image",
"resource",
"to",
"be",
"watched",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/AssetWatcher.java#L89-L93 |
10,690 | threerings/playn | core/src/playn/core/AssetWatcher.java | AssetWatcher.add | public void add(Sound sound) {
assert !start || listener == null;
++total;
sound.addCallback(callback);
} | java | public void add(Sound sound) {
assert !start || listener == null;
++total;
sound.addCallback(callback);
} | [
"public",
"void",
"add",
"(",
"Sound",
"sound",
")",
"{",
"assert",
"!",
"start",
"||",
"listener",
"==",
"null",
";",
"++",
"total",
";",
"sound",
".",
"addCallback",
"(",
"callback",
")",
";",
"}"
] | Adds a sound resource to be watched. | [
"Adds",
"a",
"sound",
"resource",
"to",
"be",
"watched",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/AssetWatcher.java#L98-L102 |
10,691 | threerings/playn | core/src/playn/core/gl/GLUtil.java | GLUtil.nextPowerOfTwo | public static int nextPowerOfTwo(int x) {
assert x < 0x10000;
int bit = 0x8000, highest = -1, count = 0;
for (int i = 15; i >= 0; --i, bit >>= 1) {
if ((x & bit) != 0) {
++count;
if (highest == -1) {
highest = i;
}
}
}
if (count <= 1) {
return 0;
... | java | public static int nextPowerOfTwo(int x) {
assert x < 0x10000;
int bit = 0x8000, highest = -1, count = 0;
for (int i = 15; i >= 0; --i, bit >>= 1) {
if ((x & bit) != 0) {
++count;
if (highest == -1) {
highest = i;
}
}
}
if (count <= 1) {
return 0;
... | [
"public",
"static",
"int",
"nextPowerOfTwo",
"(",
"int",
"x",
")",
"{",
"assert",
"x",
"<",
"0x10000",
";",
"int",
"bit",
"=",
"0x8000",
",",
"highest",
"=",
"-",
"1",
",",
"count",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"15",
";",
"i",
">... | Returns the next largest power of two, or zero if x is already a power of two.
TODO(jgw): Is there no better way to do this than all this bit twiddling? | [
"Returns",
"the",
"next",
"largest",
"power",
"of",
"two",
"or",
"zero",
"if",
"x",
"is",
"already",
"a",
"power",
"of",
"two",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/gl/GLUtil.java#L22-L38 |
10,692 | jqm4gwt/jqm4gwt | library/src/main/java/com/sksamuel/jqm4gwt/layout/JQMCollapsible.java | JQMCollapsible.setInline | @Override
public void setInline(boolean value) {
inline = value;
if (headingToggle != null) {
JQMCommon.setInlineEx(headingToggle, value, JQMCommon.STYLE_UI_BTN_INLINE);
}
} | java | @Override
public void setInline(boolean value) {
inline = value;
if (headingToggle != null) {
JQMCommon.setInlineEx(headingToggle, value, JQMCommon.STYLE_UI_BTN_INLINE);
}
} | [
"@",
"Override",
"public",
"void",
"setInline",
"(",
"boolean",
"value",
")",
"{",
"inline",
"=",
"value",
";",
"if",
"(",
"headingToggle",
"!=",
"null",
")",
"{",
"JQMCommon",
".",
"setInlineEx",
"(",
"headingToggle",
",",
"value",
",",
"JQMCommon",
".",
... | Sets the header button as inline block. | [
"Sets",
"the",
"header",
"button",
"as",
"inline",
"block",
"."
] | cf59958e9ba6d4b70f42507b2c77f10c2465085b | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/layout/JQMCollapsible.java#L222-L228 |
10,693 | jqm4gwt/jqm4gwt | library/src/main/java/com/sksamuel/jqm4gwt/layout/JQMCollapsible.java | JQMCollapsible.setCollapsed | public void setCollapsed(boolean collapsed) {
if (collapsed) {
removeAttribute("data-collapsed");
if (isInstance(getElement())) collapse();
} else {
setAttribute("data-collapsed", "false");
if (isInstance(getElement())) expand();
}
} | java | public void setCollapsed(boolean collapsed) {
if (collapsed) {
removeAttribute("data-collapsed");
if (isInstance(getElement())) collapse();
} else {
setAttribute("data-collapsed", "false");
if (isInstance(getElement())) expand();
}
} | [
"public",
"void",
"setCollapsed",
"(",
"boolean",
"collapsed",
")",
"{",
"if",
"(",
"collapsed",
")",
"{",
"removeAttribute",
"(",
"\"data-collapsed\"",
")",
";",
"if",
"(",
"isInstance",
"(",
"getElement",
"(",
")",
")",
")",
"collapse",
"(",
")",
";",
... | Programmatically set the collapsed state of this widget. | [
"Programmatically",
"set",
"the",
"collapsed",
"state",
"of",
"this",
"widget",
"."
] | cf59958e9ba6d4b70f42507b2c77f10c2465085b | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/layout/JQMCollapsible.java#L431-L439 |
10,694 | jqm4gwt/jqm4gwt | library/src/main/java/com/sksamuel/jqm4gwt/layout/JQMCollapsible.java | JQMCollapsible.setText | @Override
public void setText(String text) {
if (headingToggle != null) {
if (text == null) text = "";
String s = headingToggle.getInnerHTML();
int p = s.indexOf('<');
if (p >= 0) s = text + s.substring(p);
else s = text;
headingToggle.... | java | @Override
public void setText(String text) {
if (headingToggle != null) {
if (text == null) text = "";
String s = headingToggle.getInnerHTML();
int p = s.indexOf('<');
if (p >= 0) s = text + s.substring(p);
else s = text;
headingToggle.... | [
"@",
"Override",
"public",
"void",
"setText",
"(",
"String",
"text",
")",
"{",
"if",
"(",
"headingToggle",
"!=",
"null",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"text",
"=",
"\"\"",
";",
"String",
"s",
"=",
"headingToggle",
".",
"getInnerHTML",... | Sets the text on the header element | [
"Sets",
"the",
"text",
"on",
"the",
"header",
"element"
] | cf59958e9ba6d4b70f42507b2c77f10c2465085b | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/layout/JQMCollapsible.java#L518-L534 |
10,695 | jqm4gwt/jqm4gwt | plugins/datebox/src/main/java/com/sksamuel/jqm4gwt/plugins/datebox/JQMCalBox.java | JQMCalBox.formatDate | public String formatDate(Date d) {
if (d == null) return null;
JsDate jsd = JsDate.create(d.getTime());
return internFormat(input.getElement(), getActiveDateFormat(), jsd);
} | java | public String formatDate(Date d) {
if (d == null) return null;
JsDate jsd = JsDate.create(d.getTime());
return internFormat(input.getElement(), getActiveDateFormat(), jsd);
} | [
"public",
"String",
"formatDate",
"(",
"Date",
"d",
")",
"{",
"if",
"(",
"d",
"==",
"null",
")",
"return",
"null",
";",
"JsDate",
"jsd",
"=",
"JsDate",
".",
"create",
"(",
"d",
".",
"getTime",
"(",
")",
")",
";",
"return",
"internFormat",
"(",
"inp... | Doesn't change anything, just formats passed date as string according to widget's current settings. | [
"Doesn",
"t",
"change",
"anything",
"just",
"formats",
"passed",
"date",
"as",
"string",
"according",
"to",
"widget",
"s",
"current",
"settings",
"."
] | cf59958e9ba6d4b70f42507b2c77f10c2465085b | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/plugins/datebox/src/main/java/com/sksamuel/jqm4gwt/plugins/datebox/JQMCalBox.java#L1374-L1378 |
10,696 | jqm4gwt/jqm4gwt | library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java | JQMHeader.createButton | protected JQMButton createButton(String text, String url, DataIcon icon) {
JQMButton button = new JQMButton(text, url);
if (icon != null)
button.withBuiltInIcon(icon);
return button;
} | java | protected JQMButton createButton(String text, String url, DataIcon icon) {
JQMButton button = new JQMButton(text, url);
if (icon != null)
button.withBuiltInIcon(icon);
return button;
} | [
"protected",
"JQMButton",
"createButton",
"(",
"String",
"text",
",",
"String",
"url",
",",
"DataIcon",
"icon",
")",
"{",
"JQMButton",
"button",
"=",
"new",
"JQMButton",
"(",
"text",
",",
"url",
")",
";",
"if",
"(",
"icon",
"!=",
"null",
")",
"button",
... | Internal method for creating a button | [
"Internal",
"method",
"for",
"creating",
"a",
"button"
] | cf59958e9ba6d4b70f42507b2c77f10c2465085b | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java#L77-L82 |
10,697 | jqm4gwt/jqm4gwt | library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java | JQMHeader.setBackButton | @UiChild(tagname="backButton", limit=1)
public void setBackButton(JQMButton button) {
button.setBack(true);
setLeftButton(button);
} | java | @UiChild(tagname="backButton", limit=1)
public void setBackButton(JQMButton button) {
button.setBack(true);
setLeftButton(button);
} | [
"@",
"UiChild",
"(",
"tagname",
"=",
"\"backButton\"",
",",
"limit",
"=",
"1",
")",
"public",
"void",
"setBackButton",
"(",
"JQMButton",
"button",
")",
"{",
"button",
".",
"setBack",
"(",
"true",
")",
";",
"setLeftButton",
"(",
"button",
")",
";",
"}"
] | Sets the given button in the left position and sets that buttons role
to back. Any existing left button will be replaced.
@param button
the new back button | [
"Sets",
"the",
"given",
"button",
"in",
"the",
"left",
"position",
"and",
"sets",
"that",
"buttons",
"role",
"to",
"back",
".",
"Any",
"existing",
"left",
"button",
"will",
"be",
"replaced",
"."
] | cf59958e9ba6d4b70f42507b2c77f10c2465085b | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java#L99-L103 |
10,698 | jqm4gwt/jqm4gwt | library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java | JQMHeader.setBackButton | public JQMButton setBackButton(String text) {
JQMButton button = new JQMButton(text);
button.withBuiltInIcon(DataIcon.LEFT);
setBackButton(button);
return button;
} | java | public JQMButton setBackButton(String text) {
JQMButton button = new JQMButton(text);
button.withBuiltInIcon(DataIcon.LEFT);
setBackButton(button);
return button;
} | [
"public",
"JQMButton",
"setBackButton",
"(",
"String",
"text",
")",
"{",
"JQMButton",
"button",
"=",
"new",
"JQMButton",
"(",
"text",
")",
";",
"button",
".",
"withBuiltInIcon",
"(",
"DataIcon",
".",
"LEFT",
")",
";",
"setBackButton",
"(",
"button",
")",
"... | Creates an auto back button with the given text and replaces the
current left button, if any.
@param text
the the text for the button
@return the created {@link JQMButton} | [
"Creates",
"an",
"auto",
"back",
"button",
"with",
"the",
"given",
"text",
"and",
"replaces",
"the",
"current",
"left",
"button",
"if",
"any",
"."
] | cf59958e9ba6d4b70f42507b2c77f10c2465085b | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java#L114-L119 |
10,699 | jqm4gwt/jqm4gwt | library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java | JQMHeader.setLeftButton | @UiChild(tagname="leftButton", limit=1)
public void setLeftButton(JQMButton button) {
if (left != null) remove(left);
button.setPosOnBand(PosOnBand.LEFT);
left = button;
insert(left, 0);
} | java | @UiChild(tagname="leftButton", limit=1)
public void setLeftButton(JQMButton button) {
if (left != null) remove(left);
button.setPosOnBand(PosOnBand.LEFT);
left = button;
insert(left, 0);
} | [
"@",
"UiChild",
"(",
"tagname",
"=",
"\"leftButton\"",
",",
"limit",
"=",
"1",
")",
"public",
"void",
"setLeftButton",
"(",
"JQMButton",
"button",
")",
"{",
"if",
"(",
"left",
"!=",
"null",
")",
"remove",
"(",
"left",
")",
";",
"button",
".",
"setPosOn... | Sets the left button to be the given button. Any existing button is removed.
@param button - the button to set on the left slot | [
"Sets",
"the",
"left",
"button",
"to",
"be",
"the",
"given",
"button",
".",
"Any",
"existing",
"button",
"is",
"removed",
"."
] | cf59958e9ba6d4b70f42507b2c77f10c2465085b | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java#L126-L132 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.