repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 204 | func_name stringlengths 5 103 | whole_func_string stringlengths 87 3.44k | language stringclasses 1
value | func_code_string stringlengths 87 3.44k | func_code_tokens listlengths 21 714 | func_documentation_string stringlengths 61 1.95k | func_documentation_tokens listlengths 1 482 | split_name stringclasses 1
value | func_code_url stringlengths 102 309 |
|---|---|---|---|---|---|---|---|---|---|---|
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.fromHex | public static RgbaColor fromHex(String hex) {
if (hex.length() == 0 || hex.charAt(0) != '#') return getDefaultColor();
// #rgb
if (hex.length() == 4) {
return new RgbaColor(parseHex(hex, 1, 2),
parseHex(hex, 2, 3),
p... | java | public static RgbaColor fromHex(String hex) {
if (hex.length() == 0 || hex.charAt(0) != '#') return getDefaultColor();
// #rgb
if (hex.length() == 4) {
return new RgbaColor(parseHex(hex, 1, 2),
parseHex(hex, 2, 3),
p... | [
"public",
"static",
"RgbaColor",
"fromHex",
"(",
"String",
"hex",
")",
"{",
"if",
"(",
"hex",
".",
"length",
"(",
")",
"==",
"0",
"||",
"hex",
".",
"charAt",
"(",
"0",
")",
"!=",
"'",
"'",
")",
"return",
"getDefaultColor",
"(",
")",
";",
"// #rgb",... | Parses an RgbaColor from a hexadecimal value.
@return returns the parsed color | [
"Parses",
"an",
"RgbaColor",
"from",
"a",
"hexadecimal",
"value",
"."
] | train | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L107-L129 |
oboehm/jfachwert | src/main/java/de/jfachwert/post/Adresse.java | Adresse.of | public static Adresse of(Ort ort, String strasse, String hausnummer) {
return new Adresse(ort, strasse, hausnummer);
} | java | public static Adresse of(Ort ort, String strasse, String hausnummer) {
return new Adresse(ort, strasse, hausnummer);
} | [
"public",
"static",
"Adresse",
"of",
"(",
"Ort",
"ort",
",",
"String",
"strasse",
",",
"String",
"hausnummer",
")",
"{",
"return",
"new",
"Adresse",
"(",
"ort",
",",
"strasse",
",",
"hausnummer",
")",
";",
"}"
] | Liefert eine Adresse mit den uebergebenen Parametern.
@param ort the ort
@param strasse the strasse
@param hausnummer the hausnummer
@return Adresse | [
"Liefert",
"eine",
"Adresse",
"mit",
"den",
"uebergebenen",
"Parametern",
"."
] | train | https://github.com/oboehm/jfachwert/blob/67b513d29e3114c7aee65cd1ea7a5b7e540b0d1b/src/main/java/de/jfachwert/post/Adresse.java#L155-L157 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/util/BaseApplication.java | BaseApplication.getPDatabaseParent | public ThinPhysicalDatabaseParent getPDatabaseParent(Map<String,Object> properties, boolean bCreateIfNew)
{
return this.getEnvironment().getPDatabaseParent(properties, bCreateIfNew);
} | java | public ThinPhysicalDatabaseParent getPDatabaseParent(Map<String,Object> properties, boolean bCreateIfNew)
{
return this.getEnvironment().getPDatabaseParent(properties, bCreateIfNew);
} | [
"public",
"ThinPhysicalDatabaseParent",
"getPDatabaseParent",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
",",
"boolean",
"bCreateIfNew",
")",
"{",
"return",
"this",
".",
"getEnvironment",
"(",
")",
".",
"getPDatabaseParent",
"(",
"properties",
",... | Get the (optional) raw data database manager.
@return The pDatabaseOwner (returns an object, so this package isn't dependent on PDatabaseOwner). | [
"Get",
"the",
"(",
"optional",
")",
"raw",
"data",
"database",
"manager",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/util/BaseApplication.java#L238-L241 |
DJCordhose/jmte | src/com/floreysoft/jmte/util/Util.java | Util.fileToString | public static String fileToString(String fileName, String charsetName) {
return fileToString(new File(fileName), charsetName);
} | java | public static String fileToString(String fileName, String charsetName) {
return fileToString(new File(fileName), charsetName);
} | [
"public",
"static",
"String",
"fileToString",
"(",
"String",
"fileName",
",",
"String",
"charsetName",
")",
"{",
"return",
"fileToString",
"(",
"new",
"File",
"(",
"fileName",
")",
",",
"charsetName",
")",
";",
"}"
] | Transforms a file into a string.
@param fileName
name of the file to be transformed
@param charsetName
encoding of the file
@return the string containing the content of the file | [
"Transforms",
"a",
"file",
"into",
"a",
"string",
"."
] | train | https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/util/Util.java#L111-L113 |
ziccardi/jnrpe | jnrpe-lib/src/main/java/it/jnrpe/JNRPE.java | JNRPE.getServerBootstrap | private ServerBootstrap getServerBootstrap(final boolean useSSL) {
final CommandInvoker invoker = new CommandInvoker(pluginRepository, commandRepository, acceptParams, getExecutionContext());
final ServerBootstrap serverBootstrap = new ServerBootstrap();
serverBootstrap.group(bossGroup, worker... | java | private ServerBootstrap getServerBootstrap(final boolean useSSL) {
final CommandInvoker invoker = new CommandInvoker(pluginRepository, commandRepository, acceptParams, getExecutionContext());
final ServerBootstrap serverBootstrap = new ServerBootstrap();
serverBootstrap.group(bossGroup, worker... | [
"private",
"ServerBootstrap",
"getServerBootstrap",
"(",
"final",
"boolean",
"useSSL",
")",
"{",
"final",
"CommandInvoker",
"invoker",
"=",
"new",
"CommandInvoker",
"(",
"pluginRepository",
",",
"commandRepository",
",",
"acceptParams",
",",
"getExecutionContext",
"(",
... | Creates and returns a configured NETTY ServerBootstrap object.
@param useSSL
<code>true</code> if SSL must be used.
@return the server bootstrap object | [
"Creates",
"and",
"returns",
"a",
"configured",
"NETTY",
"ServerBootstrap",
"object",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-lib/src/main/java/it/jnrpe/JNRPE.java#L325-L352 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/api/SoySauceBuilder.java | SoySauceBuilder.readDelTemplatesFromMetaInf | private static ImmutableSet<String> readDelTemplatesFromMetaInf(ClassLoader loader) {
try {
ImmutableSet.Builder<String> builder = ImmutableSet.builder();
Enumeration<URL> resources = loader.getResources(Names.META_INF_DELTEMPLATE_PATH);
while (resources.hasMoreElements()) {
URL url = reso... | java | private static ImmutableSet<String> readDelTemplatesFromMetaInf(ClassLoader loader) {
try {
ImmutableSet.Builder<String> builder = ImmutableSet.builder();
Enumeration<URL> resources = loader.getResources(Names.META_INF_DELTEMPLATE_PATH);
while (resources.hasMoreElements()) {
URL url = reso... | [
"private",
"static",
"ImmutableSet",
"<",
"String",
">",
"readDelTemplatesFromMetaInf",
"(",
"ClassLoader",
"loader",
")",
"{",
"try",
"{",
"ImmutableSet",
".",
"Builder",
"<",
"String",
">",
"builder",
"=",
"ImmutableSet",
".",
"builder",
"(",
")",
";",
"Enum... | Walks all resources with the META_INF_DELTEMPLATE_PATH and collects the deltemplates. | [
"Walks",
"all",
"resources",
"with",
"the",
"META_INF_DELTEMPLATE_PATH",
"and",
"collects",
"the",
"deltemplates",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/api/SoySauceBuilder.java#L116-L133 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/alm/ProjectAlmBindingDao.java | ProjectAlmBindingDao.selectByRepoIds | public List<ProjectAlmBindingDto> selectByRepoIds(final DbSession session, ALM alm, Collection<String> repoIds) {
return executeLargeInputs(repoIds, partitionedIds -> getMapper(session).selectByRepoIds(alm.getId(), partitionedIds));
} | java | public List<ProjectAlmBindingDto> selectByRepoIds(final DbSession session, ALM alm, Collection<String> repoIds) {
return executeLargeInputs(repoIds, partitionedIds -> getMapper(session).selectByRepoIds(alm.getId(), partitionedIds));
} | [
"public",
"List",
"<",
"ProjectAlmBindingDto",
">",
"selectByRepoIds",
"(",
"final",
"DbSession",
"session",
",",
"ALM",
"alm",
",",
"Collection",
"<",
"String",
">",
"repoIds",
")",
"{",
"return",
"executeLargeInputs",
"(",
"repoIds",
",",
"partitionedIds",
"->... | Gets a list of bindings by their repo_id. The result does NOT contain {@code null} values for bindings not found, so
the size of result may be less than the number of ids.
<p>Results may be in a different order as input ids.</p> | [
"Gets",
"a",
"list",
"of",
"bindings",
"by",
"their",
"repo_id",
".",
"The",
"result",
"does",
"NOT",
"contain",
"{"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/alm/ProjectAlmBindingDao.java#L69-L71 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/ChannelsResponse.java | ChannelsResponse.withChannels | public ChannelsResponse withChannels(java.util.Map<String, ChannelResponse> channels) {
setChannels(channels);
return this;
} | java | public ChannelsResponse withChannels(java.util.Map<String, ChannelResponse> channels) {
setChannels(channels);
return this;
} | [
"public",
"ChannelsResponse",
"withChannels",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"ChannelResponse",
">",
"channels",
")",
"{",
"setChannels",
"(",
"channels",
")",
";",
"return",
"this",
";",
"}"
] | A map of channels, with the ChannelType as the key and the Channel as the value.
@param channels
A map of channels, with the ChannelType as the key and the Channel as the value.
@return Returns a reference to this object so that method calls can be chained together. | [
"A",
"map",
"of",
"channels",
"with",
"the",
"ChannelType",
"as",
"the",
"key",
"and",
"the",
"Channel",
"as",
"the",
"value",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/ChannelsResponse.java#L61-L64 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsHibernateUtil.java | GrailsHibernateUtil.addOrderPossiblyNested | private static void addOrderPossiblyNested(AbstractHibernateDatastore datastore, Criteria c, Class<?> targetClass, String sort, String order, boolean ignoreCase) {
int firstDotPos = sort.indexOf(".");
if (firstDotPos == -1) {
addOrder(c, sort, order, ignoreCase);
} else { // nested p... | java | private static void addOrderPossiblyNested(AbstractHibernateDatastore datastore, Criteria c, Class<?> targetClass, String sort, String order, boolean ignoreCase) {
int firstDotPos = sort.indexOf(".");
if (firstDotPos == -1) {
addOrder(c, sort, order, ignoreCase);
} else { // nested p... | [
"private",
"static",
"void",
"addOrderPossiblyNested",
"(",
"AbstractHibernateDatastore",
"datastore",
",",
"Criteria",
"c",
",",
"Class",
"<",
"?",
">",
"targetClass",
",",
"String",
"sort",
",",
"String",
"order",
",",
"boolean",
"ignoreCase",
")",
"{",
"int",... | Add order to criteria, creating necessary subCriteria if nested sort property (ie. sort:'nested.property'). | [
"Add",
"order",
"to",
"criteria",
"creating",
"necessary",
"subCriteria",
"if",
"nested",
"sort",
"property",
"(",
"ie",
".",
"sort",
":",
"nested",
".",
"property",
")",
"."
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsHibernateUtil.java#L206-L224 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java | InternalService.getConversations | @Deprecated
public Observable<ComapiResult<List<ConversationDetails>>> getConversations(@NonNull final Scope scope) {
final String token = getToken();
if (sessionController.isCreatingSession()) {
return getTaskQueue().queueGetConversations(scope);
} else if (TextUtils.isEmpty(t... | java | @Deprecated
public Observable<ComapiResult<List<ConversationDetails>>> getConversations(@NonNull final Scope scope) {
final String token = getToken();
if (sessionController.isCreatingSession()) {
return getTaskQueue().queueGetConversations(scope);
} else if (TextUtils.isEmpty(t... | [
"@",
"Deprecated",
"public",
"Observable",
"<",
"ComapiResult",
"<",
"List",
"<",
"ConversationDetails",
">",
">",
">",
"getConversations",
"(",
"@",
"NonNull",
"final",
"Scope",
"scope",
")",
"{",
"final",
"String",
"token",
"=",
"getToken",
"(",
")",
";",
... | Returns observable to get all visible conversations.
@param scope {@link Scope} of the query
@return Observable to to create a conversation.
@deprecated Please use {@link InternalService#getConversations(boolean)} instead. | [
"Returns",
"observable",
"to",
"get",
"all",
"visible",
"conversations",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L504-L523 |
belaban/JGroups | src/org/jgroups/jmx/ResourceDMBean.java | ResourceDMBean.findGetter | protected static Accessor findGetter(Object target, String attr_name) {
final String name=Util.attributeNameToMethodName(attr_name);
Class<?> clazz=target.getClass();
Method method=Util.findMethod(target, Arrays.asList("get" + name, "is" + name, toLowerCase(name)));
if(method != null ... | java | protected static Accessor findGetter(Object target, String attr_name) {
final String name=Util.attributeNameToMethodName(attr_name);
Class<?> clazz=target.getClass();
Method method=Util.findMethod(target, Arrays.asList("get" + name, "is" + name, toLowerCase(name)));
if(method != null ... | [
"protected",
"static",
"Accessor",
"findGetter",
"(",
"Object",
"target",
",",
"String",
"attr_name",
")",
"{",
"final",
"String",
"name",
"=",
"Util",
".",
"attributeNameToMethodName",
"(",
"attr_name",
")",
";",
"Class",
"<",
"?",
">",
"clazz",
"=",
"targe... | Finds an accessor for an attribute. Tries to find getAttrName(), isAttrName(), attrName() methods. If not
found, tries to use reflection to get the value of attr_name. If still not found, creates a NullAccessor. | [
"Finds",
"an",
"accessor",
"for",
"an",
"attribute",
".",
"Tries",
"to",
"find",
"getAttrName",
"()",
"isAttrName",
"()",
"attrName",
"()",
"methods",
".",
"If",
"not",
"found",
"tries",
"to",
"use",
"reflection",
"to",
"get",
"the",
"value",
"of",
"attr_n... | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/jmx/ResourceDMBean.java#L334-L349 |
HubSpot/Singularity | SingularityExecutor/src/main/java/com/hubspot/singularity/executor/SingularityExecutor.java | SingularityExecutor.launchTask | @Override
public void launchTask(final ExecutorDriver executorDriver, final Protos.TaskInfo taskInfo) {
final String taskId = taskInfo.getTaskId().getValue();
LOG.info("Asked to launch task {}", taskId);
try {
final ch.qos.logback.classic.Logger taskLog = taskBuilder.buildTaskLogger(taskId, taskIn... | java | @Override
public void launchTask(final ExecutorDriver executorDriver, final Protos.TaskInfo taskInfo) {
final String taskId = taskInfo.getTaskId().getValue();
LOG.info("Asked to launch task {}", taskId);
try {
final ch.qos.logback.classic.Logger taskLog = taskBuilder.buildTaskLogger(taskId, taskIn... | [
"@",
"Override",
"public",
"void",
"launchTask",
"(",
"final",
"ExecutorDriver",
"executorDriver",
",",
"final",
"Protos",
".",
"TaskInfo",
"taskInfo",
")",
"{",
"final",
"String",
"taskId",
"=",
"taskInfo",
".",
"getTaskId",
"(",
")",
".",
"getValue",
"(",
... | Invoked when a task has been launched on this executor (initiated
via Scheduler::launchTasks). Note that this task can be realized
with a thread, a process, or some simple computation, however, no
other callbacks will be invoked on this executor until this
callback has returned. | [
"Invoked",
"when",
"a",
"task",
"has",
"been",
"launched",
"on",
"this",
"executor",
"(",
"initiated",
"via",
"Scheduler",
"::",
"launchTasks",
")",
".",
"Note",
"that",
"this",
"task",
"can",
"be",
"realized",
"with",
"a",
"thread",
"a",
"process",
"or",
... | train | https://github.com/HubSpot/Singularity/blob/384a8c16a10aa076af5ca45c8dfcedab9e5122c8/SingularityExecutor/src/main/java/com/hubspot/singularity/executor/SingularityExecutor.java#L73-L102 |
jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java | StandardCache.cleanup | public long cleanup() {
int garbageSize = 0;
if (isCachingEnabled()) {
System.out.println(new LogEntry(Level.VERBOSE, "Identifying expired objects"));
ArrayList<K> garbage = getExpiredObjects();
garbageSize = garbage.size();
System.out.println(new LogEntry("cache cleanup: expired objects: " + garbageSiz... | java | public long cleanup() {
int garbageSize = 0;
if (isCachingEnabled()) {
System.out.println(new LogEntry(Level.VERBOSE, "Identifying expired objects"));
ArrayList<K> garbage = getExpiredObjects();
garbageSize = garbage.size();
System.out.println(new LogEntry("cache cleanup: expired objects: " + garbageSiz... | [
"public",
"long",
"cleanup",
"(",
")",
"{",
"int",
"garbageSize",
"=",
"0",
";",
"if",
"(",
"isCachingEnabled",
"(",
")",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"new",
"LogEntry",
"(",
"Level",
".",
"VERBOSE",
",",
"\"Identifying expired ob... | Removes all expired objects.
@return the number of removed objects. | [
"Removes",
"all",
"expired",
"objects",
"."
] | train | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java#L320-L332 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/samediff/SDLayerParams.java | SDLayerParams.addBiasParam | public void addBiasParam(@NonNull String paramKey, @NonNull long... paramShape) {
Preconditions.checkArgument(paramShape.length > 0, "Provided mia- parameter shape is"
+ " invalid: length 0 provided for shape. Parameter: " + paramKey);
biasParams.put(paramKey, paramShape);
... | java | public void addBiasParam(@NonNull String paramKey, @NonNull long... paramShape) {
Preconditions.checkArgument(paramShape.length > 0, "Provided mia- parameter shape is"
+ " invalid: length 0 provided for shape. Parameter: " + paramKey);
biasParams.put(paramKey, paramShape);
... | [
"public",
"void",
"addBiasParam",
"(",
"@",
"NonNull",
"String",
"paramKey",
",",
"@",
"NonNull",
"long",
"...",
"paramShape",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"paramShape",
".",
"length",
">",
"0",
",",
"\"Provided mia- parameter shape is\"",... | Add a bias parameter to the layer, with the specified shape. For example, a standard fully connected layer
could have bias parameters with shape [1, layerSize]
@param paramKey The parameter key (name) for the bias parameter
@param paramShape Shape of the bias parameter array | [
"Add",
"a",
"bias",
"parameter",
"to",
"the",
"layer",
"with",
"the",
"specified",
"shape",
".",
"For",
"example",
"a",
"standard",
"fully",
"connected",
"layer",
"could",
"have",
"bias",
"parameters",
"with",
"shape",
"[",
"1",
"layerSize",
"]"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/samediff/SDLayerParams.java#L81-L88 |
elki-project/elki | addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/layout/AbstractLayout3DPC.java | AbstractLayout3DPC.buildSpanningTree | protected N buildSpanningTree(int dim, double[] mat, Layout layout) {
assert (layout.edges == null || layout.edges.size() == 0);
int[] iedges = PrimsMinimumSpanningTree.processDense(mat, new LowerTriangularAdapter(dim));
int root = findOptimalRoot(iedges);
// Convert edges:
ArrayList<Edge> edges = ... | java | protected N buildSpanningTree(int dim, double[] mat, Layout layout) {
assert (layout.edges == null || layout.edges.size() == 0);
int[] iedges = PrimsMinimumSpanningTree.processDense(mat, new LowerTriangularAdapter(dim));
int root = findOptimalRoot(iedges);
// Convert edges:
ArrayList<Edge> edges = ... | [
"protected",
"N",
"buildSpanningTree",
"(",
"int",
"dim",
",",
"double",
"[",
"]",
"mat",
",",
"Layout",
"layout",
")",
"{",
"assert",
"(",
"layout",
".",
"edges",
"==",
"null",
"||",
"layout",
".",
"edges",
".",
"size",
"(",
")",
"==",
"0",
")",
"... | Build the minimum spanning tree.
@param mat Similarity matrix
@param layout Layout to write to
@return Root node id | [
"Build",
"the",
"minimum",
"spanning",
"tree",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/layout/AbstractLayout3DPC.java#L133-L154 |
alkacon/opencms-core | src/org/opencms/xml/A_CmsXmlDocument.java | A_CmsXmlDocument.getBookmarkName | protected static final String getBookmarkName(String name, Locale locale) {
StringBuffer result = new StringBuffer(64);
result.append('/');
result.append(locale.toString());
result.append('/');
result.append(name);
return result.toString();
} | java | protected static final String getBookmarkName(String name, Locale locale) {
StringBuffer result = new StringBuffer(64);
result.append('/');
result.append(locale.toString());
result.append('/');
result.append(name);
return result.toString();
} | [
"protected",
"static",
"final",
"String",
"getBookmarkName",
"(",
"String",
"name",
",",
"Locale",
"locale",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"64",
")",
";",
"result",
".",
"append",
"(",
"'",
"'",
")",
";",
"result",
... | Creates the bookmark name for a localized element to be used in the bookmark lookup table.<p>
@param name the element name
@param locale the element locale
@return the bookmark name for a localized element | [
"Creates",
"the",
"bookmark",
"name",
"for",
"a",
"localized",
"element",
"to",
"be",
"used",
"in",
"the",
"bookmark",
"lookup",
"table",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/A_CmsXmlDocument.java#L108-L116 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/cache/ObjectCacheJCSPerClassImpl.java | ObjectCacheJCSPerClassImpl.getCachePerClass | private ObjectCache getCachePerClass(Class objectClass, int methodCall)
{
ObjectCache cache = (ObjectCache) cachesByClass.get(objectClass.getName());
if (cache == null && methodCall == AbstractMetaCache.METHOD_CACHE)
{
/**
* the cache wasn't found, and the cach... | java | private ObjectCache getCachePerClass(Class objectClass, int methodCall)
{
ObjectCache cache = (ObjectCache) cachesByClass.get(objectClass.getName());
if (cache == null && methodCall == AbstractMetaCache.METHOD_CACHE)
{
/**
* the cache wasn't found, and the cach... | [
"private",
"ObjectCache",
"getCachePerClass",
"(",
"Class",
"objectClass",
",",
"int",
"methodCall",
")",
"{",
"ObjectCache",
"cache",
"=",
"(",
"ObjectCache",
")",
"cachesByClass",
".",
"get",
"(",
"objectClass",
".",
"getName",
"(",
")",
")",
";",
"if",
"(... | Gets the cache for the given class
@param objectClass The class to look up the cache for
@return The cache | [
"Gets",
"the",
"cache",
"for",
"the",
"given",
"class"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/cache/ObjectCacheJCSPerClassImpl.java#L108-L121 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/exception/ContextedException.java | ContextedException.setContextValue | @Override
public ContextedException setContextValue(final String label, final Object value) {
exceptionContext.setContextValue(label, value);
return this;
} | java | @Override
public ContextedException setContextValue(final String label, final Object value) {
exceptionContext.setContextValue(label, value);
return this;
} | [
"@",
"Override",
"public",
"ContextedException",
"setContextValue",
"(",
"final",
"String",
"label",
",",
"final",
"Object",
"value",
")",
"{",
"exceptionContext",
".",
"setContextValue",
"(",
"label",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Sets information helpful to a developer in diagnosing and correcting the problem.
For the information to be meaningful, the value passed should have a reasonable
toString() implementation.
Any existing values with the same labels are removed before the new one is added.
<p>
Note: This exception is only serializable if ... | [
"Sets",
"information",
"helpful",
"to",
"a",
"developer",
"in",
"diagnosing",
"and",
"correcting",
"the",
"problem",
".",
"For",
"the",
"information",
"to",
"be",
"meaningful",
"the",
"value",
"passed",
"should",
"have",
"a",
"reasonable",
"toString",
"()",
"i... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/exception/ContextedException.java#L191-L195 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/query/Criteria.java | Criteria.sloppy | public Criteria sloppy(String phrase, int distance) {
if (distance <= 0) {
throw new InvalidDataAccessApiUsageException("Slop distance has to be greater than 0.");
}
if (!StringUtils.contains(phrase, CRITERIA_VALUE_SEPERATOR)) {
throw new InvalidDataAccessApiUsageException("Phrase must consist of multiple ... | java | public Criteria sloppy(String phrase, int distance) {
if (distance <= 0) {
throw new InvalidDataAccessApiUsageException("Slop distance has to be greater than 0.");
}
if (!StringUtils.contains(phrase, CRITERIA_VALUE_SEPERATOR)) {
throw new InvalidDataAccessApiUsageException("Phrase must consist of multiple ... | [
"public",
"Criteria",
"sloppy",
"(",
"String",
"phrase",
",",
"int",
"distance",
")",
"{",
"if",
"(",
"distance",
"<=",
"0",
")",
"{",
"throw",
"new",
"InvalidDataAccessApiUsageException",
"(",
"\"Slop distance has to be greater than 0.\"",
")",
";",
"}",
"if",
... | Crates new {@link Predicate} with trailing {@code ~} followed by distance
@param phrase
@param distance
@return | [
"Crates",
"new",
"{",
"@link",
"Predicate",
"}",
"with",
"trailing",
"{",
"@code",
"~",
"}",
"followed",
"by",
"distance"
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/query/Criteria.java#L356-L367 |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java | AbstractUserAgentStringParser.examineAsBrowser | private static void examineAsBrowser(final UserAgent.Builder builder, final Data data) {
Matcher matcher;
VersionNumber version = VersionNumber.UNKNOWN;
for (final Entry<BrowserPattern, Browser> entry : data.getPatternToBrowserMap().entrySet()) {
matcher = entry.getKey().getPattern().matcher(builder.getUserAge... | java | private static void examineAsBrowser(final UserAgent.Builder builder, final Data data) {
Matcher matcher;
VersionNumber version = VersionNumber.UNKNOWN;
for (final Entry<BrowserPattern, Browser> entry : data.getPatternToBrowserMap().entrySet()) {
matcher = entry.getKey().getPattern().matcher(builder.getUserAge... | [
"private",
"static",
"void",
"examineAsBrowser",
"(",
"final",
"UserAgent",
".",
"Builder",
"builder",
",",
"final",
"Data",
"data",
")",
"{",
"Matcher",
"matcher",
";",
"VersionNumber",
"version",
"=",
"VersionNumber",
".",
"UNKNOWN",
";",
"for",
"(",
"final"... | Examines the user agent string whether it is a browser.
@param userAgent
String of an user agent
@param builder
Builder for an user agent information | [
"Examines",
"the",
"user",
"agent",
"string",
"whether",
"it",
"is",
"a",
"browser",
"."
] | train | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java#L54-L72 |
adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java | OptionsUtil.getPointWithWickedChartsId | public static Point getPointWithWickedChartsId(final Options options, final int wickedChartsId) {
for (Series<?> series : options.getSeries()) {
for (Object object : series.getData()) {
if (!(object instanceof Point)) {
break;
} else {
... | java | public static Point getPointWithWickedChartsId(final Options options, final int wickedChartsId) {
for (Series<?> series : options.getSeries()) {
for (Object object : series.getData()) {
if (!(object instanceof Point)) {
break;
} else {
... | [
"public",
"static",
"Point",
"getPointWithWickedChartsId",
"(",
"final",
"Options",
"options",
",",
"final",
"int",
"wickedChartsId",
")",
"{",
"for",
"(",
"Series",
"<",
"?",
">",
"series",
":",
"options",
".",
"getSeries",
"(",
")",
")",
"{",
"for",
"(",... | Retrieves the {@link Point} object with the given wickedChartsId from the
given {@link Options} object. Returns null if a Point with the given ID
does not exist.
@param options Chartoptions
@param wickedChartsId corresponding ID
@return Point object | [
"Retrieves",
"the",
"{",
"@link",
"Point",
"}",
"object",
"with",
"the",
"given",
"wickedChartsId",
"from",
"the",
"given",
"{",
"@link",
"Options",
"}",
"object",
".",
"Returns",
"null",
"if",
"a",
"Point",
"with",
"the",
"given",
"ID",
"does",
"not",
"... | train | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java#L193-L207 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringConverter.java | StringConverter.unicodeStringToString | public static String unicodeStringToString(String s) {
if ((s == null) || (s.indexOf("\\u") == -1)) {
return s;
}
int len = s.length();
char[] b = new char[len];
int j = 0;
for (int i = 0; i < len; i++) {
char c = s.charAt(i);
... | java | public static String unicodeStringToString(String s) {
if ((s == null) || (s.indexOf("\\u") == -1)) {
return s;
}
int len = s.length();
char[] b = new char[len];
int j = 0;
for (int i = 0; i < len; i++) {
char c = s.charAt(i);
... | [
"public",
"static",
"String",
"unicodeStringToString",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"(",
"s",
"==",
"null",
")",
"||",
"(",
"s",
".",
"indexOf",
"(",
"\"\\\\u\"",
")",
"==",
"-",
"1",
")",
")",
"{",
"return",
"s",
";",
"}",
"int",
"le... | Hsqldb specific decoding used only for log files. This method converts
the 7 bit escaped ASCII strings in a log file back into Java Unicode
strings. See stringToUnicodeBytes() above. <p>
Method based on Hypersonic Code
@param s encoded ASCII string in byte array
@return Java string | [
"Hsqldb",
"specific",
"decoding",
"used",
"only",
"for",
"log",
"files",
".",
"This",
"method",
"converts",
"the",
"7",
"bit",
"escaped",
"ASCII",
"strings",
"in",
"a",
"log",
"file",
"back",
"into",
"Java",
"Unicode",
"strings",
".",
"See",
"stringToUnicode... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringConverter.java#L434-L469 |
wcm-io/wcm-io-caconfig | extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PersistenceUtils.java | PersistenceUtils.ensurePageIfNotContainingPage | public static Resource ensurePageIfNotContainingPage(ResourceResolver resolver, String pagePath,
String resourceType, ConfigurationManagementSettings configurationManagementSettings) {
Matcher matcher = PAGE_PATH_PATTERN.matcher(pagePath);
if (matcher.matches()) {
// ensure that shorted path part th... | java | public static Resource ensurePageIfNotContainingPage(ResourceResolver resolver, String pagePath,
String resourceType, ConfigurationManagementSettings configurationManagementSettings) {
Matcher matcher = PAGE_PATH_PATTERN.matcher(pagePath);
if (matcher.matches()) {
// ensure that shorted path part th... | [
"public",
"static",
"Resource",
"ensurePageIfNotContainingPage",
"(",
"ResourceResolver",
"resolver",
",",
"String",
"pagePath",
",",
"String",
"resourceType",
",",
"ConfigurationManagementSettings",
"configurationManagementSettings",
")",
"{",
"Matcher",
"matcher",
"=",
"P... | Ensure that a page at the given path exists, if the path is not already contained in a page.
@param resolver Resource resolver
@param pagePath Page path
@param resourceType Resource type for page (if not template is set)
@param configurationManagementSettings Configuration management settings
@return Resource for AEM p... | [
"Ensure",
"that",
"a",
"page",
"at",
"the",
"given",
"path",
"exists",
"if",
"the",
"path",
"is",
"not",
"already",
"contained",
"in",
"a",
"page",
"."
] | train | https://github.com/wcm-io/wcm-io-caconfig/blob/48592eadb0b62a09eec555cedfae7e00b213f6ed/extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PersistenceUtils.java#L118-L128 |
jbehave/jbehave-core | jbehave-core/src/main/java/org/jbehave/core/embedder/MetaFilter.java | MetaFilter.createMetaMatcher | protected MetaMatcher createMetaMatcher(String filterAsString, Map<String, MetaMatcher> metaMatchers) {
for ( String key : metaMatchers.keySet() ){
if ( filterAsString.startsWith(key)){
return metaMatchers.get(key);
}
}
if (filterAsString.startsWith(GROOVY)) {
return new... | java | protected MetaMatcher createMetaMatcher(String filterAsString, Map<String, MetaMatcher> metaMatchers) {
for ( String key : metaMatchers.keySet() ){
if ( filterAsString.startsWith(key)){
return metaMatchers.get(key);
}
}
if (filterAsString.startsWith(GROOVY)) {
return new... | [
"protected",
"MetaMatcher",
"createMetaMatcher",
"(",
"String",
"filterAsString",
",",
"Map",
"<",
"String",
",",
"MetaMatcher",
">",
"metaMatchers",
")",
"{",
"for",
"(",
"String",
"key",
":",
"metaMatchers",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
... | Creates a MetaMatcher based on the filter content.
@param filterAsString the String representation of the filter
@param metaMatchers the Map of custom MetaMatchers
@return A MetaMatcher used to match the filter content | [
"Creates",
"a",
"MetaMatcher",
"based",
"on",
"the",
"filter",
"content",
"."
] | train | https://github.com/jbehave/jbehave-core/blob/bdd6a6199528df3c35087e72d4644870655b23e6/jbehave-core/src/main/java/org/jbehave/core/embedder/MetaFilter.java#L112-L122 |
twilliamson/mogwee-logging | src/main/java/com/mogwee/logging/Logger.java | Logger.warnf | public final void warnf(String message, Object... args)
{
logf(Level.WARN, null, message, args);
} | java | public final void warnf(String message, Object... args)
{
logf(Level.WARN, null, message, args);
} | [
"public",
"final",
"void",
"warnf",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"logf",
"(",
"Level",
".",
"WARN",
",",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Logs a formatted message if WARN logging is enabled.
@param message a <a href="http://download.oracle.com/javase/6/docs/api/java/util/Formatter.html#syntax">format string</a>
@param args arguments referenced by the format specifiers in the format string. | [
"Logs",
"a",
"formatted",
"message",
"if",
"WARN",
"logging",
"is",
"enabled",
"."
] | train | https://github.com/twilliamson/mogwee-logging/blob/30b99c2649de455432d956a8f6a74316de4cd62c/src/main/java/com/mogwee/logging/Logger.java#L213-L216 |
stratosphere/stratosphere | stratosphere-addons/spargel/src/main/java/eu/stratosphere/spargel/java/VertexCentricIteration.java | VertexCentricIteration.addBroadcastSetForMessagingFunction | public void addBroadcastSetForMessagingFunction(String name, DataSet<?> data) {
this.bcVarsMessaging.add(new Tuple2<String, DataSet<?>>(name, data));
} | java | public void addBroadcastSetForMessagingFunction(String name, DataSet<?> data) {
this.bcVarsMessaging.add(new Tuple2<String, DataSet<?>>(name, data));
} | [
"public",
"void",
"addBroadcastSetForMessagingFunction",
"(",
"String",
"name",
",",
"DataSet",
"<",
"?",
">",
"data",
")",
"{",
"this",
".",
"bcVarsMessaging",
".",
"add",
"(",
"new",
"Tuple2",
"<",
"String",
",",
"DataSet",
"<",
"?",
">",
">",
"(",
"na... | Adds a data set as a broadcast set to the messaging function.
@param name The name under which the broadcast data is available in the messaging function.
@param data The data set to be broadcasted. | [
"Adds",
"a",
"data",
"set",
"as",
"a",
"broadcast",
"set",
"to",
"the",
"messaging",
"function",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-addons/spargel/src/main/java/eu/stratosphere/spargel/java/VertexCentricIteration.java#L180-L182 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java | SparkComputationGraph.doEvaluation | public IEvaluation[] doEvaluation(JavaRDD<String> data, int evalNumWorkers, int evalBatchSize, DataSetLoader loader, IEvaluation... emptyEvaluations) {
return doEvaluation(data, evalNumWorkers, evalBatchSize, loader, null, emptyEvaluations);
} | java | public IEvaluation[] doEvaluation(JavaRDD<String> data, int evalNumWorkers, int evalBatchSize, DataSetLoader loader, IEvaluation... emptyEvaluations) {
return doEvaluation(data, evalNumWorkers, evalBatchSize, loader, null, emptyEvaluations);
} | [
"public",
"IEvaluation",
"[",
"]",
"doEvaluation",
"(",
"JavaRDD",
"<",
"String",
">",
"data",
",",
"int",
"evalNumWorkers",
",",
"int",
"evalBatchSize",
",",
"DataSetLoader",
"loader",
",",
"IEvaluation",
"...",
"emptyEvaluations",
")",
"{",
"return",
"doEvalua... | Perform evaluation on serialized DataSet objects on disk, (potentially in any format), that are loaded using an {@link DataSetLoader}.
@param data List of paths to the data (that can be loaded as / converted to DataSets)
@param evalNumWorkers Number of workers to perform evaluation with. To reduce memory ... | [
"Perform",
"evaluation",
"on",
"serialized",
"DataSet",
"objects",
"on",
"disk",
"(",
"potentially",
"in",
"any",
"format",
")",
"that",
"are",
"loaded",
"using",
"an",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java#L881-L883 |
eclipse/xtext-extras | org.eclipse.xtext.generator/xtend-gen/org/eclipse/xtext/generator/grammarAccess/GrammarAccess.java | GrammarAccess.toJavaIdentifier | public String toJavaIdentifier(final String text, final boolean uppercaseFirst) {
return GrammarAccessUtil.toJavaIdentifier(text, Boolean.valueOf(uppercaseFirst));
} | java | public String toJavaIdentifier(final String text, final boolean uppercaseFirst) {
return GrammarAccessUtil.toJavaIdentifier(text, Boolean.valueOf(uppercaseFirst));
} | [
"public",
"String",
"toJavaIdentifier",
"(",
"final",
"String",
"text",
",",
"final",
"boolean",
"uppercaseFirst",
")",
"{",
"return",
"GrammarAccessUtil",
".",
"toJavaIdentifier",
"(",
"text",
",",
"Boolean",
".",
"valueOf",
"(",
"uppercaseFirst",
")",
")",
";"... | Converts an arbitary string to a valid Java identifier.
The string is split up along the the characters that are not valid as Java
identifier. The first character of each segments is made upper case which
leads to a camel-case style.
@param text the string
@param uppercaseFirst whether the first character of the return... | [
"Converts",
"an",
"arbitary",
"string",
"to",
"a",
"valid",
"Java",
"identifier",
".",
"The",
"string",
"is",
"split",
"up",
"along",
"the",
"the",
"characters",
"that",
"are",
"not",
"valid",
"as",
"Java",
"identifier",
".",
"The",
"first",
"character",
"... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.generator/xtend-gen/org/eclipse/xtext/generator/grammarAccess/GrammarAccess.java#L46-L48 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_rma_id_GET | public OvhRma serviceName_rma_id_GET(String serviceName, String id) throws IOException {
String qPath = "/xdsl/{serviceName}/rma/{id}";
StringBuilder sb = path(qPath, serviceName, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhRma.class);
} | java | public OvhRma serviceName_rma_id_GET(String serviceName, String id) throws IOException {
String qPath = "/xdsl/{serviceName}/rma/{id}";
StringBuilder sb = path(qPath, serviceName, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhRma.class);
} | [
"public",
"OvhRma",
"serviceName_rma_id_GET",
"(",
"String",
"serviceName",
",",
"String",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/{serviceName}/rma/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"serviceName",... | Get this object properties
REST: GET /xdsl/{serviceName}/rma/{id}
@param serviceName [required] The internal name of your XDSL offer
@param id [required] Return merchandise authorisation identifier | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1790-L1795 |
Whiley/WhileyCompiler | src/main/java/wyil/util/AbstractTypedVisitor.java | AbstractTypedVisitor.isDerivation | public boolean isDerivation(Type parent, Type child) {
if (child.equals(parent)) {
return true;
} else if (child instanceof Type.Nominal) {
Type.Nominal t = (Type.Nominal) child;
Decl.Type decl = t.getLink().getTarget();
return isDerivation(parent, decl.getType());
} else {
return false;
}
} | java | public boolean isDerivation(Type parent, Type child) {
if (child.equals(parent)) {
return true;
} else if (child instanceof Type.Nominal) {
Type.Nominal t = (Type.Nominal) child;
Decl.Type decl = t.getLink().getTarget();
return isDerivation(parent, decl.getType());
} else {
return false;
}
} | [
"public",
"boolean",
"isDerivation",
"(",
"Type",
"parent",
",",
"Type",
"child",
")",
"{",
"if",
"(",
"child",
".",
"equals",
"(",
"parent",
")",
")",
"{",
"return",
"true",
";",
"}",
"else",
"if",
"(",
"child",
"instanceof",
"Type",
".",
"Nominal",
... | Check whether one type is a derivation of another. For example, in this
scenario:
<pre>
type parent is (int p) where ...
type child is (parent c) where ...
</pre>
@param parent
The type being derived to
@param child
The type we are trying to derive
@return | [
"Check",
"whether",
"one",
"type",
"is",
"a",
"derivation",
"of",
"another",
".",
"For",
"example",
"in",
"this",
"scenario",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/util/AbstractTypedVisitor.java#L1297-L1307 |
cdapio/tigon | tigon-yarn/src/main/java/co/cask/tigon/internal/io/DatumWriterGenerator.java | DatumWriterGenerator.encodeUnion | private void encodeUnion(GeneratorAdapter mg, TypeToken<?> outputType, Schema schema,
int value, int encoder, int schemaLocal, int seenRefs) {
Label nullLabel = mg.newLabel();
Label endLabel = mg.newLabel();
mg.loadArg(value);
mg.ifNull(nullLabel);
// Not null, write out ... | java | private void encodeUnion(GeneratorAdapter mg, TypeToken<?> outputType, Schema schema,
int value, int encoder, int schemaLocal, int seenRefs) {
Label nullLabel = mg.newLabel();
Label endLabel = mg.newLabel();
mg.loadArg(value);
mg.ifNull(nullLabel);
// Not null, write out ... | [
"private",
"void",
"encodeUnion",
"(",
"GeneratorAdapter",
"mg",
",",
"TypeToken",
"<",
"?",
">",
"outputType",
",",
"Schema",
"schema",
",",
"int",
"value",
",",
"int",
"encoder",
",",
"int",
"schemaLocal",
",",
"int",
"seenRefs",
")",
"{",
"Label",
"null... | Generates method body for encoding union schema. Union schema is used for representing object references that
could be {@code null}.
@param mg
@param outputType
@param schema
@param value
@param encoder
@param schemaLocal
@param seenRefs | [
"Generates",
"method",
"body",
"for",
"encoding",
"union",
"schema",
".",
"Union",
"schema",
"is",
"used",
"for",
"representing",
"object",
"references",
"that",
"could",
"be",
"{"
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-yarn/src/main/java/co/cask/tigon/internal/io/DatumWriterGenerator.java#L805-L831 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java | DomHelper.moveElement | public boolean moveElement(String name, Object sourceParent, Object targetParent) {
Element sourceGroup = null;
Element targetGroup = null;
Element element = null;
if (sourceParent != null) {
sourceGroup = getGroup(sourceParent);
element = getElement(sourceParent, name);
}
if (targetParent != null) {
... | java | public boolean moveElement(String name, Object sourceParent, Object targetParent) {
Element sourceGroup = null;
Element targetGroup = null;
Element element = null;
if (sourceParent != null) {
sourceGroup = getGroup(sourceParent);
element = getElement(sourceParent, name);
}
if (targetParent != null) {
... | [
"public",
"boolean",
"moveElement",
"(",
"String",
"name",
",",
"Object",
"sourceParent",
",",
"Object",
"targetParent",
")",
"{",
"Element",
"sourceGroup",
"=",
"null",
";",
"Element",
"targetGroup",
"=",
"null",
";",
"Element",
"element",
"=",
"null",
";",
... | Move an element from on group to another. The elements name will remain the same.
@param name
The name of the element within the sourceParent group.
@param sourceParent
The original parent group of the element.
@param targetParent
The target parent group for the element.
@return true when move was successful | [
"Move",
"an",
"element",
"from",
"on",
"group",
"to",
"another",
".",
"The",
"elements",
"name",
"will",
"remain",
"the",
"same",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java#L284-L308 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/Server.java | Server.addWebApplications | public WebApplicationContext[] addWebApplications(String host,
String webapps,
String defaults,
boolean extract)
throws IOException
{
retu... | java | public WebApplicationContext[] addWebApplications(String host,
String webapps,
String defaults,
boolean extract)
throws IOException
{
retu... | [
"public",
"WebApplicationContext",
"[",
"]",
"addWebApplications",
"(",
"String",
"host",
",",
"String",
"webapps",
",",
"String",
"defaults",
",",
"boolean",
"extract",
")",
"throws",
"IOException",
"{",
"return",
"addWebApplications",
"(",
"host",
",",
"webapps"... | Add Web Applications.
Add auto webapplications to the server. The name of the
webapp directory or war is used as the context name. If the
webapp matches the rootWebApp it is added as the "/" context.
@param host Virtual host name or null
@param webapps Directory file name or URL to look for auto
webapplication.
@param... | [
"Add",
"Web",
"Applications",
".",
"Add",
"auto",
"webapplications",
"to",
"the",
"server",
".",
"The",
"name",
"of",
"the",
"webapp",
"directory",
"or",
"war",
"is",
"used",
"as",
"the",
"context",
"name",
".",
"If",
"the",
"webapp",
"matches",
"the",
"... | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/Server.java#L331-L338 |
undertow-io/undertow | core/src/main/java/io/undertow/server/protocol/http/HttpContinue.java | HttpContinue.sendContinueResponse | public static void sendContinueResponse(final HttpServerExchange exchange, final IoCallback callback) {
if (!exchange.isResponseChannelAvailable()) {
callback.onException(exchange, null, UndertowMessages.MESSAGES.cannotSendContinueResponse());
return;
}
internalSendContin... | java | public static void sendContinueResponse(final HttpServerExchange exchange, final IoCallback callback) {
if (!exchange.isResponseChannelAvailable()) {
callback.onException(exchange, null, UndertowMessages.MESSAGES.cannotSendContinueResponse());
return;
}
internalSendContin... | [
"public",
"static",
"void",
"sendContinueResponse",
"(",
"final",
"HttpServerExchange",
"exchange",
",",
"final",
"IoCallback",
"callback",
")",
"{",
"if",
"(",
"!",
"exchange",
".",
"isResponseChannelAvailable",
"(",
")",
")",
"{",
"callback",
".",
"onException",... | Sends a continuation using async IO, and calls back when it is complete.
@param exchange The exchange
@param callback The completion callback | [
"Sends",
"a",
"continuation",
"using",
"async",
"IO",
"and",
"calls",
"back",
"when",
"it",
"is",
"complete",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/protocol/http/HttpContinue.java#L101-L107 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java | DTMDocumentImpl.getAttributeNode | public int getAttributeNode(int nodeHandle, String namespaceURI, String name) {
int nsIndex = m_nsNames.stringToIndex(namespaceURI),
nameIndex = m_localNames.stringToIndex(name);
nodeHandle &= NODEHANDLE_MASK;
... | java | public int getAttributeNode(int nodeHandle, String namespaceURI, String name) {
int nsIndex = m_nsNames.stringToIndex(namespaceURI),
nameIndex = m_localNames.stringToIndex(name);
nodeHandle &= NODEHANDLE_MASK;
... | [
"public",
"int",
"getAttributeNode",
"(",
"int",
"nodeHandle",
",",
"String",
"namespaceURI",
",",
"String",
"name",
")",
"{",
"int",
"nsIndex",
"=",
"m_nsNames",
".",
"stringToIndex",
"(",
"namespaceURI",
")",
",",
"nameIndex",
"=",
"m_localNames",
".",
"stri... | Retrieves an attribute node by by qualified name and namespace URI.
@param nodeHandle int Handle of the node upon which to look up this attribute.
@param namespaceURI The namespace URI of the attribute to
retrieve, or null.
@param name The local name of the attribute to
retrieve.
@return The attribute node handle with... | [
"Retrieves",
"an",
"attribute",
"node",
"by",
"by",
"qualified",
"name",
"and",
"namespace",
"URI",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java#L1086-L1104 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java | FSDirectory.getFullPathName | static String getFullPathName(INode inode) throws IOException {
INode[] inodes = getINodeArray(inode);
return getFullPathName(inodes, inodes.length-1);
} | java | static String getFullPathName(INode inode) throws IOException {
INode[] inodes = getINodeArray(inode);
return getFullPathName(inodes, inodes.length-1);
} | [
"static",
"String",
"getFullPathName",
"(",
"INode",
"inode",
")",
"throws",
"IOException",
"{",
"INode",
"[",
"]",
"inodes",
"=",
"getINodeArray",
"(",
"inode",
")",
";",
"return",
"getFullPathName",
"(",
"inodes",
",",
"inodes",
".",
"length",
"-",
"1",
... | Return the full path name of the specified inode
@param inode
@return its full path name
@throws IOException if the inode is invalid | [
"Return",
"the",
"full",
"path",
"name",
"of",
"the",
"specified",
"inode"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2271-L2274 |
jbossws/jbossws-common | src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java | ReflectionUtils.assertOnlyOneMethod | public static void assertOnlyOneMethod(final Collection<Method> methods, Class<? extends Annotation> annotation)
{
if (methods.size() > 1)
{
throw annotation == null ? MESSAGES.onlyOneMethodCanExist() : MESSAGES.onlyOneMethodCanExist2(annotation);
}
} | java | public static void assertOnlyOneMethod(final Collection<Method> methods, Class<? extends Annotation> annotation)
{
if (methods.size() > 1)
{
throw annotation == null ? MESSAGES.onlyOneMethodCanExist() : MESSAGES.onlyOneMethodCanExist2(annotation);
}
} | [
"public",
"static",
"void",
"assertOnlyOneMethod",
"(",
"final",
"Collection",
"<",
"Method",
">",
"methods",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
")",
"{",
"if",
"(",
"methods",
".",
"size",
"(",
")",
">",
"1",
")",
"{",
... | Asserts only one method is annotated with annotation.
@param method collection of methods to validate
@param annotation annotation to propagate in exception message | [
"Asserts",
"only",
"one",
"method",
"is",
"annotated",
"with",
"annotation",
"."
] | train | https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java#L330-L336 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java | OverrideService.updateResponseCode | public void updateResponseCode(int id, String responseCode) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
String queryString = "UPDATE " + Constants.DB_TABLE_ENABLED_OVERRIDE +
" SET " + Constants.ENABLED_OVERRIDES_RE... | java | public void updateResponseCode(int id, String responseCode) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
String queryString = "UPDATE " + Constants.DB_TABLE_ENABLED_OVERRIDE +
" SET " + Constants.ENABLED_OVERRIDES_RE... | [
"public",
"void",
"updateResponseCode",
"(",
"int",
"id",
",",
"String",
"responseCode",
")",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"sqlService",
".",
"getConnection",
"(",
")",
")",
"{",
"Stri... | Update the response code for a given enabled override
@param id enabled override ID to update
@param responseCode updated value of responseCode | [
"Update",
"the",
"response",
"code",
"for",
"a",
"given",
"enabled",
"override"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java#L260-L281 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/javax/xml/datatype/DatatypeFactory.java | DatatypeFactory.newDurationYearMonth | public Duration newDurationYearMonth(
final boolean isPositive,
final int year,
final int month) {
return newDuration(isPositive, year, month,
DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
DatatypeConstants.FIELD_UNDEFIN... | java | public Duration newDurationYearMonth(
final boolean isPositive,
final int year,
final int month) {
return newDuration(isPositive, year, month,
DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
DatatypeConstants.FIELD_UNDEFIN... | [
"public",
"Duration",
"newDurationYearMonth",
"(",
"final",
"boolean",
"isPositive",
",",
"final",
"int",
"year",
",",
"final",
"int",
"month",
")",
"{",
"return",
"newDuration",
"(",
"isPositive",
",",
"year",
",",
"month",
",",
"DatatypeConstants",
".",
"FIE... | <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified
<code>year</code> and <code>month</code> as defined in
<a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthyDuration">
XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
<p>A {@link DatatypeConstants... | [
"<p",
">",
"Create",
"a",
"<code",
">",
"Duration<",
"/",
"code",
">",
"of",
"type",
"<code",
">",
"xdt",
":",
"yearMonthDuration<",
"/",
"code",
">",
"using",
"the",
"specified",
"<code",
">",
"year<",
"/",
"code",
">",
"and",
"<code",
">",
"month<",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/javax/xml/datatype/DatatypeFactory.java#L653-L660 |
alrocar/POIProxy | es.alrocar.poiproxy/src/main/java/es/alrocar/jpe/parser/handler/BaseContentHandler.java | BaseContentHandler.startNewElement | public void startNewElement(String localName, Attributes atts) {
String arg0 = localName;
this.currentKey = arg0;
if (isEndElement(arg0)) {
endNewElement();
if (writerContentHandler != null) {
this.currentFeatureGeoJSON = writerContentHandler.startFeature();
this.currentGeometryGeoJSON = writerConte... | java | public void startNewElement(String localName, Attributes atts) {
String arg0 = localName;
this.currentKey = arg0;
if (isEndElement(arg0)) {
endNewElement();
if (writerContentHandler != null) {
this.currentFeatureGeoJSON = writerContentHandler.startFeature();
this.currentGeometryGeoJSON = writerConte... | [
"public",
"void",
"startNewElement",
"(",
"String",
"localName",
",",
"Attributes",
"atts",
")",
"{",
"String",
"arg0",
"=",
"localName",
";",
"this",
".",
"currentKey",
"=",
"arg0",
";",
"if",
"(",
"isEndElement",
"(",
"arg0",
")",
")",
"{",
"endNewElemen... | Compares the localname with the {@link FeatureType#getFeature()}
attribute of the current {@link FeatureType} of the
{@link DescribeService}
If the current tag being parsed is equals to
{@link FeatureType#getFeature()} then the
{@link JPEContentHandler#startFeature()} and
{@link JPEContentHandler#startPoint()} are thr... | [
"Compares",
"the",
"localname",
"with",
"the",
"{",
"@link",
"FeatureType#getFeature",
"()",
"}",
"attribute",
"of",
"the",
"current",
"{",
"@link",
"FeatureType",
"}",
"of",
"the",
"{",
"@link",
"DescribeService",
"}"
] | train | https://github.com/alrocar/POIProxy/blob/e1dabe738a862478b2580e90d5fc4209a2997868/es.alrocar.poiproxy/src/main/java/es/alrocar/jpe/parser/handler/BaseContentHandler.java#L326-L352 |
box/box-java-sdk | src/main/java/com/box/sdk/MetadataTemplate.java | MetadataTemplate.createMetadataTemplate | public static MetadataTemplate createMetadataTemplate(BoxAPIConnection api, String scope, String templateKey,
String displayName, boolean hidden, List<Field> fields) {
JsonObject jsonObject = new JsonObject();
jsonObject.add("scope", scope);
jsonObject.add("displayName", displayName... | java | public static MetadataTemplate createMetadataTemplate(BoxAPIConnection api, String scope, String templateKey,
String displayName, boolean hidden, List<Field> fields) {
JsonObject jsonObject = new JsonObject();
jsonObject.add("scope", scope);
jsonObject.add("displayName", displayName... | [
"public",
"static",
"MetadataTemplate",
"createMetadataTemplate",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"scope",
",",
"String",
"templateKey",
",",
"String",
"displayName",
",",
"boolean",
"hidden",
",",
"List",
"<",
"Field",
">",
"fields",
")",
"{",
"J... | Creates new metadata template.
@param api the API connection to be used.
@param scope the scope of the object.
@param templateKey a unique identifier for the template.
@param displayName the display name of the field.
@param hidden whether this template is hidden in the UI.
@param fields the ordered set of fields for t... | [
"Creates",
"new",
"metadata",
"template",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/MetadataTemplate.java#L198-L229 |
apache/incubator-shardingsphere | sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/sql/execute/SQLExecuteTemplate.java | SQLExecuteTemplate.executeGroup | public <T> List<T> executeGroup(final Collection<ShardingExecuteGroup<? extends StatementExecuteUnit>> sqlExecuteGroups, final SQLExecuteCallback<T> callback) throws SQLException {
return executeGroup(sqlExecuteGroups, null, callback);
} | java | public <T> List<T> executeGroup(final Collection<ShardingExecuteGroup<? extends StatementExecuteUnit>> sqlExecuteGroups, final SQLExecuteCallback<T> callback) throws SQLException {
return executeGroup(sqlExecuteGroups, null, callback);
} | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"executeGroup",
"(",
"final",
"Collection",
"<",
"ShardingExecuteGroup",
"<",
"?",
"extends",
"StatementExecuteUnit",
">",
">",
"sqlExecuteGroups",
",",
"final",
"SQLExecuteCallback",
"<",
"T",
">",
"callback",
"... | Execute group.
@param sqlExecuteGroups SQL execute groups
@param callback SQL execute callback
@param <T> class type of return value
@return execute result
@throws SQLException SQL exception | [
"Execute",
"group",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/sql/execute/SQLExecuteTemplate.java#L55-L57 |
datacleaner/DataCleaner | desktop/ui/src/main/java/org/datacleaner/panels/DCSplashPanel.java | DCSplashPanel.wrapContent | protected JScrollPane wrapContent(final JComponent panel) {
panel.setMaximumSize(new Dimension(WIDTH_CONTENT, Integer.MAX_VALUE));
panel.setAlignmentX(Component.LEFT_ALIGNMENT);
final DCPanel wrappingPanel = new DCPanel();
final BoxLayout layout = new BoxLayout(wrappingPanel, BoxLayout.... | java | protected JScrollPane wrapContent(final JComponent panel) {
panel.setMaximumSize(new Dimension(WIDTH_CONTENT, Integer.MAX_VALUE));
panel.setAlignmentX(Component.LEFT_ALIGNMENT);
final DCPanel wrappingPanel = new DCPanel();
final BoxLayout layout = new BoxLayout(wrappingPanel, BoxLayout.... | [
"protected",
"JScrollPane",
"wrapContent",
"(",
"final",
"JComponent",
"panel",
")",
"{",
"panel",
".",
"setMaximumSize",
"(",
"new",
"Dimension",
"(",
"WIDTH_CONTENT",
",",
"Integer",
".",
"MAX_VALUE",
")",
")",
";",
"panel",
".",
"setAlignmentX",
"(",
"Compo... | Wraps a content panel in a scroll pane and applies a maximum width to the
content to keep it nicely in place on the screen.
@param panel
@return | [
"Wraps",
"a",
"content",
"panel",
"in",
"a",
"scroll",
"pane",
"and",
"applies",
"a",
"maximum",
"width",
"to",
"the",
"content",
"to",
"keep",
"it",
"nicely",
"in",
"place",
"on",
"the",
"screen",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/desktop/ui/src/main/java/org/datacleaner/panels/DCSplashPanel.java#L147-L158 |
hypercube1024/firefly | firefly-db/src/main/java/com/firefly/db/init/ScriptUtils.java | ScriptUtils.readScript | private static String readScript(EncodedResource resource, String commentPrefix, String separator)
throws IOException {
LineNumberReader lnr = new LineNumberReader(resource.getReader());
try {
return readScript(lnr, commentPrefix, separator);
} finally {
lnr.... | java | private static String readScript(EncodedResource resource, String commentPrefix, String separator)
throws IOException {
LineNumberReader lnr = new LineNumberReader(resource.getReader());
try {
return readScript(lnr, commentPrefix, separator);
} finally {
lnr.... | [
"private",
"static",
"String",
"readScript",
"(",
"EncodedResource",
"resource",
",",
"String",
"commentPrefix",
",",
"String",
"separator",
")",
"throws",
"IOException",
"{",
"LineNumberReader",
"lnr",
"=",
"new",
"LineNumberReader",
"(",
"resource",
".",
"getReade... | Read a script from the provided resource, using the supplied comment
prefix and statement separator, and build a {@code String} containing the
lines.
<p>
Lines <em>beginning</em> with the comment prefix are excluded from the
results; however, line comments anywhere else — for example, within
a statement — w... | [
"Read",
"a",
"script",
"from",
"the",
"provided",
"resource",
"using",
"the",
"supplied",
"comment",
"prefix",
"and",
"statement",
"separator",
"and",
"build",
"a",
"{",
"@code",
"String",
"}",
"containing",
"the",
"lines",
".",
"<p",
">",
"Lines",
"<em",
... | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-db/src/main/java/com/firefly/db/init/ScriptUtils.java#L266-L275 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SystemUtil.java | SystemUtil.createTempDirectory | public static File createTempDirectory(String _path, String _name, boolean _deleteOnExit) {
File outputDir = new File(concatFilePath(_path, _name));
if (!outputDir.exists()) {
try {
Files.createDirectory(Paths.get(outputDir.toString()));
} catch (IOException _ex)... | java | public static File createTempDirectory(String _path, String _name, boolean _deleteOnExit) {
File outputDir = new File(concatFilePath(_path, _name));
if (!outputDir.exists()) {
try {
Files.createDirectory(Paths.get(outputDir.toString()));
} catch (IOException _ex)... | [
"public",
"static",
"File",
"createTempDirectory",
"(",
"String",
"_path",
",",
"String",
"_name",
",",
"boolean",
"_deleteOnExit",
")",
"{",
"File",
"outputDir",
"=",
"new",
"File",
"(",
"concatFilePath",
"(",
"_path",
",",
"_name",
")",
")",
";",
"if",
"... | Creates a new temporary directory in the given path.
@param _path path
@param _name directory name
@param _deleteOnExit delete directory on jvm shutdown
@return created Directory, null if directory/file was already existing | [
"Creates",
"a",
"new",
"temporary",
"directory",
"in",
"the",
"given",
"path",
"."
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L200-L216 |
scaleset/scaleset-geo | src/main/java/com/scaleset/geo/math/GoogleMapsTileMath.java | GoogleMapsTileMath.tileBbox | public Envelope tileBbox(int tx, int ty, int zoomLevel) {
Coordinate topLeft = tileTopLeft(tx, ty, zoomLevel);
// upperLeft of tx+1,ty+1 == lowRight
Coordinate lowerRight = tileTopLeft(tx + 1, ty + 1, zoomLevel);
Envelope result = new Envelope(topLeft, lowerRight);
return result;... | java | public Envelope tileBbox(int tx, int ty, int zoomLevel) {
Coordinate topLeft = tileTopLeft(tx, ty, zoomLevel);
// upperLeft of tx+1,ty+1 == lowRight
Coordinate lowerRight = tileTopLeft(tx + 1, ty + 1, zoomLevel);
Envelope result = new Envelope(topLeft, lowerRight);
return result;... | [
"public",
"Envelope",
"tileBbox",
"(",
"int",
"tx",
",",
"int",
"ty",
",",
"int",
"zoomLevel",
")",
"{",
"Coordinate",
"topLeft",
"=",
"tileTopLeft",
"(",
"tx",
",",
"ty",
",",
"zoomLevel",
")",
";",
"// upperLeft of tx+1,ty+1 == lowRight",
"Coordinate",
"lowe... | Returns the EPSG:3857 bounding of the specified tile coordinate
@param tx The tile x coordinate
@param ty The tile y coordinate
@param zoomLevel The tile zoom level
@return the EPSG:3857 bounding box | [
"Returns",
"the",
"EPSG",
":",
"3857",
"bounding",
"of",
"the",
"specified",
"tile",
"coordinate"
] | train | https://github.com/scaleset/scaleset-geo/blob/5cff2349668037dc287928a6c1a1f67c76d96b02/src/main/java/com/scaleset/geo/math/GoogleMapsTileMath.java#L285-L291 |
lingochamp/okdownload | okdownload-filedownloader/src/main/java/com/liulishuo/filedownloader/notification/FileDownloadNotificationHelper.java | FileDownloadNotificationHelper.showIndeterminate | public void showIndeterminate(final int id, int status) {
final BaseNotificationItem notification = get(id);
if (notification == null) {
return;
}
notification.updateStatus(status);
notification.show(false);
} | java | public void showIndeterminate(final int id, int status) {
final BaseNotificationItem notification = get(id);
if (notification == null) {
return;
}
notification.updateStatus(status);
notification.show(false);
} | [
"public",
"void",
"showIndeterminate",
"(",
"final",
"int",
"id",
",",
"int",
"status",
")",
"{",
"final",
"BaseNotificationItem",
"notification",
"=",
"get",
"(",
"id",
")",
";",
"if",
"(",
"notification",
"==",
"null",
")",
"{",
"return",
";",
"}",
"no... | Show the notification with indeterminate progress.
@param id The download id.
@param status {@link FileDownloadStatus} | [
"Show",
"the",
"notification",
"with",
"indeterminate",
"progress",
"."
] | train | https://github.com/lingochamp/okdownload/blob/403e2c814556ef7f2fade1f5bee83a02a5eaecb2/okdownload-filedownloader/src/main/java/com/liulishuo/filedownloader/notification/FileDownloadNotificationHelper.java#L96-L105 |
OpenTSDB/opentsdb | src/tools/Search.java | Search.runCommand | private static int runCommand(final TSDB tsdb,
final boolean use_data_table,
final String[] args) throws Exception {
final int nargs = args.length;
if (args[0].equals("lookup")) {
if (nargs < 2) { // need a query
usage(null, "Not enou... | java | private static int runCommand(final TSDB tsdb,
final boolean use_data_table,
final String[] args) throws Exception {
final int nargs = args.length;
if (args[0].equals("lookup")) {
if (nargs < 2) { // need a query
usage(null, "Not enou... | [
"private",
"static",
"int",
"runCommand",
"(",
"final",
"TSDB",
"tsdb",
",",
"final",
"boolean",
"use_data_table",
",",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"final",
"int",
"nargs",
"=",
"args",
".",
"length",
";",
"if",
... | Determines the command requested of the user can calls the appropriate
method.
@param tsdb The TSDB to use for communication
@param use_data_table Whether or not lookups should be done on the full
data table
@param args Arguments to parse
@return An exit code | [
"Determines",
"the",
"command",
"requested",
"of",
"the",
"user",
"can",
"calls",
"the",
"appropriate",
"method",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/Search.java#L97-L111 |
bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java | LocationUtil.getCuratorForLocation | public static Optional<CuratorFramework> getCuratorForLocation(URI location) {
final String defaultConnectionString;
final String namespace;
if (getLocationType(location) != LocationType.EMO_HOST_DISCOVERY) {
// Only host discovery may require ZooKeeper
return Optional.a... | java | public static Optional<CuratorFramework> getCuratorForLocation(URI location) {
final String defaultConnectionString;
final String namespace;
if (getLocationType(location) != LocationType.EMO_HOST_DISCOVERY) {
// Only host discovery may require ZooKeeper
return Optional.a... | [
"public",
"static",
"Optional",
"<",
"CuratorFramework",
">",
"getCuratorForLocation",
"(",
"URI",
"location",
")",
"{",
"final",
"String",
"defaultConnectionString",
";",
"final",
"String",
"namespace",
";",
"if",
"(",
"getLocationType",
"(",
"location",
")",
"!=... | Returns a configured, started Curator for a given location, or absent if the location does not
use host discovery. | [
"Returns",
"a",
"configured",
"started",
"Curator",
"for",
"a",
"given",
"location",
"or",
"absent",
"if",
"the",
"location",
"does",
"not",
"use",
"host",
"discovery",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java#L198-L239 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.iiop/src/com/ibm/ws/transport/iiop/yoko/ORBConfigAdapter.java | ORBConfigAdapter.translateToClientProps | private Properties translateToClientProps(Map<String, Object> clientProps, Collection<SubsystemFactory> subsystemFactories) throws ConfigException {
Properties result = createYokoORBProperties();
for (SubsystemFactory sf : subsystemFactories) {
addInitializerPropertyForSubsystem(result, sf, ... | java | private Properties translateToClientProps(Map<String, Object> clientProps, Collection<SubsystemFactory> subsystemFactories) throws ConfigException {
Properties result = createYokoORBProperties();
for (SubsystemFactory sf : subsystemFactories) {
addInitializerPropertyForSubsystem(result, sf, ... | [
"private",
"Properties",
"translateToClientProps",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"clientProps",
",",
"Collection",
"<",
"SubsystemFactory",
">",
"subsystemFactories",
")",
"throws",
"ConfigException",
"{",
"Properties",
"result",
"=",
"createYokoORBPr... | Translate client configuration into the
property bundle necessary to configure the
client ORB instance.
@param clientProps configuration properties
@param subsystemFactories configured subsystem factories
@return A property bundle that can be passed to ORB.init();
@exception ConfigException if configuration cannot be... | [
"Translate",
"client",
"configuration",
"into",
"the",
"property",
"bundle",
"necessary",
"to",
"configure",
"the",
"client",
"ORB",
"instance",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.iiop/src/com/ibm/ws/transport/iiop/yoko/ORBConfigAdapter.java#L179-L186 |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java | MessageSetImpl.getMessagesBefore | public static CompletableFuture<MessageSet> getMessagesBefore(TextChannel channel, int limit, long before) {
return getMessages(channel, limit, before, -1);
} | java | public static CompletableFuture<MessageSet> getMessagesBefore(TextChannel channel, int limit, long before) {
return getMessages(channel, limit, before, -1);
} | [
"public",
"static",
"CompletableFuture",
"<",
"MessageSet",
">",
"getMessagesBefore",
"(",
"TextChannel",
"channel",
",",
"int",
"limit",
",",
"long",
"before",
")",
"{",
"return",
"getMessages",
"(",
"channel",
",",
"limit",
",",
"before",
",",
"-",
"1",
")... | Gets up to a given amount of messages in the given channel before a given message in any channel.
@param channel The channel of the messages.
@param limit The limit of messages to get.
@param before Get messages before the message with this id.
@return The messages.
@see #getMessagesBeforeAsStream(TextChannel, long) | [
"Gets",
"up",
"to",
"a",
"given",
"amount",
"of",
"messages",
"in",
"the",
"given",
"channel",
"before",
"a",
"given",
"message",
"in",
"any",
"channel",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java#L316-L318 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/ASMifier.java | ASMifier.main | public static void main(final String[] args) throws Exception {
int i = 0;
int flags = ClassReader.SKIP_DEBUG;
boolean ok = true;
if (args.length < 1 || args.length > 2) {
ok = false;
}
if (ok && "-debug".equals(args[0])) {
i = 1;
flag... | java | public static void main(final String[] args) throws Exception {
int i = 0;
int flags = ClassReader.SKIP_DEBUG;
boolean ok = true;
if (args.length < 1 || args.length > 2) {
ok = false;
}
if (ok && "-debug".equals(args[0])) {
i = 1;
flag... | [
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"int",
"i",
"=",
"0",
";",
"int",
"flags",
"=",
"ClassReader",
".",
"SKIP_DEBUG",
";",
"boolean",
"ok",
"=",
"true",
";",
"if",
"(",
"args"... | Prints the ASM source code to generate the given class to the standard
output.
<p>
Usage: ASMifier [-debug] <binary class name or class file name>
@param args
the command line arguments.
@throws Exception
if the class cannot be found, or if an IO exception occurs. | [
"Prints",
"the",
"ASM",
"source",
"code",
"to",
"generate",
"the",
"given",
"class",
"to",
"the",
"standard",
"output",
".",
"<p",
">",
"Usage",
":",
"ASMifier",
"[",
"-",
"debug",
"]",
"<",
";",
"binary",
"class",
"name",
"or",
"class",
"file",
"nam... | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/ASMifier.java#L128-L159 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/impl/SibRaConnection.java | SibRaConnection.createBrowserSession | @Override
public BrowserSession createBrowserSession(
final SIDestinationAddress destinationAddress,
final DestinationType destType, final SelectionCriteria criteria,
final St... | java | @Override
public BrowserSession createBrowserSession(
final SIDestinationAddress destinationAddress,
final DestinationType destType, final SelectionCriteria criteria,
final St... | [
"@",
"Override",
"public",
"BrowserSession",
"createBrowserSession",
"(",
"final",
"SIDestinationAddress",
"destinationAddress",
",",
"final",
"DestinationType",
"destType",
",",
"final",
"SelectionCriteria",
"criteria",
",",
"final",
"String",
"alternateUser",
")",
"thro... | Creates a browser session. Checks that the connection is valid and then
delegates. Wraps the <code>BrowserSession</code> returned from the
delegate in a <code>SibRaBrowserSession</code>.
@param destinationAddress
the address of the destination
@param destType
the destination type
@param criteria
the selection criteria... | [
"Creates",
"a",
"browser",
"session",
".",
"Checks",
"that",
"the",
"connection",
"is",
"valid",
"and",
"then",
"delegates",
".",
"Wraps",
"the",
"<code",
">",
"BrowserSession<",
"/",
"code",
">",
"returned",
"from",
"the",
"delegate",
"in",
"a",
"<code",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/impl/SibRaConnection.java#L1530-L1549 |
davidcarboni/restolino | src/main/java/com/github/davidcarboni/restolino/routes/DefaultIndexRedirect.java | DefaultIndexRedirect.get | @Override
public Object get(HttpServletRequest req, HttpServletResponse res)
throws IOException {
res.sendRedirect(path);
return null;
} | java | @Override
public Object get(HttpServletRequest req, HttpServletResponse res)
throws IOException {
res.sendRedirect(path);
return null;
} | [
"@",
"Override",
"public",
"Object",
"get",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"IOException",
"{",
"res",
".",
"sendRedirect",
"(",
"path",
")",
";",
"return",
"null",
";",
"}"
] | Extending this class and implementing {@link Home} will make use of this
method. | [
"Extending",
"this",
"class",
"and",
"implementing",
"{"
] | train | https://github.com/davidcarboni/restolino/blob/3f84ece1bd016fbb597c624d46fcca5a2580a33d/src/main/java/com/github/davidcarboni/restolino/routes/DefaultIndexRedirect.java#L38-L43 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/session/AbstractDocumentQuery.java | AbstractDocumentQuery._search | @Override
public void _search(String fieldName, String searchTerms) {
_search(fieldName, searchTerms, SearchOperator.OR);
} | java | @Override
public void _search(String fieldName, String searchTerms) {
_search(fieldName, searchTerms, SearchOperator.OR);
} | [
"@",
"Override",
"public",
"void",
"_search",
"(",
"String",
"fieldName",
",",
"String",
"searchTerms",
")",
"{",
"_search",
"(",
"fieldName",
",",
"searchTerms",
",",
"SearchOperator",
".",
"OR",
")",
";",
"}"
] | Perform a search for documents which fields that match the searchTerms.
If there is more than a single term, each of them will be checked independently.
@param fieldName Field name
@param searchTerms Search terms | [
"Perform",
"a",
"search",
"for",
"documents",
"which",
"fields",
"that",
"match",
"the",
"searchTerms",
".",
"If",
"there",
"is",
"more",
"than",
"a",
"single",
"term",
"each",
"of",
"them",
"will",
"be",
"checked",
"independently",
"."
] | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/session/AbstractDocumentQuery.java#L1022-L1025 |
jenkinsci/jenkins | core/src/main/java/hudson/Util.java | Util.createFileSet | @Nonnull
public static FileSet createFileSet(@Nonnull File baseDir, @Nonnull String includes, @CheckForNull String excludes) {
FileSet fs = new FileSet();
fs.setDir(baseDir);
fs.setProject(new Project());
StringTokenizer tokens;
tokens = new StringTokenizer(includes,",");
... | java | @Nonnull
public static FileSet createFileSet(@Nonnull File baseDir, @Nonnull String includes, @CheckForNull String excludes) {
FileSet fs = new FileSet();
fs.setDir(baseDir);
fs.setProject(new Project());
StringTokenizer tokens;
tokens = new StringTokenizer(includes,",");
... | [
"@",
"Nonnull",
"public",
"static",
"FileSet",
"createFileSet",
"(",
"@",
"Nonnull",
"File",
"baseDir",
",",
"@",
"Nonnull",
"String",
"includes",
",",
"@",
"CheckForNull",
"String",
"excludes",
")",
"{",
"FileSet",
"fs",
"=",
"new",
"FileSet",
"(",
")",
"... | Creates Ant {@link FileSet} with the base dir and include pattern.
<p>
The difference with this and using {@link FileSet#setIncludes(String)}
is that this method doesn't treat whitespace as a pattern separator,
which makes it impossible to use space in the file path.
@param includes
String like "foo/bar/*.xml" Multip... | [
"Creates",
"Ant",
"{",
"@link",
"FileSet",
"}",
"with",
"the",
"base",
"dir",
"and",
"include",
"pattern",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/Util.java#L1143-L1164 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/datastructure/JMMap.java | JMMap.newFilteredMap | public static <K, V> Map<K, V> newFilteredMap(Map<K, V> map,
Predicate<? super Entry<K, V>> filter) {
return getEntryStreamWithFilter(map, filter)
.collect(toMap(Entry::getKey, Entry::getValue));
} | java | public static <K, V> Map<K, V> newFilteredMap(Map<K, V> map,
Predicate<? super Entry<K, V>> filter) {
return getEntryStreamWithFilter(map, filter)
.collect(toMap(Entry::getKey, Entry::getValue));
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"newFilteredMap",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"Predicate",
"<",
"?",
"super",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"filter",
")",
"{",
"return... | New filtered map map.
@param <K> the type parameter
@param <V> the type parameter
@param map the map
@param filter the filter
@return the map | [
"New",
"filtered",
"map",
"map",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/datastructure/JMMap.java#L385-L389 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.removeExecutableFeature | public void removeExecutableFeature(EObject element, IModificationContext context) throws BadLocationException {
final ICompositeNode node;
final SarlAction action = EcoreUtil2.getContainerOfType(element, SarlAction.class);
if (action == null) {
final XtendMember feature = EcoreUtil2.getContainerOfType(element... | java | public void removeExecutableFeature(EObject element, IModificationContext context) throws BadLocationException {
final ICompositeNode node;
final SarlAction action = EcoreUtil2.getContainerOfType(element, SarlAction.class);
if (action == null) {
final XtendMember feature = EcoreUtil2.getContainerOfType(element... | [
"public",
"void",
"removeExecutableFeature",
"(",
"EObject",
"element",
",",
"IModificationContext",
"context",
")",
"throws",
"BadLocationException",
"{",
"final",
"ICompositeNode",
"node",
";",
"final",
"SarlAction",
"action",
"=",
"EcoreUtil2",
".",
"getContainerOfTy... | Remove the exectuable feature.
@param element the executable feature to remove.
@param context the context of the change.
@throws BadLocationException if there is a problem with the location of the element. | [
"Remove",
"the",
"exectuable",
"feature",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L587-L599 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-infinispan/src/main/java/org/xwiki/cache/infinispan/internal/InfinispanCache.java | InfinispanCache.cacheEntryInserted | private void cacheEntryInserted(String key, T value)
{
InfinispanCacheEntryEvent<T> event =
new InfinispanCacheEntryEvent<>(new InfinispanCacheEntry<T>(this, key, value));
T previousValue = this.preEventData.get(key);
if (previousValue != null) {
if (previousValue !... | java | private void cacheEntryInserted(String key, T value)
{
InfinispanCacheEntryEvent<T> event =
new InfinispanCacheEntryEvent<>(new InfinispanCacheEntry<T>(this, key, value));
T previousValue = this.preEventData.get(key);
if (previousValue != null) {
if (previousValue !... | [
"private",
"void",
"cacheEntryInserted",
"(",
"String",
"key",
",",
"T",
"value",
")",
"{",
"InfinispanCacheEntryEvent",
"<",
"T",
">",
"event",
"=",
"new",
"InfinispanCacheEntryEvent",
"<>",
"(",
"new",
"InfinispanCacheEntry",
"<",
"T",
">",
"(",
"this",
",",... | Dispatch data insertion event.
@param key the entry key.
@param value the entry value. | [
"Dispatch",
"data",
"insertion",
"event",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-infinispan/src/main/java/org/xwiki/cache/infinispan/internal/InfinispanCache.java#L200-L216 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/DashboardResources.java | DashboardResources.updateDashboard | @PUT
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/{dashboardId}")
@Description("Updates a dashboard having the given ID.")
public DashboardDto updateDashboard(@Context HttpServletRequest req,
@PathParam("dashboardId") BigInteger dashboardId, DashboardDto dashboardDto) {
... | java | @PUT
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/{dashboardId}")
@Description("Updates a dashboard having the given ID.")
public DashboardDto updateDashboard(@Context HttpServletRequest req,
@PathParam("dashboardId") BigInteger dashboardId, DashboardDto dashboardDto) {
... | [
"@",
"PUT",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Path",
"(",
"\"/{dashboardId}\"",
")",
"@",
"Description",
"(",
"\"Updates a dashboard having the given ID.\"",
")",
... | Updates a dashboard having the given ID.
@param req The HTTP request.
@param dashboardId The dashboard ID to update.
@param dashboardDto The updated date.
@return The updated dashboard DTO.
@throws WebApplicationException If an error occurs. | [
"Updates",
"a",
"dashboard",
"having",
"the",
"given",
"ID",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/DashboardResources.java#L312-L336 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ExportConfigurationsInner.java | ExportConfigurationsInner.createAsync | public Observable<List<ApplicationInsightsComponentExportConfigurationInner>> createAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentExportRequest exportProperties) {
return createWithServiceResponseAsync(resourceGroupName, resourceName, exportProperties).map(new Func1<ServiceRes... | java | public Observable<List<ApplicationInsightsComponentExportConfigurationInner>> createAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentExportRequest exportProperties) {
return createWithServiceResponseAsync(resourceGroupName, resourceName, exportProperties).map(new Func1<ServiceRes... | [
"public",
"Observable",
"<",
"List",
"<",
"ApplicationInsightsComponentExportConfigurationInner",
">",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ApplicationInsightsComponentExportRequest",
"exportProperties",
")",
"{",
"retur... | Create a Continuous Export configuration of an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param exportProperties Properties that need to be specified to create a Continuous Export configuration o... | [
"Create",
"a",
"Continuous",
"Export",
"configuration",
"of",
"an",
"Application",
"Insights",
"component",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ExportConfigurationsInner.java#L207-L214 |
playn/playn | android/src/playn/android/AndroidHttpClient.java | AndroidHttpClient.newInstance | public static AndroidHttpClient newInstance(String userAgent) {
HttpParams params = new BasicHttpParams();
// Turn off stale checking. Our connections break all the time anyway,
// and it's not worth it to pay the penalty of checking every time.
HttpConnectionParams.setStaleCheckingEnabled(params, fals... | java | public static AndroidHttpClient newInstance(String userAgent) {
HttpParams params = new BasicHttpParams();
// Turn off stale checking. Our connections break all the time anyway,
// and it's not worth it to pay the penalty of checking every time.
HttpConnectionParams.setStaleCheckingEnabled(params, fals... | [
"public",
"static",
"AndroidHttpClient",
"newInstance",
"(",
"String",
"userAgent",
")",
"{",
"HttpParams",
"params",
"=",
"new",
"BasicHttpParams",
"(",
")",
";",
"// Turn off stale checking. Our connections break all the time anyway,",
"// and it's not worth it to pay the penal... | Create a new HttpClient with reasonable defaults (which you can update).
@param userAgent to report in your HTTP requests.
@return AndroidHttpClient for you to use for all your requests. | [
"Create",
"a",
"new",
"HttpClient",
"with",
"reasonable",
"defaults",
"(",
"which",
"you",
"can",
"update",
")",
"."
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/android/src/playn/android/AndroidHttpClient.java#L80-L106 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dictionary/CoreBiGramTableDictionary.java | CoreBiGramTableDictionary.binarySearch | private static int binarySearch(int[] a, int fromIndex, int length, int key)
{
int low = fromIndex;
int high = fromIndex + length - 1;
while (low <= high)
{
int mid = (low + high) >>> 1;
int midVal = a[mid << 1];
if (midVal < key)
... | java | private static int binarySearch(int[] a, int fromIndex, int length, int key)
{
int low = fromIndex;
int high = fromIndex + length - 1;
while (low <= high)
{
int mid = (low + high) >>> 1;
int midVal = a[mid << 1];
if (midVal < key)
... | [
"private",
"static",
"int",
"binarySearch",
"(",
"int",
"[",
"]",
"a",
",",
"int",
"fromIndex",
",",
"int",
"length",
",",
"int",
"key",
")",
"{",
"int",
"low",
"=",
"fromIndex",
";",
"int",
"high",
"=",
"fromIndex",
"+",
"length",
"-",
"1",
";",
"... | 二分搜索,由于二元接续前一个词固定时,后一个词比较少,所以二分也能取得很高的性能
@param a 目标数组
@param fromIndex 开始下标
@param length 长度
@param key 词的id
@return 共现频次 | [
"二分搜索,由于二元接续前一个词固定时,后一个词比较少,所以二分也能取得很高的性能"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/CoreBiGramTableDictionary.java#L218-L236 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.intersectRayAab | public static boolean intersectRayAab(Vector3fc origin, Vector3fc dir, Vector3fc min, Vector3fc max, Vector2f result) {
return intersectRayAab(origin.x(), origin.y(), origin.z(), dir.x(), dir.y(), dir.z(), min.x(), min.y(), min.z(), max.x(), max.y(), max.z(), result);
} | java | public static boolean intersectRayAab(Vector3fc origin, Vector3fc dir, Vector3fc min, Vector3fc max, Vector2f result) {
return intersectRayAab(origin.x(), origin.y(), origin.z(), dir.x(), dir.y(), dir.z(), min.x(), min.y(), min.z(), max.x(), max.y(), max.z(), result);
} | [
"public",
"static",
"boolean",
"intersectRayAab",
"(",
"Vector3fc",
"origin",
",",
"Vector3fc",
"dir",
",",
"Vector3fc",
"min",
",",
"Vector3fc",
"max",
",",
"Vector2f",
"result",
")",
"{",
"return",
"intersectRayAab",
"(",
"origin",
".",
"x",
"(",
")",
",",... | Test whether the ray with the given <code>origin</code> and direction <code>dir</code>
intersects the axis-aligned box specified as its minimum corner <code>min</code> and maximum corner <code>max</code>,
and return the values of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> of the near and ... | [
"Test",
"whether",
"the",
"ray",
"with",
"the",
"given",
"<code",
">",
"origin<",
"/",
"code",
">",
"and",
"direction",
"<code",
">",
"dir<",
"/",
"code",
">",
"intersects",
"the",
"axis",
"-",
"aligned",
"box",
"specified",
"as",
"its",
"minimum",
"corn... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L2411-L2413 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmVisitor.java | XsdAsmVisitor.addVisitorAttributeMethod | private static void addVisitorAttributeMethod(ClassWriter classWriter, XsdAttribute attribute) {
MethodVisitor mVisitor = classWriter.visitMethod(ACC_PUBLIC, VISIT_ATTRIBUTE_NAME + getCleanName(attribute.getName()), "(" + JAVA_STRING_DESC + ")V", null, null);
mVisitor.visitLocalVariable(firstToLower(get... | java | private static void addVisitorAttributeMethod(ClassWriter classWriter, XsdAttribute attribute) {
MethodVisitor mVisitor = classWriter.visitMethod(ACC_PUBLIC, VISIT_ATTRIBUTE_NAME + getCleanName(attribute.getName()), "(" + JAVA_STRING_DESC + ")V", null, null);
mVisitor.visitLocalVariable(firstToLower(get... | [
"private",
"static",
"void",
"addVisitorAttributeMethod",
"(",
"ClassWriter",
"classWriter",
",",
"XsdAttribute",
"attribute",
")",
"{",
"MethodVisitor",
"mVisitor",
"=",
"classWriter",
".",
"visitMethod",
"(",
"ACC_PUBLIC",
",",
"VISIT_ATTRIBUTE_NAME",
"+",
"getCleanNa... | Adds a specific method for a visitAttribute call.
Example:
void visitAttributeManifest(String manifestValue){
visitAttribute("manifest", manifestValue);
}
@param classWriter The ElementVisitor class {@link ClassWriter}.
@param attribute The specific attribute. | [
"Adds",
"a",
"specific",
"method",
"for",
"a",
"visitAttribute",
"call",
".",
"Example",
":",
"void",
"visitAttributeManifest",
"(",
"String",
"manifestValue",
")",
"{",
"visitAttribute",
"(",
"manifest",
"manifestValue",
")",
";",
"}"
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmVisitor.java#L107-L118 |
upwork/java-upwork | src/com/Upwork/api/Routers/Reports/Time.java | Time.getByTeamLimited | public JSONObject getByTeamLimited(String company, String team, HashMap<String, String> params) throws JSONException {
return _getByType(company, team, null, params, true);
} | java | public JSONObject getByTeamLimited(String company, String team, HashMap<String, String> params) throws JSONException {
return _getByType(company, team, null, params, true);
} | [
"public",
"JSONObject",
"getByTeamLimited",
"(",
"String",
"company",
",",
"String",
"team",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"_getByType",
"(",
"company",
",",
"team",
",",
"null",
"... | Generate Time Reports for a Specific Team (hide financial info)
@param company Company ID
@param team Team ID
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Generate",
"Time",
"Reports",
"for",
"a",
"Specific",
"Team",
"(",
"hide",
"financial",
"info",
")"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Reports/Time.java#L93-L95 |
calimero-project/calimero-core | src/tuwien/auto/calimero/knxnetip/ConnectionBase.java | ConnectionBase.checkChannelId | protected boolean checkChannelId(final int id, final String svcType)
{
if (id == channelId)
return true;
logger.warn("received service " + svcType + " with wrong channel ID " + id + ", expected " + channelId
+ " - ignored");
return false;
} | java | protected boolean checkChannelId(final int id, final String svcType)
{
if (id == channelId)
return true;
logger.warn("received service " + svcType + " with wrong channel ID " + id + ", expected " + channelId
+ " - ignored");
return false;
} | [
"protected",
"boolean",
"checkChannelId",
"(",
"final",
"int",
"id",
",",
"final",
"String",
"svcType",
")",
"{",
"if",
"(",
"id",
"==",
"channelId",
")",
"return",
"true",
";",
"logger",
".",
"warn",
"(",
"\"received service \"",
"+",
"svcType",
"+",
"\" ... | Validates channel id received in a packet against the one assigned to this connection.
@param id received id to check
@param svcType packet service type
@return <code>true</code> if valid, <code>false</code> otherwise | [
"Validates",
"channel",
"id",
"received",
"in",
"a",
"packet",
"against",
"the",
"one",
"assigned",
"to",
"this",
"connection",
"."
] | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/ConnectionBase.java#L487-L494 |
osglworks/java-tool | src/main/java/org/osgl/Lang.java | F5.andThen | public F5<P1, P2, P3, P4, P5, R> andThen(
final Func5<? super P1, ? super P2, ? super P3, ? super P4, ? super P5, ? extends R>... fs
) {
if (0 == fs.length) {
return this;
}
final F5<P1, P2, P3, P4, P5, R> me = this;
return new F5<... | java | public F5<P1, P2, P3, P4, P5, R> andThen(
final Func5<? super P1, ? super P2, ? super P3, ? super P4, ? super P5, ? extends R>... fs
) {
if (0 == fs.length) {
return this;
}
final F5<P1, P2, P3, P4, P5, R> me = this;
return new F5<... | [
"public",
"F5",
"<",
"P1",
",",
"P2",
",",
"P3",
",",
"P4",
",",
"P5",
",",
"R",
">",
"andThen",
"(",
"final",
"Func5",
"<",
"?",
"super",
"P1",
",",
"?",
"super",
"P2",
",",
"?",
"super",
"P3",
",",
"?",
"super",
"P4",
",",
"?",
"super",
"... | Returns a composed function that applied, in sequence, this function and
all functions specified one by one. If applying anyone of the functions
throws an exception, it is relayed to the caller of the composed function.
If an exception is thrown out, the following functions will not be applied.
<p>When apply the compos... | [
"Returns",
"a",
"composed",
"function",
"that",
"applied",
"in",
"sequence",
"this",
"function",
"and",
"all",
"functions",
"specified",
"one",
"by",
"one",
".",
"If",
"applying",
"anyone",
"of",
"the",
"functions",
"throws",
"an",
"exception",
"it",
"is",
"... | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/Lang.java#L1890-L1908 |
windup/windup | reporting/api/src/main/java/org/jboss/windup/reporting/service/ClassificationService.java | ClassificationService.attachClassification | public ClassificationModel attachClassification(GraphRewrite event, ClassificationModel classificationModel, FileModel fileModel)
{
if (fileModel instanceof DuplicateArchiveModel)
{
fileModel = ((DuplicateArchiveModel) fileModel).getCanonicalArchive();
}
if (!isClassific... | java | public ClassificationModel attachClassification(GraphRewrite event, ClassificationModel classificationModel, FileModel fileModel)
{
if (fileModel instanceof DuplicateArchiveModel)
{
fileModel = ((DuplicateArchiveModel) fileModel).getCanonicalArchive();
}
if (!isClassific... | [
"public",
"ClassificationModel",
"attachClassification",
"(",
"GraphRewrite",
"event",
",",
"ClassificationModel",
"classificationModel",
",",
"FileModel",
"fileModel",
")",
"{",
"if",
"(",
"fileModel",
"instanceof",
"DuplicateArchiveModel",
")",
"{",
"fileModel",
"=",
... | This method just attaches the {@link ClassificationModel} to the {@link FileModel}.
It will only do so if this link is not already present. | [
"This",
"method",
"just",
"attaches",
"the",
"{"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/service/ClassificationService.java#L296-L312 |
dropwizard/dropwizard | dropwizard-jersey/src/main/java/io/dropwizard/jersey/validation/ConstraintMessage.java | ConstraintMessage.getMessage | public static String getMessage(ConstraintViolation<?> v, Invocable invocable) {
final Pair<Path, ? extends ConstraintDescriptor<?>> of =
Pair.of(v.getPropertyPath(), v.getConstraintDescriptor());
final String cachePrefix = PREFIX_CACHE.getIfPresent(of);
if (cachePrefix == null) ... | java | public static String getMessage(ConstraintViolation<?> v, Invocable invocable) {
final Pair<Path, ? extends ConstraintDescriptor<?>> of =
Pair.of(v.getPropertyPath(), v.getConstraintDescriptor());
final String cachePrefix = PREFIX_CACHE.getIfPresent(of);
if (cachePrefix == null) ... | [
"public",
"static",
"String",
"getMessage",
"(",
"ConstraintViolation",
"<",
"?",
">",
"v",
",",
"Invocable",
"invocable",
")",
"{",
"final",
"Pair",
"<",
"Path",
",",
"?",
"extends",
"ConstraintDescriptor",
"<",
"?",
">",
">",
"of",
"=",
"Pair",
".",
"o... | Gets the human friendly location of where the violation was raised. | [
"Gets",
"the",
"human",
"friendly",
"location",
"of",
"where",
"the",
"violation",
"was",
"raised",
"."
] | train | https://github.com/dropwizard/dropwizard/blob/7ee09a410476b9681e8072ab684788bb440877bd/dropwizard-jersey/src/main/java/io/dropwizard/jersey/validation/ConstraintMessage.java#L40-L50 |
PrashamTrivedi/SharedPreferenceInspector | sharedpreferenceinspector/src/main/java/com/ceelites/sharedpreferenceinspector/Utils/SharedPreferenceUtils.java | SharedPreferenceUtils.initWith | public static SharedPreferenceUtils initWith(Context context, String name) {
if (sharedPreferenceUtils == null) {
sharedPreferenceUtils = new SharedPreferenceUtils();
}
if (isEmptyString(name)) {
sharedPreferenceUtils.sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
} else {
... | java | public static SharedPreferenceUtils initWith(Context context, String name) {
if (sharedPreferenceUtils == null) {
sharedPreferenceUtils = new SharedPreferenceUtils();
}
if (isEmptyString(name)) {
sharedPreferenceUtils.sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
} else {
... | [
"public",
"static",
"SharedPreferenceUtils",
"initWith",
"(",
"Context",
"context",
",",
"String",
"name",
")",
"{",
"if",
"(",
"sharedPreferenceUtils",
"==",
"null",
")",
"{",
"sharedPreferenceUtils",
"=",
"new",
"SharedPreferenceUtils",
"(",
")",
";",
"}",
"if... | Init SharedPreferences with context and a SharedPreferences name
@param context:
Context to init SharedPreferences
@param name:
Name of SharedPreferences file. If you pass <code>null</code> it will create default SharedPrefernces
@return: SharedPreferenceUtils object. It will store given the sharedPreferences value w... | [
"Init",
"SharedPreferences",
"with",
"context",
"and",
"a",
"SharedPreferences",
"name"
] | train | https://github.com/PrashamTrivedi/SharedPreferenceInspector/blob/c04d567c4d0fc5e0f8cda308ca85df19c6b3b838/sharedpreferenceinspector/src/main/java/com/ceelites/sharedpreferenceinspector/Utils/SharedPreferenceUtils.java#L63-L73 |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.setVersion | protected static void setVersion(Selenified clazz, ITestContext context, String version) {
context.setAttribute(clazz.getClass().getName() + "Version", version);
} | java | protected static void setVersion(Selenified clazz, ITestContext context, String version) {
context.setAttribute(clazz.getClass().getName() + "Version", version);
} | [
"protected",
"static",
"void",
"setVersion",
"(",
"Selenified",
"clazz",
",",
"ITestContext",
"context",
",",
"String",
"version",
")",
"{",
"context",
".",
"setAttribute",
"(",
"clazz",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\"Version\""... | Sets the version of the current test suite being executed.
@param clazz - the test suite class, used for making threadsafe storage of
application, allowing suites to have independent applications
under test, run at the same time
@param context - the TestNG context associated with the test suite, used for
storing app... | [
"Sets",
"the",
"version",
"of",
"the",
"current",
"test",
"suite",
"being",
"executed",
"."
] | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L135-L137 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/MessageBirdServiceImpl.java | MessageBirdServiceImpl.doRequest | <P> APIResponse doRequest(final String method, final String url, final P payload) throws GeneralException {
HttpURLConnection connection = null;
InputStream inputStream = null;
if (METHOD_PATCH.equalsIgnoreCase(method)) {
// It'd perhaps be cleaner to call this in the constructor, b... | java | <P> APIResponse doRequest(final String method, final String url, final P payload) throws GeneralException {
HttpURLConnection connection = null;
InputStream inputStream = null;
if (METHOD_PATCH.equalsIgnoreCase(method)) {
// It'd perhaps be cleaner to call this in the constructor, b... | [
"<",
"P",
">",
"APIResponse",
"doRequest",
"(",
"final",
"String",
"method",
",",
"final",
"String",
"url",
",",
"final",
"P",
"payload",
")",
"throws",
"GeneralException",
"{",
"HttpURLConnection",
"connection",
"=",
"null",
";",
"InputStream",
"inputStream",
... | Actually sends a HTTP request and returns its body and HTTP status code.
@param method HTTP method.
@param url Absolute URL.
@param payload Payload to JSON encode for the request body. May be null.
@param <P> Type of the payload.
@return APIResponse containing the response's body and status. | [
"Actually",
"sends",
"a",
"HTTP",
"request",
"and",
"returns",
"its",
"body",
"and",
"HTTP",
"status",
"code",
"."
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdServiceImpl.java#L219-L253 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/components/CalendarPanel.java | CalendarPanel.labelIndicatorSetColorsToDefaultState | private void labelIndicatorSetColorsToDefaultState(JLabel label) {
if (label == null || settings == null) {
return;
}
if (label == labelMonth || label == labelYear) {
label.setBackground(settings.getColor(DateArea.BackgroundMonthAndYearMenuLabels));
monthAndYe... | java | private void labelIndicatorSetColorsToDefaultState(JLabel label) {
if (label == null || settings == null) {
return;
}
if (label == labelMonth || label == labelYear) {
label.setBackground(settings.getColor(DateArea.BackgroundMonthAndYearMenuLabels));
monthAndYe... | [
"private",
"void",
"labelIndicatorSetColorsToDefaultState",
"(",
"JLabel",
"label",
")",
"{",
"if",
"(",
"label",
"==",
"null",
"||",
"settings",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"label",
"==",
"labelMonth",
"||",
"label",
"==",
"labe... | labelIndicatorSetColorsToDefaultState, This event is called to set a label indicator to the
state it should have when there is no mouse hovering over it. | [
"labelIndicatorSetColorsToDefaultState",
"This",
"event",
"is",
"called",
"to",
"set",
"a",
"label",
"indicator",
"to",
"the",
"state",
"it",
"should",
"have",
"when",
"there",
"is",
"no",
"mouse",
"hovering",
"over",
"it",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/components/CalendarPanel.java#L961-L977 |
darrachequesne/spring-data-jpa-datatables | src/main/java/org/springframework/data/jpa/datatables/mapping/DataTablesInput.java | DataTablesInput.addColumn | public void addColumn(String columnName, boolean searchable, boolean orderable,
String searchValue) {
this.columns.add(new Column(columnName, "", searchable, orderable,
new Search(searchValue, false)));
} | java | public void addColumn(String columnName, boolean searchable, boolean orderable,
String searchValue) {
this.columns.add(new Column(columnName, "", searchable, orderable,
new Search(searchValue, false)));
} | [
"public",
"void",
"addColumn",
"(",
"String",
"columnName",
",",
"boolean",
"searchable",
",",
"boolean",
"orderable",
",",
"String",
"searchValue",
")",
"{",
"this",
".",
"columns",
".",
"add",
"(",
"new",
"Column",
"(",
"columnName",
",",
"\"\"",
",",
"s... | Add a new column
@param columnName the name of the column
@param searchable whether the column is searchable or not
@param orderable whether the column is orderable or not
@param searchValue if any, the search value to apply | [
"Add",
"a",
"new",
"column"
] | train | https://github.com/darrachequesne/spring-data-jpa-datatables/blob/0174dec8f52595a8e4b79f32c79922d64b02b732/src/main/java/org/springframework/data/jpa/datatables/mapping/DataTablesInput.java#L100-L104 |
stephanrauh/AngularFaces | AngularFaces_2.0/AngularFaces-core/src/main/java/de/beyondjava/angularFaces/components/puiupdateModelAfterAJAXRequest/PuiUpdateModelAfterAJAXRequestRenderer.java | PuiUpdateModelAfterAJAXRequestRenderer.encodeBegin | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (FacesContext.getCurrentInstance().isPostback()) {
ResponseWriter writer = context.getResponseWriter();
writer.writeText("\n", null);
writer.startElement("script", component);
writer.write("if (window.j... | java | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (FacesContext.getCurrentInstance().isPostback()) {
ResponseWriter writer = context.getResponseWriter();
writer.writeText("\n", null);
writer.startElement("script", component);
writer.write("if (window.j... | [
"@",
"Override",
"public",
"void",
"encodeBegin",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"FacesContext",
".",
"getCurrentInstance",
"(",
")",
".",
"isPostback",
"(",
")",
")",
"{",
"Respon... | private static final Logger LOGGER = Logger.getLogger("de.beyondjava.angularFaces.components.puiupdateModelAfterAJAXRequest.puiUpdateModelAfterAJAXRequestRenderer"); | [
"private",
"static",
"final",
"Logger",
"LOGGER",
"=",
"Logger",
".",
"getLogger",
"(",
"de",
".",
"beyondjava",
".",
"angularFaces",
".",
"components",
".",
"puiupdateModelAfterAJAXRequest",
".",
"puiUpdateModelAfterAJAXRequestRenderer",
")",
";"
] | train | https://github.com/stephanrauh/AngularFaces/blob/43d915f004645b1bbbf2625214294dab0858ba01/AngularFaces_2.0/AngularFaces-core/src/main/java/de/beyondjava/angularFaces/components/puiupdateModelAfterAJAXRequest/PuiUpdateModelAfterAJAXRequestRenderer.java#L37-L51 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/DatabaseAutomaticTuningsInner.java | DatabaseAutomaticTuningsInner.updateAsync | public Observable<DatabaseAutomaticTuningInner> updateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseAutomaticTuningInner parameters) {
return updateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1<ServiceResponse<DatabaseAutomaticT... | java | public Observable<DatabaseAutomaticTuningInner> updateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseAutomaticTuningInner parameters) {
return updateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1<ServiceResponse<DatabaseAutomaticT... | [
"public",
"Observable",
"<",
"DatabaseAutomaticTuningInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"DatabaseAutomaticTuningInner",
"parameters",
")",
"{",
"return",
"updateWithServiceResponse... | Update automatic tuning properties for target database.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@param paramet... | [
"Update",
"automatic",
"tuning",
"properties",
"for",
"target",
"database",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/DatabaseAutomaticTuningsInner.java#L201-L208 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/BaseField.java | BaseField.setupTableLookup | public ScreenComponent setupTableLookup(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Rec record, int iQueryKeySeq, Converter fldDisplayFieldDesc, boolean bIncludeBlankOption, boolean bIncludeFormButton)
{
String keyAreaName = null;
if (iQueryKeySeq !... | java | public ScreenComponent setupTableLookup(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Rec record, int iQueryKeySeq, Converter fldDisplayFieldDesc, boolean bIncludeBlankOption, boolean bIncludeFormButton)
{
String keyAreaName = null;
if (iQueryKeySeq !... | [
"public",
"ScreenComponent",
"setupTableLookup",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Rec",
"record",
",",
"int",
"iQueryKeySeq",
",",
"Converter",
"fldDisplayFieldDe... | Same as setupTablePopup for larger files (that don't fit in a popup).
Displays a [Key to record (opt)] [Record Description] [Lookup button] [Form button (opt)]
@param record Record to display in a popup
@param iQueryKeySeq Key to use for code-lookup operation (-1 = None)
@param iDisplayFieldSeq Description field for th... | [
"Same",
"as",
"setupTablePopup",
"for",
"larger",
"files",
"(",
"that",
"don",
"t",
"fit",
"in",
"a",
"popup",
")",
".",
"Displays",
"a",
"[",
"Key",
"to",
"record",
"(",
"opt",
")",
"]",
"[",
"Record",
"Description",
"]",
"[",
"Lookup",
"button",
"]... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L1304-L1310 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/BaseXmlParser.java | BaseXmlParser.addProperties | protected void addProperties(Element element, BeanDefinitionBuilder builder) {
NamedNodeMap attributes = element.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node node = attributes.item(i);
String attrName = getNodeName(node);
attrName ... | java | protected void addProperties(Element element, BeanDefinitionBuilder builder) {
NamedNodeMap attributes = element.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node node = attributes.item(i);
String attrName = getNodeName(node);
attrName ... | [
"protected",
"void",
"addProperties",
"(",
"Element",
"element",
",",
"BeanDefinitionBuilder",
"builder",
")",
"{",
"NamedNodeMap",
"attributes",
"=",
"element",
".",
"getAttributes",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"attribute... | Adds all attributes of the specified elements as properties in the current builder.
@param element Element whose attributes are to be added.
@param builder Target builder. | [
"Adds",
"all",
"attributes",
"of",
"the",
"specified",
"elements",
"as",
"properties",
"in",
"the",
"current",
"builder",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/BaseXmlParser.java#L93-L102 |
square/android-times-square | library/src/main/java/com/squareup/timessquare/CalendarPickerView.java | CalendarPickerView.getMonthCellWithIndexByDate | private MonthCellWithMonthIndex getMonthCellWithIndexByDate(Date date) {
Calendar searchCal = Calendar.getInstance(timeZone, locale);
searchCal.setTime(date);
String monthKey = monthKey(searchCal);
Calendar actCal = Calendar.getInstance(timeZone, locale);
int index = cells.getIndexOfKey(monthKey);
... | java | private MonthCellWithMonthIndex getMonthCellWithIndexByDate(Date date) {
Calendar searchCal = Calendar.getInstance(timeZone, locale);
searchCal.setTime(date);
String monthKey = monthKey(searchCal);
Calendar actCal = Calendar.getInstance(timeZone, locale);
int index = cells.getIndexOfKey(monthKey);
... | [
"private",
"MonthCellWithMonthIndex",
"getMonthCellWithIndexByDate",
"(",
"Date",
"date",
")",
"{",
"Calendar",
"searchCal",
"=",
"Calendar",
".",
"getInstance",
"(",
"timeZone",
",",
"locale",
")",
";",
"searchCal",
".",
"setTime",
"(",
"date",
")",
";",
"Strin... | Return cell and month-index (for scrolling) for a given Date. | [
"Return",
"cell",
"and",
"month",
"-",
"index",
"(",
"for",
"scrolling",
")",
"for",
"a",
"given",
"Date",
"."
] | train | https://github.com/square/android-times-square/blob/83b08e7cc220d587845054cd1471a604d17721f6/library/src/main/java/com/squareup/timessquare/CalendarPickerView.java#L861-L878 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/StatementExecutor.java | StatementExecutor.queryForId | public T queryForId(DatabaseConnection databaseConnection, ID id, ObjectCache objectCache) throws SQLException {
if (mappedQueryForId == null) {
mappedQueryForId = MappedQueryForFieldEq.build(dao, tableInfo, null);
}
return mappedQueryForId.execute(databaseConnection, id, objectCache);
} | java | public T queryForId(DatabaseConnection databaseConnection, ID id, ObjectCache objectCache) throws SQLException {
if (mappedQueryForId == null) {
mappedQueryForId = MappedQueryForFieldEq.build(dao, tableInfo, null);
}
return mappedQueryForId.execute(databaseConnection, id, objectCache);
} | [
"public",
"T",
"queryForId",
"(",
"DatabaseConnection",
"databaseConnection",
",",
"ID",
"id",
",",
"ObjectCache",
"objectCache",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"mappedQueryForId",
"==",
"null",
")",
"{",
"mappedQueryForId",
"=",
"MappedQueryForField... | Return the object associated with the id or null if none. This does a SQL
{@code SELECT col1,col2,... FROM ... WHERE ... = id} type query. | [
"Return",
"the",
"object",
"associated",
"with",
"the",
"id",
"or",
"null",
"if",
"none",
".",
"This",
"does",
"a",
"SQL",
"{"
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L90-L95 |
alkacon/opencms-core | src/org/opencms/ui/login/CmsTokenValidator.java | CmsTokenValidator.createToken | public static String createToken(CmsObject cms, CmsUser user, long currentTime) throws CmsException {
String randomKey = RandomStringUtils.randomAlphanumeric(8);
String value = CmsEncoder.encodeStringsAsBase64Parameter(Arrays.asList(randomKey, "" + currentTime));
user.setAdditionalInfo(ADDINFO_... | java | public static String createToken(CmsObject cms, CmsUser user, long currentTime) throws CmsException {
String randomKey = RandomStringUtils.randomAlphanumeric(8);
String value = CmsEncoder.encodeStringsAsBase64Parameter(Arrays.asList(randomKey, "" + currentTime));
user.setAdditionalInfo(ADDINFO_... | [
"public",
"static",
"String",
"createToken",
"(",
"CmsObject",
"cms",
",",
"CmsUser",
"user",
",",
"long",
"currentTime",
")",
"throws",
"CmsException",
"{",
"String",
"randomKey",
"=",
"RandomStringUtils",
".",
"randomAlphanumeric",
"(",
"8",
")",
";",
"String"... | Creates a new token for the given user and stores it in the user's additional info.<p>
@param cms the CMS context
@param user the user
@param currentTime the current time
@return the authorization token
@throws CmsException if something goes wrong | [
"Creates",
"a",
"new",
"token",
"for",
"the",
"given",
"user",
"and",
"stores",
"it",
"in",
"the",
"user",
"s",
"additional",
"info",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/login/CmsTokenValidator.java#L80-L87 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/util/ClassLoaderUtils.java | ClassLoaderUtils.listResources | public static Collection<String> listResources(ClassLoader classLoader, String rootPath, Predicate<String> predicate) {
String jarPath = null;
JarFile jar = null;
try {
Collection<String> paths = new ArrayList<>();
URL root = classLoader.getResource(rootPath);
if (root != null) {
c... | java | public static Collection<String> listResources(ClassLoader classLoader, String rootPath, Predicate<String> predicate) {
String jarPath = null;
JarFile jar = null;
try {
Collection<String> paths = new ArrayList<>();
URL root = classLoader.getResource(rootPath);
if (root != null) {
c... | [
"public",
"static",
"Collection",
"<",
"String",
">",
"listResources",
"(",
"ClassLoader",
"classLoader",
",",
"String",
"rootPath",
",",
"Predicate",
"<",
"String",
">",
"predicate",
")",
"{",
"String",
"jarPath",
"=",
"null",
";",
"JarFile",
"jar",
"=",
"n... | Finds directories and files within a given directory and its subdirectories.
@param classLoader
@param rootPath the root directory, for example org/sonar/sqale, or a file in this root directory, for example org/sonar/sqale/index.txt
@param predicate
@return a list of relative paths, for example {"org/sonar/sqale", ... | [
"Finds",
"directories",
"and",
"files",
"within",
"a",
"given",
"directory",
"and",
"its",
"subdirectories",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/util/ClassLoaderUtils.java#L62-L97 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/PeerGroup.java | PeerGroup.createPeer | @GuardedBy("lock")
protected Peer createPeer(PeerAddress address, VersionMessage ver) {
return new Peer(params, ver, address, chain, downloadTxDependencyDepth);
} | java | @GuardedBy("lock")
protected Peer createPeer(PeerAddress address, VersionMessage ver) {
return new Peer(params, ver, address, chain, downloadTxDependencyDepth);
} | [
"@",
"GuardedBy",
"(",
"\"lock\"",
")",
"protected",
"Peer",
"createPeer",
"(",
"PeerAddress",
"address",
",",
"VersionMessage",
"ver",
")",
"{",
"return",
"new",
"Peer",
"(",
"params",
",",
"ver",
",",
"address",
",",
"chain",
",",
"downloadTxDependencyDepth"... | You can override this to customise the creation of {@link Peer} objects. | [
"You",
"can",
"override",
"this",
"to",
"customise",
"the",
"creation",
"of",
"{"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/PeerGroup.java#L1381-L1384 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/UpdateIntegrationResponseResult.java | UpdateIntegrationResponseResult.withResponseTemplates | public UpdateIntegrationResponseResult withResponseTemplates(java.util.Map<String, String> responseTemplates) {
setResponseTemplates(responseTemplates);
return this;
} | java | public UpdateIntegrationResponseResult withResponseTemplates(java.util.Map<String, String> responseTemplates) {
setResponseTemplates(responseTemplates);
return this;
} | [
"public",
"UpdateIntegrationResponseResult",
"withResponseTemplates",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"responseTemplates",
")",
"{",
"setResponseTemplates",
"(",
"responseTemplates",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Specifies the templates used to transform the integration response body. Response templates are represented as a
key/value map, with a content-type as the key and a template as the value.
</p>
@param responseTemplates
Specifies the templates used to transform the integration response body. Response templates are
r... | [
"<p",
">",
"Specifies",
"the",
"templates",
"used",
"to",
"transform",
"the",
"integration",
"response",
"body",
".",
"Response",
"templates",
"are",
"represented",
"as",
"a",
"key",
"/",
"value",
"map",
"with",
"a",
"content",
"-",
"type",
"as",
"the",
"k... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/UpdateIntegrationResponseResult.java#L351-L354 |
facebookarchive/hadoop-20 | src/contrib/data_join/src/java/org/apache/hadoop/contrib/utils/join/JobBase.java | JobBase.addLongValue | protected Long addLongValue(Object name, long inc) {
Long val = this.longCounters.get(name);
Long retv = null;
if (val == null) {
retv = new Long(inc);
} else {
retv = new Long(val.longValue() + inc);
}
this.longCounters.put(name, retv);
return retv;
} | java | protected Long addLongValue(Object name, long inc) {
Long val = this.longCounters.get(name);
Long retv = null;
if (val == null) {
retv = new Long(inc);
} else {
retv = new Long(val.longValue() + inc);
}
this.longCounters.put(name, retv);
return retv;
} | [
"protected",
"Long",
"addLongValue",
"(",
"Object",
"name",
",",
"long",
"inc",
")",
"{",
"Long",
"val",
"=",
"this",
".",
"longCounters",
".",
"get",
"(",
"name",
")",
";",
"Long",
"retv",
"=",
"null",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{"... | Increment the given counter by the given incremental value If the counter
does not exist, one is created with value 0.
@param name
the counter name
@param inc
the incremental value
@return the updated value. | [
"Increment",
"the",
"given",
"counter",
"by",
"the",
"given",
"incremental",
"value",
"If",
"the",
"counter",
"does",
"not",
"exist",
"one",
"is",
"created",
"with",
"value",
"0",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/data_join/src/java/org/apache/hadoop/contrib/utils/join/JobBase.java#L99-L109 |
albfernandez/itext2 | src/main/java/com/lowagie/text/FontFactoryImp.java | FontFactoryImp.registerFamily | public void registerFamily(String familyName, String fullName, String path) {
if (path != null)
trueTypeFonts.setProperty(fullName, path);
ArrayList tmp = (ArrayList) fontFamilies.get(familyName);
if (tmp == null) {
tmp = new ArrayList();
tmp.add(fullName);
... | java | public void registerFamily(String familyName, String fullName, String path) {
if (path != null)
trueTypeFonts.setProperty(fullName, path);
ArrayList tmp = (ArrayList) fontFamilies.get(familyName);
if (tmp == null) {
tmp = new ArrayList();
tmp.add(fullName);
... | [
"public",
"void",
"registerFamily",
"(",
"String",
"familyName",
",",
"String",
"fullName",
",",
"String",
"path",
")",
"{",
"if",
"(",
"path",
"!=",
"null",
")",
"trueTypeFonts",
".",
"setProperty",
"(",
"fullName",
",",
"path",
")",
";",
"ArrayList",
"tm... | Register a font by giving explicitly the font family and name.
@param familyName the font family
@param fullName the font name
@param path the font path | [
"Register",
"a",
"font",
"by",
"giving",
"explicitly",
"the",
"font",
"family",
"and",
"name",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/FontFactoryImp.java#L486-L508 |
apereo/cas | core/cas-server-core-rest/src/main/java/org/apereo/cas/rest/factory/CasProtocolServiceTicketResourceEntityResponseFactory.java | CasProtocolServiceTicketResourceEntityResponseFactory.grantServiceTicket | protected String grantServiceTicket(final String ticketGrantingTicket, final Service service, final AuthenticationResult authenticationResult) {
val ticket = centralAuthenticationService.grantServiceTicket(ticketGrantingTicket, service, authenticationResult);
LOGGER.debug("Generated service ticket [{}]... | java | protected String grantServiceTicket(final String ticketGrantingTicket, final Service service, final AuthenticationResult authenticationResult) {
val ticket = centralAuthenticationService.grantServiceTicket(ticketGrantingTicket, service, authenticationResult);
LOGGER.debug("Generated service ticket [{}]... | [
"protected",
"String",
"grantServiceTicket",
"(",
"final",
"String",
"ticketGrantingTicket",
",",
"final",
"Service",
"service",
",",
"final",
"AuthenticationResult",
"authenticationResult",
")",
"{",
"val",
"ticket",
"=",
"centralAuthenticationService",
".",
"grantServic... | Grant service ticket service ticket.
@param ticketGrantingTicket the ticket granting ticket
@param service the service
@param authenticationResult the authentication result
@return the service ticket | [
"Grant",
"service",
"ticket",
"service",
"ticket",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-rest/src/main/java/org/apereo/cas/rest/factory/CasProtocolServiceTicketResourceEntityResponseFactory.java#L42-L47 |
code4craft/webmagic | webmagic-core/src/main/java/us/codecraft/webmagic/Site.java | Site.addHeader | public Site addHeader(String key, String value) {
headers.put(key, value);
return this;
} | java | public Site addHeader(String key, String value) {
headers.put(key, value);
return this;
} | [
"public",
"Site",
"addHeader",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"headers",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Put an Http header for downloader. <br>
Use {@link #addCookie(String, String)} for cookie and {@link #setUserAgent(String)} for user-agent. <br>
@param key key of http header, there are some keys constant in {@link HttpConstant.Header}
@param value value of header
@return this | [
"Put",
"an",
"Http",
"header",
"for",
"downloader",
".",
"<br",
">",
"Use",
"{",
"@link",
"#addCookie",
"(",
"String",
"String",
")",
"}",
"for",
"cookie",
"and",
"{",
"@link",
"#setUserAgent",
"(",
"String",
")",
"}",
"for",
"user",
"-",
"agent",
".",... | train | https://github.com/code4craft/webmagic/blob/be892b80bf6682cd063d30ac25a79be0c079a901/webmagic-core/src/main/java/us/codecraft/webmagic/Site.java#L247-L250 |
elastic/elasticsearch-hadoop | mr/src/main/java/org/elasticsearch/hadoop/rest/RestService.java | RestService.initMultiIndices | private static RestRepository initMultiIndices(Settings settings, long currentInstance, Resource resource, Log log) {
if (log.isDebugEnabled()) {
log.debug(String.format("Resource [%s] resolves as an index pattern", resource));
}
// multi-index write - since we don't know before han... | java | private static RestRepository initMultiIndices(Settings settings, long currentInstance, Resource resource, Log log) {
if (log.isDebugEnabled()) {
log.debug(String.format("Resource [%s] resolves as an index pattern", resource));
}
// multi-index write - since we don't know before han... | [
"private",
"static",
"RestRepository",
"initMultiIndices",
"(",
"Settings",
"settings",
",",
"long",
"currentInstance",
",",
"Resource",
"resource",
",",
"Log",
"log",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug"... | Creates a RestRepository for use with a multi-index resource pattern. The client is left pinned
to the original node that it was pinned to since the shard locations cannot be determined at all.
@param settings Job settings
@param currentInstance Partition number
@param resource Configured write resource
@param log Logg... | [
"Creates",
"a",
"RestRepository",
"for",
"use",
"with",
"a",
"multi",
"-",
"index",
"resource",
"pattern",
".",
"The",
"client",
"is",
"left",
"pinned",
"to",
"the",
"original",
"node",
"that",
"it",
"was",
"pinned",
"to",
"since",
"the",
"shard",
"locatio... | train | https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/rest/RestService.java#L732-L744 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/read/ReadFileExtensions.java | ReadFileExtensions.readFromFile | public static String readFromFile(final File file, final Charset encoding) throws IOException
{
return inputStream2String(StreamExtensions.getInputStream(file), encoding);
} | java | public static String readFromFile(final File file, final Charset encoding) throws IOException
{
return inputStream2String(StreamExtensions.getInputStream(file), encoding);
} | [
"public",
"static",
"String",
"readFromFile",
"(",
"final",
"File",
"file",
",",
"final",
"Charset",
"encoding",
")",
"throws",
"IOException",
"{",
"return",
"inputStream2String",
"(",
"StreamExtensions",
".",
"getInputStream",
"(",
"file",
")",
",",
"encoding",
... | Read from file.
@param file
the file
@param encoding
the encoding
@return the string
@throws IOException
Signals that an I/O exception has occurred. | [
"Read",
"from",
"file",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/read/ReadFileExtensions.java#L184-L187 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/LockFile.java | LockFile.closeRAF | private final void closeRAF() throws LockFile.UnexpectedFileIOException {
if (raf != null) {
try {
raf.close();
} catch (IOException ex) {
throw new UnexpectedFileIOException(this, "closeRAF", ex);
} finally {
raf = null;
... | java | private final void closeRAF() throws LockFile.UnexpectedFileIOException {
if (raf != null) {
try {
raf.close();
} catch (IOException ex) {
throw new UnexpectedFileIOException(this, "closeRAF", ex);
} finally {
raf = null;
... | [
"private",
"final",
"void",
"closeRAF",
"(",
")",
"throws",
"LockFile",
".",
"UnexpectedFileIOException",
"{",
"if",
"(",
"raf",
"!=",
"null",
")",
"{",
"try",
"{",
"raf",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
")",
"{",
... | Closes this object's {@link #raf RandomAccessFile}. <p>
As a side-effect, the associated <tt>FileChannel</tt> object, if any,
is closed as well.
@throws UnexpectedFileIOException if an <tt>IOException</tt> is thrown | [
"Closes",
"this",
"object",
"s",
"{",
"@link",
"#raf",
"RandomAccessFile",
"}",
".",
"<p",
">"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/LockFile.java#L870-L881 |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java | XLinkUtils.setValueOfModel | public static void setValueOfModel(Object model, OpenEngSBModelEntry entry, Object value) throws
NoSuchFieldException,
IllegalArgumentException,
IllegalAccessException {
Class clazz = model.getClass();
Field field = clazz.getDeclaredField(entry.getKey());
f... | java | public static void setValueOfModel(Object model, OpenEngSBModelEntry entry, Object value) throws
NoSuchFieldException,
IllegalArgumentException,
IllegalAccessException {
Class clazz = model.getClass();
Field field = clazz.getDeclaredField(entry.getKey());
f... | [
"public",
"static",
"void",
"setValueOfModel",
"(",
"Object",
"model",
",",
"OpenEngSBModelEntry",
"entry",
",",
"Object",
"value",
")",
"throws",
"NoSuchFieldException",
",",
"IllegalArgumentException",
",",
"IllegalAccessException",
"{",
"Class",
"clazz",
"=",
"mode... | Sets the value, of the field defined in the OpenEngSBModelEntry, the the given model,
with reflection. | [
"Sets",
"the",
"value",
"of",
"the",
"field",
"defined",
"in",
"the",
"OpenEngSBModelEntry",
"the",
"the",
"given",
"model",
"with",
"reflection",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java#L120-L128 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/locale/InternalLocaleBuilder.java | InternalLocaleBuilder.removePrivateuseVariant | static String removePrivateuseVariant(String privuseVal) {
StringTokenIterator itr = new StringTokenIterator(privuseVal, LanguageTag.SEP);
// Note: privateuse value "abc-lvariant" is unchanged
// because no subtags after "lvariant".
int prefixStart = -1;
boolean sawPrivuseVar =... | java | static String removePrivateuseVariant(String privuseVal) {
StringTokenIterator itr = new StringTokenIterator(privuseVal, LanguageTag.SEP);
// Note: privateuse value "abc-lvariant" is unchanged
// because no subtags after "lvariant".
int prefixStart = -1;
boolean sawPrivuseVar =... | [
"static",
"String",
"removePrivateuseVariant",
"(",
"String",
"privuseVal",
")",
"{",
"StringTokenIterator",
"itr",
"=",
"new",
"StringTokenIterator",
"(",
"privuseVal",
",",
"LanguageTag",
".",
"SEP",
")",
";",
"// Note: privateuse value \"abc-lvariant\" is unchanged",
"... | /*
Remove special private use subtag sequence identified by "lvariant"
and return the rest. Only used by LocaleExtensions | [
"/",
"*",
"Remove",
"special",
"private",
"use",
"subtag",
"sequence",
"identified",
"by",
"lvariant",
"and",
"return",
"the",
"rest",
".",
"Only",
"used",
"by",
"LocaleExtensions"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/locale/InternalLocaleBuilder.java#L513-L539 |
FudanNLP/fnlp | fnlp-core/src/main/java/org/fnlp/nlp/langmodel/lda/LdaGibbsSampler.java | LdaGibbsSampler.sampleFullConditional | private int sampleFullConditional(int m, int n) {
// remove z_i from the count variables
int topic = z[m][n];
word_topic_matrix[documents[m][n]][topic]--;
nd[m][topic]--;
nwsum[topic]--;
ndsum[m]--;
// do multinomial sampling via cumulative method:
... | java | private int sampleFullConditional(int m, int n) {
// remove z_i from the count variables
int topic = z[m][n];
word_topic_matrix[documents[m][n]][topic]--;
nd[m][topic]--;
nwsum[topic]--;
ndsum[m]--;
// do multinomial sampling via cumulative method:
... | [
"private",
"int",
"sampleFullConditional",
"(",
"int",
"m",
",",
"int",
"n",
")",
"{",
"// remove z_i from the count variables\r",
"int",
"topic",
"=",
"z",
"[",
"m",
"]",
"[",
"n",
"]",
";",
"word_topic_matrix",
"[",
"documents",
"[",
"m",
"]",
"[",
"n",
... | Sample a topic z_i from the full conditional distribution: p(z_i = j |
z_-i, w) = (n_-i,j(w_i) + beta)/(n_-i,j(.) + W * beta) * (n_-i,j(d_i) +
alpha)/(n_-i,.(d_i) + K * alpha)
@param m
document
@param n
word | [
"Sample",
"a",
"topic",
"z_i",
"from",
"the",
"full",
"conditional",
"distribution",
":",
"p",
"(",
"z_i",
"=",
"j",
"|",
"z_",
"-",
"i",
"w",
")",
"=",
"(",
"n_",
"-",
"i",
"j",
"(",
"w_i",
")",
"+",
"beta",
")",
"/",
"(",
"n_",
"-",
"i",
... | train | https://github.com/FudanNLP/fnlp/blob/ce258f3e4a5add2ba0b5e4cbac7cab2190af6659/fnlp-core/src/main/java/org/fnlp/nlp/langmodel/lda/LdaGibbsSampler.java#L255-L280 |
Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/shared/Applications.java | Applications.getNextIndex | public AtomicLong getNextIndex(String virtualHostname, boolean secure) {
Map<String, VipIndexSupport> index = (secure) ? secureVirtualHostNameAppMap : virtualHostNameAppMap;
return Optional.ofNullable(index.get(virtualHostname.toUpperCase(Locale.ROOT)))
.map(VipIndexSupport::getRoundRobi... | java | public AtomicLong getNextIndex(String virtualHostname, boolean secure) {
Map<String, VipIndexSupport> index = (secure) ? secureVirtualHostNameAppMap : virtualHostNameAppMap;
return Optional.ofNullable(index.get(virtualHostname.toUpperCase(Locale.ROOT)))
.map(VipIndexSupport::getRoundRobi... | [
"public",
"AtomicLong",
"getNextIndex",
"(",
"String",
"virtualHostname",
",",
"boolean",
"secure",
")",
"{",
"Map",
"<",
"String",
",",
"VipIndexSupport",
">",
"index",
"=",
"(",
"secure",
")",
"?",
"secureVirtualHostNameAppMap",
":",
"virtualHostNameAppMap",
";"... | Gets the next round-robin index for the given virtual host name. This
index is reset after every registry fetch cycle.
@param virtualHostname
the virtual host name.
@param secure
indicates whether it is a secure request or a non-secure
request.
@return AtomicLong value representing the next round-robin index. | [
"Gets",
"the",
"next",
"round",
"-",
"robin",
"index",
"for",
"the",
"given",
"virtual",
"host",
"name",
".",
"This",
"index",
"is",
"reset",
"after",
"every",
"registry",
"fetch",
"cycle",
"."
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/shared/Applications.java#L338-L343 |
attribyte/wpdb | src/main/java/org/attribyte/wp/model/User.java | User.withMetadata | public User withMetadata(final List<Meta> metadata) {
return new User(id, username, displayName, slug, email, createTimestamp, url, metadata);
} | java | public User withMetadata(final List<Meta> metadata) {
return new User(id, username, displayName, slug, email, createTimestamp, url, metadata);
} | [
"public",
"User",
"withMetadata",
"(",
"final",
"List",
"<",
"Meta",
">",
"metadata",
")",
"{",
"return",
"new",
"User",
"(",
"id",
",",
"username",
",",
"displayName",
",",
"slug",
",",
"email",
",",
"createTimestamp",
",",
"url",
",",
"metadata",
")",
... | Creates a user with added metadata.
@param metadata The metadata.
@return The user with metadata added. | [
"Creates",
"a",
"user",
"with",
"added",
"metadata",
"."
] | train | https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/model/User.java#L147-L149 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/maven3/Maven3Builder.java | Maven3Builder.copyClassWorldsFile | private FilePath copyClassWorldsFile(FilePath ws, URL resource) {
try {
FilePath remoteClassworlds =
ws.createTextTempFile("classworlds", "conf", "");
remoteClassworlds.copyFrom(resource);
return remoteClassworlds;
} catch (Exception e) {
... | java | private FilePath copyClassWorldsFile(FilePath ws, URL resource) {
try {
FilePath remoteClassworlds =
ws.createTextTempFile("classworlds", "conf", "");
remoteClassworlds.copyFrom(resource);
return remoteClassworlds;
} catch (Exception e) {
... | [
"private",
"FilePath",
"copyClassWorldsFile",
"(",
"FilePath",
"ws",
",",
"URL",
"resource",
")",
"{",
"try",
"{",
"FilePath",
"remoteClassworlds",
"=",
"ws",
".",
"createTextTempFile",
"(",
"\"classworlds\"",
",",
"\"conf\"",
",",
"\"\"",
")",
";",
"remoteClass... | Copies a classworlds file to a temporary location either on the local filesystem or on a slave depending on the
node type.
@return The path of the classworlds.conf file | [
"Copies",
"a",
"classworlds",
"file",
"to",
"a",
"temporary",
"location",
"either",
"on",
"the",
"local",
"filesystem",
"or",
"on",
"a",
"slave",
"depending",
"on",
"the",
"node",
"type",
"."
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/maven3/Maven3Builder.java#L284-L293 |
kirgor/enklib | common/src/main/java/com/kirgor/enklib/common/NamingUtils.java | NamingUtils.snakeToCamel | public static String snakeToCamel(String snake, boolean upper) {
StringBuilder sb = new StringBuilder();
boolean firstWord = true;
for (String word : snake.split("_")) {
if (!word.isEmpty()) {
if (firstWord && !upper) {
sb.append(word.toLowerCase()... | java | public static String snakeToCamel(String snake, boolean upper) {
StringBuilder sb = new StringBuilder();
boolean firstWord = true;
for (String word : snake.split("_")) {
if (!word.isEmpty()) {
if (firstWord && !upper) {
sb.append(word.toLowerCase()... | [
"public",
"static",
"String",
"snakeToCamel",
"(",
"String",
"snake",
",",
"boolean",
"upper",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"boolean",
"firstWord",
"=",
"true",
";",
"for",
"(",
"String",
"word",
":",
"snake"... | Converts snake case string (lower or upper) to camel case,
for example 'hello_world' or 'HELLO_WORLD' -> 'helloWorld' or 'HelloWorld'.
@param snake Input string.
@param upper True if result snake cased string should be upper cased like 'HelloWorld'. | [
"Converts",
"snake",
"case",
"string",
"(",
"lower",
"or",
"upper",
")",
"to",
"camel",
"case",
"for",
"example",
"hello_world",
"or",
"HELLO_WORLD",
"-",
">",
"helloWorld",
"or",
"HelloWorld",
"."
] | train | https://github.com/kirgor/enklib/blob/8a24db296dc43db5d8fe509cf64ace0a0c7be8f2/common/src/main/java/com/kirgor/enklib/common/NamingUtils.java#L82-L96 |
keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/NDArrayDoubles.java | NDArrayDoubles.setAssignmentValue | public void setAssignmentValue(int[] assignment, double value) {
assert !Double.isNaN(value);
values[getTableAccessOffset(assignment)] = value;
} | java | public void setAssignmentValue(int[] assignment, double value) {
assert !Double.isNaN(value);
values[getTableAccessOffset(assignment)] = value;
} | [
"public",
"void",
"setAssignmentValue",
"(",
"int",
"[",
"]",
"assignment",
",",
"double",
"value",
")",
"{",
"assert",
"!",
"Double",
".",
"isNaN",
"(",
"value",
")",
";",
"values",
"[",
"getTableAccessOffset",
"(",
"assignment",
")",
"]",
"=",
"value",
... | Set a single value in the factor table.
@param assignment a list of variable settings, in the same order as the neighbors array of the factor
@param value the value to put into the factor table | [
"Set",
"a",
"single",
"value",
"in",
"the",
"factor",
"table",
"."
] | train | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/NDArrayDoubles.java#L71-L74 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.