repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
brianwhu/xillium | gear/src/main/java/org/xillium/gear/auth/DatabaseBackedAuthority.java | DatabaseBackedAuthority.loadRolesAndPermissions | @Transactional(readOnly=true)
public List<Permission> loadRolesAndPermissions() throws Exception {
return _persistence.getResults(_qRoleAuthorizations, null);
} | java | @Transactional(readOnly=true)
public List<Permission> loadRolesAndPermissions() throws Exception {
return _persistence.getResults(_qRoleAuthorizations, null);
} | [
"@",
"Transactional",
"(",
"readOnly",
"=",
"true",
")",
"public",
"List",
"<",
"Permission",
">",
"loadRolesAndPermissions",
"(",
")",
"throws",
"Exception",
"{",
"return",
"_persistence",
".",
"getResults",
"(",
"_qRoleAuthorizations",
",",
"null",
")",
";",
... | Loads all role permissions into memory. | [
"Loads",
"all",
"role",
"permissions",
"into",
"memory",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/gear/src/main/java/org/xillium/gear/auth/DatabaseBackedAuthority.java#L36-L39 | train |
mcpat/microjiac-public | tools/microjiac-config/src/main/java/de/jiac/micro/config/generator/ConfigurationGenerator.java | ConfigurationGenerator.execute | public static AbstractConfiguration[] execute(String applicationNamespace, ClassLoader loader, Logger log) throws Exception {
String packageName= "de.jiac.micro.internal.latebind";
MicroJIACToolContext context= new MicroJIACToolContext(loader);
ConfigurationGenerator generator= new Configuratio... | java | public static AbstractConfiguration[] execute(String applicationNamespace, ClassLoader loader, Logger log) throws Exception {
String packageName= "de.jiac.micro.internal.latebind";
MicroJIACToolContext context= new MicroJIACToolContext(loader);
ConfigurationGenerator generator= new Configuratio... | [
"public",
"static",
"AbstractConfiguration",
"[",
"]",
"execute",
"(",
"String",
"applicationNamespace",
",",
"ClassLoader",
"loader",
",",
"Logger",
"log",
")",
"throws",
"Exception",
"{",
"String",
"packageName",
"=",
"\"de.jiac.micro.internal.latebind\"",
";",
"Mic... | Return the array of generated node configurations.
@param applicationNamespace the namespace where the application definition is located
@param loader the classloader which has access to all required resources and classes
@param log the log that outputs the plugin informations
@return... | [
"Return",
"the",
"array",
"of",
"generated",
"node",
"configurations",
"."
] | 3c649e44846981a68e84cc4578719532414d8d35 | https://github.com/mcpat/microjiac-public/blob/3c649e44846981a68e84cc4578719532414d8d35/tools/microjiac-config/src/main/java/de/jiac/micro/config/generator/ConfigurationGenerator.java#L517-L540 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java | ProfilePackageIndexFrameWriter.generate | public static void generate(ConfigurationImpl configuration, String profileName) {
ProfilePackageIndexFrameWriter profpackgen;
DocPath filename = DocPaths.profileFrame(profileName);
try {
profpackgen = new ProfilePackageIndexFrameWriter(configuration, filename);
profpackg... | java | public static void generate(ConfigurationImpl configuration, String profileName) {
ProfilePackageIndexFrameWriter profpackgen;
DocPath filename = DocPaths.profileFrame(profileName);
try {
profpackgen = new ProfilePackageIndexFrameWriter(configuration, filename);
profpackg... | [
"public",
"static",
"void",
"generate",
"(",
"ConfigurationImpl",
"configuration",
",",
"String",
"profileName",
")",
"{",
"ProfilePackageIndexFrameWriter",
"profpackgen",
";",
"DocPath",
"filename",
"=",
"DocPaths",
".",
"profileFrame",
"(",
"profileName",
")",
";",
... | Generate the profile package index file.
@throws DocletAbortException
@param configuration the configuration object
@param profileName the name of the profile being documented | [
"Generate",
"the",
"profile",
"package",
"index",
"file",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java#L67-L80 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javadoc/TypeMaker.java | TypeMaker.getTypeString | static String getTypeString(DocEnv env, Type t, boolean full) {
// TODO: should annotations be included here?
if (t.isAnnotated()) {
t = t.unannotatedType();
}
switch (t.getTag()) {
case ARRAY:
StringBuilder s = new StringBuilder();
while (t.ha... | java | static String getTypeString(DocEnv env, Type t, boolean full) {
// TODO: should annotations be included here?
if (t.isAnnotated()) {
t = t.unannotatedType();
}
switch (t.getTag()) {
case ARRAY:
StringBuilder s = new StringBuilder();
while (t.ha... | [
"static",
"String",
"getTypeString",
"(",
"DocEnv",
"env",
",",
"Type",
"t",
",",
"boolean",
"full",
")",
"{",
"// TODO: should annotations be included here?",
"if",
"(",
"t",
".",
"isAnnotated",
"(",
")",
")",
"{",
"t",
"=",
"t",
".",
"unannotatedType",
"("... | Return the string representation of a type use. Bounds of type
variables are not included; bounds of wildcard types are.
Class names are qualified if "full" is true. | [
"Return",
"the",
"string",
"representation",
"of",
"a",
"type",
"use",
".",
"Bounds",
"of",
"type",
"variables",
"are",
"not",
"included",
";",
"bounds",
"of",
"wildcard",
"types",
"are",
".",
"Class",
"names",
"are",
"qualified",
"if",
"full",
"is",
"true... | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javadoc/TypeMaker.java#L155-L178 | train |
defei/codelogger-utils | src/main/java/org/codelogger/utils/PathUtils.java | PathUtils.getWebProjectPath | public static String getWebProjectPath(Object currentObject) {
Class<? extends Object> class1 = currentObject.getClass();
ClassLoader classLoader = class1.getClassLoader();
URL resource = classLoader.getResource("/");
String path = resource.getPath();
int webRootIndex = StringUt... | java | public static String getWebProjectPath(Object currentObject) {
Class<? extends Object> class1 = currentObject.getClass();
ClassLoader classLoader = class1.getClassLoader();
URL resource = classLoader.getResource("/");
String path = resource.getPath();
int webRootIndex = StringUt... | [
"public",
"static",
"String",
"getWebProjectPath",
"(",
"Object",
"currentObject",
")",
"{",
"Class",
"<",
"?",
"extends",
"Object",
">",
"class1",
"=",
"currentObject",
".",
"getClass",
"(",
")",
";",
"ClassLoader",
"classLoader",
"=",
"class1",
".",
"getClas... | The parameter currentObject recommend to user 'this', because of can not
be a object which build by manually with 'new';
@param currentObject
@return web project physical path. | [
"The",
"parameter",
"currentObject",
"recommend",
"to",
"user",
"this",
"because",
"of",
"can",
"not",
"be",
"a",
"object",
"which",
"build",
"by",
"manually",
"with",
"new",
";"
] | d906f5d217b783c7ae3e53442cd6fb87b20ecc0a | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/PathUtils.java#L14-L26 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/BuildState.java | BuildState.flattenPackagesSourcesAndArtifacts | public void flattenPackagesSourcesAndArtifacts(Map<String,Module> m) {
modules = m;
// Extract all the found packages.
for (Module i : modules.values()) {
for (Map.Entry<String,Package> j : i.packages().entrySet()) {
Package p = packages.get(j.getKey());
... | java | public void flattenPackagesSourcesAndArtifacts(Map<String,Module> m) {
modules = m;
// Extract all the found packages.
for (Module i : modules.values()) {
for (Map.Entry<String,Package> j : i.packages().entrySet()) {
Package p = packages.get(j.getKey());
... | [
"public",
"void",
"flattenPackagesSourcesAndArtifacts",
"(",
"Map",
"<",
"String",
",",
"Module",
">",
"m",
")",
"{",
"modules",
"=",
"m",
";",
"// Extract all the found packages.",
"for",
"(",
"Module",
"i",
":",
"modules",
".",
"values",
"(",
")",
")",
"{"... | Store references to all packages, sources and artifacts for all modules
into the build state. I.e. flatten the module tree structure
into global maps stored in the BuildState for easy access.
@param m The set of modules. | [
"Store",
"references",
"to",
"all",
"packages",
"sources",
"and",
"artifacts",
"for",
"all",
"modules",
"into",
"the",
"build",
"state",
".",
"I",
".",
"e",
".",
"flatten",
"the",
"module",
"tree",
"structure",
"into",
"global",
"maps",
"stored",
"in",
"th... | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/BuildState.java#L90-L122 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/BuildState.java | BuildState.checkInternalState | public void checkInternalState(String msg, boolean linkedOnly, Map<String,Source> srcs) {
boolean baad = false;
Map<String,Source> original = new HashMap<String,Source>();
Map<String,Source> calculated = new HashMap<String,Source>();
for (String s : sources.keySet()) {
Sourc... | java | public void checkInternalState(String msg, boolean linkedOnly, Map<String,Source> srcs) {
boolean baad = false;
Map<String,Source> original = new HashMap<String,Source>();
Map<String,Source> calculated = new HashMap<String,Source>();
for (String s : sources.keySet()) {
Sourc... | [
"public",
"void",
"checkInternalState",
"(",
"String",
"msg",
",",
"boolean",
"linkedOnly",
",",
"Map",
"<",
"String",
",",
"Source",
">",
"srcs",
")",
"{",
"boolean",
"baad",
"=",
"false",
";",
"Map",
"<",
"String",
",",
"Source",
">",
"original",
"=",
... | Verify that the setModules method above did the right thing when
running through the module->package->source structure. | [
"Verify",
"that",
"the",
"setModules",
"method",
"above",
"did",
"the",
"right",
"thing",
"when",
"running",
"through",
"the",
"module",
"-",
">",
"package",
"-",
">",
"source",
"structure",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/BuildState.java#L182-L233 | train |
jbundle/osgi | obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java | ObrClassFinderService.getRepositoryAdmin | public RepositoryAdmin getRepositoryAdmin(BundleContext context, ObrClassFinderService autoStartNotify) throws InvalidSyntaxException
{
RepositoryAdmin admin = null;
ServiceReference[] ref = context.getServiceReferences(RepositoryAdmin.class.getName(), null);
if ((ref != null) && (ref.le... | java | public RepositoryAdmin getRepositoryAdmin(BundleContext context, ObrClassFinderService autoStartNotify) throws InvalidSyntaxException
{
RepositoryAdmin admin = null;
ServiceReference[] ref = context.getServiceReferences(RepositoryAdmin.class.getName(), null);
if ((ref != null) && (ref.le... | [
"public",
"RepositoryAdmin",
"getRepositoryAdmin",
"(",
"BundleContext",
"context",
",",
"ObrClassFinderService",
"autoStartNotify",
")",
"throws",
"InvalidSyntaxException",
"{",
"RepositoryAdmin",
"admin",
"=",
"null",
";",
"ServiceReference",
"[",
"]",
"ref",
"=",
"co... | Get the repository admin service.
@param context
@return
@throws InvalidSyntaxException | [
"Get",
"the",
"repository",
"admin",
"service",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java#L70-L88 | train |
jbundle/osgi | obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java | ObrClassFinderService.addBootstrapRepository | public void addBootstrapRepository(RepositoryAdmin repositoryAdmin, BundleContext context)
{
if (repositoryAdmin == null)
return;
String repository = context.getProperty("jbundle.repository.url");
if (repository != null)
if (repository.length() > 0)
this.addRep... | java | public void addBootstrapRepository(RepositoryAdmin repositoryAdmin, BundleContext context)
{
if (repositoryAdmin == null)
return;
String repository = context.getProperty("jbundle.repository.url");
if (repository != null)
if (repository.length() > 0)
this.addRep... | [
"public",
"void",
"addBootstrapRepository",
"(",
"RepositoryAdmin",
"repositoryAdmin",
",",
"BundleContext",
"context",
")",
"{",
"if",
"(",
"repositoryAdmin",
"==",
"null",
")",
"return",
";",
"String",
"repository",
"=",
"context",
".",
"getProperty",
"(",
"\"jb... | Add the standard obr repository, so I can get the bundles that I need.
@param repositoryAdmin
@param context | [
"Add",
"the",
"standard",
"obr",
"repository",
"so",
"I",
"can",
"get",
"the",
"bundles",
"that",
"I",
"need",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java#L94-L105 | train |
jbundle/osgi | obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java | ObrClassFinderService.addRepository | public void addRepository(RepositoryAdmin repositoryAdmin, String repository)
{
try {
if (repository != null)
{
boolean duplicate = false;
for (Repository repo : repositoryAdmin.listRepositories())
{
if (repository.e... | java | public void addRepository(RepositoryAdmin repositoryAdmin, String repository)
{
try {
if (repository != null)
{
boolean duplicate = false;
for (Repository repo : repositoryAdmin.listRepositories())
{
if (repository.e... | [
"public",
"void",
"addRepository",
"(",
"RepositoryAdmin",
"repositoryAdmin",
",",
"String",
"repository",
")",
"{",
"try",
"{",
"if",
"(",
"repository",
"!=",
"null",
")",
"{",
"boolean",
"duplicate",
"=",
"false",
";",
"for",
"(",
"Repository",
"repo",
":"... | Add this repository to my available repositories.
@param repositoryAdmin
@param repository | [
"Add",
"this",
"repository",
"to",
"my",
"available",
"repositories",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java#L111-L132 | train |
jbundle/osgi | obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java | ObrClassFinderService.startClassFinderActivator | public boolean startClassFinderActivator(BundleContext context)
{
if (ClassFinderActivator.getClassFinder(context, 0) == this)
return true; // Already up!
// If the repository is not up, but the bundle is deployed, this will find it
String packageName = ClassFinderActivator.getPackageName... | java | public boolean startClassFinderActivator(BundleContext context)
{
if (ClassFinderActivator.getClassFinder(context, 0) == this)
return true; // Already up!
// If the repository is not up, but the bundle is deployed, this will find it
String packageName = ClassFinderActivator.getPackageName... | [
"public",
"boolean",
"startClassFinderActivator",
"(",
"BundleContext",
"context",
")",
"{",
"if",
"(",
"ClassFinderActivator",
".",
"getClassFinder",
"(",
"context",
",",
"0",
")",
"==",
"this",
")",
"return",
"true",
";",
"// Already up!",
"// If the repository is... | Convenience method to start the class finder utility service.
If admin service is not up yet, this starts it.
@param className
@return true If I'm up already
@return false If I had a problem. | [
"Convenience",
"method",
"to",
"start",
"the",
"class",
"finder",
"utility",
"service",
".",
"If",
"admin",
"service",
"is",
"not",
"up",
"yet",
"this",
"starts",
"it",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java#L167-L195 | train |
jbundle/osgi | obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java | ObrClassFinderService.deployThisResource | public Object deployThisResource(String packageName, String versionRange, boolean start)
{
int options = 0;
//?if (start)
//? options = Resolver.START;
if (repositoryAdmin == null)
return null;
DataModelHelper helper = repositoryAdmin.getHelper();
if (this.getResourceFromCa... | java | public Object deployThisResource(String packageName, String versionRange, boolean start)
{
int options = 0;
//?if (start)
//? options = Resolver.START;
if (repositoryAdmin == null)
return null;
DataModelHelper helper = repositoryAdmin.getHelper();
if (this.getResourceFromCa... | [
"public",
"Object",
"deployThisResource",
"(",
"String",
"packageName",
",",
"String",
"versionRange",
",",
"boolean",
"start",
")",
"{",
"int",
"options",
"=",
"0",
";",
"//?if (start)",
"//?\toptions = Resolver.START;",
"if",
"(",
"repositoryAdmin",
"==",
"null",
... | Find this resource in the repository, then deploy and optionally start it.
@param className
@param options
@return | [
"Find",
"this",
"resource",
"in",
"the",
"repository",
"then",
"deploy",
"and",
"optionally",
"start",
"it",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java#L202-L242 | train |
jbundle/osgi | obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java | ObrClassFinderService.deployResources | public void deployResources(Resource[] resources, int options)
{
if (resources != null)
{
for (Resource resource : resources)
{
this.deployResource(resource, options);
}
}
} | java | public void deployResources(Resource[] resources, int options)
{
if (resources != null)
{
for (Resource resource : resources)
{
this.deployResource(resource, options);
}
}
} | [
"public",
"void",
"deployResources",
"(",
"Resource",
"[",
"]",
"resources",
",",
"int",
"options",
")",
"{",
"if",
"(",
"resources",
"!=",
"null",
")",
"{",
"for",
"(",
"Resource",
"resource",
":",
"resources",
")",
"{",
"this",
".",
"deployResource",
"... | Deploy this list of resources.
@param resources
@param options | [
"Deploy",
"this",
"list",
"of",
"resources",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java#L248-L257 | train |
jbundle/osgi | obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java | ObrClassFinderService.deployResource | public void deployResource(Resource resource, int options)
{
String name = resource.getSymbolicName() + "/" + resource.getVersion();
Lock lock = this.getLock(name);
try {
boolean acquired = lock.tryLock();
if (acquired) { // Good, deploy this resource
try {
R... | java | public void deployResource(Resource resource, int options)
{
String name = resource.getSymbolicName() + "/" + resource.getVersion();
Lock lock = this.getLock(name);
try {
boolean acquired = lock.tryLock();
if (acquired) { // Good, deploy this resource
try {
R... | [
"public",
"void",
"deployResource",
"(",
"Resource",
"resource",
",",
"int",
"options",
")",
"{",
"String",
"name",
"=",
"resource",
".",
"getSymbolicName",
"(",
")",
"+",
"\"/\"",
"+",
"resource",
".",
"getVersion",
"(",
")",
";",
"Lock",
"lock",
"=",
"... | Deploy this resource.
@param resource
@param options | [
"Deploy",
"this",
"resource",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java#L264-L316 | train |
jbundle/osgi | obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java | ObrClassFinderService.isResourceBundleMatch | public boolean isResourceBundleMatch(Object objResource, Bundle bundle)
{
Resource resource = (Resource)objResource;
return ((bundle.getSymbolicName().equals(resource.getSymbolicName())) && (isValidVersion(bundle.getVersion(), resource.getVersion().toString())));
} | java | public boolean isResourceBundleMatch(Object objResource, Bundle bundle)
{
Resource resource = (Resource)objResource;
return ((bundle.getSymbolicName().equals(resource.getSymbolicName())) && (isValidVersion(bundle.getVersion(), resource.getVersion().toString())));
} | [
"public",
"boolean",
"isResourceBundleMatch",
"(",
"Object",
"objResource",
",",
"Bundle",
"bundle",
")",
"{",
"Resource",
"resource",
"=",
"(",
"Resource",
")",
"objResource",
";",
"return",
"(",
"(",
"bundle",
".",
"getSymbolicName",
"(",
")",
".",
"equals",... | Does this resource match this bundle?
@param resource
@param context
@return | [
"Does",
"this",
"resource",
"match",
"this",
"bundle?"
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/obr/src/main/java/org/jbundle/util/osgi/obr/ObrClassFinderService.java#L336-L340 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/HttpTransport.java | HttpTransport.request | @SuppressWarnings("unchecked")
public List<RpcResponse> request(List<RpcRequest> reqList) {
List<RpcResponse> respList = new ArrayList<RpcResponse>();
List<Map> marshaledReqs = new ArrayList<Map>();
Map<String,RpcRequest> byReqId = new HashMap<String,RpcRequest>();
for (RpcRequest r... | java | @SuppressWarnings("unchecked")
public List<RpcResponse> request(List<RpcRequest> reqList) {
List<RpcResponse> respList = new ArrayList<RpcResponse>();
List<Map> marshaledReqs = new ArrayList<Map>();
Map<String,RpcRequest> byReqId = new HashMap<String,RpcRequest>();
for (RpcRequest r... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"List",
"<",
"RpcResponse",
">",
"request",
"(",
"List",
"<",
"RpcRequest",
">",
"reqList",
")",
"{",
"List",
"<",
"RpcResponse",
">",
"respList",
"=",
"new",
"ArrayList",
"<",
"RpcResponse",
">",... | Makes JSON-RPC batch request against the remote server as a single HTTP request. | [
"Makes",
"JSON",
"-",
"RPC",
"batch",
"request",
"against",
"the",
"remote",
"server",
"as",
"a",
"single",
"HTTP",
"request",
"."
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/HttpTransport.java#L175-L237 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/HttpTransport.java | HttpTransport.createURLConnection | public URLConnection createURLConnection(URL url) throws IOException {
URLConnection conn = url.openConnection();
return conn;
} | java | public URLConnection createURLConnection(URL url) throws IOException {
URLConnection conn = url.openConnection();
return conn;
} | [
"public",
"URLConnection",
"createURLConnection",
"(",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"URLConnection",
"conn",
"=",
"url",
".",
"openConnection",
"(",
")",
";",
"return",
"conn",
";",
"}"
] | Returns an URLConnection for the given URL. Subclasses may
override this and customize the connection with custom timeouts,
headers, etc.
Headers passed into the constructor, and the Content-Length header,
will be added after this method is called. | [
"Returns",
"an",
"URLConnection",
"for",
"the",
"given",
"URL",
".",
"Subclasses",
"may",
"override",
"this",
"and",
"customize",
"the",
"connection",
"with",
"custom",
"timeouts",
"headers",
"etc",
"."
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/HttpTransport.java#L247-L250 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java | MethodWriterImpl.getSignature | public Content getSignature(MethodDoc method) {
Content pre = new HtmlTree(HtmlTag.PRE);
writer.addAnnotationInfo(method, pre);
addModifiers(method, pre);
addTypeParameters(method, pre);
addReturnType(method, pre);
if (configuration.linksource) {
Content metho... | java | public Content getSignature(MethodDoc method) {
Content pre = new HtmlTree(HtmlTag.PRE);
writer.addAnnotationInfo(method, pre);
addModifiers(method, pre);
addTypeParameters(method, pre);
addReturnType(method, pre);
if (configuration.linksource) {
Content metho... | [
"public",
"Content",
"getSignature",
"(",
"MethodDoc",
"method",
")",
"{",
"Content",
"pre",
"=",
"new",
"HtmlTree",
"(",
"HtmlTag",
".",
"PRE",
")",
";",
"writer",
".",
"addAnnotationInfo",
"(",
"method",
",",
"pre",
")",
";",
"addModifiers",
"(",
"method... | Get the signature for the given method.
@param method the method being documented.
@return a content object for the signature | [
"Get",
"the",
"signature",
"for",
"the",
"given",
"method",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java#L121-L137 | train |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/provider/TemporaryTokenCache.java | TemporaryTokenCache.generateTemporaryToken | public String generateTemporaryToken(String key, int secondsToLive, Object context) {
checkNotNull(key);
String token = tokenGenerator.generate();
tokenCache.put(key, Triplet.of(token, DateTime.now().plusSeconds(secondsToLive).getMillis(), context));
return token;
} | java | public String generateTemporaryToken(String key, int secondsToLive, Object context) {
checkNotNull(key);
String token = tokenGenerator.generate();
tokenCache.put(key, Triplet.of(token, DateTime.now().plusSeconds(secondsToLive).getMillis(), context));
return token;
} | [
"public",
"String",
"generateTemporaryToken",
"(",
"String",
"key",
",",
"int",
"secondsToLive",
",",
"Object",
"context",
")",
"{",
"checkNotNull",
"(",
"key",
")",
";",
"String",
"token",
"=",
"tokenGenerator",
".",
"generate",
"(",
")",
";",
"tokenCache",
... | Same as above but will also store a context that can be retried later. | [
"Same",
"as",
"above",
"but",
"will",
"also",
"store",
"a",
"context",
"that",
"can",
"be",
"retried",
"later",
"."
] | eb8ba8e6794a96ea0dd9744cada4f9ad9618f114 | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/provider/TemporaryTokenCache.java#L54-L59 | train |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/provider/TemporaryTokenCache.java | TemporaryTokenCache.getContextForToken | public Optional<Object> getContextForToken(String key, String token) {
Object context = validateTokenAndGetContext(key, token).second();
return null != context ? Optional.of(context) : Optional.absent();
} | java | public Optional<Object> getContextForToken(String key, String token) {
Object context = validateTokenAndGetContext(key, token).second();
return null != context ? Optional.of(context) : Optional.absent();
} | [
"public",
"Optional",
"<",
"Object",
">",
"getContextForToken",
"(",
"String",
"key",
",",
"String",
"token",
")",
"{",
"Object",
"context",
"=",
"validateTokenAndGetContext",
"(",
"key",
",",
"token",
")",
".",
"second",
"(",
")",
";",
"return",
"null",
"... | Validate a short lived token and returning the associated context
The token is removed if found and valid.
@param key cacheKey
@param token temporary token to validate
@return an optional. The context will be absent if either the token is invalid of the context is null. | [
"Validate",
"a",
"short",
"lived",
"token",
"and",
"returning",
"the",
"associated",
"context",
"The",
"token",
"is",
"removed",
"if",
"found",
"and",
"valid",
"."
] | eb8ba8e6794a96ea0dd9744cada4f9ad9618f114 | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/provider/TemporaryTokenCache.java#L96-L99 | train |
yerenkow/javaz | cache/src/main/java/org/javaz/cache/CacheImpl.java | CacheImpl.put | public Object put(Object key, Object value)
{
long objectStamp = System.currentTimeMillis();
synchronized (objects)
{
objectTimeStamps.put(key, objectStamp);
if (nextTimeSomeExpired == NO_OBJECTS)
{
nextTimeSomeExpired = objectStamp;
... | java | public Object put(Object key, Object value)
{
long objectStamp = System.currentTimeMillis();
synchronized (objects)
{
objectTimeStamps.put(key, objectStamp);
if (nextTimeSomeExpired == NO_OBJECTS)
{
nextTimeSomeExpired = objectStamp;
... | [
"public",
"Object",
"put",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"long",
"objectStamp",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"synchronized",
"(",
"objects",
")",
"{",
"objectTimeStamps",
".",
"put",
"(",
"key",
",",
"... | Method to store value in cache, if this value first in cache - also mark nextTimeSomeExpired
as its creating time;
@param key, may not be null
@param value - any value object
@return old value or null | [
"Method",
"to",
"store",
"value",
"in",
"cache",
"if",
"this",
"value",
"first",
"in",
"cache",
"-",
"also",
"mark",
"nextTimeSomeExpired",
"as",
"its",
"creating",
"time",
";"
] | 1902ec50b5d6a531d9c5faf99760eacf3d0cbb21 | https://github.com/yerenkow/javaz/blob/1902ec50b5d6a531d9c5faf99760eacf3d0cbb21/cache/src/main/java/org/javaz/cache/CacheImpl.java#L81-L93 | train |
yerenkow/javaz | cache/src/main/java/org/javaz/cache/CacheImpl.java | CacheImpl.remove | public Object remove(Object key)
{
synchronized (objects)
{
Object remove = objects.remove(key);
objectTimeStamps.remove(key);
if (remove != null)
{
findNextExpireTime();
}
return remove;
}
} | java | public Object remove(Object key)
{
synchronized (objects)
{
Object remove = objects.remove(key);
objectTimeStamps.remove(key);
if (remove != null)
{
findNextExpireTime();
}
return remove;
}
} | [
"public",
"Object",
"remove",
"(",
"Object",
"key",
")",
"{",
"synchronized",
"(",
"objects",
")",
"{",
"Object",
"remove",
"=",
"objects",
".",
"remove",
"(",
"key",
")",
";",
"objectTimeStamps",
".",
"remove",
"(",
"key",
")",
";",
"if",
"(",
"remove... | When we remove any object, we must found again nextTimeSomeExpired.
@param key - key to remove
@return - object, if any | [
"When",
"we",
"remove",
"any",
"object",
"we",
"must",
"found",
"again",
"nextTimeSomeExpired",
"."
] | 1902ec50b5d6a531d9c5faf99760eacf3d0cbb21 | https://github.com/yerenkow/javaz/blob/1902ec50b5d6a531d9c5faf99760eacf3d0cbb21/cache/src/main/java/org/javaz/cache/CacheImpl.java#L196-L208 | train |
yerenkow/javaz | cache/src/main/java/org/javaz/cache/CacheImpl.java | CacheImpl.findNextExpireTime | private void findNextExpireTime()
{
if (objects.size() == 0)
{
nextTimeSomeExpired = NO_OBJECTS;
}
else
{
nextTimeSomeExpired = NO_OBJECTS;
Collection<Long> longs = null;
synchronized (objects)
{
long... | java | private void findNextExpireTime()
{
if (objects.size() == 0)
{
nextTimeSomeExpired = NO_OBJECTS;
}
else
{
nextTimeSomeExpired = NO_OBJECTS;
Collection<Long> longs = null;
synchronized (objects)
{
long... | [
"private",
"void",
"findNextExpireTime",
"(",
")",
"{",
"if",
"(",
"objects",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"nextTimeSomeExpired",
"=",
"NO_OBJECTS",
";",
"}",
"else",
"{",
"nextTimeSomeExpired",
"=",
"NO_OBJECTS",
";",
"Collection",
"<",
"Lo... | Internal-use method, finds out when next object will expire and store this as nextTimeSomeExpired.
If there's no items in cache - let's store NO_OBJECTS | [
"Internal",
"-",
"use",
"method",
"finds",
"out",
"when",
"next",
"object",
"will",
"expire",
"and",
"store",
"this",
"as",
"nextTimeSomeExpired",
".",
"If",
"there",
"s",
"no",
"items",
"in",
"cache",
"-",
"let",
"s",
"store",
"NO_OBJECTS"
] | 1902ec50b5d6a531d9c5faf99760eacf3d0cbb21 | https://github.com/yerenkow/javaz/blob/1902ec50b5d6a531d9c5faf99760eacf3d0cbb21/cache/src/main/java/org/javaz/cache/CacheImpl.java#L223-L246 | train |
brianwhu/xillium | core/src/main/java/org/xillium/core/util/ServiceMilestone.java | ServiceMilestone.attach | @SuppressWarnings("unchecked")
public static <M extends Enum<M>> void attach(Service service, String milestore, ServiceMilestone.Evaluation evaluation) throws Exception {
for (Field field: Beans.getKnownInstanceFields(service.getClass())) {
if (ServiceMilestone.class.isAssignableFrom(field.getTy... | java | @SuppressWarnings("unchecked")
public static <M extends Enum<M>> void attach(Service service, String milestore, ServiceMilestone.Evaluation evaluation) throws Exception {
for (Field field: Beans.getKnownInstanceFields(service.getClass())) {
if (ServiceMilestone.class.isAssignableFrom(field.getTy... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"M",
"extends",
"Enum",
"<",
"M",
">",
">",
"void",
"attach",
"(",
"Service",
"service",
",",
"String",
"milestore",
",",
"ServiceMilestone",
".",
"Evaluation",
"evaluation",
")",
"... | Attaches a ServiceMilestone.Evaluation onto a service. | [
"Attaches",
"a",
"ServiceMilestone",
".",
"Evaluation",
"onto",
"a",
"service",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/core/src/main/java/org/xillium/core/util/ServiceMilestone.java#L78-L93 | train |
brianwhu/xillium | core/src/main/java/org/xillium/core/util/ServiceMilestone.java | ServiceMilestone.attach | public void attach(M m, Evaluation eval) {
_evaluations[m.ordinal()] = _evaluations[m.ordinal()] == null ? eval : new CompoundMilestoneEvaluation(eval, _evaluations[m.ordinal()]);
} | java | public void attach(M m, Evaluation eval) {
_evaluations[m.ordinal()] = _evaluations[m.ordinal()] == null ? eval : new CompoundMilestoneEvaluation(eval, _evaluations[m.ordinal()]);
} | [
"public",
"void",
"attach",
"(",
"M",
"m",
",",
"Evaluation",
"eval",
")",
"{",
"_evaluations",
"[",
"m",
".",
"ordinal",
"(",
")",
"]",
"=",
"_evaluations",
"[",
"m",
".",
"ordinal",
"(",
")",
"]",
"==",
"null",
"?",
"eval",
":",
"new",
"CompoundM... | Attaches a ServiceMilestone.Evaluation. | [
"Attaches",
"a",
"ServiceMilestone",
".",
"Evaluation",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/core/src/main/java/org/xillium/core/util/ServiceMilestone.java#L125-L127 | train |
brianwhu/xillium | core/src/main/java/org/xillium/core/util/ServiceMilestone.java | ServiceMilestone.detach | public void detach(M m, Evaluation eval) {
_evaluations[m.ordinal()] = CompoundMilestoneEvaluation.cleanse(_evaluations[m.ordinal()], eval);
} | java | public void detach(M m, Evaluation eval) {
_evaluations[m.ordinal()] = CompoundMilestoneEvaluation.cleanse(_evaluations[m.ordinal()], eval);
} | [
"public",
"void",
"detach",
"(",
"M",
"m",
",",
"Evaluation",
"eval",
")",
"{",
"_evaluations",
"[",
"m",
".",
"ordinal",
"(",
")",
"]",
"=",
"CompoundMilestoneEvaluation",
".",
"cleanse",
"(",
"_evaluations",
"[",
"m",
".",
"ordinal",
"(",
")",
"]",
"... | Detaches a ServiceMilestone.Evaluation. | [
"Detaches",
"a",
"ServiceMilestone",
".",
"Evaluation",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/core/src/main/java/org/xillium/core/util/ServiceMilestone.java#L132-L134 | train |
brianwhu/xillium | core/src/main/java/org/xillium/core/util/ServiceMilestone.java | ServiceMilestone.evaluate | @SuppressWarnings("unchecked")
public Recommendation evaluate(M milestone, DataBinder binder, Reifier dict, Persistence persist) {
Evaluation evaluation = _evaluations[milestone.ordinal()];
return evaluation != null ? evaluation.evaluate((Class<M>)milestone.getClass(), milestone.toString(), binder, ... | java | @SuppressWarnings("unchecked")
public Recommendation evaluate(M milestone, DataBinder binder, Reifier dict, Persistence persist) {
Evaluation evaluation = _evaluations[milestone.ordinal()];
return evaluation != null ? evaluation.evaluate((Class<M>)milestone.getClass(), milestone.toString(), binder, ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Recommendation",
"evaluate",
"(",
"M",
"milestone",
",",
"DataBinder",
"binder",
",",
"Reifier",
"dict",
",",
"Persistence",
"persist",
")",
"{",
"Evaluation",
"evaluation",
"=",
"_evaluations",
"[",
... | Executes evaluations at a milestone. | [
"Executes",
"evaluations",
"at",
"a",
"milestone",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/core/src/main/java/org/xillium/core/util/ServiceMilestone.java#L139-L143 | train |
incodehq-legacy/incode-module-document | dom/src/main/java/org/incode/module/document/dom/impl/types/DocumentTypeRepository.java | DocumentTypeRepository.findByReference | @Programmatic
public DocumentType findByReference(
final String reference) {
return queryResultsCache.execute(
() -> repositoryService.firstMatch(
new QueryDefault<>(DocumentType.class,
"findByReference",
... | java | @Programmatic
public DocumentType findByReference(
final String reference) {
return queryResultsCache.execute(
() -> repositoryService.firstMatch(
new QueryDefault<>(DocumentType.class,
"findByReference",
... | [
"@",
"Programmatic",
"public",
"DocumentType",
"findByReference",
"(",
"final",
"String",
"reference",
")",
"{",
"return",
"queryResultsCache",
".",
"execute",
"(",
"(",
")",
"->",
"repositoryService",
".",
"firstMatch",
"(",
"new",
"QueryDefault",
"<>",
"(",
"D... | region > findByReference | [
"region",
">",
"findByReference"
] | c62f064e96d6e6007f7fd6a4bc06e03b78b1816c | https://github.com/incodehq-legacy/incode-module-document/blob/c62f064e96d6e6007f7fd6a4bc06e03b78b1816c/dom/src/main/java/org/incode/module/document/dom/impl/types/DocumentTypeRepository.java#L53-L64 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java | ClassWriter.xClassName | public Name xClassName(Type t) {
if (t.hasTag(CLASS)) {
return names.fromUtf(externalize(t.tsym.flatName()));
} else if (t.hasTag(ARRAY)) {
return typeSig(types.erasure(t));
} else {
throw new AssertionError("xClassName");
}
} | java | public Name xClassName(Type t) {
if (t.hasTag(CLASS)) {
return names.fromUtf(externalize(t.tsym.flatName()));
} else if (t.hasTag(ARRAY)) {
return typeSig(types.erasure(t));
} else {
throw new AssertionError("xClassName");
}
} | [
"public",
"Name",
"xClassName",
"(",
"Type",
"t",
")",
"{",
"if",
"(",
"t",
".",
"hasTag",
"(",
"CLASS",
")",
")",
"{",
"return",
"names",
".",
"fromUtf",
"(",
"externalize",
"(",
"t",
".",
"tsym",
".",
"flatName",
"(",
")",
")",
")",
";",
"}",
... | Given a type t, return the extended class name of its erasure in
external representation. | [
"Given",
"a",
"type",
"t",
"return",
"the",
"extended",
"class",
"name",
"of",
"its",
"erasure",
"in",
"external",
"representation",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java#L357-L365 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java | ClassWriter.fieldName | Name fieldName(Symbol sym) {
if (scramble && (sym.flags() & PRIVATE) != 0 ||
scrambleAll && (sym.flags() & (PROTECTED | PUBLIC)) == 0)
return names.fromString("_$" + sym.name.getIndex());
else
return sym.name;
} | java | Name fieldName(Symbol sym) {
if (scramble && (sym.flags() & PRIVATE) != 0 ||
scrambleAll && (sym.flags() & (PROTECTED | PUBLIC)) == 0)
return names.fromString("_$" + sym.name.getIndex());
else
return sym.name;
} | [
"Name",
"fieldName",
"(",
"Symbol",
"sym",
")",
"{",
"if",
"(",
"scramble",
"&&",
"(",
"sym",
".",
"flags",
"(",
")",
"&",
"PRIVATE",
")",
"!=",
"0",
"||",
"scrambleAll",
"&&",
"(",
"sym",
".",
"flags",
"(",
")",
"&",
"(",
"PROTECTED",
"|",
"PUBL... | Given a field, return its name. | [
"Given",
"a",
"field",
"return",
"its",
"name",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java#L494-L500 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java | ClassWriter.writeMethod | void writeMethod(MethodSymbol m) {
int flags = adjustFlags(m.flags());
databuf.appendChar(flags);
if (dumpMethodModifiers) {
PrintWriter pw = log.getWriter(Log.WriterKind.ERROR);
pw.println("METHOD " + fieldName(m));
pw.println("---" + flagNames(m.flags()));
... | java | void writeMethod(MethodSymbol m) {
int flags = adjustFlags(m.flags());
databuf.appendChar(flags);
if (dumpMethodModifiers) {
PrintWriter pw = log.getWriter(Log.WriterKind.ERROR);
pw.println("METHOD " + fieldName(m));
pw.println("---" + flagNames(m.flags()));
... | [
"void",
"writeMethod",
"(",
"MethodSymbol",
"m",
")",
"{",
"int",
"flags",
"=",
"adjustFlags",
"(",
"m",
".",
"flags",
"(",
")",
")",
";",
"databuf",
".",
"appendChar",
"(",
"flags",
")",
";",
"if",
"(",
"dumpMethodModifiers",
")",
"{",
"PrintWriter",
... | Write method symbol, entering all references into constant pool. | [
"Write",
"method",
"symbol",
"entering",
"all",
"references",
"into",
"constant",
"pool",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java#L1105-L1144 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/util/MetaDataHelper.java | MetaDataHelper.getPrimaryKey | public static Set<String> getPrimaryKey(DatabaseMetaData metadata, String tableName) throws Exception {
Set<String> columns = new HashSet<String>();
ResultSet keys = metadata.getPrimaryKeys(metadata.getConnection().getCatalog(), metadata.getUserName(), tableName);
while (keys.next()) {
... | java | public static Set<String> getPrimaryKey(DatabaseMetaData metadata, String tableName) throws Exception {
Set<String> columns = new HashSet<String>();
ResultSet keys = metadata.getPrimaryKeys(metadata.getConnection().getCatalog(), metadata.getUserName(), tableName);
while (keys.next()) {
... | [
"public",
"static",
"Set",
"<",
"String",
">",
"getPrimaryKey",
"(",
"DatabaseMetaData",
"metadata",
",",
"String",
"tableName",
")",
"throws",
"Exception",
"{",
"Set",
"<",
"String",
">",
"columns",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";"... | Returns a table's primary key columns as a Set of strings. | [
"Returns",
"a",
"table",
"s",
"primary",
"key",
"columns",
"as",
"a",
"Set",
"of",
"strings",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/util/MetaDataHelper.java#L103-L111 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/util/MetaDataHelper.java | MetaDataHelper.getExportedKeys | public static Map<String, ForeignKey> getExportedKeys(DatabaseMetaData metadata, String tableName) throws Exception {
ResultSet keys = metadata.getExportedKeys(metadata.getConnection().getCatalog(), metadata.getUserName(), tableName);
Map<String, ForeignKey> map = new HashMap<String, ForeignKey>();
... | java | public static Map<String, ForeignKey> getExportedKeys(DatabaseMetaData metadata, String tableName) throws Exception {
ResultSet keys = metadata.getExportedKeys(metadata.getConnection().getCatalog(), metadata.getUserName(), tableName);
Map<String, ForeignKey> map = new HashMap<String, ForeignKey>();
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"ForeignKey",
">",
"getExportedKeys",
"(",
"DatabaseMetaData",
"metadata",
",",
"String",
"tableName",
")",
"throws",
"Exception",
"{",
"ResultSet",
"keys",
"=",
"metadata",
".",
"getExportedKeys",
"(",
"metadata",
... | Returns a table's exported keys and their columns as a Map from the key name to the ForeignKey object.
<p>A foreign key may not have a name. On such a database, 2 foreign keys must reference 2 different tables. Otherwise
there's no way to tell them apart and the foreign key information reported by DatabaseMetaData bec... | [
"Returns",
"a",
"table",
"s",
"exported",
"keys",
"and",
"their",
"columns",
"as",
"a",
"Map",
"from",
"the",
"key",
"name",
"to",
"the",
"ForeignKey",
"object",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/util/MetaDataHelper.java#L119-L136 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/util/MetaDataHelper.java | MetaDataHelper.getForeignKeys | public static Map<String, ForeignKey> getForeignKeys(DatabaseMetaData metadata, String tableName) throws Exception {
ResultSet keys = metadata.getImportedKeys(metadata.getConnection().getCatalog(), metadata.getUserName(), tableName);
Map<String, ForeignKey> map = new HashMap<String, ForeignKey>();
... | java | public static Map<String, ForeignKey> getForeignKeys(DatabaseMetaData metadata, String tableName) throws Exception {
ResultSet keys = metadata.getImportedKeys(metadata.getConnection().getCatalog(), metadata.getUserName(), tableName);
Map<String, ForeignKey> map = new HashMap<String, ForeignKey>();
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"ForeignKey",
">",
"getForeignKeys",
"(",
"DatabaseMetaData",
"metadata",
",",
"String",
"tableName",
")",
"throws",
"Exception",
"{",
"ResultSet",
"keys",
"=",
"metadata",
".",
"getImportedKeys",
"(",
"metadata",
"... | Returns a table's foreign keys and their columns as a Map from the key name to the ForeignKey object.
<p>A foreign key may not have a name. On such a database, 2 foreign keys must reference 2 different tables. Otherwise
there's no way to tell them apart and the foreign key information reported by DatabaseMetaData beco... | [
"Returns",
"a",
"table",
"s",
"foreign",
"keys",
"and",
"their",
"columns",
"as",
"a",
"Map",
"from",
"the",
"key",
"name",
"to",
"the",
"ForeignKey",
"object",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/util/MetaDataHelper.java#L144-L161 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/util/MetaDataHelper.java | MetaDataHelper.getColumns | public static List<Column> getColumns(DatabaseMetaData metadata, String tableName) throws Exception {
List<Column> columns = new ArrayList<Column>();
PreparedStatement stmt = metadata.getConnection().prepareStatement("SELECT * FROM " + tableName);
ResultSetMetaData rsmeta = stmt.getMetaData();
... | java | public static List<Column> getColumns(DatabaseMetaData metadata, String tableName) throws Exception {
List<Column> columns = new ArrayList<Column>();
PreparedStatement stmt = metadata.getConnection().prepareStatement("SELECT * FROM " + tableName);
ResultSetMetaData rsmeta = stmt.getMetaData();
... | [
"public",
"static",
"List",
"<",
"Column",
">",
"getColumns",
"(",
"DatabaseMetaData",
"metadata",
",",
"String",
"tableName",
")",
"throws",
"Exception",
"{",
"List",
"<",
"Column",
">",
"columns",
"=",
"new",
"ArrayList",
"<",
"Column",
">",
"(",
")",
";... | Returns a table's columns | [
"Returns",
"a",
"table",
"s",
"columns"
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/util/MetaDataHelper.java#L166-L176 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/util/MetaDataHelper.java | MetaDataHelper.getTable | public static Table getTable(DatabaseMetaData metadata, String tableName) throws Exception {
return new Table(
tableName,
getPrimaryKey(metadata, tableName),
getForeignKeys(metadata, tableName),
getExportedKeys(metadata, tableName),
getColumns(metadata... | java | public static Table getTable(DatabaseMetaData metadata, String tableName) throws Exception {
return new Table(
tableName,
getPrimaryKey(metadata, tableName),
getForeignKeys(metadata, tableName),
getExportedKeys(metadata, tableName),
getColumns(metadata... | [
"public",
"static",
"Table",
"getTable",
"(",
"DatabaseMetaData",
"metadata",
",",
"String",
"tableName",
")",
"throws",
"Exception",
"{",
"return",
"new",
"Table",
"(",
"tableName",
",",
"getPrimaryKey",
"(",
"metadata",
",",
"tableName",
")",
",",
"getForeignK... | Returns a table's structure | [
"Returns",
"a",
"table",
"s",
"structure"
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/util/MetaDataHelper.java#L181-L189 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/persistence/util/MetaDataHelper.java | MetaDataHelper.getClassName | public static String getClassName(ResultSetMetaData meta, int index) throws SQLException {
switch (meta.getColumnType(index)) {
case Types.NUMERIC:
int precision = meta.getPrecision(index);
if (meta.getScale(index) == 0) {
if (precision > 18) {
... | java | public static String getClassName(ResultSetMetaData meta, int index) throws SQLException {
switch (meta.getColumnType(index)) {
case Types.NUMERIC:
int precision = meta.getPrecision(index);
if (meta.getScale(index) == 0) {
if (precision > 18) {
... | [
"public",
"static",
"String",
"getClassName",
"(",
"ResultSetMetaData",
"meta",
",",
"int",
"index",
")",
"throws",
"SQLException",
"{",
"switch",
"(",
"meta",
".",
"getColumnType",
"(",
"index",
")",
")",
"{",
"case",
"Types",
".",
"NUMERIC",
":",
"int",
... | Returns a column's java class name. | [
"Returns",
"a",
"column",
"s",
"java",
"class",
"name",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/util/MetaDataHelper.java#L194-L228 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/provider/newrelic/MonitorCache.java | MonitorCache.add | public void add(Collection<Monitor> monitors)
{
for(Monitor monitor : monitors)
this.monitors.put(monitor.getId(), monitor);
} | java | public void add(Collection<Monitor> monitors)
{
for(Monitor monitor : monitors)
this.monitors.put(monitor.getId(), monitor);
} | [
"public",
"void",
"add",
"(",
"Collection",
"<",
"Monitor",
">",
"monitors",
")",
"{",
"for",
"(",
"Monitor",
"monitor",
":",
"monitors",
")",
"this",
".",
"monitors",
".",
"put",
"(",
"monitor",
".",
"getId",
"(",
")",
",",
"monitor",
")",
";",
"}"
... | Adds the monitor list to the monitors for the account.
@param monitors The monitors to add | [
"Adds",
"the",
"monitor",
"list",
"to",
"the",
"monitors",
"for",
"the",
"account",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/provider/newrelic/MonitorCache.java#L58-L62 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/provider/newrelic/MonitorCache.java | MonitorCache.labels | public LabelCache labels(String monitorId)
{
LabelCache cache = labels.get(monitorId);
if(cache == null)
labels.put(monitorId, cache = new LabelCache(monitorId));
return cache;
} | java | public LabelCache labels(String monitorId)
{
LabelCache cache = labels.get(monitorId);
if(cache == null)
labels.put(monitorId, cache = new LabelCache(monitorId));
return cache;
} | [
"public",
"LabelCache",
"labels",
"(",
"String",
"monitorId",
")",
"{",
"LabelCache",
"cache",
"=",
"labels",
".",
"get",
"(",
"monitorId",
")",
";",
"if",
"(",
"cache",
"==",
"null",
")",
"labels",
".",
"put",
"(",
"monitorId",
",",
"cache",
"=",
"new... | Returns the cache of labels for the given monitor, creating one if it doesn't exist .
@param monitorId The id of the monitor for the cache of labels
@return The cache of labels for the given monitor | [
"Returns",
"the",
"cache",
"of",
"labels",
"for",
"the",
"given",
"monitor",
"creating",
"one",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/provider/newrelic/MonitorCache.java#L104-L110 | train |
magik6k/JWWF | src/main/java/net/magik6k/jwwf/widgets/basic/panel/TabbedPanel.java | TabbedPanel.put | public TabbedPanel put(Widget widget, String name, int index) {
if (index < 0 || index >= content.length) throw new IndexOutOfBoundsException();
if (widget == null) return this;
attach(widget);
content[index] = new Tab(widget, name);
this.sendElement();
return this;
} | java | public TabbedPanel put(Widget widget, String name, int index) {
if (index < 0 || index >= content.length) throw new IndexOutOfBoundsException();
if (widget == null) return this;
attach(widget);
content[index] = new Tab(widget, name);
this.sendElement();
return this;
} | [
"public",
"TabbedPanel",
"put",
"(",
"Widget",
"widget",
",",
"String",
"name",
",",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"content",
".",
"length",
")",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
... | Puts new widget to the container
@param widget Widget to put
@param name Name of tab
@param index id of 'cell' in the container to put widget to(numbered from 0)
@return This instance for chaining | [
"Puts",
"new",
"widget",
"to",
"the",
"container"
] | 8ba334501396c3301495da8708733f6014f20665 | https://github.com/magik6k/JWWF/blob/8ba334501396c3301495da8708733f6014f20665/src/main/java/net/magik6k/jwwf/widgets/basic/panel/TabbedPanel.java#L69-L76 | train |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/email/ExtendedEmailAddress.java | ExtendedEmailAddress.setAddress | @Nonnull
public final EChange setAddress (@Nonnull final String sAddress)
{
ValueEnforcer.notNull (sAddress, "Address");
final String sRealAddress = EmailAddressHelper.getUnifiedEmailAddress (sAddress);
if (EqualsHelper.equals (sRealAddress, m_sAddress))
return EChange.UNCHANGED;
// Check on... | java | @Nonnull
public final EChange setAddress (@Nonnull final String sAddress)
{
ValueEnforcer.notNull (sAddress, "Address");
final String sRealAddress = EmailAddressHelper.getUnifiedEmailAddress (sAddress);
if (EqualsHelper.equals (sRealAddress, m_sAddress))
return EChange.UNCHANGED;
// Check on... | [
"@",
"Nonnull",
"public",
"final",
"EChange",
"setAddress",
"(",
"@",
"Nonnull",
"final",
"String",
"sAddress",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sAddress",
",",
"\"Address\"",
")",
";",
"final",
"String",
"sRealAddress",
"=",
"EmailAddressHelper"... | Set the address part of the email address. Performs a validity check of the
email address.
@param sAddress
The address part to be set. May not be <code>null</code>.
@return {@link EChange#CHANGED} if the address was valid and different from
the existing one. Returns {@link EChange#UNCHANGED} if the email
address was t... | [
"Set",
"the",
"address",
"part",
"of",
"the",
"email",
"address",
".",
"Performs",
"a",
"validity",
"check",
"of",
"the",
"email",
"address",
"."
] | ca5e0b03c735b30b47930c018bfb5e71f00d0ff4 | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/email/ExtendedEmailAddress.java#L114-L133 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/file/JavacFileManager.java | JavacFileManager.preRegister | public static void preRegister(Context context) {
context.put(JavaFileManager.class, new Context.Factory<JavaFileManager>() {
public JavaFileManager make(Context c) {
return new JavacFileManager(c, true, null);
}
});
} | java | public static void preRegister(Context context) {
context.put(JavaFileManager.class, new Context.Factory<JavaFileManager>() {
public JavaFileManager make(Context c) {
return new JavacFileManager(c, true, null);
}
});
} | [
"public",
"static",
"void",
"preRegister",
"(",
"Context",
"context",
")",
"{",
"context",
".",
"put",
"(",
"JavaFileManager",
".",
"class",
",",
"new",
"Context",
".",
"Factory",
"<",
"JavaFileManager",
">",
"(",
")",
"{",
"public",
"JavaFileManager",
"make... | Register a Context.Factory to create a JavacFileManager. | [
"Register",
"a",
"Context",
".",
"Factory",
"to",
"create",
"a",
"JavacFileManager",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java#L112-L118 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/file/JavacFileManager.java | JavacFileManager.listDirectory | private void listDirectory(File directory,
RelativeDirectory subdirectory,
Set<JavaFileObject.Kind> fileKinds,
boolean recurse,
ListBuffer<JavaFileObject> resultList) {
File d = subdirecto... | java | private void listDirectory(File directory,
RelativeDirectory subdirectory,
Set<JavaFileObject.Kind> fileKinds,
boolean recurse,
ListBuffer<JavaFileObject> resultList) {
File d = subdirecto... | [
"private",
"void",
"listDirectory",
"(",
"File",
"directory",
",",
"RelativeDirectory",
"subdirectory",
",",
"Set",
"<",
"JavaFileObject",
".",
"Kind",
">",
"fileKinds",
",",
"boolean",
"recurse",
",",
"ListBuffer",
"<",
"JavaFileObject",
">",
"resultList",
")",
... | Insert all files in subdirectory subdirectory of directory directory
which match fileKinds into resultList | [
"Insert",
"all",
"files",
"in",
"subdirectory",
"subdirectory",
"of",
"directory",
"directory",
"which",
"match",
"fileKinds",
"into",
"resultList"
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java#L257-L291 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/file/JavacFileManager.java | JavacFileManager.listArchive | private void listArchive(Archive archive,
RelativeDirectory subdirectory,
Set<JavaFileObject.Kind> fileKinds,
boolean recurse,
ListBuffer<JavaFileObject> resultList) {
// Get the files dir... | java | private void listArchive(Archive archive,
RelativeDirectory subdirectory,
Set<JavaFileObject.Kind> fileKinds,
boolean recurse,
ListBuffer<JavaFileObject> resultList) {
// Get the files dir... | [
"private",
"void",
"listArchive",
"(",
"Archive",
"archive",
",",
"RelativeDirectory",
"subdirectory",
",",
"Set",
"<",
"JavaFileObject",
".",
"Kind",
">",
"fileKinds",
",",
"boolean",
"recurse",
",",
"ListBuffer",
"<",
"JavaFileObject",
">",
"resultList",
")",
... | Insert all files in subdirectory subdirectory of archive archive
which match fileKinds into resultList | [
"Insert",
"all",
"files",
"in",
"subdirectory",
"subdirectory",
"of",
"archive",
"archive",
"which",
"match",
"fileKinds",
"into",
"resultList"
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java#L297-L322 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/file/JavacFileManager.java | JavacFileManager.listContainer | private void listContainer(File container,
RelativeDirectory subdirectory,
Set<JavaFileObject.Kind> fileKinds,
boolean recurse,
ListBuffer<JavaFileObject> resultList) {
Archive archive = a... | java | private void listContainer(File container,
RelativeDirectory subdirectory,
Set<JavaFileObject.Kind> fileKinds,
boolean recurse,
ListBuffer<JavaFileObject> resultList) {
Archive archive = a... | [
"private",
"void",
"listContainer",
"(",
"File",
"container",
",",
"RelativeDirectory",
"subdirectory",
",",
"Set",
"<",
"JavaFileObject",
".",
"Kind",
">",
"fileKinds",
",",
"boolean",
"recurse",
",",
"ListBuffer",
"<",
"JavaFileObject",
">",
"resultList",
")",
... | container is a directory, a zip file, or a non-existant path.
Insert all files in subdirectory subdirectory of container which
match fileKinds into resultList | [
"container",
"is",
"a",
"directory",
"a",
"zip",
"file",
"or",
"a",
"non",
"-",
"existant",
"path",
".",
"Insert",
"all",
"files",
"in",
"subdirectory",
"subdirectory",
"of",
"container",
"which",
"match",
"fileKinds",
"into",
"resultList"
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java#L329-L360 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/file/JavacFileManager.java | JavacFileManager.openArchive | private Archive openArchive(File zipFileName, boolean useOptimizedZip) throws IOException {
File origZipFileName = zipFileName;
if (symbolFileEnabled && locations.isDefaultBootClassPathRtJar(zipFileName)) {
File file = zipFileName.getParentFile().getParentFile(); // ${java.home}
... | java | private Archive openArchive(File zipFileName, boolean useOptimizedZip) throws IOException {
File origZipFileName = zipFileName;
if (symbolFileEnabled && locations.isDefaultBootClassPathRtJar(zipFileName)) {
File file = zipFileName.getParentFile().getParentFile(); // ${java.home}
... | [
"private",
"Archive",
"openArchive",
"(",
"File",
"zipFileName",
",",
"boolean",
"useOptimizedZip",
")",
"throws",
"IOException",
"{",
"File",
"origZipFileName",
"=",
"zipFileName",
";",
"if",
"(",
"symbolFileEnabled",
"&&",
"locations",
".",
"isDefaultBootClassPathRt... | Open a new zip file directory, and cache it. | [
"Open",
"a",
"new",
"zip",
"file",
"directory",
"and",
"cache",
"it",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java#L474-L559 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/provider/newrelic/KeyTransactionCache.java | KeyTransactionCache.add | public void add(Collection<KeyTransaction> keyTransactions)
{
for(KeyTransaction keyTransaction : keyTransactions)
this.keyTransactions.put(keyTransaction.getId(), keyTransaction);
} | java | public void add(Collection<KeyTransaction> keyTransactions)
{
for(KeyTransaction keyTransaction : keyTransactions)
this.keyTransactions.put(keyTransaction.getId(), keyTransaction);
} | [
"public",
"void",
"add",
"(",
"Collection",
"<",
"KeyTransaction",
">",
"keyTransactions",
")",
"{",
"for",
"(",
"KeyTransaction",
"keyTransaction",
":",
"keyTransactions",
")",
"this",
".",
"keyTransactions",
".",
"put",
"(",
"keyTransaction",
".",
"getId",
"("... | Adds the key transaction list to the key transactions for the account.
@param keyTransactions The key transactions to add | [
"Adds",
"the",
"key",
"transaction",
"list",
"to",
"the",
"key",
"transactions",
"for",
"the",
"account",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/provider/newrelic/KeyTransactionCache.java#L67-L71 | train |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/vat/VATINStructureManager.java | VATINStructureManager.getFromValidVATIN | @Nullable
public static VATINStructure getFromValidVATIN (@Nullable final String sVATIN)
{
if (StringHelper.getLength (sVATIN) > 2)
for (final VATINStructure aStructure : s_aList)
if (aStructure.isValid (sVATIN))
return aStructure;
return null;
} | java | @Nullable
public static VATINStructure getFromValidVATIN (@Nullable final String sVATIN)
{
if (StringHelper.getLength (sVATIN) > 2)
for (final VATINStructure aStructure : s_aList)
if (aStructure.isValid (sVATIN))
return aStructure;
return null;
} | [
"@",
"Nullable",
"public",
"static",
"VATINStructure",
"getFromValidVATIN",
"(",
"@",
"Nullable",
"final",
"String",
"sVATIN",
")",
"{",
"if",
"(",
"StringHelper",
".",
"getLength",
"(",
"sVATIN",
")",
">",
"2",
")",
"for",
"(",
"final",
"VATINStructure",
"a... | Determine the structure for a given VATIN.
@param sVATIN
The VATIN to check
@return <code>null</code> if no VATIN structure was found for the passed
VATIN. | [
"Determine",
"the",
"structure",
"for",
"a",
"given",
"VATIN",
"."
] | ca5e0b03c735b30b47930c018bfb5e71f00d0ff4 | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/vat/VATINStructureManager.java#L74-L82 | train |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/vat/VATINStructureManager.java | VATINStructureManager.getFromVATINCountry | @Nullable
public static VATINStructure getFromVATINCountry (@Nullable final String sVATIN)
{
if (StringHelper.getLength (sVATIN) >= 2)
{
final String sCountry = sVATIN.substring (0, 2);
for (final VATINStructure aStructure : s_aList)
if (aStructure.getExamples ().get (0).substring (0, 2)... | java | @Nullable
public static VATINStructure getFromVATINCountry (@Nullable final String sVATIN)
{
if (StringHelper.getLength (sVATIN) >= 2)
{
final String sCountry = sVATIN.substring (0, 2);
for (final VATINStructure aStructure : s_aList)
if (aStructure.getExamples ().get (0).substring (0, 2)... | [
"@",
"Nullable",
"public",
"static",
"VATINStructure",
"getFromVATINCountry",
"(",
"@",
"Nullable",
"final",
"String",
"sVATIN",
")",
"{",
"if",
"(",
"StringHelper",
".",
"getLength",
"(",
"sVATIN",
")",
">=",
"2",
")",
"{",
"final",
"String",
"sCountry",
"=... | Resolve the VATIN structure only from the country part of the given VATIN.
This should help indicate how the VATIN is valid.
@param sVATIN
The VATIN with at least 2 characters for the country code.
@return <code>null</code> if the passed string is shorter than 2 characters
or if the passed VATIN country code is invali... | [
"Resolve",
"the",
"VATIN",
"structure",
"only",
"from",
"the",
"country",
"part",
"of",
"the",
"given",
"VATIN",
".",
"This",
"should",
"help",
"indicate",
"how",
"the",
"VATIN",
"is",
"valid",
"."
] | ca5e0b03c735b30b47930c018bfb5e71f00d0ff4 | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/vat/VATINStructureManager.java#L93-L104 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/api/WrappingJavaFileManager.java | WrappingJavaFileManager.wrap | protected Iterable<JavaFileObject> wrap(Iterable<JavaFileObject> fileObjects) {
List<JavaFileObject> mapped = new ArrayList<JavaFileObject>();
for (JavaFileObject fileObject : fileObjects)
mapped.add(wrap(fileObject));
return Collections.unmodifiableList(mapped);
} | java | protected Iterable<JavaFileObject> wrap(Iterable<JavaFileObject> fileObjects) {
List<JavaFileObject> mapped = new ArrayList<JavaFileObject>();
for (JavaFileObject fileObject : fileObjects)
mapped.add(wrap(fileObject));
return Collections.unmodifiableList(mapped);
} | [
"protected",
"Iterable",
"<",
"JavaFileObject",
">",
"wrap",
"(",
"Iterable",
"<",
"JavaFileObject",
">",
"fileObjects",
")",
"{",
"List",
"<",
"JavaFileObject",
">",
"mapped",
"=",
"new",
"ArrayList",
"<",
"JavaFileObject",
">",
"(",
")",
";",
"for",
"(",
... | This implementation maps the given list of file objects by
calling wrap on each. Subclasses may override this behavior.
@param fileObjects a list of file objects
@return the mapping | [
"This",
"implementation",
"maps",
"the",
"given",
"list",
"of",
"file",
"objects",
"by",
"calling",
"wrap",
"on",
"each",
".",
"Subclasses",
"may",
"override",
"this",
"behavior",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/api/WrappingJavaFileManager.java#L117-L122 | train |
syphr42/libmythtv-java | control/src/main/java/org/syphr/mythtv/control/ControlFactory.java | ControlFactory.createInstance | public static Control createInstance(ControlVersion version)
{
switch (version)
{
case _0_24:
return new Control0_24();
case _0_25:
return new Control0_25();
default:
throw new IllegalArgumentException("Unknown con... | java | public static Control createInstance(ControlVersion version)
{
switch (version)
{
case _0_24:
return new Control0_24();
case _0_25:
return new Control0_25();
default:
throw new IllegalArgumentException("Unknown con... | [
"public",
"static",
"Control",
"createInstance",
"(",
"ControlVersion",
"version",
")",
"{",
"switch",
"(",
"version",
")",
"{",
"case",
"_0_24",
":",
"return",
"new",
"Control0_24",
"(",
")",
";",
"case",
"_0_25",
":",
"return",
"new",
"Control0_25",
"(",
... | Create a new instance of the frontend network control for the desired
version.
@param version
the desired network control version
@return a new network control instance | [
"Create",
"a",
"new",
"instance",
"of",
"the",
"frontend",
"network",
"control",
"for",
"the",
"desired",
"version",
"."
] | cc7a2012fbd4a4ba2562dda6b2614fb0548526ea | https://github.com/syphr42/libmythtv-java/blob/cc7a2012fbd4a4ba2562dda6b2614fb0548526ea/control/src/main/java/org/syphr/mythtv/control/ControlFactory.java#L37-L50 | train |
magik6k/JWWF | src/main/java/net/magik6k/jwwf/core/Widget.java | Widget.attach | protected final void attach(Attachable widget) {
if (user != null) {
widget.addTo(user);
} else {
if (waitingForUser == null) waitingForUser = new LinkedList<Attachable>();
waitingForUser.add(widget);
}
} | java | protected final void attach(Attachable widget) {
if (user != null) {
widget.addTo(user);
} else {
if (waitingForUser == null) waitingForUser = new LinkedList<Attachable>();
waitingForUser.add(widget);
}
} | [
"protected",
"final",
"void",
"attach",
"(",
"Attachable",
"widget",
")",
"{",
"if",
"(",
"user",
"!=",
"null",
")",
"{",
"widget",
".",
"addTo",
"(",
"user",
")",
";",
"}",
"else",
"{",
"if",
"(",
"waitingForUser",
"==",
"null",
")",
"waitingForUser",... | Used to declare that instance of widget is 'held' by this widget.
If this widget is container it must invoke this method for all widgets it stores
@param widget Widget that is stored in this widget | [
"Used",
"to",
"declare",
"that",
"instance",
"of",
"widget",
"is",
"held",
"by",
"this",
"widget",
".",
"If",
"this",
"widget",
"is",
"container",
"it",
"must",
"invoke",
"this",
"method",
"for",
"all",
"widgets",
"it",
"stores"
] | 8ba334501396c3301495da8708733f6014f20665 | https://github.com/magik6k/JWWF/blob/8ba334501396c3301495da8708733f6014f20665/src/main/java/net/magik6k/jwwf/core/Widget.java#L126-L133 | train |
jbundle/osgi | core/src/main/java/org/jbundle/util/osgi/finder/ClassServiceUtility.java | ClassServiceUtility.getClassFinder | public org.jbundle.util.osgi.ClassFinder getClassFinder(Object context)
{
if (!classServiceAvailable)
return null;
try {
if (classFinder == null)
{
Class.forName("org.osgi.framework.BundleActivator"); // This tests to see if osgi exists
... | java | public org.jbundle.util.osgi.ClassFinder getClassFinder(Object context)
{
if (!classServiceAvailable)
return null;
try {
if (classFinder == null)
{
Class.forName("org.osgi.framework.BundleActivator"); // This tests to see if osgi exists
... | [
"public",
"org",
".",
"jbundle",
".",
"util",
".",
"osgi",
".",
"ClassFinder",
"getClassFinder",
"(",
"Object",
"context",
")",
"{",
"if",
"(",
"!",
"classServiceAvailable",
")",
"return",
"null",
";",
"try",
"{",
"if",
"(",
"classFinder",
"==",
"null",
... | Doesn't need to be static since this is only created once | [
"Doesn",
"t",
"need",
"to",
"be",
"static",
"since",
"this",
"is",
"only",
"created",
"once"
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/core/src/main/java/org/jbundle/util/osgi/finder/ClassServiceUtility.java#L55-L84 | train |
jbundle/osgi | core/src/main/java/org/jbundle/util/osgi/finder/ClassServiceUtility.java | ClassServiceUtility.getResourceBundle | public final ResourceBundle getResourceBundle(String className, Locale locale, String version, ClassLoader classLoader) throws MissingResourceException
{
MissingResourceException ex = null;
ResourceBundle resourceBundle = null;
try {
resourceBundle = ResourceBundle.getBundle(clas... | java | public final ResourceBundle getResourceBundle(String className, Locale locale, String version, ClassLoader classLoader) throws MissingResourceException
{
MissingResourceException ex = null;
ResourceBundle resourceBundle = null;
try {
resourceBundle = ResourceBundle.getBundle(clas... | [
"public",
"final",
"ResourceBundle",
"getResourceBundle",
"(",
"String",
"className",
",",
"Locale",
"locale",
",",
"String",
"version",
",",
"ClassLoader",
"classLoader",
")",
"throws",
"MissingResourceException",
"{",
"MissingResourceException",
"ex",
"=",
"null",
"... | Gets a resource bundle using the specified base name and locale,
@param locale the locale for which a resource bundle is desired
@param baseName the base name of the resource bundle, a fully qualified class name
@exception NullPointerException if <code>baseName</code> or <code>locale</code> is <code>null</code>
@except... | [
"Gets",
"a",
"resource",
"bundle",
"using",
"the",
"specified",
"base",
"name",
"and",
"locale"
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/core/src/main/java/org/jbundle/util/osgi/finder/ClassServiceUtility.java#L195-L220 | train |
jbundle/osgi | core/src/main/java/org/jbundle/util/osgi/finder/ClassServiceUtility.java | ClassServiceUtility.getFullClassName | public static String getFullClassName(String packageName, String className) {
return ClassServiceUtility.getFullClassName(null, packageName, className);
} | java | public static String getFullClassName(String packageName, String className) {
return ClassServiceUtility.getFullClassName(null, packageName, className);
} | [
"public",
"static",
"String",
"getFullClassName",
"(",
"String",
"packageName",
",",
"String",
"className",
")",
"{",
"return",
"ClassServiceUtility",
".",
"getFullClassName",
"(",
"null",
",",
"packageName",
",",
"className",
")",
";",
"}"
] | If class name starts with '.' append base package. | [
"If",
"class",
"name",
"starts",
"with",
".",
"append",
"base",
"package",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/core/src/main/java/org/jbundle/util/osgi/finder/ClassServiceUtility.java#L283-L285 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.find | public String find(String name) {
String value = null;
for (DataBinder top = this; top != null && (value = top.get(name)) == null; top = top.getLower());
return value;
} | java | public String find(String name) {
String value = null;
for (DataBinder top = this; top != null && (value = top.get(name)) == null; top = top.getLower());
return value;
} | [
"public",
"String",
"find",
"(",
"String",
"name",
")",
"{",
"String",
"value",
"=",
"null",
";",
"for",
"(",
"DataBinder",
"top",
"=",
"this",
";",
"top",
"!=",
"null",
"&&",
"(",
"value",
"=",
"top",
".",
"get",
"(",
"name",
")",
")",
"==",
"nu... | Finds a string value from all data binders, starting from the current binder searching downwards.
@param name the name of the value
@return the first value found | [
"Finds",
"a",
"string",
"value",
"from",
"all",
"data",
"binders",
"starting",
"from",
"the",
"current",
"binder",
"searching",
"downwards",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L67-L71 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.put | public String put(String name, String value, String alternative) {
return put(name, value != null ? value : alternative);
} | java | public String put(String name, String value, String alternative) {
return put(name, value != null ? value : alternative);
} | [
"public",
"String",
"put",
"(",
"String",
"name",
",",
"String",
"value",
",",
"String",
"alternative",
")",
"{",
"return",
"put",
"(",
"name",
",",
"value",
"!=",
"null",
"?",
"value",
":",
"alternative",
")",
";",
"}"
] | Puts a new string value into this binder, but using an alternative value if the given one is null. | [
"Puts",
"a",
"new",
"string",
"value",
"into",
"this",
"binder",
"but",
"using",
"an",
"alternative",
"value",
"if",
"the",
"given",
"one",
"is",
"null",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L76-L78 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.putResultSet | public CachedResultSet putResultSet(String name, CachedResultSet rs) {
return _rsets.put(name, rs);
} | java | public CachedResultSet putResultSet(String name, CachedResultSet rs) {
return _rsets.put(name, rs);
} | [
"public",
"CachedResultSet",
"putResultSet",
"(",
"String",
"name",
",",
"CachedResultSet",
"rs",
")",
"{",
"return",
"_rsets",
".",
"put",
"(",
"name",
",",
"rs",
")",
";",
"}"
] | Puts a new result set into this binder. | [
"Puts",
"a",
"new",
"result",
"set",
"into",
"this",
"binder",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L83-L85 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.putNamedObject | @SuppressWarnings("unchecked")
public <T, V> T putNamedObject(String name, V object) {
return (T)_named.put(name, object);
} | java | @SuppressWarnings("unchecked")
public <T, V> T putNamedObject(String name, V object) {
return (T)_named.put(name, object);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
",",
"V",
">",
"T",
"putNamedObject",
"(",
"String",
"name",
",",
"V",
"object",
")",
"{",
"return",
"(",
"T",
")",
"_named",
".",
"put",
"(",
"name",
",",
"object",
")",
";",
... | Puts a named object into this binder returning the original object under the name, if any. | [
"Puts",
"a",
"named",
"object",
"into",
"this",
"binder",
"returning",
"the",
"original",
"object",
"under",
"the",
"name",
"if",
"any",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L104-L107 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.getNamedObject | @SuppressWarnings("unchecked")
public <T> T getNamedObject(String name) {
return (T)_named.get(name);
} | java | @SuppressWarnings("unchecked")
public <T> T getNamedObject(String name) {
return (T)_named.get(name);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"getNamedObject",
"(",
"String",
"name",
")",
"{",
"return",
"(",
"T",
")",
"_named",
".",
"get",
"(",
"name",
")",
";",
"}"
] | Retrieves a named object from this binder. | [
"Retrieves",
"a",
"named",
"object",
"from",
"this",
"binder",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L112-L115 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.getNamedObject | public <T> T getNamedObject(String name, Class<T> type) {
return type.cast(_named.get(name));
} | java | public <T> T getNamedObject(String name, Class<T> type) {
return type.cast(_named.get(name));
} | [
"public",
"<",
"T",
">",
"T",
"getNamedObject",
"(",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"type",
".",
"cast",
"(",
"_named",
".",
"get",
"(",
"name",
")",
")",
";",
"}"
] | Retrieves a named object of a specific type from this binder. | [
"Retrieves",
"a",
"named",
"object",
"of",
"a",
"specific",
"type",
"from",
"this",
"binder",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L120-L122 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.map | public <K, V> Map<K, V> map(String name, Class<K> ktype, Class<V> vtype) {
Map<K, V> map = getNamedObject(name);
if (map == null) putNamedObject(name, map = new HashMap<K, V>());
return map;
} | java | public <K, V> Map<K, V> map(String name, Class<K> ktype, Class<V> vtype) {
Map<K, V> map = getNamedObject(name);
if (map == null) putNamedObject(name, map = new HashMap<K, V>());
return map;
} | [
"public",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"map",
"(",
"String",
"name",
",",
"Class",
"<",
"K",
">",
"ktype",
",",
"Class",
"<",
"V",
">",
"vtype",
")",
"{",
"Map",
"<",
"K",
",",
"V",
">",
"map",
"=",
"getNamedObje... | Introduces a HashMap under the given name if one does not exist yet. | [
"Introduces",
"a",
"HashMap",
"under",
"the",
"given",
"name",
"if",
"one",
"does",
"not",
"exist",
"yet",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L134-L138 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.mul | public <K, V> Multimap<K, V> mul(String name, Class<K> ktype, Class<V> vtype) {
Multimap<K, V> map = getNamedObject(name);
if (map == null) putNamedObject(name, map = new Multimap<K, V>());
return map;
} | java | public <K, V> Multimap<K, V> mul(String name, Class<K> ktype, Class<V> vtype) {
Multimap<K, V> map = getNamedObject(name);
if (map == null) putNamedObject(name, map = new Multimap<K, V>());
return map;
} | [
"public",
"<",
"K",
",",
"V",
">",
"Multimap",
"<",
"K",
",",
"V",
">",
"mul",
"(",
"String",
"name",
",",
"Class",
"<",
"K",
">",
"ktype",
",",
"Class",
"<",
"V",
">",
"vtype",
")",
"{",
"Multimap",
"<",
"K",
",",
"V",
">",
"map",
"=",
"ge... | Introduces a Multimap under the given name if one does not exist yet. | [
"Introduces",
"a",
"Multimap",
"under",
"the",
"given",
"name",
"if",
"one",
"does",
"not",
"exist",
"yet",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L143-L147 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.process | @Override
public DataBinder process(ResultSet rset) throws Exception {
try {
if (rset.next()) {
ResultSetMetaData meta = rset.getMetaData();
int width = meta.getColumnCount();
for (int i = 1; i <= width; ++i) {
Object value = rs... | java | @Override
public DataBinder process(ResultSet rset) throws Exception {
try {
if (rset.next()) {
ResultSetMetaData meta = rset.getMetaData();
int width = meta.getColumnCount();
for (int i = 1; i <= width; ++i) {
Object value = rs... | [
"@",
"Override",
"public",
"DataBinder",
"process",
"(",
"ResultSet",
"rset",
")",
"throws",
"Exception",
"{",
"try",
"{",
"if",
"(",
"rset",
".",
"next",
"(",
")",
")",
"{",
"ResultSetMetaData",
"meta",
"=",
"rset",
".",
"getMetaData",
"(",
")",
";",
... | Fills the data binder with columns in the current row of a result set. | [
"Fills",
"the",
"data",
"binder",
"with",
"columns",
"in",
"the",
"current",
"row",
"of",
"a",
"result",
"set",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L152-L171 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.put | public DataBinder put(Object object) throws Exception {
for (Field field: Beans.getKnownInstanceFields(object.getClass())) {
Object value = field.get(object);
if (value != null) {
put(field.getName(), value.toString());
}
}
return this;
} | java | public DataBinder put(Object object) throws Exception {
for (Field field: Beans.getKnownInstanceFields(object.getClass())) {
Object value = field.get(object);
if (value != null) {
put(field.getName(), value.toString());
}
}
return this;
} | [
"public",
"DataBinder",
"put",
"(",
"Object",
"object",
")",
"throws",
"Exception",
"{",
"for",
"(",
"Field",
"field",
":",
"Beans",
".",
"getKnownInstanceFields",
"(",
"object",
".",
"getClass",
"(",
")",
")",
")",
"{",
"Object",
"value",
"=",
"field",
... | Fills the data binder with non-static, non-transient fields of an Object, excluding null values. | [
"Fills",
"the",
"data",
"binder",
"with",
"non",
"-",
"static",
"non",
"-",
"transient",
"fields",
"of",
"an",
"Object",
"excluding",
"null",
"values",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L176-L184 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.put | public <T extends DataObject> DataBinder put(T object, String... names) throws Exception {
Class<?> type = object.getClass();
Object value;
for (String name: names) {
Field field = Beans.getKnownField(type, name);
if (!Modifier.isStatic(field.getModifiers()) && !Modifier.... | java | public <T extends DataObject> DataBinder put(T object, String... names) throws Exception {
Class<?> type = object.getClass();
Object value;
for (String name: names) {
Field field = Beans.getKnownField(type, name);
if (!Modifier.isStatic(field.getModifiers()) && !Modifier.... | [
"public",
"<",
"T",
"extends",
"DataObject",
">",
"DataBinder",
"put",
"(",
"T",
"object",
",",
"String",
"...",
"names",
")",
"throws",
"Exception",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"object",
".",
"getClass",
"(",
")",
";",
"Object",
"value",... | Fills the data binder with a subset of non-static, non-transient fields of an Object, excluding null values.
@param names - the names of the fields in the subset | [
"Fills",
"the",
"data",
"binder",
"with",
"a",
"subset",
"of",
"non",
"-",
"static",
"non",
"-",
"transient",
"fields",
"of",
"an",
"Object",
"excluding",
"null",
"values",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L191-L201 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.load | public DataBinder load(String[] args, int offset) {
for (int i = offset; i < args.length; ++i) {
int equal = args[i].indexOf('=');
if (equal > 0) {
put(args[i].substring(0, equal), args[i].substring(equal + 1));
} else {
throw new RuntimeExcept... | java | public DataBinder load(String[] args, int offset) {
for (int i = offset; i < args.length; ++i) {
int equal = args[i].indexOf('=');
if (equal > 0) {
put(args[i].substring(0, equal), args[i].substring(equal + 1));
} else {
throw new RuntimeExcept... | [
"public",
"DataBinder",
"load",
"(",
"String",
"[",
"]",
"args",
",",
"int",
"offset",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"offset",
";",
"i",
"<",
"args",
".",
"length",
";",
"++",
"i",
")",
"{",
"int",
"equal",
"=",
"args",
"[",
"i",
"]",
... | Loads parameters from an array of strings each in the form of name=value. | [
"Loads",
"parameters",
"from",
"an",
"array",
"of",
"strings",
"each",
"in",
"the",
"form",
"of",
"name",
"=",
"value",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L224-L234 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.load | public DataBinder load(String filename) throws IOException {
Properties props = new Properties();
Reader reader = new FileReader(filename);
props.load(reader);
reader.close();
return load(props);
} | java | public DataBinder load(String filename) throws IOException {
Properties props = new Properties();
Reader reader = new FileReader(filename);
props.load(reader);
reader.close();
return load(props);
} | [
"public",
"DataBinder",
"load",
"(",
"String",
"filename",
")",
"throws",
"IOException",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"Reader",
"reader",
"=",
"new",
"FileReader",
"(",
"filename",
")",
";",
"props",
".",
"load",
"("... | Loads parameters from a property file. | [
"Loads",
"parameters",
"from",
"a",
"property",
"file",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L239-L245 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.load | public DataBinder load(Properties props) {
Enumeration<?> enumeration = props.propertyNames();
while (enumeration.hasMoreElements()) {
String key = (String)enumeration.nextElement();
put(key, props.getProperty(key));
}
return this;
} | java | public DataBinder load(Properties props) {
Enumeration<?> enumeration = props.propertyNames();
while (enumeration.hasMoreElements()) {
String key = (String)enumeration.nextElement();
put(key, props.getProperty(key));
}
return this;
} | [
"public",
"DataBinder",
"load",
"(",
"Properties",
"props",
")",
"{",
"Enumeration",
"<",
"?",
">",
"enumeration",
"=",
"props",
".",
"propertyNames",
"(",
")",
";",
"while",
"(",
"enumeration",
".",
"hasMoreElements",
"(",
")",
")",
"{",
"String",
"key",
... | Loads parameters from a Properties object. | [
"Loads",
"parameters",
"from",
"a",
"Properties",
"object",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L250-L257 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.estimateMaximumBytes | public int estimateMaximumBytes() {
int count = this.size();
for (String key: _rsets.keySet()) {
CachedResultSet crs = _rsets.get(key);
if (crs.rows != null) {
count += crs.columns.length*crs.rows.size();
}
}
return count * 64;
} | java | public int estimateMaximumBytes() {
int count = this.size();
for (String key: _rsets.keySet()) {
CachedResultSet crs = _rsets.get(key);
if (crs.rows != null) {
count += crs.columns.length*crs.rows.size();
}
}
return count * 64;
} | [
"public",
"int",
"estimateMaximumBytes",
"(",
")",
"{",
"int",
"count",
"=",
"this",
".",
"size",
"(",
")",
";",
"for",
"(",
"String",
"key",
":",
"_rsets",
".",
"keySet",
"(",
")",
")",
"{",
"CachedResultSet",
"crs",
"=",
"_rsets",
".",
"get",
"(",
... | Provides a very rough estimate of how big a JSON representative of this binder might be. | [
"Provides",
"a",
"very",
"rough",
"estimate",
"of",
"how",
"big",
"a",
"JSON",
"representative",
"of",
"this",
"binder",
"might",
"be",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L262-L271 | train |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.toJSON | public String toJSON() {
JSONBuilder jb = new JSONBuilder(estimateMaximumBytes()).append('{');
appendParams(jb).append(',');
appendTables(jb);
jb.append('}');
return jb.toString();
} | java | public String toJSON() {
JSONBuilder jb = new JSONBuilder(estimateMaximumBytes()).append('{');
appendParams(jb).append(',');
appendTables(jb);
jb.append('}');
return jb.toString();
} | [
"public",
"String",
"toJSON",
"(",
")",
"{",
"JSONBuilder",
"jb",
"=",
"new",
"JSONBuilder",
"(",
"estimateMaximumBytes",
"(",
")",
")",
".",
"append",
"(",
"'",
"'",
")",
";",
"appendParams",
"(",
"jb",
")",
".",
"append",
"(",
"'",
"'",
")",
";",
... | Returns a JSON string representing the contents of this data binder, excluding named objects. | [
"Returns",
"a",
"JSON",
"string",
"representing",
"the",
"contents",
"of",
"this",
"data",
"binder",
"excluding",
"named",
"objects",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L276-L283 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/DateUtilities.java | DateUtilities.getDateForHour | private static long getDateForHour(long dt, TimeZone tz, int hour, int dayoffset)
{
Calendar c = getCalendar(tz);
c.setTimeInMillis(dt);
int dd = c.get(Calendar.DAY_OF_MONTH);
int mm = c.get(Calendar.MONTH);
int yy = c.get(Calendar.YEAR);
c.set(yy, mm, dd, hour, 0, 0)... | java | private static long getDateForHour(long dt, TimeZone tz, int hour, int dayoffset)
{
Calendar c = getCalendar(tz);
c.setTimeInMillis(dt);
int dd = c.get(Calendar.DAY_OF_MONTH);
int mm = c.get(Calendar.MONTH);
int yy = c.get(Calendar.YEAR);
c.set(yy, mm, dd, hour, 0, 0)... | [
"private",
"static",
"long",
"getDateForHour",
"(",
"long",
"dt",
",",
"TimeZone",
"tz",
",",
"int",
"hour",
",",
"int",
"dayoffset",
")",
"{",
"Calendar",
"c",
"=",
"getCalendar",
"(",
"tz",
")",
";",
"c",
".",
"setTimeInMillis",
"(",
"dt",
")",
";",
... | Returns the date for the given hour.
@param dt The date to be checked
@param tz The timezone associated with the date
@param hour The hour to be checked
@param dayoffset The day of the month to offset
@return The date for the given hour | [
"Returns",
"the",
"date",
"for",
"the",
"given",
"hour",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/DateUtilities.java#L175-L187 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/DateUtilities.java | DateUtilities.getCalendar | public static Calendar getCalendar(TimeZone tz, Locale locale)
{
if(tz == null)
tz = getCurrentTimeZone();
if(locale == null)
locale = getCurrentLocale();
return Calendar.getInstance(tz, locale);
} | java | public static Calendar getCalendar(TimeZone tz, Locale locale)
{
if(tz == null)
tz = getCurrentTimeZone();
if(locale == null)
locale = getCurrentLocale();
return Calendar.getInstance(tz, locale);
} | [
"public",
"static",
"Calendar",
"getCalendar",
"(",
"TimeZone",
"tz",
",",
"Locale",
"locale",
")",
"{",
"if",
"(",
"tz",
"==",
"null",
")",
"tz",
"=",
"getCurrentTimeZone",
"(",
")",
";",
"if",
"(",
"locale",
"==",
"null",
")",
"locale",
"=",
"getCurr... | Returns a new calendar object using the given timezone and locale.
@param tz The timezone associated with the new calendar
@param locale The locale associated with the new calendar
@return A new calendar object for the given timezone and locale | [
"Returns",
"a",
"new",
"calendar",
"object",
"using",
"the",
"given",
"timezone",
"and",
"locale",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/DateUtilities.java#L195-L202 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/DateUtilities.java | DateUtilities.getLocale | public static Locale getLocale(String country)
{
if(country == null || country.length() == 0)
country = Locale.getDefault().getCountry();
List<Locale> locales = LocaleUtils.languagesByCountry(country);
Locale locale = Locale.getDefault();
if(locales.size() > 0)
... | java | public static Locale getLocale(String country)
{
if(country == null || country.length() == 0)
country = Locale.getDefault().getCountry();
List<Locale> locales = LocaleUtils.languagesByCountry(country);
Locale locale = Locale.getDefault();
if(locales.size() > 0)
... | [
"public",
"static",
"Locale",
"getLocale",
"(",
"String",
"country",
")",
"{",
"if",
"(",
"country",
"==",
"null",
"||",
"country",
".",
"length",
"(",
")",
"==",
"0",
")",
"country",
"=",
"Locale",
".",
"getDefault",
"(",
")",
".",
"getCountry",
"(",
... | Returns the locale for the given country.
@param country The country for the locale
@return The locale for the given country | [
"Returns",
"the",
"locale",
"for",
"the",
"given",
"country",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/DateUtilities.java#L317-L326 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/DateUtilities.java | DateUtilities.setCalendarData | public static void setCalendarData(Calendar calendar, Locale locale)
{
int[] array = (int[])localeData.get(locale);
if(array == null)
{
Calendar c = Calendar.getInstance(locale);
array = new int[2];
array[0] = c.getFirstDayOfWeek();
array[1] = ... | java | public static void setCalendarData(Calendar calendar, Locale locale)
{
int[] array = (int[])localeData.get(locale);
if(array == null)
{
Calendar c = Calendar.getInstance(locale);
array = new int[2];
array[0] = c.getFirstDayOfWeek();
array[1] = ... | [
"public",
"static",
"void",
"setCalendarData",
"(",
"Calendar",
"calendar",
",",
"Locale",
"locale",
")",
"{",
"int",
"[",
"]",
"array",
"=",
"(",
"int",
"[",
"]",
")",
"localeData",
".",
"get",
"(",
"locale",
")",
";",
"if",
"(",
"array",
"==",
"nul... | Set the attributes of the given calendar from the given locale.
@param calendar The calendar to set the date settings on
@param locale The locale to use for the date settings | [
"Set",
"the",
"attributes",
"of",
"the",
"given",
"calendar",
"from",
"the",
"given",
"locale",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/DateUtilities.java#L333-L346 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/DateUtilities.java | DateUtilities.addDays | public static Date addDays(long dt, int days)
{
Calendar c = getCalendar();
if(dt > 0L)
c.setTimeInMillis(dt);
c.add(Calendar.DATE, days);
return c.getTime();
} | java | public static Date addDays(long dt, int days)
{
Calendar c = getCalendar();
if(dt > 0L)
c.setTimeInMillis(dt);
c.add(Calendar.DATE, days);
return c.getTime();
} | [
"public",
"static",
"Date",
"addDays",
"(",
"long",
"dt",
",",
"int",
"days",
")",
"{",
"Calendar",
"c",
"=",
"getCalendar",
"(",
")",
";",
"if",
"(",
"dt",
">",
"0L",
")",
"c",
".",
"setTimeInMillis",
"(",
"dt",
")",
";",
"c",
".",
"add",
"(",
... | Returns the given date adding the given number of days.
@param dt The date to add the days to
@param days The number of days to add. To subtract days, use a negative value.
@return The date with the given days added | [
"Returns",
"the",
"given",
"date",
"adding",
"the",
"given",
"number",
"of",
"days",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/DateUtilities.java#L354-L361 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/DateUtilities.java | DateUtilities.convertToUtc | public static long convertToUtc(long millis, String tz)
{
long ret = millis;
if(tz != null && tz.length() > 0)
{
DateTime dt = new DateTime(millis, DateTimeZone.forID(tz));
ret = dt.withZoneRetainFields(DateTimeZone.forID("UTC")).getMillis();
}
return ... | java | public static long convertToUtc(long millis, String tz)
{
long ret = millis;
if(tz != null && tz.length() > 0)
{
DateTime dt = new DateTime(millis, DateTimeZone.forID(tz));
ret = dt.withZoneRetainFields(DateTimeZone.forID("UTC")).getMillis();
}
return ... | [
"public",
"static",
"long",
"convertToUtc",
"(",
"long",
"millis",
",",
"String",
"tz",
")",
"{",
"long",
"ret",
"=",
"millis",
";",
"if",
"(",
"tz",
"!=",
"null",
"&&",
"tz",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"DateTime",
"dt",
"=",
"n... | Returns the given date converted to UTC using the given timezone.
@param millis The date to convert
@param tz The timezone associated with the date
@return The given date converted using the given timezone | [
"Returns",
"the",
"given",
"date",
"converted",
"to",
"UTC",
"using",
"the",
"given",
"timezone",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/DateUtilities.java#L379-L388 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/server/JavacServer.java | JavacServer.useServer | public static int useServer(String settings, String[] args,
Set<URI> sourcesToCompile,
Set<URI> visibleSources,
Map<URI, Set<String>> visibleClasses,
Map<String, Set<URI>> packageArtifacts,
Map<String, Set<String>> packageDependencies,
Map<String, ... | java | public static int useServer(String settings, String[] args,
Set<URI> sourcesToCompile,
Set<URI> visibleSources,
Map<URI, Set<String>> visibleClasses,
Map<String, Set<URI>> packageArtifacts,
Map<String, Set<String>> packageDependencies,
Map<String, ... | [
"public",
"static",
"int",
"useServer",
"(",
"String",
"settings",
",",
"String",
"[",
"]",
"args",
",",
"Set",
"<",
"URI",
">",
"sourcesToCompile",
",",
"Set",
"<",
"URI",
">",
"visibleSources",
",",
"Map",
"<",
"URI",
",",
"Set",
"<",
"String",
">",
... | Dispatch a compilation request to a javac server.
@param args are the command line args to javac and is allowed to contain source files, @file and other command line options to javac.
The generated classes, h files and other artifacts from the javac invocation are stored by the javac server to disk.
@param sources_t... | [
"Dispatch",
"a",
"compilation",
"request",
"to",
"a",
"javac",
"server",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/server/JavacServer.java#L231-L318 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/server/JavacServer.java | JavacServer.fork | private static String fork(String sjavac, String portfile, String logfile, int poolsize, int keepalive,
final PrintStream err, String stdouterrfile, String background)
throws IOException, ProblemException {
if (stdouterrfile != null && stdouterrfile.trim().equals("")) {
stdou... | java | private static String fork(String sjavac, String portfile, String logfile, int poolsize, int keepalive,
final PrintStream err, String stdouterrfile, String background)
throws IOException, ProblemException {
if (stdouterrfile != null && stdouterrfile.trim().equals("")) {
stdou... | [
"private",
"static",
"String",
"fork",
"(",
"String",
"sjavac",
",",
"String",
"portfile",
",",
"String",
"logfile",
",",
"int",
"poolsize",
",",
"int",
"keepalive",
",",
"final",
"PrintStream",
"err",
",",
"String",
"stdouterrfile",
",",
"String",
"background... | Fork a background process. Returns the command line used that can be printed if something failed. | [
"Fork",
"a",
"background",
"process",
".",
"Returns",
"the",
"command",
"line",
"used",
"that",
"can",
"be",
"printed",
"if",
"something",
"failed",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/server/JavacServer.java#L359-L410 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/server/JavacServer.java | JavacServer.connectGetSysInfo | public static SysInfo connectGetSysInfo(String serverSettings, PrintStream out, PrintStream err) {
SysInfo sysinfo = new SysInfo(-1, -1);
String id = Util.extractStringOption("id", serverSettings);
String portfile = Util.extractStringOption("portfile", serverSettings);
try {
... | java | public static SysInfo connectGetSysInfo(String serverSettings, PrintStream out, PrintStream err) {
SysInfo sysinfo = new SysInfo(-1, -1);
String id = Util.extractStringOption("id", serverSettings);
String portfile = Util.extractStringOption("portfile", serverSettings);
try {
... | [
"public",
"static",
"SysInfo",
"connectGetSysInfo",
"(",
"String",
"serverSettings",
",",
"PrintStream",
"out",
",",
"PrintStream",
"err",
")",
"{",
"SysInfo",
"sysinfo",
"=",
"new",
"SysInfo",
"(",
"-",
"1",
",",
"-",
"1",
")",
";",
"String",
"id",
"=",
... | Make a request to the server only to get the maximum possible heap size to use for compilations.
@param port_file The port file used to synchronize creation of this server.
@param id The identify of the compilation.
@param out Standard out information.
@param err Standard err information.
@return The maximum heap size... | [
"Make",
"a",
"request",
"to",
"the",
"server",
"only",
"to",
"get",
"the",
"maximum",
"possible",
"heap",
"size",
"to",
"use",
"for",
"compilations",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/server/JavacServer.java#L432-L450 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/server/JavacServer.java | JavacServer.run | private void run(PortFile portFile, PrintStream err, int keepalive) {
boolean fileDeleted = false;
long timeSinceLastCompile;
try {
// Every 5 second (check_portfile_interval) we test if the portfile has disappeared => quit
// Or if the last request was finished more than... | java | private void run(PortFile portFile, PrintStream err, int keepalive) {
boolean fileDeleted = false;
long timeSinceLastCompile;
try {
// Every 5 second (check_portfile_interval) we test if the portfile has disappeared => quit
// Or if the last request was finished more than... | [
"private",
"void",
"run",
"(",
"PortFile",
"portFile",
",",
"PrintStream",
"err",
",",
"int",
"keepalive",
")",
"{",
"boolean",
"fileDeleted",
"=",
"false",
";",
"long",
"timeSinceLastCompile",
";",
"try",
"{",
"// Every 5 second (check_portfile_interval) we test if t... | Run the server thread until it exits. Either because of inactivity or because the port file has been deleted by someone else, or overtaken by some other
javac server. | [
"Run",
"the",
"server",
"thread",
"until",
"it",
"exits",
".",
"Either",
"because",
"of",
"inactivity",
"or",
"because",
"the",
"port",
"file",
"has",
"been",
"deleted",
"by",
"someone",
"else",
"or",
"overtaken",
"by",
"some",
"other",
"javac",
"server",
... | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/server/JavacServer.java#L653-L737 | train |
koendeschacht/bow-utils | src/main/java/be/bagofwords/util/SocketConnection.java | SocketConnection.writeValue | public <T extends Object> void writeValue(T value) throws IOException {
writeValue(value, (Class<T>) value.getClass());
} | java | public <T extends Object> void writeValue(T value) throws IOException {
writeValue(value, (Class<T>) value.getClass());
} | [
"public",
"<",
"T",
"extends",
"Object",
">",
"void",
"writeValue",
"(",
"T",
"value",
")",
"throws",
"IOException",
"{",
"writeValue",
"(",
"value",
",",
"(",
"Class",
"<",
"T",
">",
")",
"value",
".",
"getClass",
"(",
")",
")",
";",
"}"
] | Value can not be null | [
"Value",
"can",
"not",
"be",
"null"
] | f599da17cb7a40b8ffc5610a9761fa922e99d7cb | https://github.com/koendeschacht/bow-utils/blob/f599da17cb7a40b8ffc5610a9761fa922e99d7cb/src/main/java/be/bagofwords/util/SocketConnection.java#L271-L273 | train |
pierre/serialization | thrift/src/main/java/com/ning/metrics/serialization/event/ThriftEnvelopeEvent.java | ThriftEnvelopeEvent.deserializeFromStream | private void deserializeFromStream(final InputStream in) throws IOException
{
final byte[] dateTimeBytes = new byte[8];
in.read(dateTimeBytes, 0, 8);
eventDateTime = new DateTime(ByteBuffer.wrap(dateTimeBytes).getLong(0));
final byte[] sizeGranularityInBytes = new byte[4];
i... | java | private void deserializeFromStream(final InputStream in) throws IOException
{
final byte[] dateTimeBytes = new byte[8];
in.read(dateTimeBytes, 0, 8);
eventDateTime = new DateTime(ByteBuffer.wrap(dateTimeBytes).getLong(0));
final byte[] sizeGranularityInBytes = new byte[4];
i... | [
"private",
"void",
"deserializeFromStream",
"(",
"final",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"final",
"byte",
"[",
"]",
"dateTimeBytes",
"=",
"new",
"byte",
"[",
"8",
"]",
";",
"in",
".",
"read",
"(",
"dateTimeBytes",
",",
"0",
",",
... | Given an InputStream, extract the eventDateTime, granularity and thriftEnvelope to build
the ThriftEnvelopeEvent.
This method expects the stream to be open and won't close it for you.
@param in InputStream to read
@throws IOException generic I/O Exception | [
"Given",
"an",
"InputStream",
"extract",
"the",
"eventDateTime",
"granularity",
"and",
"thriftEnvelope",
"to",
"build",
"the",
"ThriftEnvelopeEvent",
".",
"This",
"method",
"expects",
"the",
"stream",
"to",
"be",
"open",
"and",
"won",
"t",
"close",
"it",
"for",
... | b15b7c749ba78bfe94dce8fc22f31b30b2e6830b | https://github.com/pierre/serialization/blob/b15b7c749ba78bfe94dce8fc22f31b30b2e6830b/thrift/src/main/java/com/ning/metrics/serialization/event/ThriftEnvelopeEvent.java#L150-L163 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/provider/newrelic/ApplicationInstanceCache.java | ApplicationInstanceCache.add | public void add(Collection<ApplicationInstance> applicationInstances)
{
for(ApplicationInstance applicationInstance : applicationInstances)
this.applicationInstances.put(applicationInstance.getId(), applicationInstance);
} | java | public void add(Collection<ApplicationInstance> applicationInstances)
{
for(ApplicationInstance applicationInstance : applicationInstances)
this.applicationInstances.put(applicationInstance.getId(), applicationInstance);
} | [
"public",
"void",
"add",
"(",
"Collection",
"<",
"ApplicationInstance",
">",
"applicationInstances",
")",
"{",
"for",
"(",
"ApplicationInstance",
"applicationInstance",
":",
"applicationInstances",
")",
"this",
".",
"applicationInstances",
".",
"put",
"(",
"applicatio... | Adds the application instance list to the application instances for the account.
@param applicationInstances The application instances to add | [
"Adds",
"the",
"application",
"instance",
"list",
"to",
"the",
"application",
"instances",
"for",
"the",
"account",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/provider/newrelic/ApplicationInstanceCache.java#L67-L71 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/DateFormatPool.java | DateFormatPool.get | public Object get()
{
synchronized(this)
{
if (freePool.isEmpty() || usedPool.size() >= capacity)
{
try
{
wait(1000);
}
catch (InterruptedException e)
{
}
... | java | public Object get()
{
synchronized(this)
{
if (freePool.isEmpty() || usedPool.size() >= capacity)
{
try
{
wait(1000);
}
catch (InterruptedException e)
{
}
... | [
"public",
"Object",
"get",
"(",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"freePool",
".",
"isEmpty",
"(",
")",
"||",
"usedPool",
".",
"size",
"(",
")",
">=",
"capacity",
")",
"{",
"try",
"{",
"wait",
"(",
"1000",
")",
";",
"}",... | Retrieve a resource from the pool of free resources.
@return The next available resource from the pool | [
"Retrieve",
"a",
"resource",
"from",
"the",
"pool",
"of",
"free",
"resources",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/DateFormatPool.java#L70-L94 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/DateFormatPool.java | DateFormatPool.getFormat | public SimpleDateFormat getFormat(String format)
{
SimpleDateFormat f = (SimpleDateFormat)get();
f.applyPattern(format);
return f;
} | java | public SimpleDateFormat getFormat(String format)
{
SimpleDateFormat f = (SimpleDateFormat)get();
f.applyPattern(format);
return f;
} | [
"public",
"SimpleDateFormat",
"getFormat",
"(",
"String",
"format",
")",
"{",
"SimpleDateFormat",
"f",
"=",
"(",
"SimpleDateFormat",
")",
"get",
"(",
")",
";",
"f",
".",
"applyPattern",
"(",
"format",
")",
";",
"return",
"f",
";",
"}"
] | Retrieve a date format from the pool of free resources.
@param format The date format to apply to the resource returned
@return The next available date format from the pool of free resources | [
"Retrieve",
"a",
"date",
"format",
"from",
"the",
"pool",
"of",
"free",
"resources",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/DateFormatPool.java#L101-L106 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/DateFormatPool.java | DateFormatPool.release | public void release(Object o)
{
synchronized(this)
{
usedPool.remove(o);
freePool.add(o);
notify();
}
} | java | public void release(Object o)
{
synchronized(this)
{
usedPool.remove(o);
freePool.add(o);
notify();
}
} | [
"public",
"void",
"release",
"(",
"Object",
"o",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"usedPool",
".",
"remove",
"(",
"o",
")",
";",
"freePool",
".",
"add",
"(",
"o",
")",
";",
"notify",
"(",
")",
";",
"}",
"}"
] | Release a resource and put it back in the pool of free resources.
@param o The object to return to the pool | [
"Release",
"a",
"resource",
"and",
"put",
"it",
"back",
"in",
"the",
"pool",
"of",
"free",
"resources",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/DateFormatPool.java#L112-L120 | train |
mcpat/microjiac-public | tools/microjiac-midlet-maven-plugin/src/main/java/de/jiac/micro/mojo/ConfiguratorMojo.java | ConfiguratorMojo.execute | public void execute() throws MojoExecutionException {
ClassLoader classloader;
try {
classloader= createClassLoader();
} catch (Exception e) {
throw new MojoExecutionException("could not create classloader from dependencies", e);
}
Abstra... | java | public void execute() throws MojoExecutionException {
ClassLoader classloader;
try {
classloader= createClassLoader();
} catch (Exception e) {
throw new MojoExecutionException("could not create classloader from dependencies", e);
}
Abstra... | [
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"ClassLoader",
"classloader",
";",
"try",
"{",
"classloader",
"=",
"createClassLoader",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"MojoExecution... | Processes all dependencies first and then creates a new JVM to
generate the configurator implementation with. | [
"Processes",
"all",
"dependencies",
"first",
"and",
"then",
"creates",
"a",
"new",
"JVM",
"to",
"generate",
"the",
"configurator",
"implementation",
"with",
"."
] | 3c649e44846981a68e84cc4578719532414d8d35 | https://github.com/mcpat/microjiac-public/blob/3c649e44846981a68e84cc4578719532414d8d35/tools/microjiac-midlet-maven-plugin/src/main/java/de/jiac/micro/mojo/ConfiguratorMojo.java#L185-L204 | train |
wanglinsong/thx-android | uia-client/src/main/java/com/android/uiautomator/stub/Rect.java | Rect.toShortString | public String toShortString(StringBuilder sb) {
sb.setLength(0);
sb.append('[');
sb.append(left);
sb.append(',');
sb.append(top);
sb.append("][");
sb.append(right);
sb.append(',');
sb.append(bottom);
sb.append(']');
return sb.toStri... | java | public String toShortString(StringBuilder sb) {
sb.setLength(0);
sb.append('[');
sb.append(left);
sb.append(',');
sb.append(top);
sb.append("][");
sb.append(right);
sb.append(',');
sb.append(bottom);
sb.append(']');
return sb.toStri... | [
"public",
"String",
"toShortString",
"(",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"setLength",
"(",
"0",
")",
";",
"sb",
".",
"append",
"(",
"'",
"'",
")",
";",
"sb",
".",
"append",
"(",
"left",
")",
";",
"sb",
".",
"append",
"(",
"'",
"'",
... | Return a string representation of the rectangle in a compact form.
@param sb sb
@return string | [
"Return",
"a",
"string",
"representation",
"of",
"the",
"rectangle",
"in",
"a",
"compact",
"form",
"."
] | 4a98c4181b3e8876e688591737da37627c07e72b | https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/Rect.java#L138-L150 | train |
wanglinsong/thx-android | uia-client/src/main/java/com/android/uiautomator/stub/Rect.java | Rect.flattenToString | public String flattenToString() {
StringBuilder sb = new StringBuilder(32);
// WARNING: Do not change the format of this string, it must be
// preserved because Rects are saved in this flattened format.
sb.append(left);
sb.append(' ');
sb.append(top);
sb.append(' ... | java | public String flattenToString() {
StringBuilder sb = new StringBuilder(32);
// WARNING: Do not change the format of this string, it must be
// preserved because Rects are saved in this flattened format.
sb.append(left);
sb.append(' ');
sb.append(top);
sb.append(' ... | [
"public",
"String",
"flattenToString",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"32",
")",
";",
"// WARNING: Do not change the format of this string, it must be",
"// preserved because Rects are saved in this flattened format.",
"sb",
".",
"append... | Return a string representation of the rectangle in a well-defined format.
You can later recover the Rect from this string through
{@link #unflattenFromString(String)}.
@return Returns a new String of the form "left top right bottom" | [
"Return",
"a",
"string",
"representation",
"of",
"the",
"rectangle",
"in",
"a",
"well",
"-",
"defined",
"format",
"."
] | 4a98c4181b3e8876e688591737da37627c07e72b | https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/Rect.java#L160-L172 | train |
wanglinsong/thx-android | uia-client/src/main/java/com/android/uiautomator/stub/Rect.java | Rect.set | public void set(Rect src) {
this.left = src.left;
this.top = src.top;
this.right = src.right;
this.bottom = src.bottom;
} | java | public void set(Rect src) {
this.left = src.left;
this.top = src.top;
this.right = src.right;
this.bottom = src.bottom;
} | [
"public",
"void",
"set",
"(",
"Rect",
"src",
")",
"{",
"this",
".",
"left",
"=",
"src",
".",
"left",
";",
"this",
".",
"top",
"=",
"src",
".",
"top",
";",
"this",
".",
"right",
"=",
"src",
".",
"right",
";",
"this",
".",
"bottom",
"=",
"src",
... | Copy the coordinates from src into this rectangle.
@param src The rectangle whose coordinates are copied into this
rectangle. | [
"Copy",
"the",
"coordinates",
"from",
"src",
"into",
"this",
"rectangle",
"."
] | 4a98c4181b3e8876e688591737da37627c07e72b | https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/Rect.java#L280-L285 | train |
wanglinsong/thx-android | uia-client/src/main/java/com/android/uiautomator/stub/Rect.java | Rect.offset | public void offset(int dx, int dy) {
left += dx;
top += dy;
right += dx;
bottom += dy;
} | java | public void offset(int dx, int dy) {
left += dx;
top += dy;
right += dx;
bottom += dy;
} | [
"public",
"void",
"offset",
"(",
"int",
"dx",
",",
"int",
"dy",
")",
"{",
"left",
"+=",
"dx",
";",
"top",
"+=",
"dy",
";",
"right",
"+=",
"dx",
";",
"bottom",
"+=",
"dy",
";",
"}"
] | Offset the rectangle by adding dx to its left and right coordinates, and
adding dy to its top and bottom coordinates.
@param dx The amount to add to the rectangle's left and right coordinates
@param dy The amount to add to the rectangle's top and bottom coordinates | [
"Offset",
"the",
"rectangle",
"by",
"adding",
"dx",
"to",
"its",
"left",
"and",
"right",
"coordinates",
"and",
"adding",
"dy",
"to",
"its",
"top",
"and",
"bottom",
"coordinates",
"."
] | 4a98c4181b3e8876e688591737da37627c07e72b | https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/Rect.java#L294-L299 | train |
wanglinsong/thx-android | uia-client/src/main/java/com/android/uiautomator/stub/Rect.java | Rect.contains | public boolean contains(int left, int top, int right, int bottom) {
// check for empty first
return this.left < this.right && this.top < this.bottom
// now check for containment
&& this.left <= left && this.top <= top
&& this.right >= right && this.bottom ... | java | public boolean contains(int left, int top, int right, int bottom) {
// check for empty first
return this.left < this.right && this.top < this.bottom
// now check for containment
&& this.left <= left && this.top <= top
&& this.right >= right && this.bottom ... | [
"public",
"boolean",
"contains",
"(",
"int",
"left",
",",
"int",
"top",
",",
"int",
"right",
",",
"int",
"bottom",
")",
"{",
"// check for empty first",
"return",
"this",
".",
"left",
"<",
"this",
".",
"right",
"&&",
"this",
".",
"top",
"<",
"this",
".... | Returns true iff the 4 specified sides of a rectangle are inside or equal
to this rectangle. i.e. is this rectangle a superset of the specified
rectangle. An empty rectangle never contains another rectangle.
@param left The left side of the rectangle being tested for containment
@param top The top of the rectangl... | [
"Returns",
"true",
"iff",
"the",
"4",
"specified",
"sides",
"of",
"a",
"rectangle",
"are",
"inside",
"or",
"equal",
"to",
"this",
"rectangle",
".",
"i",
".",
"e",
".",
"is",
"this",
"rectangle",
"a",
"superset",
"of",
"the",
"specified",
"rectangle",
"."... | 4a98c4181b3e8876e688591737da37627c07e72b | https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/Rect.java#L361-L367 | train |
wanglinsong/thx-android | uia-client/src/main/java/com/android/uiautomator/stub/Rect.java | Rect.contains | public boolean contains(Rect r) {
// check for empty first
return this.left < this.right && this.top < this.bottom
// now check for containment
&& left <= r.left && top <= r.top && right >= r.right && bottom >= r.bottom;
} | java | public boolean contains(Rect r) {
// check for empty first
return this.left < this.right && this.top < this.bottom
// now check for containment
&& left <= r.left && top <= r.top && right >= r.right && bottom >= r.bottom;
} | [
"public",
"boolean",
"contains",
"(",
"Rect",
"r",
")",
"{",
"// check for empty first",
"return",
"this",
".",
"left",
"<",
"this",
".",
"right",
"&&",
"this",
".",
"top",
"<",
"this",
".",
"bottom",
"// now check for containment",
"&&",
"left",
"<=",
"r",
... | Returns true iff the specified rectangle r is inside or equal to this
rectangle. An empty rectangle never contains another rectangle.
@param r The rectangle being tested for containment.
@return true iff the specified rectangle r is inside or equal to this
rectangle | [
"Returns",
"true",
"iff",
"the",
"specified",
"rectangle",
"r",
"is",
"inside",
"or",
"equal",
"to",
"this",
"rectangle",
".",
"An",
"empty",
"rectangle",
"never",
"contains",
"another",
"rectangle",
"."
] | 4a98c4181b3e8876e688591737da37627c07e72b | https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/Rect.java#L378-L383 | train |
wanglinsong/thx-android | uia-client/src/main/java/com/android/uiautomator/stub/Rect.java | Rect.union | public void union(Rect r) {
union(r.left, r.top, r.right, r.bottom);
} | java | public void union(Rect r) {
union(r.left, r.top, r.right, r.bottom);
} | [
"public",
"void",
"union",
"(",
"Rect",
"r",
")",
"{",
"union",
"(",
"r",
".",
"left",
",",
"r",
".",
"top",
",",
"r",
".",
"right",
",",
"r",
".",
"bottom",
")",
";",
"}"
] | Update this Rect to enclose itself and the specified rectangle. If the
specified rectangle is empty, nothing is done. If this rectangle is empty
it is set to the specified rectangle.
@param r The rectangle being unioned with this rectangle | [
"Update",
"this",
"Rect",
"to",
"enclose",
"itself",
"and",
"the",
"specified",
"rectangle",
".",
"If",
"the",
"specified",
"rectangle",
"is",
"empty",
"nothing",
"is",
"done",
".",
"If",
"this",
"rectangle",
"is",
"empty",
"it",
"is",
"set",
"to",
"the",
... | 4a98c4181b3e8876e688591737da37627c07e72b | https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/Rect.java#L538-L540 | train |
wanglinsong/thx-android | uia-client/src/main/java/com/android/uiautomator/stub/Rect.java | Rect.scale | public void scale(float scale) {
if (scale != 1.0f) {
left = (int) (left * scale + 0.5f);
top = (int) (top * scale + 0.5f);
right = (int) (right * scale + 0.5f);
bottom = (int) (bottom * scale + 0.5f);
}
} | java | public void scale(float scale) {
if (scale != 1.0f) {
left = (int) (left * scale + 0.5f);
top = (int) (top * scale + 0.5f);
right = (int) (right * scale + 0.5f);
bottom = (int) (bottom * scale + 0.5f);
}
} | [
"public",
"void",
"scale",
"(",
"float",
"scale",
")",
"{",
"if",
"(",
"scale",
"!=",
"1.0f",
")",
"{",
"left",
"=",
"(",
"int",
")",
"(",
"left",
"*",
"scale",
"+",
"0.5f",
")",
";",
"top",
"=",
"(",
"int",
")",
"(",
"top",
"*",
"scale",
"+"... | Scales up the rect by the given scale.
@param scale scale | [
"Scales",
"up",
"the",
"rect",
"by",
"the",
"given",
"scale",
"."
] | 4a98c4181b3e8876e688591737da37627c07e72b | https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/Rect.java#L587-L594 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/provider/newrelic/PluginCache.java | PluginCache.add | public void add(Collection<Plugin> plugins)
{
for(Plugin plugin : plugins)
this.plugins.put(plugin.getId(), plugin);
} | java | public void add(Collection<Plugin> plugins)
{
for(Plugin plugin : plugins)
this.plugins.put(plugin.getId(), plugin);
} | [
"public",
"void",
"add",
"(",
"Collection",
"<",
"Plugin",
">",
"plugins",
")",
"{",
"for",
"(",
"Plugin",
"plugin",
":",
"plugins",
")",
"this",
".",
"plugins",
".",
"put",
"(",
"plugin",
".",
"getId",
"(",
")",
",",
"plugin",
")",
";",
"}"
] | Adds the plugin list to the plugins for the account.
@param plugins The plugins to add | [
"Adds",
"the",
"plugin",
"list",
"to",
"the",
"plugins",
"for",
"the",
"account",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/provider/newrelic/PluginCache.java#L56-L60 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/provider/newrelic/PluginCache.java | PluginCache.components | public PluginComponentCache components(long pluginId)
{
PluginComponentCache cache = components.get(pluginId);
if(cache == null)
components.put(pluginId, cache = new PluginComponentCache(pluginId));
return cache;
} | java | public PluginComponentCache components(long pluginId)
{
PluginComponentCache cache = components.get(pluginId);
if(cache == null)
components.put(pluginId, cache = new PluginComponentCache(pluginId));
return cache;
} | [
"public",
"PluginComponentCache",
"components",
"(",
"long",
"pluginId",
")",
"{",
"PluginComponentCache",
"cache",
"=",
"components",
".",
"get",
"(",
"pluginId",
")",
";",
"if",
"(",
"cache",
"==",
"null",
")",
"components",
".",
"put",
"(",
"pluginId",
",... | Returns the cache of plugin components for the given plugin, creating one if it doesn't exist .
@param pluginId The id of the plugin for the cache of plugin component
@return The cache of plugin components for the given plugin | [
"Returns",
"the",
"cache",
"of",
"plugin",
"components",
"for",
"the",
"given",
"plugin",
"creating",
"one",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/provider/newrelic/PluginCache.java#L102-L108 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/Field.java | Field.getTypeConverter | public TypeConverter getTypeConverter() throws RpcException {
if (contract == null) {
throw new IllegalStateException("contract cannot be null");
}
if (type == null) {
throw new IllegalStateException("field type cannot be null");
}
TypeConverter tc = null... | java | public TypeConverter getTypeConverter() throws RpcException {
if (contract == null) {
throw new IllegalStateException("contract cannot be null");
}
if (type == null) {
throw new IllegalStateException("field type cannot be null");
}
TypeConverter tc = null... | [
"public",
"TypeConverter",
"getTypeConverter",
"(",
")",
"throws",
"RpcException",
"{",
"if",
"(",
"contract",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"contract cannot be null\"",
")",
";",
"}",
"if",
"(",
"type",
"==",
"null",
... | Returns a new TypeConverter appropriate for the Field's type.
@throws RpcException If type is not defined in the Contract | [
"Returns",
"a",
"new",
"TypeConverter",
"appropriate",
"for",
"the",
"Field",
"s",
"type",
"."
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/Field.java#L52-L91 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/Field.java | Field.getJavaType | public String getJavaType(boolean wrapArray) {
String t = "";
if (type.equals("string")) {
t = "String";
}
else if (type.equals("float")) {
t = "Double";
}
else if (type.equals("int")) {
t = "Long";
}
else if (type.equal... | java | public String getJavaType(boolean wrapArray) {
String t = "";
if (type.equals("string")) {
t = "String";
}
else if (type.equals("float")) {
t = "Double";
}
else if (type.equals("int")) {
t = "Long";
}
else if (type.equal... | [
"public",
"String",
"getJavaType",
"(",
"boolean",
"wrapArray",
")",
"{",
"String",
"t",
"=",
"\"\"",
";",
"if",
"(",
"type",
".",
"equals",
"(",
"\"string\"",
")",
")",
"{",
"t",
"=",
"\"String\"",
";",
"}",
"else",
"if",
"(",
"type",
".",
"equals",... | Returns the Java type this type maps to. Used by Idl2Java code generator.
@param wrapArray If true, returned String will include '[]' after type to designate
a Java array type | [
"Returns",
"the",
"Java",
"type",
"this",
"type",
"maps",
"to",
".",
"Used",
"by",
"Idl2Java",
"code",
"generator",
"."
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/Field.java#L148-L172 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.