id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
156,400 | pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/connect/ConnectionResolver.java | ConnectionResolver.resolveAll | public List<ConnectionParams> resolveAll(String correlationId) throws ApplicationException {
List<ConnectionParams> resolved = new ArrayList<ConnectionParams>();
List<ConnectionParams> toResolve = new ArrayList<ConnectionParams>();
// Sort connections
for (ConnectionParams connection : _connections) {
if (c... | java | public List<ConnectionParams> resolveAll(String correlationId) throws ApplicationException {
List<ConnectionParams> resolved = new ArrayList<ConnectionParams>();
List<ConnectionParams> toResolve = new ArrayList<ConnectionParams>();
// Sort connections
for (ConnectionParams connection : _connections) {
if (c... | [
"public",
"List",
"<",
"ConnectionParams",
">",
"resolveAll",
"(",
"String",
"correlationId",
")",
"throws",
"ApplicationException",
"{",
"List",
"<",
"ConnectionParams",
">",
"resolved",
"=",
"new",
"ArrayList",
"<",
"ConnectionParams",
">",
"(",
")",
";",
"Lis... | Resolves all component connection. If connections are configured to be
retrieved from Discovery service it finds a IDiscovery and resolves the
connection there.
@param correlationId (optional) transaction id to trace execution through
call chain.
@return a list of resolved connections.
@throws ApplicationException whe... | [
"Resolves",
"all",
"component",
"connection",
".",
"If",
"connections",
"are",
"configured",
"to",
"be",
"retrieved",
"from",
"Discovery",
"service",
"it",
"finds",
"a",
"IDiscovery",
"and",
"resolves",
"the",
"connection",
"there",
"."
] | 122352fbf9b208f6417376da7b8ad725bc85ee58 | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/connect/ConnectionResolver.java#L276-L302 |
156,401 | onepf/OPFUtils | opfutils/src/main/java/org/onepf/opfutils/OPFUtils.java | OPFUtils.getAppVersion | public static int getAppVersion(@NonNull final Context context) {
try {
final PackageInfo packageInfo = context.getPackageManager()
.getPackageInfo(context.getPackageName(), 0);
return packageInfo.versionCode;
} catch (PackageManager.NameNotFoundException igno... | java | public static int getAppVersion(@NonNull final Context context) {
try {
final PackageInfo packageInfo = context.getPackageManager()
.getPackageInfo(context.getPackageName(), 0);
return packageInfo.versionCode;
} catch (PackageManager.NameNotFoundException igno... | [
"public",
"static",
"int",
"getAppVersion",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
")",
"{",
"try",
"{",
"final",
"PackageInfo",
"packageInfo",
"=",
"context",
".",
"getPackageManager",
"(",
")",
".",
"getPackageInfo",
"(",
"context",
".",
"getPac... | Returns the version code of the application.
@return The version code of the application. | [
"Returns",
"the",
"version",
"code",
"of",
"the",
"application",
"."
] | e30c2c64077c5d577c0cd7d3cead809d31f7dab1 | https://github.com/onepf/OPFUtils/blob/e30c2c64077c5d577c0cd7d3cead809d31f7dab1/opfutils/src/main/java/org/onepf/opfutils/OPFUtils.java#L71-L81 |
156,402 | onepf/OPFUtils | opfutils/src/main/java/org/onepf/opfutils/OPFUtils.java | OPFUtils.getPackageInstaller | @Nullable
public static String getPackageInstaller(@NonNull final Context context) {
final PackageManager packageManager = context.getPackageManager();
return packageManager.getInstallerPackageName(context.getPackageName());
} | java | @Nullable
public static String getPackageInstaller(@NonNull final Context context) {
final PackageManager packageManager = context.getPackageManager();
return packageManager.getInstallerPackageName(context.getPackageName());
} | [
"@",
"Nullable",
"public",
"static",
"String",
"getPackageInstaller",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
")",
"{",
"final",
"PackageManager",
"packageManager",
"=",
"context",
".",
"getPackageManager",
"(",
")",
";",
"return",
"packageManager",
".... | Returns the package name of the application installer.
@param context The instance of {@link android.content.Context}.
@return The package name of the application installer. | [
"Returns",
"the",
"package",
"name",
"of",
"the",
"application",
"installer",
"."
] | e30c2c64077c5d577c0cd7d3cead809d31f7dab1 | https://github.com/onepf/OPFUtils/blob/e30c2c64077c5d577c0cd7d3cead809d31f7dab1/opfutils/src/main/java/org/onepf/opfutils/OPFUtils.java#L126-L130 |
156,403 | jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/mvc/component/StandardRequestMapper.java | StandardRequestMapper.start | public void start() {
boolean succeeded = true;
Iterator i = mappingFilesMap.keySet().iterator();
while (i.hasNext()) {
String mappingName = (String) i.next();
String fileName = mappingFilesMap.getProperty(mappingName);
System.out.println(new LogEntry("loading mapping '" + mappingName + "' from '" + file... | java | public void start() {
boolean succeeded = true;
Iterator i = mappingFilesMap.keySet().iterator();
while (i.hasNext()) {
String mappingName = (String) i.next();
String fileName = mappingFilesMap.getProperty(mappingName);
System.out.println(new LogEntry("loading mapping '" + mappingName + "' from '" + file... | [
"public",
"void",
"start",
"(",
")",
"{",
"boolean",
"succeeded",
"=",
"true",
";",
"Iterator",
"i",
"=",
"mappingFilesMap",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"i",
".",
"hasNext",
"(",
")",
")",
"{",
"String",
"... | Loads mappings. | [
"Loads",
"mappings",
"."
] | 0fb0885775b576209ff1b5a0f67e3c25a99a6420 | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/mvc/component/StandardRequestMapper.java#L100-L117 |
156,404 | jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/mvc/component/StandardRequestMapper.java | StandardRequestMapper.setProperties | public void setProperties(Properties properties) throws ConfigurationException {
// initialRequest = application.getCurrentRequest();
autoReload = Boolean.valueOf(properties.getProperty("autoreload", "true"));
defaultMappingName = properties.getProperty("defaultmapping", defaultMappingName);
/* strict = section... | java | public void setProperties(Properties properties) throws ConfigurationException {
// initialRequest = application.getCurrentRequest();
autoReload = Boolean.valueOf(properties.getProperty("autoreload", "true"));
defaultMappingName = properties.getProperty("defaultmapping", defaultMappingName);
/* strict = section... | [
"public",
"void",
"setProperties",
"(",
"Properties",
"properties",
")",
"throws",
"ConfigurationException",
"{",
"//\t\tinitialRequest = application.getCurrentRequest();",
"autoReload",
"=",
"Boolean",
".",
"valueOf",
"(",
"properties",
".",
"getProperty",
"(",
"\"autorelo... | Loads mapping values.
@throws ConfigurationException if no properties section exists where mapping definition files are specified | [
"Loads",
"mapping",
"values",
"."
] | 0fb0885775b576209ff1b5a0f67e3c25a99a6420 | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/mvc/component/StandardRequestMapper.java#L164-L174 |
156,405 | lotaris/rox-commons-maven-plugin | src/main/java/org/twdata/maven/mojoexecutor/MojoExecutor.java | MojoExecutor.executeMojo | public static void executeMojo(Plugin plugin, String goal, Xpp3Dom configuration, ExecutionEnvironment env) throws MojoExecutionException {
if (configuration == null) {
throw new NullPointerException("configuration may not be null");
}
try {
String executionId = null;
if (goal != null && goal.l... | java | public static void executeMojo(Plugin plugin, String goal, Xpp3Dom configuration, ExecutionEnvironment env) throws MojoExecutionException {
if (configuration == null) {
throw new NullPointerException("configuration may not be null");
}
try {
String executionId = null;
if (goal != null && goal.l... | [
"public",
"static",
"void",
"executeMojo",
"(",
"Plugin",
"plugin",
",",
"String",
"goal",
",",
"Xpp3Dom",
"configuration",
",",
"ExecutionEnvironment",
"env",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"configuration",
"==",
"null",
")",
"{",
"thr... | Entry point for executing a mojo
@param plugin The plugin to execute
@param goal The goal to execute
@param configuration The execution configuration
@param env The execution environment
@throws MojoExecutionException If there are any exceptions locating or executing the mojo | [
"Entry",
"point",
"for",
"executing",
"a",
"mojo"
] | e2602d7f1e8c2e6994c0df07cc0003828adfa2af | https://github.com/lotaris/rox-commons-maven-plugin/blob/e2602d7f1e8c2e6994c0df07cc0003828adfa2af/src/main/java/org/twdata/maven/mojoexecutor/MojoExecutor.java#L73-L112 |
156,406 | lotaris/rox-commons-maven-plugin | src/main/java/org/twdata/maven/mojoexecutor/MojoExecutor.java | MojoExecutor.configuration | public static Xpp3Dom configuration(Element... elements) {
Xpp3Dom dom = new Xpp3Dom("configuration");
for (Element e : elements) {
dom.addChild(e.toDom());
}
return dom;
} | java | public static Xpp3Dom configuration(Element... elements) {
Xpp3Dom dom = new Xpp3Dom("configuration");
for (Element e : elements) {
dom.addChild(e.toDom());
}
return dom;
} | [
"public",
"static",
"Xpp3Dom",
"configuration",
"(",
"Element",
"...",
"elements",
")",
"{",
"Xpp3Dom",
"dom",
"=",
"new",
"Xpp3Dom",
"(",
"\"configuration\"",
")",
";",
"for",
"(",
"Element",
"e",
":",
"elements",
")",
"{",
"dom",
".",
"addChild",
"(",
... | Builds the configuration for the goal using Elements
@param elements A list of elements for the configuration section
@return The elements transformed into the Maven-native XML format | [
"Builds",
"the",
"configuration",
"for",
"the",
"goal",
"using",
"Elements"
] | e2602d7f1e8c2e6994c0df07cc0003828adfa2af | https://github.com/lotaris/rox-commons-maven-plugin/blob/e2602d7f1e8c2e6994c0df07cc0003828adfa2af/src/main/java/org/twdata/maven/mojoexecutor/MojoExecutor.java#L143-L151 |
156,407 | lotaris/rox-commons-maven-plugin | src/main/java/org/twdata/maven/mojoexecutor/MojoExecutor.java | MojoExecutor.plugin | public static Plugin plugin(String groupId, String artifactId) {
return plugin(groupId, artifactId, null);
} | java | public static Plugin plugin(String groupId, String artifactId) {
return plugin(groupId, artifactId, null);
} | [
"public",
"static",
"Plugin",
"plugin",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
")",
"{",
"return",
"plugin",
"(",
"groupId",
",",
"artifactId",
",",
"null",
")",
";",
"}"
] | Defines the plugin without its version
@param groupId The group id
@param artifactId The artifact id
@return The plugin instance | [
"Defines",
"the",
"plugin",
"without",
"its",
"version"
] | e2602d7f1e8c2e6994c0df07cc0003828adfa2af | https://github.com/lotaris/rox-commons-maven-plugin/blob/e2602d7f1e8c2e6994c0df07cc0003828adfa2af/src/main/java/org/twdata/maven/mojoexecutor/MojoExecutor.java#L160-L162 |
156,408 | lotaris/rox-commons-maven-plugin | src/main/java/org/twdata/maven/mojoexecutor/MojoExecutor.java | MojoExecutor.plugin | public static Plugin plugin(String groupId, String artifactId, String version) {
Plugin plugin = new Plugin();
plugin.setArtifactId(artifactId);
plugin.setGroupId(groupId);
plugin.setVersion(version);
return plugin;
} | java | public static Plugin plugin(String groupId, String artifactId, String version) {
Plugin plugin = new Plugin();
plugin.setArtifactId(artifactId);
plugin.setGroupId(groupId);
plugin.setVersion(version);
return plugin;
} | [
"public",
"static",
"Plugin",
"plugin",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
",",
"String",
"version",
")",
"{",
"Plugin",
"plugin",
"=",
"new",
"Plugin",
"(",
")",
";",
"plugin",
".",
"setArtifactId",
"(",
"artifactId",
")",
";",
"plugin... | Defines a plugin
@param groupId The group id
@param artifactId The artifact id
@param version The plugin version
@return The plugin instance | [
"Defines",
"a",
"plugin"
] | e2602d7f1e8c2e6994c0df07cc0003828adfa2af | https://github.com/lotaris/rox-commons-maven-plugin/blob/e2602d7f1e8c2e6994c0df07cc0003828adfa2af/src/main/java/org/twdata/maven/mojoexecutor/MojoExecutor.java#L172-L178 |
156,409 | foundation-runtime/monitoring | monitoring-jmx-lib/src/main/java/com/cisco/oss/foundation/monitoring/RMIRegistryManager.java | RMIRegistryManager.isRMIRegistryRunning | public static boolean isRMIRegistryRunning(Configuration configuration, int port) {
try {
final Registry registry = RegistryFinder.getInstance().getRegistry(configuration, port);
registry.list();
return true;
} catch (RemoteException ex) {
return false;
... | java | public static boolean isRMIRegistryRunning(Configuration configuration, int port) {
try {
final Registry registry = RegistryFinder.getInstance().getRegistry(configuration, port);
registry.list();
return true;
} catch (RemoteException ex) {
return false;
... | [
"public",
"static",
"boolean",
"isRMIRegistryRunning",
"(",
"Configuration",
"configuration",
",",
"int",
"port",
")",
"{",
"try",
"{",
"final",
"Registry",
"registry",
"=",
"RegistryFinder",
".",
"getInstance",
"(",
")",
".",
"getRegistry",
"(",
"configuration",
... | Checks if rmiregistry is running on the specified port.
@param port
@return true if rmiregistry is running on the specified port, false
otherwise | [
"Checks",
"if",
"rmiregistry",
"is",
"running",
"on",
"the",
"specified",
"port",
"."
] | a85ec72dc5558f787704fb13d9125a5803403ee5 | https://github.com/foundation-runtime/monitoring/blob/a85ec72dc5558f787704fb13d9125a5803403ee5/monitoring-jmx-lib/src/main/java/com/cisco/oss/foundation/monitoring/RMIRegistryManager.java#L45-L55 |
156,410 | foundation-runtime/monitoring | monitoring-jmx-lib/src/main/java/com/cisco/oss/foundation/monitoring/RMIRegistryManager.java | RMIRegistryManager.isServiceExported | public static boolean isServiceExported(Configuration configuration, int port, String serviceName) {
if (serviceName == null)
return false;
try {
final Registry registry = RegistryFinder.getInstance().getRegistry(configuration, port);
String[] list = registry.list();
... | java | public static boolean isServiceExported(Configuration configuration, int port, String serviceName) {
if (serviceName == null)
return false;
try {
final Registry registry = RegistryFinder.getInstance().getRegistry(configuration, port);
String[] list = registry.list();
... | [
"public",
"static",
"boolean",
"isServiceExported",
"(",
"Configuration",
"configuration",
",",
"int",
"port",
",",
"String",
"serviceName",
")",
"{",
"if",
"(",
"serviceName",
"==",
"null",
")",
"return",
"false",
";",
"try",
"{",
"final",
"Registry",
"regist... | Checks if a service is exported on the rmi registry with specified port.
@param port
@return true if rmiregistry is running on the specified port and service
is exported on the rmi registry, false otherwise | [
"Checks",
"if",
"a",
"service",
"is",
"exported",
"on",
"the",
"rmi",
"registry",
"with",
"specified",
"port",
"."
] | a85ec72dc5558f787704fb13d9125a5803403ee5 | https://github.com/foundation-runtime/monitoring/blob/a85ec72dc5558f787704fb13d9125a5803403ee5/monitoring-jmx-lib/src/main/java/com/cisco/oss/foundation/monitoring/RMIRegistryManager.java#L64-L83 |
156,411 | foundation-runtime/monitoring | monitoring-jmx-lib/src/main/java/com/cisco/oss/foundation/monitoring/RMIRegistryManager.java | RMIRegistryManager.startRMIRegistry | public static boolean startRMIRegistry(Configuration configuration, int port) {
if (isRMIRegistryRunning(configuration, port))
return true;
if (configuration.getBoolean(FoundationMonitoringConstants.IN_PROC_RMI)) {
return startInProcRMIRegistry(port);
} else {
... | java | public static boolean startRMIRegistry(Configuration configuration, int port) {
if (isRMIRegistryRunning(configuration, port))
return true;
if (configuration.getBoolean(FoundationMonitoringConstants.IN_PROC_RMI)) {
return startInProcRMIRegistry(port);
} else {
... | [
"public",
"static",
"boolean",
"startRMIRegistry",
"(",
"Configuration",
"configuration",
",",
"int",
"port",
")",
"{",
"if",
"(",
"isRMIRegistryRunning",
"(",
"configuration",
",",
"port",
")",
")",
"return",
"true",
";",
"if",
"(",
"configuration",
".",
"get... | Starts rmiregistry on the specified port. If property
"service.monitor.inProcess" is set to true in configSchema.xml,
then an in-process rmiregistry is started.
Otherwise rmiregistry will be started in a seperate process.
@param port on which the rmiregistry needs to be started
@return true if successful or it is alre... | [
"Starts",
"rmiregistry",
"on",
"the",
"specified",
"port",
".",
"If",
"property",
"service",
".",
"monitor",
".",
"inProcess",
"is",
"set",
"to",
"true",
"in",
"configSchema",
".",
"xml",
"then",
"an",
"in",
"-",
"process",
"rmiregistry",
"is",
"started",
... | a85ec72dc5558f787704fb13d9125a5803403ee5 | https://github.com/foundation-runtime/monitoring/blob/a85ec72dc5558f787704fb13d9125a5803403ee5/monitoring-jmx-lib/src/main/java/com/cisco/oss/foundation/monitoring/RMIRegistryManager.java#L94-L103 |
156,412 | foundation-runtime/monitoring | monitoring-jmx-lib/src/main/java/com/cisco/oss/foundation/monitoring/RMIRegistryManager.java | RMIRegistryManager.startInProcRMIRegistry | public static boolean startInProcRMIRegistry(final int port) {
LOGGER.info("Starting In-Process rmiregistry on port " + port);
boolean result = true;
try {
LocateRegistry.createRegistry(port);
LOGGER.info("In-Process rmiregistry started on port " + port);
} catch ... | java | public static boolean startInProcRMIRegistry(final int port) {
LOGGER.info("Starting In-Process rmiregistry on port " + port);
boolean result = true;
try {
LocateRegistry.createRegistry(port);
LOGGER.info("In-Process rmiregistry started on port " + port);
} catch ... | [
"public",
"static",
"boolean",
"startInProcRMIRegistry",
"(",
"final",
"int",
"port",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"Starting In-Process rmiregistry on port \"",
"+",
"port",
")",
";",
"boolean",
"result",
"=",
"true",
";",
"try",
"{",
"LocateRegistry",
... | Starts in-process rmiregistry on the specified port.
@param port on which the rmiregistry needs to be started
@return true if successful, false otherwise | [
"Starts",
"in",
"-",
"process",
"rmiregistry",
"on",
"the",
"specified",
"port",
"."
] | a85ec72dc5558f787704fb13d9125a5803403ee5 | https://github.com/foundation-runtime/monitoring/blob/a85ec72dc5558f787704fb13d9125a5803403ee5/monitoring-jmx-lib/src/main/java/com/cisco/oss/foundation/monitoring/RMIRegistryManager.java#L111-L122 |
156,413 | foundation-runtime/monitoring | monitoring-jmx-lib/src/main/java/com/cisco/oss/foundation/monitoring/RMIRegistryManager.java | RMIRegistryManager.startOutProcRMIRegistry | public static boolean startOutProcRMIRegistry(Configuration configuration, final int port) {
LOGGER.info("Starting rmiregistry on port " + port);
try {
Registry registryStarted = RegistryFinder.getInstance().getRegistry(configuration, port);
if (registryStarted != null) {
... | java | public static boolean startOutProcRMIRegistry(Configuration configuration, final int port) {
LOGGER.info("Starting rmiregistry on port " + port);
try {
Registry registryStarted = RegistryFinder.getInstance().getRegistry(configuration, port);
if (registryStarted != null) {
... | [
"public",
"static",
"boolean",
"startOutProcRMIRegistry",
"(",
"Configuration",
"configuration",
",",
"final",
"int",
"port",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"Starting rmiregistry on port \"",
"+",
"port",
")",
";",
"try",
"{",
"Registry",
"registryStarted",... | Starts rmiregistry in a separate process on the specified port.
@param port on which the rmiregistry needs to be started
@return true if successful, false otherwise | [
"Starts",
"rmiregistry",
"in",
"a",
"separate",
"process",
"on",
"the",
"specified",
"port",
"."
] | a85ec72dc5558f787704fb13d9125a5803403ee5 | https://github.com/foundation-runtime/monitoring/blob/a85ec72dc5558f787704fb13d9125a5803403ee5/monitoring-jmx-lib/src/main/java/com/cisco/oss/foundation/monitoring/RMIRegistryManager.java#L130-L146 |
156,414 | jpelzer/pelzer-util | src/main/java/com/pelzer/util/PasswordCrypt.java | PasswordCrypt.computePasswordHash | public static String computePasswordHash(final String password, final byte[] salt) {
if (StringMan.isEmpty(password))
return (StringMan.encodeBytesToString(salt));
final KeySpec spec = new PBEKeySpec(password.toCharArray(), salt, 2048, 160);
SecretKeyFactory f;
try {
f = SecretKeyFactory.get... | java | public static String computePasswordHash(final String password, final byte[] salt) {
if (StringMan.isEmpty(password))
return (StringMan.encodeBytesToString(salt));
final KeySpec spec = new PBEKeySpec(password.toCharArray(), salt, 2048, 160);
SecretKeyFactory f;
try {
f = SecretKeyFactory.get... | [
"public",
"static",
"String",
"computePasswordHash",
"(",
"final",
"String",
"password",
",",
"final",
"byte",
"[",
"]",
"salt",
")",
"{",
"if",
"(",
"StringMan",
".",
"isEmpty",
"(",
"password",
")",
")",
"return",
"(",
"StringMan",
".",
"encodeBytesToStrin... | Uses PBKDF2WithHmacSHA1 to hash the password using the given salt,
returning the has in encoded hexadecimal form. If the password is empty,
returns the salt. | [
"Uses",
"PBKDF2WithHmacSHA1",
"to",
"hash",
"the",
"password",
"using",
"the",
"given",
"salt",
"returning",
"the",
"has",
"in",
"encoded",
"hexadecimal",
"form",
".",
"If",
"the",
"password",
"is",
"empty",
"returns",
"the",
"salt",
"."
] | ec14f2573fd977d1442dba5d1507a264f5ea9aa6 | https://github.com/jpelzer/pelzer-util/blob/ec14f2573fd977d1442dba5d1507a264f5ea9aa6/src/main/java/com/pelzer/util/PasswordCrypt.java#L28-L42 |
156,415 | jpelzer/pelzer-util | src/main/java/com/pelzer/util/PasswordCrypt.java | PasswordCrypt.stringToSalt | public static byte[] stringToSalt(final String string) {
try {
final MessageDigest digest = MessageDigest.getInstance("SHA-1");
digest.reset();
return digest.digest(string.getBytes("UTF-8"));
} catch (final NoSuchAlgorithmException ex) {
throw new RuntimeException(ex);
} catch (final... | java | public static byte[] stringToSalt(final String string) {
try {
final MessageDigest digest = MessageDigest.getInstance("SHA-1");
digest.reset();
return digest.digest(string.getBytes("UTF-8"));
} catch (final NoSuchAlgorithmException ex) {
throw new RuntimeException(ex);
} catch (final... | [
"public",
"static",
"byte",
"[",
"]",
"stringToSalt",
"(",
"final",
"String",
"string",
")",
"{",
"try",
"{",
"final",
"MessageDigest",
"digest",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"\"SHA-1\"",
")",
";",
"digest",
".",
"reset",
"(",
")",
";",
... | Uses SHA-1 to hash the given string and returns the byte array. | [
"Uses",
"SHA",
"-",
"1",
"to",
"hash",
"the",
"given",
"string",
"and",
"returns",
"the",
"byte",
"array",
"."
] | ec14f2573fd977d1442dba5d1507a264f5ea9aa6 | https://github.com/jpelzer/pelzer-util/blob/ec14f2573fd977d1442dba5d1507a264f5ea9aa6/src/main/java/com/pelzer/util/PasswordCrypt.java#L55-L65 |
156,416 | keub/remote-resources-maven-plugin | src/main/java/com/github/keub/maven/plugin/service/ResourceService.java | ResourceService.execute | public static void execute(CopyResourcesMojo copyResourcesMojo,
Resource resource, File outputDirectory)
throws ResourceExecutionException {
copyResourcesMojo.getLog().debug("Execute resource : " + resource);
// choose a location to checkout project
File workspacePlugin = PathUtils.getWorkspace(copyResourc... | java | public static void execute(CopyResourcesMojo copyResourcesMojo,
Resource resource, File outputDirectory)
throws ResourceExecutionException {
copyResourcesMojo.getLog().debug("Execute resource : " + resource);
// choose a location to checkout project
File workspacePlugin = PathUtils.getWorkspace(copyResourc... | [
"public",
"static",
"void",
"execute",
"(",
"CopyResourcesMojo",
"copyResourcesMojo",
",",
"Resource",
"resource",
",",
"File",
"outputDirectory",
")",
"throws",
"ResourceExecutionException",
"{",
"copyResourcesMojo",
".",
"getLog",
"(",
")",
".",
"debug",
"(",
"\"E... | execute with a resource
@param copyResourcesMojo
@param resource
@param outputDirectory
@param flatten
@throws ResourceExecutionException | [
"execute",
"with",
"a",
"resource"
] | 543445731412aa15db2ea2b9b7840da1f40302d0 | https://github.com/keub/remote-resources-maven-plugin/blob/543445731412aa15db2ea2b9b7840da1f40302d0/src/main/java/com/github/keub/maven/plugin/service/ResourceService.java#L26-L71 |
156,417 | schallee/alib4j | osgi/slf4j_log_listener/src/main/java/net/darkmist/alib/osgi/slf4j_log_listener/LogBridge.java | LogBridge.getLogEntries | @SuppressWarnings("unchecked")
private static Enumeration<LogEntry> getLogEntries(LogReaderService lrs)
{
return (Enumeration<LogEntry>)lrs.getLog();
} | java | @SuppressWarnings("unchecked")
private static Enumeration<LogEntry> getLogEntries(LogReaderService lrs)
{
return (Enumeration<LogEntry>)lrs.getLog();
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"Enumeration",
"<",
"LogEntry",
">",
"getLogEntries",
"(",
"LogReaderService",
"lrs",
")",
"{",
"return",
"(",
"Enumeration",
"<",
"LogEntry",
">",
")",
"lrs",
".",
"getLog",
"(",
")",
... | Utility method to reduce unchecked area. | [
"Utility",
"method",
"to",
"reduce",
"unchecked",
"area",
"."
] | 0e0718aee574bbb62268e1cf58e99286529ce529 | https://github.com/schallee/alib4j/blob/0e0718aee574bbb62268e1cf58e99286529ce529/osgi/slf4j_log_listener/src/main/java/net/darkmist/alib/osgi/slf4j_log_listener/LogBridge.java#L75-L79 |
156,418 | pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/connect/MemoryDiscovery.java | MemoryDiscovery.readConnections | public void readConnections(ConfigParams connections) {
synchronized (_lock) {
_items.clear();
for (Map.Entry<String, String> entry : connections.entrySet()) {
DiscoveryItem item = new DiscoveryItem();
item.key = entry.getKey();
item.connection = ConnectionParams.fromString(entry.getValue());
_i... | java | public void readConnections(ConfigParams connections) {
synchronized (_lock) {
_items.clear();
for (Map.Entry<String, String> entry : connections.entrySet()) {
DiscoveryItem item = new DiscoveryItem();
item.key = entry.getKey();
item.connection = ConnectionParams.fromString(entry.getValue());
_i... | [
"public",
"void",
"readConnections",
"(",
"ConfigParams",
"connections",
")",
"{",
"synchronized",
"(",
"_lock",
")",
"{",
"_items",
".",
"clear",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"connectio... | Reads connections from configuration parameters. Each section represents an
individual Connection params
@param connections configuration parameters to be read | [
"Reads",
"connections",
"from",
"configuration",
"parameters",
".",
"Each",
"section",
"represents",
"an",
"individual",
"Connection",
"params"
] | 122352fbf9b208f6417376da7b8ad725bc85ee58 | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/connect/MemoryDiscovery.java#L77-L87 |
156,419 | pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/connect/MemoryDiscovery.java | MemoryDiscovery.register | public void register(String correlationId, String key, ConnectionParams connection) {
synchronized (_lock) {
DiscoveryItem item = new DiscoveryItem();
item.key = key;
item.connection = connection;
_items.add(item);
}
} | java | public void register(String correlationId, String key, ConnectionParams connection) {
synchronized (_lock) {
DiscoveryItem item = new DiscoveryItem();
item.key = key;
item.connection = connection;
_items.add(item);
}
} | [
"public",
"void",
"register",
"(",
"String",
"correlationId",
",",
"String",
"key",
",",
"ConnectionParams",
"connection",
")",
"{",
"synchronized",
"(",
"_lock",
")",
"{",
"DiscoveryItem",
"item",
"=",
"new",
"DiscoveryItem",
"(",
")",
";",
"item",
".",
"ke... | Registers connection parameters into the discovery service.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param key a key to uniquely identify the connection parameters.
@param connection a connection to be registered. | [
"Registers",
"connection",
"parameters",
"into",
"the",
"discovery",
"service",
"."
] | 122352fbf9b208f6417376da7b8ad725bc85ee58 | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/connect/MemoryDiscovery.java#L97-L104 |
156,420 | pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/connect/MemoryDiscovery.java | MemoryDiscovery.resolveOne | public ConnectionParams resolveOne(String correlationId, String key) {
ConnectionParams connection = null;
synchronized (_lock) {
for (DiscoveryItem item : _items) {
if (item.key == key && item.connection != null) {
connection = item.connection;
break;
}
}
}
return connection;
} | java | public ConnectionParams resolveOne(String correlationId, String key) {
ConnectionParams connection = null;
synchronized (_lock) {
for (DiscoveryItem item : _items) {
if (item.key == key && item.connection != null) {
connection = item.connection;
break;
}
}
}
return connection;
} | [
"public",
"ConnectionParams",
"resolveOne",
"(",
"String",
"correlationId",
",",
"String",
"key",
")",
"{",
"ConnectionParams",
"connection",
"=",
"null",
";",
"synchronized",
"(",
"_lock",
")",
"{",
"for",
"(",
"DiscoveryItem",
"item",
":",
"_items",
")",
"{"... | Resolves a single connection parameters by its key.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param key a key to uniquely identify the connection.
@return receives found connection. | [
"Resolves",
"a",
"single",
"connection",
"parameters",
"by",
"its",
"key",
"."
] | 122352fbf9b208f6417376da7b8ad725bc85ee58 | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/connect/MemoryDiscovery.java#L114-L127 |
156,421 | pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/connect/MemoryDiscovery.java | MemoryDiscovery.resolveAll | public List<ConnectionParams> resolveAll(String correlationId, String key) {
List<ConnectionParams> connections = new ArrayList<ConnectionParams>();
synchronized (_lock) {
for (DiscoveryItem item : _items) {
if (item.key == key && item.connection != null)
connections.add(item.connection);
}
}
r... | java | public List<ConnectionParams> resolveAll(String correlationId, String key) {
List<ConnectionParams> connections = new ArrayList<ConnectionParams>();
synchronized (_lock) {
for (DiscoveryItem item : _items) {
if (item.key == key && item.connection != null)
connections.add(item.connection);
}
}
r... | [
"public",
"List",
"<",
"ConnectionParams",
">",
"resolveAll",
"(",
"String",
"correlationId",
",",
"String",
"key",
")",
"{",
"List",
"<",
"ConnectionParams",
">",
"connections",
"=",
"new",
"ArrayList",
"<",
"ConnectionParams",
">",
"(",
")",
";",
"synchroniz... | Resolves all connection parameters by their key.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param key a key to uniquely identify the connections.
@return receives found connections. | [
"Resolves",
"all",
"connection",
"parameters",
"by",
"their",
"key",
"."
] | 122352fbf9b208f6417376da7b8ad725bc85ee58 | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/connect/MemoryDiscovery.java#L137-L148 |
156,422 | bwkimmel/java-util | src/main/java/ca/eandb/util/progress/ProgressPanel.java | ProgressPanel.getScrollPane | private JScrollPane getScrollPane() {
if (scrollPane == null) {
scrollPane = new JScrollPane();
scrollPane.setViewportView(getTable());
}
return scrollPane;
} | java | private JScrollPane getScrollPane() {
if (scrollPane == null) {
scrollPane = new JScrollPane();
scrollPane.setViewportView(getTable());
}
return scrollPane;
} | [
"private",
"JScrollPane",
"getScrollPane",
"(",
")",
"{",
"if",
"(",
"scrollPane",
"==",
"null",
")",
"{",
"scrollPane",
"=",
"new",
"JScrollPane",
"(",
")",
";",
"scrollPane",
".",
"setViewportView",
"(",
"getTable",
"(",
")",
")",
";",
"}",
"return",
"... | This method initializes scrollPane
@return javax.swing.JScrollPane | [
"This",
"method",
"initializes",
"scrollPane"
] | 0c03664d42f0e6b111f64447f222aa73c2819e5c | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/progress/ProgressPanel.java#L87-L93 |
156,423 | bwkimmel/java-util | src/main/java/ca/eandb/util/progress/ProgressPanel.java | ProgressPanel.getTable | private JTable getTable() {
if (table == null) {
table = new JTable();
table.setModel(getModel());
ProgressBarRenderer.applyTo(table);
}
return table;
} | java | private JTable getTable() {
if (table == null) {
table = new JTable();
table.setModel(getModel());
ProgressBarRenderer.applyTo(table);
}
return table;
} | [
"private",
"JTable",
"getTable",
"(",
")",
"{",
"if",
"(",
"table",
"==",
"null",
")",
"{",
"table",
"=",
"new",
"JTable",
"(",
")",
";",
"table",
".",
"setModel",
"(",
"getModel",
"(",
")",
")",
";",
"ProgressBarRenderer",
".",
"applyTo",
"(",
"tabl... | This method initializes table
@return javax.swing.JTable | [
"This",
"method",
"initializes",
"table"
] | 0c03664d42f0e6b111f64447f222aa73c2819e5c | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/progress/ProgressPanel.java#L100-L107 |
156,424 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.dot | public static double dot(DoubleTuple t0, DoubleTuple t1)
{
Utils.checkForEqualSize(t0, t1);
double result = 0;
for (int i=0; i<t0.getSize(); i++)
{
result += t0.get(i) * t1.get(i);
}
return result;
} | java | public static double dot(DoubleTuple t0, DoubleTuple t1)
{
Utils.checkForEqualSize(t0, t1);
double result = 0;
for (int i=0; i<t0.getSize(); i++)
{
result += t0.get(i) * t1.get(i);
}
return result;
} | [
"public",
"static",
"double",
"dot",
"(",
"DoubleTuple",
"t0",
",",
"DoubleTuple",
"t1",
")",
"{",
"Utils",
".",
"checkForEqualSize",
"(",
"t0",
",",
"t1",
")",
";",
"double",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<"... | Computes the dot product of the given tuples
@param t0 The first input tuple
@param t1 The second input tuple
@return The dot product
@throws IllegalArgumentException If the given tuples do not
have the same {@link Tuple#getSize() size} | [
"Computes",
"the",
"dot",
"product",
"of",
"the",
"given",
"tuples"
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L808-L817 |
156,425 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.appendRange | private static void appendRange(
StringBuilder sb, DoubleTuple tuple,
Locale locale, String format, int min, int max)
{
for (int i=min; i<max; i++)
{
if (i > min)
{
sb.append(", ");
}
if (locale != null && for... | java | private static void appendRange(
StringBuilder sb, DoubleTuple tuple,
Locale locale, String format, int min, int max)
{
for (int i=min; i<max; i++)
{
if (i > min)
{
sb.append(", ");
}
if (locale != null && for... | [
"private",
"static",
"void",
"appendRange",
"(",
"StringBuilder",
"sb",
",",
"DoubleTuple",
"tuple",
",",
"Locale",
"locale",
",",
"String",
"format",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"min",
";",
"i",
"<",
... | Append the string representation of the specified range of the given
tuple to the given string builder
@param sb The string builder
@param tuple The tuple
@param locale The locale. If this is <code>null</code>, then a
canonical string representation of the elements will be used.
@param format The format. If this is <c... | [
"Append",
"the",
"string",
"representation",
"of",
"the",
"specified",
"range",
"of",
"the",
"given",
"tuple",
"to",
"the",
"given",
"string",
"builder"
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1320-L1339 |
156,426 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.randomize | public static void randomize(
MutableDoubleTuple t, double min, double max, Random random)
{
double delta = max - min;
for (int i=0; i<t.getSize(); i++)
{
t.set(i, min + random.nextDouble() * delta);
}
} | java | public static void randomize(
MutableDoubleTuple t, double min, double max, Random random)
{
double delta = max - min;
for (int i=0; i<t.getSize(); i++)
{
t.set(i, min + random.nextDouble() * delta);
}
} | [
"public",
"static",
"void",
"randomize",
"(",
"MutableDoubleTuple",
"t",
",",
"double",
"min",
",",
"double",
"max",
",",
"Random",
"random",
")",
"{",
"double",
"delta",
"=",
"max",
"-",
"min",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
... | Fill the given tuple with random values in
the specified range, using the given random number generator
@param t The tuple to fill
@param min The minimum value, inclusive
@param max The maximum value, exclusive
@param random The random number generator | [
"Fill",
"the",
"given",
"tuple",
"with",
"random",
"values",
"in",
"the",
"specified",
"range",
"using",
"the",
"given",
"random",
"number",
"generator"
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1455-L1463 |
156,427 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.createRandom | public static MutableDoubleTuple createRandom(int size, Random random)
{
MutableDoubleTuple t = create(size);
randomize(t, random);
return t;
} | java | public static MutableDoubleTuple createRandom(int size, Random random)
{
MutableDoubleTuple t = create(size);
randomize(t, random);
return t;
} | [
"public",
"static",
"MutableDoubleTuple",
"createRandom",
"(",
"int",
"size",
",",
"Random",
"random",
")",
"{",
"MutableDoubleTuple",
"t",
"=",
"create",
"(",
"size",
")",
";",
"randomize",
"(",
"t",
",",
"random",
")",
";",
"return",
"t",
";",
"}"
] | Creates a tuple with the given size that
is filled with random values in [0,1)
@param size The size
@param random The random number generator
@return The new tuple | [
"Creates",
"a",
"tuple",
"with",
"the",
"given",
"size",
"that",
"is",
"filled",
"with",
"random",
"values",
"in",
"[",
"0",
"1",
")"
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1485-L1490 |
156,428 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.randomizeGaussian | public static void randomizeGaussian(MutableDoubleTuple t, Random random)
{
for (int i=0; i<t.getSize(); i++)
{
double value = random.nextGaussian();
t.set(i, value);
}
} | java | public static void randomizeGaussian(MutableDoubleTuple t, Random random)
{
for (int i=0; i<t.getSize(); i++)
{
double value = random.nextGaussian();
t.set(i, value);
}
} | [
"public",
"static",
"void",
"randomizeGaussian",
"(",
"MutableDoubleTuple",
"t",
",",
"Random",
"random",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"t",
".",
"getSize",
"(",
")",
";",
"i",
"++",
")",
"{",
"double",
"value",
"=",
"r... | Randomize the given tuple with a gaussian
distribution with a mean of 0.0 and standard deviation of 1.0
@param t The tuple to fill
@param random The random number generator | [
"Randomize",
"the",
"given",
"tuple",
"with",
"a",
"gaussian",
"distribution",
"with",
"a",
"mean",
"of",
"0",
".",
"0",
"and",
"standard",
"deviation",
"of",
"1",
".",
"0"
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1519-L1526 |
156,429 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.createRandomGaussian | public static MutableDoubleTuple createRandomGaussian(
int size, Random random)
{
MutableDoubleTuple t = create(size);
randomizeGaussian(t, random);
return t;
} | java | public static MutableDoubleTuple createRandomGaussian(
int size, Random random)
{
MutableDoubleTuple t = create(size);
randomizeGaussian(t, random);
return t;
} | [
"public",
"static",
"MutableDoubleTuple",
"createRandomGaussian",
"(",
"int",
"size",
",",
"Random",
"random",
")",
"{",
"MutableDoubleTuple",
"t",
"=",
"create",
"(",
"size",
")",
";",
"randomizeGaussian",
"(",
"t",
",",
"random",
")",
";",
"return",
"t",
"... | Creates a tuple with the given size
that was filled with values from a gaussian
distribution with mean 0.0 and standard deviation 1.0
@param size The size
@param random The random number generator
@return The new tuple | [
"Creates",
"a",
"tuple",
"with",
"the",
"given",
"size",
"that",
"was",
"filled",
"with",
"values",
"from",
"a",
"gaussian",
"distribution",
"with",
"mean",
"0",
".",
"0",
"and",
"standard",
"deviation",
"1",
".",
"0"
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1537-L1543 |
156,430 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.normalizeElements | public static MutableDoubleTuple normalizeElements(
DoubleTuple t, double min, double max, MutableDoubleTuple result)
{
return rescaleElements(t, min(t), max(t), min, max, result);
} | java | public static MutableDoubleTuple normalizeElements(
DoubleTuple t, double min, double max, MutableDoubleTuple result)
{
return rescaleElements(t, min(t), max(t), min, max, result);
} | [
"public",
"static",
"MutableDoubleTuple",
"normalizeElements",
"(",
"DoubleTuple",
"t",
",",
"double",
"min",
",",
"double",
"max",
",",
"MutableDoubleTuple",
"result",
")",
"{",
"return",
"rescaleElements",
"(",
"t",
",",
"min",
"(",
"t",
")",
",",
"max",
"... | Normalize the elements of the given tuple, so that its minimum and
maximum elements match the given minimum and maximum values.
@param t The input tuple
@param min The minimum value
@param max The maximum value
@param result The tuple that will store the result
@return The result tuple
@throws IllegalArgumentException... | [
"Normalize",
"the",
"elements",
"of",
"the",
"given",
"tuple",
"so",
"that",
"its",
"minimum",
"and",
"maximum",
"elements",
"match",
"the",
"given",
"minimum",
"and",
"maximum",
"values",
"."
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1595-L1599 |
156,431 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.normalizeElements | public static MutableDoubleTuple normalizeElements(
DoubleTuple t, DoubleTuple min, DoubleTuple max,
MutableDoubleTuple result)
{
result = validate(t, result);
for (int i=0; i<result.getSize(); i++)
{
double value = t.get(i);
double minValue = ... | java | public static MutableDoubleTuple normalizeElements(
DoubleTuple t, DoubleTuple min, DoubleTuple max,
MutableDoubleTuple result)
{
result = validate(t, result);
for (int i=0; i<result.getSize(); i++)
{
double value = t.get(i);
double minValue = ... | [
"public",
"static",
"MutableDoubleTuple",
"normalizeElements",
"(",
"DoubleTuple",
"t",
",",
"DoubleTuple",
"min",
",",
"DoubleTuple",
"max",
",",
"MutableDoubleTuple",
"result",
")",
"{",
"result",
"=",
"validate",
"(",
"t",
",",
"result",
")",
";",
"for",
"(... | Normalize the elements of the given tuple, so that each element
will be linearly rescaled to the interval defined by the corresponding
elements of the given minimum and maximum tuple.
Each element that is equal to the corresponding minimum element will
be 0.0 in the resulting tuple.
Each element that is equal to the co... | [
"Normalize",
"the",
"elements",
"of",
"the",
"given",
"tuple",
"so",
"that",
"each",
"element",
"will",
"be",
"linearly",
"rescaled",
"to",
"the",
"interval",
"defined",
"by",
"the",
"corresponding",
"elements",
"of",
"the",
"given",
"minimum",
"and",
"maximum... | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1619-L1634 |
156,432 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.rescaleElements | public static MutableDoubleTuple rescaleElements(
DoubleTuple t, double oldMin, double oldMax,
double newMin, double newMax, MutableDoubleTuple result)
{
double invDelta = 1.0 / (oldMax - oldMin);
double newRange = newMax - newMin;
double scaling = invDelta * newRange;
... | java | public static MutableDoubleTuple rescaleElements(
DoubleTuple t, double oldMin, double oldMax,
double newMin, double newMax, MutableDoubleTuple result)
{
double invDelta = 1.0 / (oldMax - oldMin);
double newRange = newMax - newMin;
double scaling = invDelta * newRange;
... | [
"public",
"static",
"MutableDoubleTuple",
"rescaleElements",
"(",
"DoubleTuple",
"t",
",",
"double",
"oldMin",
",",
"double",
"oldMax",
",",
"double",
"newMin",
",",
"double",
"newMax",
",",
"MutableDoubleTuple",
"result",
")",
"{",
"double",
"invDelta",
"=",
"1... | Rescale the elements of the given tuple, so that the specified
old range is mapped to the specified new range.
@param t The input tuple
@param oldMin The old minimum value
@param oldMax The old maximum value
@param newMin The new minimum value
@param newMax The new maximum value
@param result The tuple that will store... | [
"Rescale",
"the",
"elements",
"of",
"the",
"given",
"tuple",
"so",
"that",
"the",
"specified",
"old",
"range",
"is",
"mapped",
"to",
"the",
"specified",
"new",
"range",
"."
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1651-L1660 |
156,433 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.geometricMean | public static double geometricMean(DoubleTuple t)
{
double product = DoubleTupleFunctions.reduce(t, 1.0, (a,b) -> (a*b));
return Math.pow(product, 1.0 / t.getSize());
} | java | public static double geometricMean(DoubleTuple t)
{
double product = DoubleTupleFunctions.reduce(t, 1.0, (a,b) -> (a*b));
return Math.pow(product, 1.0 / t.getSize());
} | [
"public",
"static",
"double",
"geometricMean",
"(",
"DoubleTuple",
"t",
")",
"{",
"double",
"product",
"=",
"DoubleTupleFunctions",
".",
"reduce",
"(",
"t",
",",
"1.0",
",",
"(",
"a",
",",
"b",
")",
"->",
"(",
"a",
"*",
"b",
")",
")",
";",
"return",
... | Returns the geometric mean of the given tuple
@param t The input tuple
@return The mean | [
"Returns",
"the",
"geometric",
"mean",
"of",
"the",
"given",
"tuple"
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1690-L1694 |
156,434 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.harmonicMean | public static double harmonicMean(DoubleTuple t)
{
double s =
DoubleTupleFunctions.reduce(t, 0.0, (a, b) -> (a + (1.0 / b)));
return t.getSize() / s;
} | java | public static double harmonicMean(DoubleTuple t)
{
double s =
DoubleTupleFunctions.reduce(t, 0.0, (a, b) -> (a + (1.0 / b)));
return t.getSize() / s;
} | [
"public",
"static",
"double",
"harmonicMean",
"(",
"DoubleTuple",
"t",
")",
"{",
"double",
"s",
"=",
"DoubleTupleFunctions",
".",
"reduce",
"(",
"t",
",",
"0.0",
",",
"(",
"a",
",",
"b",
")",
"->",
"(",
"a",
"+",
"(",
"1.0",
"/",
"b",
")",
")",
"... | Returns the harmonic mean of the given tuple
@param t The input tuple
@return The mean | [
"Returns",
"the",
"harmonic",
"mean",
"of",
"the",
"given",
"tuple"
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1702-L1707 |
156,435 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.standardize | public static MutableDoubleTuple standardize(
DoubleTuple t, MutableDoubleTuple result)
{
result = DoubleTuples.validate(t, result);
double mean = arithmeticMean(t);
double standardDeviation = standardDeviationFromMean(t, mean);
double invStandardDeviation = 1.0 / stand... | java | public static MutableDoubleTuple standardize(
DoubleTuple t, MutableDoubleTuple result)
{
result = DoubleTuples.validate(t, result);
double mean = arithmeticMean(t);
double standardDeviation = standardDeviationFromMean(t, mean);
double invStandardDeviation = 1.0 / stand... | [
"public",
"static",
"MutableDoubleTuple",
"standardize",
"(",
"DoubleTuple",
"t",
",",
"MutableDoubleTuple",
"result",
")",
"{",
"result",
"=",
"DoubleTuples",
".",
"validate",
"(",
"t",
",",
"result",
")",
";",
"double",
"mean",
"=",
"arithmeticMean",
"(",
"t... | Standardize the given tuple. This means that the mean of the elements
is subtracted from them, and they are divided by the standard
deviation.
@param t The tuple
@param result The result tuple
@return The result tuple
@throws IllegalArgumentException If the given tuples do not
have the same {@link Tuple#getSize() size... | [
"Standardize",
"the",
"given",
"tuple",
".",
"This",
"means",
"that",
"the",
"mean",
"of",
"the",
"elements",
"is",
"subtracted",
"from",
"them",
"and",
"they",
"are",
"divided",
"by",
"the",
"standard",
"deviation",
"."
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1739-L1748 |
156,436 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.arithmeticMean | public static double arithmeticMean(DoubleTuple t)
{
double sum = DoubleTupleFunctions.reduce(t, 0.0, (a,b) -> (a+b));
return sum / t.getSize();
} | java | public static double arithmeticMean(DoubleTuple t)
{
double sum = DoubleTupleFunctions.reduce(t, 0.0, (a,b) -> (a+b));
return sum / t.getSize();
} | [
"public",
"static",
"double",
"arithmeticMean",
"(",
"DoubleTuple",
"t",
")",
"{",
"double",
"sum",
"=",
"DoubleTupleFunctions",
".",
"reduce",
"(",
"t",
",",
"0.0",
",",
"(",
"a",
",",
"b",
")",
"->",
"(",
"a",
"+",
"b",
")",
")",
";",
"return",
"... | Returns the arithmetic mean of the given tuple
@param t The input tuple
@return The mean | [
"Returns",
"the",
"arithmetic",
"mean",
"of",
"the",
"given",
"tuple"
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1756-L1760 |
156,437 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.variance | public static double variance(DoubleTuple t, double mean)
{
int d = t.getSize();
double variance = 0;
for (int i=0; i<d; i++)
{
double difference = t.get(i) - mean;
variance += difference * difference;
}
return variance / (d - 1);
... | java | public static double variance(DoubleTuple t, double mean)
{
int d = t.getSize();
double variance = 0;
for (int i=0; i<d; i++)
{
double difference = t.get(i) - mean;
variance += difference * difference;
}
return variance / (d - 1);
... | [
"public",
"static",
"double",
"variance",
"(",
"DoubleTuple",
"t",
",",
"double",
"mean",
")",
"{",
"int",
"d",
"=",
"t",
".",
"getSize",
"(",
")",
";",
"double",
"variance",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"d",
... | Returns the bias-corrected sample variance of the given tuple.
@param t The input tuple
@param mean The mean, which may have been computed before with
{@link #arithmeticMean(DoubleTuple)}
@return The variance | [
"Returns",
"the",
"bias",
"-",
"corrected",
"sample",
"variance",
"of",
"the",
"given",
"tuple",
"."
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1786-L1796 |
156,438 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.containsNaN | public static boolean containsNaN(DoubleTuple tuple)
{
for (int i=0; i<tuple.getSize(); i++)
{
if (Double.isNaN(tuple.get(i)))
{
return true;
}
}
return false;
} | java | public static boolean containsNaN(DoubleTuple tuple)
{
for (int i=0; i<tuple.getSize(); i++)
{
if (Double.isNaN(tuple.get(i)))
{
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"containsNaN",
"(",
"DoubleTuple",
"tuple",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"tuple",
".",
"getSize",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"tuple",
".... | Returns whether the given tuple contains an element that
is Not A Number
@param tuple The tuple
@return Whether the tuple contains a NaN element | [
"Returns",
"whether",
"the",
"given",
"tuple",
"contains",
"an",
"element",
"that",
"is",
"Not",
"A",
"Number"
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1839-L1849 |
156,439 | javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.replaceNaN | public static MutableDoubleTuple replaceNaN(
DoubleTuple t, double newValue, MutableDoubleTuple result)
{
return DoubleTupleFunctions.apply(
t, d -> Double.isNaN(d) ? newValue : d, result);
} | java | public static MutableDoubleTuple replaceNaN(
DoubleTuple t, double newValue, MutableDoubleTuple result)
{
return DoubleTupleFunctions.apply(
t, d -> Double.isNaN(d) ? newValue : d, result);
} | [
"public",
"static",
"MutableDoubleTuple",
"replaceNaN",
"(",
"DoubleTuple",
"t",
",",
"double",
"newValue",
",",
"MutableDoubleTuple",
"result",
")",
"{",
"return",
"DoubleTupleFunctions",
".",
"apply",
"(",
"t",
",",
"d",
"->",
"Double",
".",
"isNaN",
"(",
"d... | Replace all occurrences of "Not A Number" in the given tuple
with the given value, and store the result in the given
result tuple
@param t The tuple
@param newValue The value that should replace the NaN value
@param result The tuple that will store the result
@return The result tuple
@throws IllegalArgumentException I... | [
"Replace",
"all",
"occurrences",
"of",
"Not",
"A",
"Number",
"in",
"the",
"given",
"tuple",
"with",
"the",
"given",
"value",
"and",
"store",
"the",
"result",
"in",
"the",
"given",
"result",
"tuple"
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1863-L1868 |
156,440 | intellimate/Izou | src/main/java/org/intellimate/izou/system/sound/replaced/MixerAspect.java | MixerAspect.getAndRegisterLine | static Line getAndRegisterLine(Line line) {
AddOnModel addOnModel;
Optional<AddOnModel> addOnModelForClassLoader = main.getSecurityManager().getAddOnModelForClassLoader();
if (!addOnModelForClassLoader.isPresent()) {
logger.debug("the SoundManager will not manage this line, obtained ... | java | static Line getAndRegisterLine(Line line) {
AddOnModel addOnModel;
Optional<AddOnModel> addOnModelForClassLoader = main.getSecurityManager().getAddOnModelForClassLoader();
if (!addOnModelForClassLoader.isPresent()) {
logger.debug("the SoundManager will not manage this line, obtained ... | [
"static",
"Line",
"getAndRegisterLine",
"(",
"Line",
"line",
")",
"{",
"AddOnModel",
"addOnModel",
";",
"Optional",
"<",
"AddOnModel",
">",
"addOnModelForClassLoader",
"=",
"main",
".",
"getSecurityManager",
"(",
")",
".",
"getAddOnModelForClassLoader",
"(",
")",
... | creates the appropriate IzouSoundLine if the request originates from an AddOn.
@param line the line
@return an IzouSoundLine if an addon requested the line | [
"creates",
"the",
"appropriate",
"IzouSoundLine",
"if",
"the",
"request",
"originates",
"from",
"an",
"AddOn",
"."
] | 40a808b97998e17655c4a78e30ce7326148aed27 | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/system/sound/replaced/MixerAspect.java#L37-L63 |
156,441 | jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java | StandardCache.getReport | public String getReport() {
StringBuffer info = new StringBuffer();
if (!isCachingEnabled()) {
info.append("cache behaviour: DISABLED\n");
} else if (isCachingPermanent()) {
info.append("cache behaviour: PERMANENT\n");
} else {
info.append("cache behaviour: NORMAL\n");
}
info.append("time to live:... | java | public String getReport() {
StringBuffer info = new StringBuffer();
if (!isCachingEnabled()) {
info.append("cache behaviour: DISABLED\n");
} else if (isCachingPermanent()) {
info.append("cache behaviour: PERMANENT\n");
} else {
info.append("cache behaviour: NORMAL\n");
}
info.append("time to live:... | [
"public",
"String",
"getReport",
"(",
")",
"{",
"StringBuffer",
"info",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"if",
"(",
"!",
"isCachingEnabled",
"(",
")",
")",
"{",
"info",
".",
"append",
"(",
"\"cache behaviour: DISABLED\\n\"",
")",
";",
"}",
"else"... | Returns a status report containing behavior and statistics.
@return status report | [
"Returns",
"a",
"status",
"report",
"containing",
"behavior",
"and",
"statistics",
"."
] | 0fb0885775b576209ff1b5a0f67e3c25a99a6420 | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java#L75-L96 |
156,442 | jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java | StandardCache.stop | public void stop() {
hits = 0;
misses = 0;
unavailable = 0;
delayedHits = 0;
delayedMisses = 0;
data.clear();
mirror.clear();
isStarted = false;
} | java | public void stop() {
hits = 0;
misses = 0;
unavailable = 0;
delayedHits = 0;
delayedMisses = 0;
data.clear();
mirror.clear();
isStarted = false;
} | [
"public",
"void",
"stop",
"(",
")",
"{",
"hits",
"=",
"0",
";",
"misses",
"=",
"0",
";",
"unavailable",
"=",
"0",
";",
"delayedHits",
"=",
"0",
";",
"delayedMisses",
"=",
"0",
";",
"data",
".",
"clear",
"(",
")",
";",
"mirror",
".",
"clear",
"(",... | Clears storage. Resets statistics.
Is invoked by superclass. | [
"Clears",
"storage",
".",
"Resets",
"statistics",
".",
"Is",
"invoked",
"by",
"superclass",
"."
] | 0fb0885775b576209ff1b5a0f67e3c25a99a6420 | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java#L111-L120 |
156,443 | jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java | StandardCache.retrieve | public Object retrieve(K key, int timeout) {
Object retval = null;
if (isCachingEnabled()) {
CachedObject<V> co = getCachedObject(key);
if (co == null || isCachedObjectExpired(co)) {
misses++;
co = new CachedObject<V>();
co.setBeingRetrieved();
this.storeCachedObject(key, co);
} else if (co... | java | public Object retrieve(K key, int timeout) {
Object retval = null;
if (isCachingEnabled()) {
CachedObject<V> co = getCachedObject(key);
if (co == null || isCachedObjectExpired(co)) {
misses++;
co = new CachedObject<V>();
co.setBeingRetrieved();
this.storeCachedObject(key, co);
} else if (co... | [
"public",
"Object",
"retrieve",
"(",
"K",
"key",
",",
"int",
"timeout",
")",
"{",
"Object",
"retval",
"=",
"null",
";",
"if",
"(",
"isCachingEnabled",
"(",
")",
")",
"{",
"CachedObject",
"<",
"V",
">",
"co",
"=",
"getCachedObject",
"(",
"key",
")",
"... | Retrieves an object from cache.
This method should be used if a programmer suspects bursts of requests for
a particular object.
If this is the case, the first thread will retrieve the object,
the others will wait for some time, in order to save overhead.
@param key the key to retrieve the object by
@param timeout ... | [
"Retrieves",
"an",
"object",
"from",
"cache",
".",
"This",
"method",
"should",
"be",
"used",
"if",
"a",
"programmer",
"suspects",
"bursts",
"of",
"requests",
"for",
"a",
"particular",
"object",
".",
"If",
"this",
"is",
"the",
"case",
"the",
"first",
"threa... | 0fb0885775b576209ff1b5a0f67e3c25a99a6420 | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java#L180-L211 |
156,444 | jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java | StandardCache.storeCachedObject | private Object storeCachedObject(K key, CachedObject<V> co) {
//data is only locked if cleanup removes cached objects
synchronized (data) {
data.put(key, co);
}
//mirror is also locked if cleanup is busy collecting cached objects
synchronized (mirror) {
mirror.put(key, co);
}
System.out.println(new ... | java | private Object storeCachedObject(K key, CachedObject<V> co) {
//data is only locked if cleanup removes cached objects
synchronized (data) {
data.put(key, co);
}
//mirror is also locked if cleanup is busy collecting cached objects
synchronized (mirror) {
mirror.put(key, co);
}
System.out.println(new ... | [
"private",
"Object",
"storeCachedObject",
"(",
"K",
"key",
",",
"CachedObject",
"<",
"V",
">",
"co",
")",
"{",
"//data is only locked if cleanup removes cached objects",
"synchronized",
"(",
"data",
")",
"{",
"data",
".",
"put",
"(",
"key",
",",
"co",
")",
";"... | Places an empty wrapper in the cache to indicate that some thread should
be busy retrieving the object, after which it should be cached after all.
@param co
@return | [
"Places",
"an",
"empty",
"wrapper",
"in",
"the",
"cache",
"to",
"indicate",
"that",
"some",
"thread",
"should",
"be",
"busy",
"retrieving",
"the",
"object",
"after",
"which",
"it",
"should",
"be",
"cached",
"after",
"all",
"."
] | 0fb0885775b576209ff1b5a0f67e3c25a99a6420 | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java#L237-L248 |
156,445 | jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java | StandardCache.retrieve | public V retrieve(K key) {
V retval = null;
if (isCachingEnabled()) {
CachedObject<V> co = getCachedObject(key);
if (co == null || (isCachedObjectExpired(co))) {
//take pressure off of cleanup
misses++;
} else if (co.getObject() == null) {
unavailable++;
} else {
hits++;
retval = co.... | java | public V retrieve(K key) {
V retval = null;
if (isCachingEnabled()) {
CachedObject<V> co = getCachedObject(key);
if (co == null || (isCachedObjectExpired(co))) {
//take pressure off of cleanup
misses++;
} else if (co.getObject() == null) {
unavailable++;
} else {
hits++;
retval = co.... | [
"public",
"V",
"retrieve",
"(",
"K",
"key",
")",
"{",
"V",
"retval",
"=",
"null",
";",
"if",
"(",
"isCachingEnabled",
"(",
")",
")",
"{",
"CachedObject",
"<",
"V",
">",
"co",
"=",
"getCachedObject",
"(",
"key",
")",
";",
"if",
"(",
"co",
"==",
"n... | Retrieves an object from cache.
@param key the key to retrieve the object by
@return the cached object or null if it's not found | [
"Retrieves",
"an",
"object",
"from",
"cache",
"."
] | 0fb0885775b576209ff1b5a0f67e3c25a99a6420 | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java#L272-L287 |
156,446 | jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java | StandardCache.cleanup | public long cleanup() {
int garbageSize = 0;
if (isCachingEnabled()) {
System.out.println(new LogEntry(Level.VERBOSE, "Identifying expired objects"));
ArrayList<K> garbage = getExpiredObjects();
garbageSize = garbage.size();
System.out.println(new LogEntry("cache cleanup: expired objects: " + garbageSiz... | java | public long cleanup() {
int garbageSize = 0;
if (isCachingEnabled()) {
System.out.println(new LogEntry(Level.VERBOSE, "Identifying expired objects"));
ArrayList<K> garbage = getExpiredObjects();
garbageSize = garbage.size();
System.out.println(new LogEntry("cache cleanup: expired objects: " + garbageSiz... | [
"public",
"long",
"cleanup",
"(",
")",
"{",
"int",
"garbageSize",
"=",
"0",
";",
"if",
"(",
"isCachingEnabled",
"(",
")",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"new",
"LogEntry",
"(",
"Level",
".",
"VERBOSE",
",",
"\"Identifying expired ob... | Removes all expired objects.
@return the number of removed objects. | [
"Removes",
"all",
"expired",
"objects",
"."
] | 0fb0885775b576209ff1b5a0f67e3c25a99a6420 | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java#L320-L332 |
156,447 | jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java | StandardCache.clear | public void clear(Object key) {
Object removed;
if (isCachingEnabled()) {
synchronized (mirror) {
synchronized (data) {
removed = data.remove(key);
mirror.remove(key);
}
}
System.out.println(new LogEntry("object with key " + key + (removed == null ? " NOT" : "") + " removed from cache"));... | java | public void clear(Object key) {
Object removed;
if (isCachingEnabled()) {
synchronized (mirror) {
synchronized (data) {
removed = data.remove(key);
mirror.remove(key);
}
}
System.out.println(new LogEntry("object with key " + key + (removed == null ? " NOT" : "") + " removed from cache"));... | [
"public",
"void",
"clear",
"(",
"Object",
"key",
")",
"{",
"Object",
"removed",
";",
"if",
"(",
"isCachingEnabled",
"(",
")",
")",
"{",
"synchronized",
"(",
"mirror",
")",
"{",
"synchronized",
"(",
"data",
")",
"{",
"removed",
"=",
"data",
".",
"remove... | Removes an object from cache.
@param key object key | [
"Removes",
"an",
"object",
"from",
"cache",
"."
] | 0fb0885775b576209ff1b5a0f67e3c25a99a6420 | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java#L354-L365 |
156,448 | jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java | StandardCache.clear | public void clear(Collection keys) {
synchronized (mirror) {
synchronized (data) {
Iterator i = keys.iterator();
while (i.hasNext()) {
Object key = i.next();
data.remove(key);
mirror.remove(key);
}
}
}
} | java | public void clear(Collection keys) {
synchronized (mirror) {
synchronized (data) {
Iterator i = keys.iterator();
while (i.hasNext()) {
Object key = i.next();
data.remove(key);
mirror.remove(key);
}
}
}
} | [
"public",
"void",
"clear",
"(",
"Collection",
"keys",
")",
"{",
"synchronized",
"(",
"mirror",
")",
"{",
"synchronized",
"(",
"data",
")",
"{",
"Iterator",
"i",
"=",
"keys",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"i",
".",
"hasNext",
"(",
")",... | Removes a collection of objects from cache.
@param keys object keys | [
"Removes",
"a",
"collection",
"of",
"objects",
"from",
"cache",
"."
] | 0fb0885775b576209ff1b5a0f67e3c25a99a6420 | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java#L372-L383 |
156,449 | pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/auth/MemoryCredentialStore.java | MemoryCredentialStore.readCredentials | public void readCredentials(ConfigParams credentials) {
synchronized (_lock) {
_items.clear();
for (Map.Entry<String, String> entry : credentials.entrySet())
_items.put(entry.getKey(), CredentialParams.fromString(entry.getValue()));
}
} | java | public void readCredentials(ConfigParams credentials) {
synchronized (_lock) {
_items.clear();
for (Map.Entry<String, String> entry : credentials.entrySet())
_items.put(entry.getKey(), CredentialParams.fromString(entry.getValue()));
}
} | [
"public",
"void",
"readCredentials",
"(",
"ConfigParams",
"credentials",
")",
"{",
"synchronized",
"(",
"_lock",
")",
"{",
"_items",
".",
"clear",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"credentia... | Reads credentials from configuration parameters.
Each section represents an individual CredentialParams
@param credentials configuration parameters to be read | [
"Reads",
"credentials",
"from",
"configuration",
"parameters",
".",
"Each",
"section",
"represents",
"an",
"individual",
"CredentialParams"
] | 122352fbf9b208f6417376da7b8ad725bc85ee58 | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/auth/MemoryCredentialStore.java#L72-L78 |
156,450 | pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/auth/MemoryCredentialStore.java | MemoryCredentialStore.store | public void store(String correlationId, String key, CredentialParams credential) {
synchronized (_lock) {
if (credential != null)
_items.put(key, credential);
else
_items.remove(key);
}
} | java | public void store(String correlationId, String key, CredentialParams credential) {
synchronized (_lock) {
if (credential != null)
_items.put(key, credential);
else
_items.remove(key);
}
} | [
"public",
"void",
"store",
"(",
"String",
"correlationId",
",",
"String",
"key",
",",
"CredentialParams",
"credential",
")",
"{",
"synchronized",
"(",
"_lock",
")",
"{",
"if",
"(",
"credential",
"!=",
"null",
")",
"_items",
".",
"put",
"(",
"key",
",",
"... | Stores credential parameters into the store.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param key a key to uniquely identify the credential parameters.
@param credential a credential parameters to be stored. | [
"Stores",
"credential",
"parameters",
"into",
"the",
"store",
"."
] | 122352fbf9b208f6417376da7b8ad725bc85ee58 | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/auth/MemoryCredentialStore.java#L88-L95 |
156,451 | pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/auth/MemoryCredentialStore.java | MemoryCredentialStore.lookup | public CredentialParams lookup(String correlationId, String key) {
synchronized (_lock) {
return _items.get(key);
}
} | java | public CredentialParams lookup(String correlationId, String key) {
synchronized (_lock) {
return _items.get(key);
}
} | [
"public",
"CredentialParams",
"lookup",
"(",
"String",
"correlationId",
",",
"String",
"key",
")",
"{",
"synchronized",
"(",
"_lock",
")",
"{",
"return",
"_items",
".",
"get",
"(",
"key",
")",
";",
"}",
"}"
] | Lookups credential parameters by its key.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param key a key to uniquely identify the credential parameters.
@return resolved credential parameters or null if nothing was found. | [
"Lookups",
"credential",
"parameters",
"by",
"its",
"key",
"."
] | 122352fbf9b208f6417376da7b8ad725bc85ee58 | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/auth/MemoryCredentialStore.java#L105-L109 |
156,452 | loicoudot/java4cpp-core | src/main/java/com/github/loicoudot/java4cpp/Context.java | Context.createClassLoader | private void createClassLoader() {
if (!Utils.isNullOrEmpty(settings.getJarFiles())) {
try {
String[] files = settings.getJarFiles().split(";");
List<URL> urls = newArrayList();
for (String path : files) {
File file = new File(path)... | java | private void createClassLoader() {
if (!Utils.isNullOrEmpty(settings.getJarFiles())) {
try {
String[] files = settings.getJarFiles().split(";");
List<URL> urls = newArrayList();
for (String path : files) {
File file = new File(path)... | [
"private",
"void",
"createClassLoader",
"(",
")",
"{",
"if",
"(",
"!",
"Utils",
".",
"isNullOrEmpty",
"(",
"settings",
".",
"getJarFiles",
"(",
")",
")",
")",
"{",
"try",
"{",
"String",
"[",
"]",
"files",
"=",
"settings",
".",
"getJarFiles",
"(",
")",
... | Construct the context class loader by adding all jars. | [
"Construct",
"the",
"context",
"class",
"loader",
"by",
"adding",
"all",
"jars",
"."
] | 7fe5a5dd5a29c3f95b62f46eaacbb8f8778b9493 | https://github.com/loicoudot/java4cpp-core/blob/7fe5a5dd5a29c3f95b62f46eaacbb8f8778b9493/src/main/java/com/github/loicoudot/java4cpp/Context.java#L74-L90 |
156,453 | eiichiro/jaguar | jaguar-core/src/main/java/org/eiichiro/jaguar/Container.java | Container.installed | public boolean installed(Class<?> component) {
Preconditions.checkArgument(component != null,
"Parameter 'component' must not be [" + component + "]");
return installed.contains(component);
} | java | public boolean installed(Class<?> component) {
Preconditions.checkArgument(component != null,
"Parameter 'component' must not be [" + component + "]");
return installed.contains(component);
} | [
"public",
"boolean",
"installed",
"(",
"Class",
"<",
"?",
">",
"component",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"component",
"!=",
"null",
",",
"\"Parameter 'component' must not be [\"",
"+",
"component",
"+",
"\"]\"",
")",
";",
"return",
"inst... | Indicates the specified component installed or not in the container.
@param component The component class to be examined.
@return <code>true</code> if the specified component installed in the
container. | [
"Indicates",
"the",
"specified",
"component",
"installed",
"or",
"not",
"in",
"the",
"container",
"."
] | 9da0b8677fa306f10f848402490c75d05c213547 | https://github.com/eiichiro/jaguar/blob/9da0b8677fa306f10f848402490c75d05c213547/jaguar-core/src/main/java/org/eiichiro/jaguar/Container.java#L447-L451 |
156,454 | CubeEngine/Dirigent | src/main/java/org/cubeengine/dirigent/formatter/AbstractFormatter.java | AbstractFormatter.getGenericType | @SuppressWarnings("unchecked")
private static <T> Class<T> getGenericType(Class<?> thisClass)
{
Type type = thisClass;
do
{
type = ((Class<?>)type).getGenericSuperclass();
if (type instanceof ParameterizedType)
{
return (Class<T>)((Para... | java | @SuppressWarnings("unchecked")
private static <T> Class<T> getGenericType(Class<?> thisClass)
{
Type type = thisClass;
do
{
type = ((Class<?>)type).getGenericSuperclass();
if (type instanceof ParameterizedType)
{
return (Class<T>)((Para... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"<",
"T",
">",
"Class",
"<",
"T",
">",
"getGenericType",
"(",
"Class",
"<",
"?",
">",
"thisClass",
")",
"{",
"Type",
"type",
"=",
"thisClass",
";",
"do",
"{",
"type",
"=",
"(",
... | Loads the class information from the generic type of the specified class.
@param thisClass The class.
@param <T> The parameter object type.
@return the class information. | [
"Loads",
"the",
"class",
"information",
"from",
"the",
"generic",
"type",
"of",
"the",
"specified",
"class",
"."
] | 68587a8202754a6a6b629cc15e14c516806badaa | https://github.com/CubeEngine/Dirigent/blob/68587a8202754a6a6b629cc15e14c516806badaa/src/main/java/org/cubeengine/dirigent/formatter/AbstractFormatter.java#L101-L116 |
156,455 | micwin/ticino | events/src/main/java/net/micwin/ticino/events/EventScope.java | EventScope.registerInternal | private void registerInternal(final Object receiver, final Method method, final Class<? extends T> eventClass) {
List<ReceiverDescriptor> receivers = this.receiverMap.get(eventClass);
if (receivers == null) {
receivers = new LinkedList<ReceiverDescriptor>();
this.receiverMap.put(eventClass, receivers);
}
... | java | private void registerInternal(final Object receiver, final Method method, final Class<? extends T> eventClass) {
List<ReceiverDescriptor> receivers = this.receiverMap.get(eventClass);
if (receivers == null) {
receivers = new LinkedList<ReceiverDescriptor>();
this.receiverMap.put(eventClass, receivers);
}
... | [
"private",
"void",
"registerInternal",
"(",
"final",
"Object",
"receiver",
",",
"final",
"Method",
"method",
",",
"final",
"Class",
"<",
"?",
"extends",
"T",
">",
"eventClass",
")",
"{",
"List",
"<",
"ReceiverDescriptor",
">",
"receivers",
"=",
"this",
".",
... | Registers a receiver to an internal map.
@param receiver
@param method
@param eventClass | [
"Registers",
"a",
"receiver",
"to",
"an",
"internal",
"map",
"."
] | 4d143093500cd2fb9767ebe8cd05ddda23e35613 | https://github.com/micwin/ticino/blob/4d143093500cd2fb9767ebe8cd05ddda23e35613/events/src/main/java/net/micwin/ticino/events/EventScope.java#L201-L214 |
156,456 | micwin/ticino | events/src/main/java/net/micwin/ticino/events/EventScope.java | EventScope.dispatch | private <Q extends T> Q dispatch(final Q event, boolean stopOnFirstException) {
if (event == null) {
throw new IllegalArgumentException("event is null");
}
if (this.baseClass != null && !this.baseClass.isAssignableFrom(event.getClass())) {
throw new IllegalArgumentException("event of type " + event.getCla... | java | private <Q extends T> Q dispatch(final Q event, boolean stopOnFirstException) {
if (event == null) {
throw new IllegalArgumentException("event is null");
}
if (this.baseClass != null && !this.baseClass.isAssignableFrom(event.getClass())) {
throw new IllegalArgumentException("event of type " + event.getCla... | [
"private",
"<",
"Q",
"extends",
"T",
">",
"Q",
"dispatch",
"(",
"final",
"Q",
"event",
",",
"boolean",
"stopOnFirstException",
")",
"{",
"if",
"(",
"event",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"event is null\"",
")",
... | Dispatch an event to receivers synchronously.
@param event
The event object to dispatch.
@param stopOnFirstException
wether to wrap first exception that comes up in a
{@link DispatchException} and then cancel execution.
@throws DispatchException
if stopOnFirstException == true, then first exception that
comes up wrap... | [
"Dispatch",
"an",
"event",
"to",
"receivers",
"synchronously",
"."
] | 4d143093500cd2fb9767ebe8cd05ddda23e35613 | https://github.com/micwin/ticino/blob/4d143093500cd2fb9767ebe8cd05ddda23e35613/events/src/main/java/net/micwin/ticino/events/EventScope.java#L332-L379 |
156,457 | micwin/ticino | events/src/main/java/net/micwin/ticino/events/EventScope.java | EventScope.dispatchAsynchronous | public synchronized <Q extends T> void dispatchAsynchronous(final Q event, final IPostProcessor<Q> pPostProcessor) {
new Thread(new Runnable() {
@Override
public void run() {
try {
// delegate dispatch result
pPostProcessor.done(dispatch(event));
} catch (DispatchException lEx) {
//... | java | public synchronized <Q extends T> void dispatchAsynchronous(final Q event, final IPostProcessor<Q> pPostProcessor) {
new Thread(new Runnable() {
@Override
public void run() {
try {
// delegate dispatch result
pPostProcessor.done(dispatch(event));
} catch (DispatchException lEx) {
//... | [
"public",
"synchronized",
"<",
"Q",
"extends",
"T",
">",
"void",
"dispatchAsynchronous",
"(",
"final",
"Q",
"event",
",",
"final",
"IPostProcessor",
"<",
"Q",
">",
"pPostProcessor",
")",
"{",
"new",
"Thread",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"... | Dispatch an event to receivers asynchronously. Does start a thread and
then return immediately.
@param event
The event object to dispatch.
@param pPostProcessor
The postprocessor to call when the event doispatchment
returns. | [
"Dispatch",
"an",
"event",
"to",
"receivers",
"asynchronously",
".",
"Does",
"start",
"a",
"thread",
"and",
"then",
"return",
"immediately",
"."
] | 4d143093500cd2fb9767ebe8cd05ddda23e35613 | https://github.com/micwin/ticino/blob/4d143093500cd2fb9767ebe8cd05ddda23e35613/events/src/main/java/net/micwin/ticino/events/EventScope.java#L391-L412 |
156,458 | micwin/ticino | events/src/main/java/net/micwin/ticino/events/EventScope.java | EventScope.collectReceiver | private void collectReceiver(final Class<?> eventClass, final Collection<ReceiverDescriptor> receiverCollection) {
if (this.receiverMap.get(eventClass) != null) {
receiverCollection.addAll(this.receiverMap.get(eventClass));
}
if (!eventClass.isInterface() && eventClass.getSuperclass() != Object.class) {
th... | java | private void collectReceiver(final Class<?> eventClass, final Collection<ReceiverDescriptor> receiverCollection) {
if (this.receiverMap.get(eventClass) != null) {
receiverCollection.addAll(this.receiverMap.get(eventClass));
}
if (!eventClass.isInterface() && eventClass.getSuperclass() != Object.class) {
th... | [
"private",
"void",
"collectReceiver",
"(",
"final",
"Class",
"<",
"?",
">",
"eventClass",
",",
"final",
"Collection",
"<",
"ReceiverDescriptor",
">",
"receiverCollection",
")",
"{",
"if",
"(",
"this",
".",
"receiverMap",
".",
"get",
"(",
"eventClass",
")",
"... | collects receiver descriptors of super classes and interfaces.
@param eventClass
@param receiverCollection
the collection receivers are put in. | [
"collects",
"receiver",
"descriptors",
"of",
"super",
"classes",
"and",
"interfaces",
"."
] | 4d143093500cd2fb9767ebe8cd05ddda23e35613 | https://github.com/micwin/ticino/blob/4d143093500cd2fb9767ebe8cd05ddda23e35613/events/src/main/java/net/micwin/ticino/events/EventScope.java#L421-L432 |
156,459 | maestrano/maestrano-java | src/main/java/com/maestrano/net/MnoHttpClient.java | MnoHttpClient.getAuthenticatedClient | public static MnoHttpClient getAuthenticatedClient(String key, String secret, String contentType) {
MnoHttpClient client = new MnoHttpClient(contentType);
String authStr = key + ":" + secret;
client.basicAuthHash = "Basic " + DatatypeConverter.printBase64Binary(authStr.getBytes());
return client;
} | java | public static MnoHttpClient getAuthenticatedClient(String key, String secret, String contentType) {
MnoHttpClient client = new MnoHttpClient(contentType);
String authStr = key + ":" + secret;
client.basicAuthHash = "Basic " + DatatypeConverter.printBase64Binary(authStr.getBytes());
return client;
} | [
"public",
"static",
"MnoHttpClient",
"getAuthenticatedClient",
"(",
"String",
"key",
",",
"String",
"secret",
",",
"String",
"contentType",
")",
"{",
"MnoHttpClient",
"client",
"=",
"new",
"MnoHttpClient",
"(",
"contentType",
")",
";",
"String",
"authStr",
"=",
... | Return a client with HTTP Basic Authentication setup | [
"Return",
"a",
"client",
"with",
"HTTP",
"Basic",
"Authentication",
"setup"
] | e71c6d3172d7645529d678d1cb3ea9e0a59de314 | https://github.com/maestrano/maestrano-java/blob/e71c6d3172d7645529d678d1cb3ea9e0a59de314/src/main/java/com/maestrano/net/MnoHttpClient.java#L60-L66 |
156,460 | maestrano/maestrano-java | src/main/java/com/maestrano/net/MnoHttpClient.java | MnoHttpClient.post | public String post(String url, String payload) throws AuthenticationException, ApiException {
return performRequest(url, "POST", null, null, payload);
} | java | public String post(String url, String payload) throws AuthenticationException, ApiException {
return performRequest(url, "POST", null, null, payload);
} | [
"public",
"String",
"post",
"(",
"String",
"url",
",",
"String",
"payload",
")",
"throws",
"AuthenticationException",
",",
"ApiException",
"{",
"return",
"performRequest",
"(",
"url",
",",
"\"POST\"",
",",
"null",
",",
"null",
",",
"payload",
")",
";",
"}"
] | Perform a POST request on the specified endpoint
@param url
@param header
@param payload
@return response body
@throws ApiException
@throws AuthenticationException | [
"Perform",
"a",
"POST",
"request",
"on",
"the",
"specified",
"endpoint"
] | e71c6d3172d7645529d678d1cb3ea9e0a59de314 | https://github.com/maestrano/maestrano-java/blob/e71c6d3172d7645529d678d1cb3ea9e0a59de314/src/main/java/com/maestrano/net/MnoHttpClient.java#L117-L119 |
156,461 | maestrano/maestrano-java | src/main/java/com/maestrano/net/MnoHttpClient.java | MnoHttpClient.openConnection | protected HttpURLConnection openConnection(String url, Map<String, String> header) throws IOException {
// Initialize connection
URL urlObj = null;
HttpURLConnection conn = null;
int redirectCount = 0;
boolean redirect = true;
while (redirect) {
if (redirectCount > 10) {
throw new ProtocolException(... | java | protected HttpURLConnection openConnection(String url, Map<String, String> header) throws IOException {
// Initialize connection
URL urlObj = null;
HttpURLConnection conn = null;
int redirectCount = 0;
boolean redirect = true;
while (redirect) {
if (redirectCount > 10) {
throw new ProtocolException(... | [
"protected",
"HttpURLConnection",
"openConnection",
"(",
"String",
"url",
",",
"Map",
"<",
"String",
",",
"String",
">",
"header",
")",
"throws",
"IOException",
"{",
"// Initialize connection",
"URL",
"urlObj",
"=",
"null",
";",
"HttpURLConnection",
"conn",
"=",
... | Open a connection and follow the redirect
@param String
url
@param header
contain
@return HttpURLConnection connection
@throws IOException | [
"Open",
"a",
"connection",
"and",
"follow",
"the",
"redirect"
] | e71c6d3172d7645529d678d1cb3ea9e0a59de314 | https://github.com/maestrano/maestrano-java/blob/e71c6d3172d7645529d678d1cb3ea9e0a59de314/src/main/java/com/maestrano/net/MnoHttpClient.java#L302-L349 |
156,462 | micwin/ticino | static/src/main/java/net/micwin/ticino/events/PublicScopes.java | PublicScopes.get | @SuppressWarnings("unchecked")
public static <T> EventScope<T> get (final Class<T> pEventType) {
if (pEventType == Object.class) {
return null;
}
EventScope<T> lResult = (EventScope<T>) sScopes.get (pEventType);
if (lResult != null) {
return lResult;
... | java | @SuppressWarnings("unchecked")
public static <T> EventScope<T> get (final Class<T> pEventType) {
if (pEventType == Object.class) {
return null;
}
EventScope<T> lResult = (EventScope<T>) sScopes.get (pEventType);
if (lResult != null) {
return lResult;
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"EventScope",
"<",
"T",
">",
"get",
"(",
"final",
"Class",
"<",
"T",
">",
"pEventType",
")",
"{",
"if",
"(",
"pEventType",
"==",
"Object",
".",
"class",
")",
"{",
... | Returns the event scope bound to that event type. This is an expensive
operation, so make sure to only call as seldom as possible.
@param pEventType
@return | [
"Returns",
"the",
"event",
"scope",
"bound",
"to",
"that",
"event",
"type",
".",
"This",
"is",
"an",
"expensive",
"operation",
"so",
"make",
"sure",
"to",
"only",
"call",
"as",
"seldom",
"as",
"possible",
"."
] | 4d143093500cd2fb9767ebe8cd05ddda23e35613 | https://github.com/micwin/ticino/blob/4d143093500cd2fb9767ebe8cd05ddda23e35613/static/src/main/java/net/micwin/ticino/events/PublicScopes.java#L57-L83 |
156,463 | javagl/ND | nd-iteration/src/main/java/de/javagl/nd/iteration/tuples/i/VonNeumannIntTupleIterator.java | VonNeumannIntTupleIterator.increment | private boolean increment(int index)
{
if (index == -1)
{
return false;
}
int value = current.get(index);
if (value < max.get(index))
{
current.set(index, value+1);
updateMinMax(index+1);
return true;
... | java | private boolean increment(int index)
{
if (index == -1)
{
return false;
}
int value = current.get(index);
if (value < max.get(index))
{
current.set(index, value+1);
updateMinMax(index+1);
return true;
... | [
"private",
"boolean",
"increment",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"return",
"false",
";",
"}",
"int",
"value",
"=",
"current",
".",
"get",
"(",
"index",
")",
";",
"if",
"(",
"value",
"<",
"max",
".",
... | Increment the current value starting at the given index,
and return whether this was possible
@param index The index
@return Whether the value could be incremented | [
"Increment",
"the",
"current",
"value",
"starting",
"at",
"the",
"given",
"index",
"and",
"return",
"whether",
"this",
"was",
"possible"
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-iteration/src/main/java/de/javagl/nd/iteration/tuples/i/VonNeumannIntTupleIterator.java#L129-L148 |
156,464 | soulwarelabs/jCommons-API | src/main/java/com/soulwarelabs/jcommons/data/Credentials.java | Credentials.copy | public static Credentials copy(Credentials credentials) {
if (credentials == null) {
return null;
}
return new Credentials(credentials.login, credentials.password);
} | java | public static Credentials copy(Credentials credentials) {
if (credentials == null) {
return null;
}
return new Credentials(credentials.login, credentials.password);
} | [
"public",
"static",
"Credentials",
"copy",
"(",
"Credentials",
"credentials",
")",
"{",
"if",
"(",
"credentials",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"Credentials",
"(",
"credentials",
".",
"login",
",",
"credentials",
".",
... | Creates a new copy of authentication pair.
@param credentials original authentication pair (optional).
@return copied authentication pair (optional).
@since v1.1.0 | [
"Creates",
"a",
"new",
"copy",
"of",
"authentication",
"pair",
"."
] | 57795ae28aea144e68502149506ec99dd67f0c67 | https://github.com/soulwarelabs/jCommons-API/blob/57795ae28aea144e68502149506ec99dd67f0c67/src/main/java/com/soulwarelabs/jcommons/data/Credentials.java#L53-L58 |
156,465 | CubeEngine/Dirigent | src/main/java/org/cubeengine/dirigent/formatter/NumberFormatter.java | NumberFormatter.parseNumberToString | protected String parseNumberToString(Number number, Context context, Arguments args)
{
final NumberFormat numberFormat = parseFormatter(context, args);
final Currency currency = context.get(Contexts.CURRENCY);
if (currency != null)
{
numberFormat.setCurrency(currency);
... | java | protected String parseNumberToString(Number number, Context context, Arguments args)
{
final NumberFormat numberFormat = parseFormatter(context, args);
final Currency currency = context.get(Contexts.CURRENCY);
if (currency != null)
{
numberFormat.setCurrency(currency);
... | [
"protected",
"String",
"parseNumberToString",
"(",
"Number",
"number",
",",
"Context",
"context",
",",
"Arguments",
"args",
")",
"{",
"final",
"NumberFormat",
"numberFormat",
"=",
"parseFormatter",
"(",
"context",
",",
"args",
")",
";",
"final",
"Currency",
"cur... | Parses the given number to a string depending on the context.
@param number The number to parse.
@param context The context to use.
@param args The arguments of the macro.
@return The number as a string. | [
"Parses",
"the",
"given",
"number",
"to",
"a",
"string",
"depending",
"on",
"the",
"context",
"."
] | 68587a8202754a6a6b629cc15e14c516806badaa | https://github.com/CubeEngine/Dirigent/blob/68587a8202754a6a6b629cc15e14c516806badaa/src/main/java/org/cubeengine/dirigent/formatter/NumberFormatter.java#L113-L124 |
156,466 | wg/scrypt | src/main/java/com/lambdaworks/crypto/SCryptUtil.java | SCryptUtil.check | public static boolean check(String passwd, String hashed) {
try {
String[] parts = hashed.split("\\$");
if (parts.length != 5 || !parts[1].equals("s0")) {
throw new IllegalArgumentException("Invalid hashed value");
}
long params = Long.parseLong(... | java | public static boolean check(String passwd, String hashed) {
try {
String[] parts = hashed.split("\\$");
if (parts.length != 5 || !parts[1].equals("s0")) {
throw new IllegalArgumentException("Invalid hashed value");
}
long params = Long.parseLong(... | [
"public",
"static",
"boolean",
"check",
"(",
"String",
"passwd",
",",
"String",
"hashed",
")",
"{",
"try",
"{",
"String",
"[",
"]",
"parts",
"=",
"hashed",
".",
"split",
"(",
"\"\\\\$\"",
")",
";",
"if",
"(",
"parts",
".",
"length",
"!=",
"5",
"||",
... | Compare the supplied plaintext password to a hashed password.
@param passwd Plaintext password.
@param hashed scrypt hashed password.
@return true if passwd matches hashed value. | [
"Compare",
"the",
"supplied",
"plaintext",
"password",
"to",
"a",
"hashed",
"password",
"."
] | 0675236370458e819ee21e4427c5f7f3f9485d33 | https://github.com/wg/scrypt/blob/0675236370458e819ee21e4427c5f7f3f9485d33/src/main/java/com/lambdaworks/crypto/SCryptUtil.java#L72-L102 |
156,467 | wg/scrypt | src/main/java/com/lambdaworks/jni/Platform.java | Platform.detect | public static Platform detect() throws UnsupportedPlatformException {
String osArch = getProperty("os.arch");
String osName = getProperty("os.name");
for (Arch arch : Arch.values()) {
if (arch.pattern.matcher(osArch).matches()) {
for (OS os : OS.values()) {
... | java | public static Platform detect() throws UnsupportedPlatformException {
String osArch = getProperty("os.arch");
String osName = getProperty("os.name");
for (Arch arch : Arch.values()) {
if (arch.pattern.matcher(osArch).matches()) {
for (OS os : OS.values()) {
... | [
"public",
"static",
"Platform",
"detect",
"(",
")",
"throws",
"UnsupportedPlatformException",
"{",
"String",
"osArch",
"=",
"getProperty",
"(",
"\"os.arch\"",
")",
";",
"String",
"osName",
"=",
"getProperty",
"(",
"\"os.name\"",
")",
";",
"for",
"(",
"Arch",
"... | Attempt to detect the current platform.
@return The current platform.
@throws UnsupportedPlatformException if the platform cannot be detected. | [
"Attempt",
"to",
"detect",
"the",
"current",
"platform",
"."
] | 0675236370458e819ee21e4427c5f7f3f9485d33 | https://github.com/wg/scrypt/blob/0675236370458e819ee21e4427c5f7f3f9485d33/src/main/java/com/lambdaworks/jni/Platform.java#L56-L72 |
156,468 | groovy/groovy-core | src/main/org/codehaus/groovy/ast/ASTNode.java | ASTNode.getNodeMetaData | public <T> T getNodeMetaData(Object key) {
if (metaDataMap == null) {
return (T) null;
}
return (T) metaDataMap.get(key);
} | java | public <T> T getNodeMetaData(Object key) {
if (metaDataMap == null) {
return (T) null;
}
return (T) metaDataMap.get(key);
} | [
"public",
"<",
"T",
">",
"T",
"getNodeMetaData",
"(",
"Object",
"key",
")",
"{",
"if",
"(",
"metaDataMap",
"==",
"null",
")",
"{",
"return",
"(",
"T",
")",
"null",
";",
"}",
"return",
"(",
"T",
")",
"metaDataMap",
".",
"get",
"(",
"key",
")",
";"... | Gets the node meta data.
@param key - the meta data key
@return the node meta data value for this key | [
"Gets",
"the",
"node",
"meta",
"data",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/ast/ASTNode.java#L119-L124 |
156,469 | groovy/groovy-core | src/main/org/codehaus/groovy/ast/ASTNode.java | ASTNode.copyNodeMetaData | public void copyNodeMetaData(ASTNode other) {
if (other.metaDataMap == null) {
return;
}
if (metaDataMap == null) {
metaDataMap = new ListHashMap();
}
metaDataMap.putAll(other.metaDataMap);
} | java | public void copyNodeMetaData(ASTNode other) {
if (other.metaDataMap == null) {
return;
}
if (metaDataMap == null) {
metaDataMap = new ListHashMap();
}
metaDataMap.putAll(other.metaDataMap);
} | [
"public",
"void",
"copyNodeMetaData",
"(",
"ASTNode",
"other",
")",
"{",
"if",
"(",
"other",
".",
"metaDataMap",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"metaDataMap",
"==",
"null",
")",
"{",
"metaDataMap",
"=",
"new",
"ListHashMap",
"(",
... | Copies all node meta data from the other node to this one
@param other - the other node | [
"Copies",
"all",
"node",
"meta",
"data",
"from",
"the",
"other",
"node",
"to",
"this",
"one"
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/ast/ASTNode.java#L130-L138 |
156,470 | groovy/groovy-core | src/main/org/codehaus/groovy/ast/ASTNode.java | ASTNode.setNodeMetaData | public void setNodeMetaData(Object key, Object value) {
if (key==null) throw new GroovyBugError("Tried to set meta data with null key on "+this+".");
if (metaDataMap == null) {
metaDataMap = new ListHashMap();
}
Object old = metaDataMap.put(key,value);
if (old!=null) ... | java | public void setNodeMetaData(Object key, Object value) {
if (key==null) throw new GroovyBugError("Tried to set meta data with null key on "+this+".");
if (metaDataMap == null) {
metaDataMap = new ListHashMap();
}
Object old = metaDataMap.put(key,value);
if (old!=null) ... | [
"public",
"void",
"setNodeMetaData",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"throw",
"new",
"GroovyBugError",
"(",
"\"Tried to set meta data with null key on \"",
"+",
"this",
"+",
"\".\"",
")",
";",
"if",
... | Sets the node meta data.
@param key - the meta data key
@param value - the meta data value
@throws GroovyBugError if key is null or there is already meta
data under that key | [
"Sets",
"the",
"node",
"meta",
"data",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/ast/ASTNode.java#L148-L155 |
156,471 | groovy/groovy-core | src/main/org/codehaus/groovy/ast/ASTNode.java | ASTNode.putNodeMetaData | public Object putNodeMetaData(Object key, Object value) {
if (key == null) throw new GroovyBugError("Tried to set meta data with null key on " + this + ".");
if (metaDataMap == null) {
metaDataMap = new ListHashMap();
}
return metaDataMap.put(key, value);
} | java | public Object putNodeMetaData(Object key, Object value) {
if (key == null) throw new GroovyBugError("Tried to set meta data with null key on " + this + ".");
if (metaDataMap == null) {
metaDataMap = new ListHashMap();
}
return metaDataMap.put(key, value);
} | [
"public",
"Object",
"putNodeMetaData",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"throw",
"new",
"GroovyBugError",
"(",
"\"Tried to set meta data with null key on \"",
"+",
"this",
"+",
"\".\"",
")",
";",
"if"... | Sets the node meta data but allows overwriting values.
@param key - the meta data key
@param value - the meta data value
@return the old node meta data value for this key
@throws GroovyBugError if key is null | [
"Sets",
"the",
"node",
"meta",
"data",
"but",
"allows",
"overwriting",
"values",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/ast/ASTNode.java#L165-L171 |
156,472 | groovy/groovy-core | src/main/org/codehaus/groovy/ast/ASTNode.java | ASTNode.removeNodeMetaData | public void removeNodeMetaData(Object key) {
if (key==null) throw new GroovyBugError("Tried to remove meta data with null key "+this+".");
if (metaDataMap == null) {
return;
}
metaDataMap.remove(key);
} | java | public void removeNodeMetaData(Object key) {
if (key==null) throw new GroovyBugError("Tried to remove meta data with null key "+this+".");
if (metaDataMap == null) {
return;
}
metaDataMap.remove(key);
} | [
"public",
"void",
"removeNodeMetaData",
"(",
"Object",
"key",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"throw",
"new",
"GroovyBugError",
"(",
"\"Tried to remove meta data with null key \"",
"+",
"this",
"+",
"\".\"",
")",
";",
"if",
"(",
"metaDataMap",
"... | Removes a node meta data entry.
@param key - the meta data key
@throws GroovyBugError if the key is null | [
"Removes",
"a",
"node",
"meta",
"data",
"entry",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/ast/ASTNode.java#L179-L185 |
156,473 | groovy/groovy-core | src/main/groovy/lang/IntRange.java | IntRange.subListBorders | public RangeInfo subListBorders(int size) {
if (inclusive == null) throw new IllegalStateException("Should not call subListBorders on a non-inclusive aware IntRange");
int tempFrom = from;
if (tempFrom < 0) {
tempFrom += size;
}
int tempTo = to;
if (tempTo < 0... | java | public RangeInfo subListBorders(int size) {
if (inclusive == null) throw new IllegalStateException("Should not call subListBorders on a non-inclusive aware IntRange");
int tempFrom = from;
if (tempFrom < 0) {
tempFrom += size;
}
int tempTo = to;
if (tempTo < 0... | [
"public",
"RangeInfo",
"subListBorders",
"(",
"int",
"size",
")",
"{",
"if",
"(",
"inclusive",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Should not call subListBorders on a non-inclusive aware IntRange\"",
")",
";",
"int",
"tempFrom",
"=",
"f... | A method for determining from and to information when using this IntRange to index an aggregate object of the specified size.
Normally only used internally within Groovy but useful if adding range indexing support for your own aggregates.
@param size the size of the aggregate being indexed
@return the calculated range... | [
"A",
"method",
"for",
"determining",
"from",
"and",
"to",
"information",
"when",
"using",
"this",
"IntRange",
"to",
"index",
"an",
"aggregate",
"object",
"of",
"the",
"specified",
"size",
".",
"Normally",
"only",
"used",
"internally",
"within",
"Groovy",
"but"... | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/lang/IntRange.java#L197-L211 |
156,474 | groovy/groovy-core | src/main/groovy/beans/BindableASTTransformation.java | BindableASTTransformation.createSetterMethod | protected void createSetterMethod(ClassNode declaringClass, PropertyNode propertyNode, String setterName, Statement setterBlock) {
MethodNode setter = new MethodNode(
setterName,
propertyNode.getModifiers(),
ClassHelper.VOID_TYPE,
params(param... | java | protected void createSetterMethod(ClassNode declaringClass, PropertyNode propertyNode, String setterName, Statement setterBlock) {
MethodNode setter = new MethodNode(
setterName,
propertyNode.getModifiers(),
ClassHelper.VOID_TYPE,
params(param... | [
"protected",
"void",
"createSetterMethod",
"(",
"ClassNode",
"declaringClass",
",",
"PropertyNode",
"propertyNode",
",",
"String",
"setterName",
",",
"Statement",
"setterBlock",
")",
"{",
"MethodNode",
"setter",
"=",
"new",
"MethodNode",
"(",
"setterName",
",",
"pro... | Creates a setter method with the given body.
@param declaringClass the class to which we will add the setter
@param propertyNode the field to back the setter
@param setterName the name of the setter
@param setterBlock the statement representing the setter block | [
"Creates",
"a",
"setter",
"method",
"with",
"the",
"given",
"body",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/beans/BindableASTTransformation.java#L247-L258 |
156,475 | groovy/groovy-core | src/main/org/codehaus/groovy/control/CompilationUnit.java | CompilationUnit.applyToPrimaryClassNodes | public void applyToPrimaryClassNodes(PrimaryClassNodeOperation body) throws CompilationFailedException {
Iterator classNodes = getPrimaryClassNodes(body.needSortedInput()).iterator();
while (classNodes.hasNext()) {
SourceUnit context = null;
try {
ClassNode classN... | java | public void applyToPrimaryClassNodes(PrimaryClassNodeOperation body) throws CompilationFailedException {
Iterator classNodes = getPrimaryClassNodes(body.needSortedInput()).iterator();
while (classNodes.hasNext()) {
SourceUnit context = null;
try {
ClassNode classN... | [
"public",
"void",
"applyToPrimaryClassNodes",
"(",
"PrimaryClassNodeOperation",
"body",
")",
"throws",
"CompilationFailedException",
"{",
"Iterator",
"classNodes",
"=",
"getPrimaryClassNodes",
"(",
"body",
".",
"needSortedInput",
"(",
")",
")",
".",
"iterator",
"(",
"... | A loop driver for applying operations to all primary ClassNodes in
our AST. Automatically skips units that have already been processed
through the current phase. | [
"A",
"loop",
"driver",
"for",
"applying",
"operations",
"to",
"all",
"primary",
"ClassNodes",
"in",
"our",
"AST",
".",
"Automatically",
"skips",
"units",
"that",
"have",
"already",
"been",
"processed",
"through",
"the",
"current",
"phase",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/control/CompilationUnit.java#L1041-L1076 |
156,476 | groovy/groovy-core | src/main/org/codehaus/groovy/runtime/SocketGroovyMethods.java | SocketGroovyMethods.withStreams | public static <T> T withStreams(Socket socket, @ClosureParams(value=SimpleType.class, options={"java.io.InputStream","java.io.OutputStream"}) Closure<T> closure) throws IOException {
InputStream input = socket.getInputStream();
OutputStream output = socket.getOutputStream();
try {
T ... | java | public static <T> T withStreams(Socket socket, @ClosureParams(value=SimpleType.class, options={"java.io.InputStream","java.io.OutputStream"}) Closure<T> closure) throws IOException {
InputStream input = socket.getInputStream();
OutputStream output = socket.getOutputStream();
try {
T ... | [
"public",
"static",
"<",
"T",
">",
"T",
"withStreams",
"(",
"Socket",
"socket",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"{",
"\"java.io.InputStream\"",
",",
"\"java.io.OutputStream\"",
"}",
")",
"Closure",... | Passes the Socket's InputStream and OutputStream to the closure. The
streams will be closed after the closure returns, even if an exception
is thrown.
@param socket a Socket
@param closure a Closure
@return the value returned by the closure
@throws IOException if an IOException occurs.
@since 1.5.2 | [
"Passes",
"the",
"Socket",
"s",
"InputStream",
"and",
"OutputStream",
"to",
"the",
"closure",
".",
"The",
"streams",
"will",
"be",
"closed",
"after",
"the",
"closure",
"returns",
"even",
"if",
"an",
"exception",
"is",
"thrown",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/SocketGroovyMethods.java#L61-L79 |
156,477 | groovy/groovy-core | src/main/org/codehaus/groovy/runtime/SocketGroovyMethods.java | SocketGroovyMethods.withObjectStreams | public static <T> T withObjectStreams(Socket socket, @ClosureParams(value=SimpleType.class, options={"java.io.ObjectInputStream","java.io.ObjectOutputStream"}) Closure<T> closure) throws IOException {
InputStream input = socket.getInputStream();
OutputStream output = socket.getOutputStream();
Ob... | java | public static <T> T withObjectStreams(Socket socket, @ClosureParams(value=SimpleType.class, options={"java.io.ObjectInputStream","java.io.ObjectOutputStream"}) Closure<T> closure) throws IOException {
InputStream input = socket.getInputStream();
OutputStream output = socket.getOutputStream();
Ob... | [
"public",
"static",
"<",
"T",
">",
"T",
"withObjectStreams",
"(",
"Socket",
"socket",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"{",
"\"java.io.ObjectInputStream\"",
",",
"\"java.io.ObjectOutputStream\"",
"}",
... | Creates an InputObjectStream and an OutputObjectStream from a Socket, and
passes them to the closure. The streams will be closed after the closure
returns, even if an exception is thrown.
@param socket this Socket
@param closure a Closure
@return the value returned by the closure
@throws IOException if an IOExceptio... | [
"Creates",
"an",
"InputObjectStream",
"and",
"an",
"OutputObjectStream",
"from",
"a",
"Socket",
"and",
"passes",
"them",
"to",
"the",
"closure",
".",
"The",
"streams",
"will",
"be",
"closed",
"after",
"the",
"closure",
"returns",
"even",
"if",
"an",
"exception... | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/SocketGroovyMethods.java#L92-L120 |
156,478 | groovy/groovy-core | src/main/org/codehaus/groovy/runtime/MethodKey.java | MethodKey.createCopy | public MethodKey createCopy() {
int size = getParameterCount();
Class[] paramTypes = new Class[size];
for (int i = 0; i < size; i++) {
paramTypes[i] = getParameterType(i);
}
return new DefaultMethodKey(sender, name, paramTypes, isCallToSuper);
} | java | public MethodKey createCopy() {
int size = getParameterCount();
Class[] paramTypes = new Class[size];
for (int i = 0; i < size; i++) {
paramTypes[i] = getParameterType(i);
}
return new DefaultMethodKey(sender, name, paramTypes, isCallToSuper);
} | [
"public",
"MethodKey",
"createCopy",
"(",
")",
"{",
"int",
"size",
"=",
"getParameterCount",
"(",
")",
";",
"Class",
"[",
"]",
"paramTypes",
"=",
"new",
"Class",
"[",
"size",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
... | Creates an immutable copy that we can cache. | [
"Creates",
"an",
"immutable",
"copy",
"that",
"we",
"can",
"cache",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/MethodKey.java#L49-L56 |
156,479 | groovy/groovy-core | src/main/org/codehaus/groovy/transform/trait/TraitComposer.java | TraitComposer.doExtendTraits | public static void doExtendTraits(final ClassNode cNode, final SourceUnit unit, final CompilationUnit cu) {
if (cNode.isInterface()) return;
boolean isItselfTrait = Traits.isTrait(cNode);
SuperCallTraitTransformer superCallTransformer = new SuperCallTraitTransformer(unit);
if (isItselfTr... | java | public static void doExtendTraits(final ClassNode cNode, final SourceUnit unit, final CompilationUnit cu) {
if (cNode.isInterface()) return;
boolean isItselfTrait = Traits.isTrait(cNode);
SuperCallTraitTransformer superCallTransformer = new SuperCallTraitTransformer(unit);
if (isItselfTr... | [
"public",
"static",
"void",
"doExtendTraits",
"(",
"final",
"ClassNode",
"cNode",
",",
"final",
"SourceUnit",
"unit",
",",
"final",
"CompilationUnit",
"cu",
")",
"{",
"if",
"(",
"cNode",
".",
"isInterface",
"(",
")",
")",
"return",
";",
"boolean",
"isItselfT... | Given a class node, if this class node implements a trait, then generate all the appropriate
code which delegates calls to the trait. It is safe to call this method on a class node which
does not implement a trait.
@param cNode a class node
@param unit the source unit | [
"Given",
"a",
"class",
"node",
"if",
"this",
"class",
"node",
"implements",
"a",
"trait",
"then",
"generate",
"all",
"the",
"appropriate",
"code",
"which",
"delegates",
"calls",
"to",
"the",
"trait",
".",
"It",
"is",
"safe",
"to",
"call",
"this",
"method",... | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java#L102-L122 |
156,480 | groovy/groovy-core | src/main/org/codehaus/groovy/control/ErrorCollector.java | ErrorCollector.getSyntaxError | public SyntaxException getSyntaxError(int index) {
SyntaxException exception = null;
Message message = getError(index);
if (message != null && message instanceof SyntaxErrorMessage) {
exception = ((SyntaxErrorMessage) message).getCause();
}
return exception;
} | java | public SyntaxException getSyntaxError(int index) {
SyntaxException exception = null;
Message message = getError(index);
if (message != null && message instanceof SyntaxErrorMessage) {
exception = ((SyntaxErrorMessage) message).getCause();
}
return exception;
} | [
"public",
"SyntaxException",
"getSyntaxError",
"(",
"int",
"index",
")",
"{",
"SyntaxException",
"exception",
"=",
"null",
";",
"Message",
"message",
"=",
"getError",
"(",
"index",
")",
";",
"if",
"(",
"message",
"!=",
"null",
"&&",
"message",
"instanceof",
... | Convenience routine to return the specified error's
underlying SyntaxException, or null if it isn't one. | [
"Convenience",
"routine",
"to",
"return",
"the",
"specified",
"error",
"s",
"underlying",
"SyntaxException",
"or",
"null",
"if",
"it",
"isn",
"t",
"one",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/control/ErrorCollector.java#L240-L248 |
156,481 | groovy/groovy-core | src/main/org/apache/commons/cli/GroovyInternalPosixParser.java | GroovyInternalPosixParser.gobble | private void gobble(Iterator iter)
{
if (eatTheRest)
{
while (iter.hasNext())
{
tokens.add(iter.next());
}
}
} | java | private void gobble(Iterator iter)
{
if (eatTheRest)
{
while (iter.hasNext())
{
tokens.add(iter.next());
}
}
} | [
"private",
"void",
"gobble",
"(",
"Iterator",
"iter",
")",
"{",
"if",
"(",
"eatTheRest",
")",
"{",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",
"tokens",
".",
"add",
"(",
"iter",
".",
"next",
"(",
")",
")",
";",
"}",
"}",
"}"
] | Adds the remaining tokens to the processed tokens list.
@param iter An iterator over the remaining tokens | [
"Adds",
"the",
"remaining",
"tokens",
"to",
"the",
"processed",
"tokens",
"list",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/apache/commons/cli/GroovyInternalPosixParser.java#L165-L174 |
156,482 | groovy/groovy-core | src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java | StaticTypeCheckingSupport.allParametersAndArgumentsMatch | public static int allParametersAndArgumentsMatch(Parameter[] params, ClassNode[] args) {
if (params==null) {
params = Parameter.EMPTY_ARRAY;
}
int dist = 0;
if (args.length<params.length) return -1;
// we already know the lengths are equal
for (int i = 0; i < ... | java | public static int allParametersAndArgumentsMatch(Parameter[] params, ClassNode[] args) {
if (params==null) {
params = Parameter.EMPTY_ARRAY;
}
int dist = 0;
if (args.length<params.length) return -1;
// we already know the lengths are equal
for (int i = 0; i < ... | [
"public",
"static",
"int",
"allParametersAndArgumentsMatch",
"(",
"Parameter",
"[",
"]",
"params",
",",
"ClassNode",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"params",
"==",
"null",
")",
"{",
"params",
"=",
"Parameter",
".",
"EMPTY_ARRAY",
";",
"}",
"int",
... | Checks that arguments and parameter types match.
@param params method parameters
@param args type arguments
@return -1 if arguments do not match, 0 if arguments are of the exact type and >0 when one or more argument is
not of the exact type but still match | [
"Checks",
"that",
"arguments",
"and",
"parameter",
"types",
"match",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java#L216-L232 |
156,483 | groovy/groovy-core | src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java | StaticTypeCheckingSupport.excessArgumentsMatchesVargsParameter | static int excessArgumentsMatchesVargsParameter(Parameter[] params, ClassNode[] args) {
// we already know parameter length is bigger zero and last is a vargs
// the excess arguments are all put in an array for the vargs call
// so check against the component type
int dist = 0;
C... | java | static int excessArgumentsMatchesVargsParameter(Parameter[] params, ClassNode[] args) {
// we already know parameter length is bigger zero and last is a vargs
// the excess arguments are all put in an array for the vargs call
// so check against the component type
int dist = 0;
C... | [
"static",
"int",
"excessArgumentsMatchesVargsParameter",
"(",
"Parameter",
"[",
"]",
"params",
",",
"ClassNode",
"[",
"]",
"args",
")",
"{",
"// we already know parameter length is bigger zero and last is a vargs",
"// the excess arguments are all put in an array for the vargs call",... | Checks that excess arguments match the vararg signature parameter.
@param params
@param args
@return -1 if no match, 0 if all arguments matches the vararg type and >0 if one or more vararg argument is
assignable to the vararg type, but still not an exact match | [
"Checks",
"that",
"excess",
"arguments",
"match",
"the",
"vararg",
"signature",
"parameter",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java#L276-L287 |
156,484 | groovy/groovy-core | src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java | StaticTypeCheckingSupport.lastArgMatchesVarg | static int lastArgMatchesVarg(Parameter[] params, ClassNode... args) {
if (!isVargs(params)) return -1;
// case length ==0 handled already
// we have now two cases,
// the argument is wrapped in the vargs array or
// the argument is an array that can be used for the vargs part di... | java | static int lastArgMatchesVarg(Parameter[] params, ClassNode... args) {
if (!isVargs(params)) return -1;
// case length ==0 handled already
// we have now two cases,
// the argument is wrapped in the vargs array or
// the argument is an array that can be used for the vargs part di... | [
"static",
"int",
"lastArgMatchesVarg",
"(",
"Parameter",
"[",
"]",
"params",
",",
"ClassNode",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"isVargs",
"(",
"params",
")",
")",
"return",
"-",
"1",
";",
"// case length ==0 handled already",
"// we have now two cases,"... | Checks if the last argument matches the vararg type.
@param params
@param args
@return -1 if no match, 0 if the last argument is exactly the vararg type and 1 if of an assignable type | [
"Checks",
"if",
"the",
"last",
"argument",
"matches",
"the",
"vararg",
"type",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java#L295-L307 |
156,485 | groovy/groovy-core | src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java | StaticTypeCheckingSupport.buildParameter | private static Parameter buildParameter(final Map<String, GenericsType> genericFromReceiver, final Map<String, GenericsType> placeholdersFromContext, final Parameter methodParameter, final ClassNode paramType) {
if (genericFromReceiver.isEmpty() && (placeholdersFromContext==null||placeholdersFromContext.isEmpty... | java | private static Parameter buildParameter(final Map<String, GenericsType> genericFromReceiver, final Map<String, GenericsType> placeholdersFromContext, final Parameter methodParameter, final ClassNode paramType) {
if (genericFromReceiver.isEmpty() && (placeholdersFromContext==null||placeholdersFromContext.isEmpty... | [
"private",
"static",
"Parameter",
"buildParameter",
"(",
"final",
"Map",
"<",
"String",
",",
"GenericsType",
">",
"genericFromReceiver",
",",
"final",
"Map",
"<",
"String",
",",
"GenericsType",
">",
"placeholdersFromContext",
",",
"final",
"Parameter",
"methodParame... | Given a parameter, builds a new parameter for which the known generics placeholders are resolved.
@param genericFromReceiver resolved generics from the receiver of the message
@param placeholdersFromContext, resolved generics from the method context
@param methodParameter the method parameter for which we want to resol... | [
"Given",
"a",
"parameter",
"builds",
"a",
"new",
"parameter",
"for",
"which",
"the",
"known",
"generics",
"placeholders",
"are",
"resolved",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java#L1170-L1183 |
156,486 | groovy/groovy-core | src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java | StaticTypeCheckingSupport.isClassClassNodeWrappingConcreteType | public static boolean isClassClassNodeWrappingConcreteType(ClassNode classNode) {
GenericsType[] genericsTypes = classNode.getGenericsTypes();
return ClassHelper.CLASS_Type.equals(classNode)
&& classNode.isUsingGenerics()
&& genericsTypes!=null
&& !generic... | java | public static boolean isClassClassNodeWrappingConcreteType(ClassNode classNode) {
GenericsType[] genericsTypes = classNode.getGenericsTypes();
return ClassHelper.CLASS_Type.equals(classNode)
&& classNode.isUsingGenerics()
&& genericsTypes!=null
&& !generic... | [
"public",
"static",
"boolean",
"isClassClassNodeWrappingConcreteType",
"(",
"ClassNode",
"classNode",
")",
"{",
"GenericsType",
"[",
"]",
"genericsTypes",
"=",
"classNode",
".",
"getGenericsTypes",
"(",
")",
";",
"return",
"ClassHelper",
".",
"CLASS_Type",
".",
"equ... | Returns true if the class node represents a the class node for the Class class
and if the parametrized type is a neither a placeholder or a wildcard. For example,
the class node Class<Foo> where Foo is a class would return true, but the class
node for Class<?> would return false.
@param classNode a class no... | [
"Returns",
"true",
"if",
"the",
"class",
"node",
"represents",
"a",
"the",
"class",
"node",
"for",
"the",
"Class",
"class",
"and",
"if",
"the",
"parametrized",
"type",
"is",
"a",
"neither",
"a",
"placeholder",
"or",
"a",
"wildcard",
".",
"For",
"example",
... | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java#L2069-L2076 |
156,487 | groovy/groovy-core | src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.splitEachLine | public static <T> T splitEachLine(InputStream stream, String regex, String charset, @ClosureParams(value=FromString.class,options="List<String>") Closure<T> closure) throws IOException {
return splitEachLine(new BufferedReader(new InputStreamReader(stream, charset)), regex, closure);
} | java | public static <T> T splitEachLine(InputStream stream, String regex, String charset, @ClosureParams(value=FromString.class,options="List<String>") Closure<T> closure) throws IOException {
return splitEachLine(new BufferedReader(new InputStreamReader(stream, charset)), regex, closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"splitEachLine",
"(",
"InputStream",
"stream",
",",
"String",
"regex",
",",
"String",
"charset",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FromString",
".",
"class",
",",
"options",
"=",
"\"List<String>\"",
")",
... | Iterates through the given InputStream line by line using the specified
encoding, splitting each line using the given separator. The list of tokens
for each line is then passed to the given closure. Finally, the stream
is closed.
@param stream an InputStream
@param regex the delimiting regular expression
@param ch... | [
"Iterates",
"through",
"the",
"given",
"InputStream",
"line",
"by",
"line",
"using",
"the",
"specified",
"encoding",
"splitting",
"each",
"line",
"using",
"the",
"given",
"separator",
".",
"The",
"list",
"of",
"tokens",
"for",
"each",
"line",
"is",
"then",
"... | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java#L603-L605 |
156,488 | groovy/groovy-core | src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.transformChar | public static void transformChar(Reader self, Writer writer, @ClosureParams(value=SimpleType.class, options="java.lang.String") Closure closure) throws IOException {
int c;
try {
char[] chars = new char[1];
while ((c = self.read()) != -1) {
chars[0] = (char) c;
... | java | public static void transformChar(Reader self, Writer writer, @ClosureParams(value=SimpleType.class, options="java.lang.String") Closure closure) throws IOException {
int c;
try {
char[] chars = new char[1];
while ((c = self.read()) != -1) {
chars[0] = (char) c;
... | [
"public",
"static",
"void",
"transformChar",
"(",
"Reader",
"self",
",",
"Writer",
"writer",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.lang.String\"",
")",
"Closure",
"closure",
")",
"throws",
"IOExc... | Transforms each character from this reader by passing it to the given
closure. The Closure should return each transformed character, which
will be passed to the Writer. The reader and writer will be both be
closed before this method returns.
@param self a Reader object
@param writer a Writer to receive the trans... | [
"Transforms",
"each",
"character",
"from",
"this",
"reader",
"by",
"passing",
"it",
"to",
"the",
"given",
"closure",
".",
"The",
"Closure",
"should",
"return",
"each",
"transformed",
"character",
"which",
"will",
"be",
"passed",
"to",
"the",
"Writer",
".",
"... | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1398-L1418 |
156,489 | groovy/groovy-core | src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.withCloseable | public static <T, U extends Closeable> T withCloseable(U self, @ClosureParams(value=FirstParam.class) Closure<T> action) throws IOException {
try {
T result = action.call(self);
Closeable temp = self;
self = null;
temp.close();
return result;
... | java | public static <T, U extends Closeable> T withCloseable(U self, @ClosureParams(value=FirstParam.class) Closure<T> action) throws IOException {
try {
T result = action.call(self);
Closeable temp = self;
self = null;
temp.close();
return result;
... | [
"public",
"static",
"<",
"T",
",",
"U",
"extends",
"Closeable",
">",
"T",
"withCloseable",
"(",
"U",
"self",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FirstParam",
".",
"class",
")",
"Closure",
"<",
"T",
">",
"action",
")",
"throws",
"IOException",
... | Allows this closeable to be used within the closure, ensuring that it
is closed once the closure has been executed and before this method returns.
@param self the Closeable
@param action the closure taking the Closeable as parameter
@return the value returned by the closure
@throws IOException if an IOException occurs... | [
"Allows",
"this",
"closeable",
"to",
"be",
"used",
"within",
"the",
"closure",
"ensuring",
"that",
"it",
"is",
"closed",
"once",
"the",
"closure",
"has",
"been",
"executed",
"and",
"before",
"this",
"method",
"returns",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1620-L1632 |
156,490 | groovy/groovy-core | src/main/groovy/lang/MetaArrayLengthProperty.java | MetaArrayLengthProperty.getProperty | public Object getProperty(Object object) {
return java.lang.reflect.Array.getLength(object);
} | java | public Object getProperty(Object object) {
return java.lang.reflect.Array.getLength(object);
} | [
"public",
"Object",
"getProperty",
"(",
"Object",
"object",
")",
"{",
"return",
"java",
".",
"lang",
".",
"reflect",
".",
"Array",
".",
"getLength",
"(",
"object",
")",
";",
"}"
] | Get this property from the given object.
@param object an array
@return the length of the array object
@throws IllegalArgumentException if object is not an array | [
"Get",
"this",
"property",
"from",
"the",
"given",
"object",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/lang/MetaArrayLengthProperty.java#L43-L45 |
156,491 | groovy/groovy-core | src/main/org/codehaus/groovy/runtime/ProxyGeneratorAdapter.java | ProxyGeneratorAdapter.makeDelegateCall | protected MethodVisitor makeDelegateCall(final String name, final String desc, final String signature, final String[] exceptions, final int accessFlags) {
MethodVisitor mv = super.visitMethod(accessFlags, name, desc, signature, exceptions);
mv.visitVarInsn(ALOAD, 0); // load this
mv.visitFieldIn... | java | protected MethodVisitor makeDelegateCall(final String name, final String desc, final String signature, final String[] exceptions, final int accessFlags) {
MethodVisitor mv = super.visitMethod(accessFlags, name, desc, signature, exceptions);
mv.visitVarInsn(ALOAD, 0); // load this
mv.visitFieldIn... | [
"protected",
"MethodVisitor",
"makeDelegateCall",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"desc",
",",
"final",
"String",
"signature",
",",
"final",
"String",
"[",
"]",
"exceptions",
",",
"final",
"int",
"accessFlags",
")",
"{",
"MethodVisitor",
... | Generate a call to the delegate object. | [
"Generate",
"a",
"call",
"to",
"the",
"delegate",
"object",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/ProxyGeneratorAdapter.java#L708-L741 |
156,492 | groovy/groovy-core | src/main/org/codehaus/groovy/reflection/stdclasses/CachedSAMClass.java | CachedSAMClass.getSAMMethod | public static Method getSAMMethod(Class<?> c) {
// SAM = single public abstract method
// if the class is not abstract there is no abstract method
if (!Modifier.isAbstract(c.getModifiers())) return null;
if (c.isInterface()) {
Method[] methods = c.getMethods();
//... | java | public static Method getSAMMethod(Class<?> c) {
// SAM = single public abstract method
// if the class is not abstract there is no abstract method
if (!Modifier.isAbstract(c.getModifiers())) return null;
if (c.isInterface()) {
Method[] methods = c.getMethods();
//... | [
"public",
"static",
"Method",
"getSAMMethod",
"(",
"Class",
"<",
"?",
">",
"c",
")",
"{",
"// SAM = single public abstract method",
"// if the class is not abstract there is no abstract method",
"if",
"(",
"!",
"Modifier",
".",
"isAbstract",
"(",
"c",
".",
"getModifiers... | returns the abstract method from a SAM type, if it is a SAM type.
@param c the SAM class
@return null if nothing was found, the method otherwise | [
"returns",
"the",
"abstract",
"method",
"from",
"a",
"SAM",
"type",
"if",
"it",
"is",
"a",
"SAM",
"type",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/reflection/stdclasses/CachedSAMClass.java#L159-L195 |
156,493 | groovy/groovy-core | src/main/org/codehaus/groovy/classgen/asm/MopWriter.java | MopWriter.generateMopCalls | protected void generateMopCalls(LinkedList<MethodNode> mopCalls, boolean useThis) {
for (MethodNode method : mopCalls) {
String name = getMopMethodName(method, useThis);
Parameter[] parameters = method.getParameters();
String methodDescriptor = BytecodeHelper.getMethodDescrip... | java | protected void generateMopCalls(LinkedList<MethodNode> mopCalls, boolean useThis) {
for (MethodNode method : mopCalls) {
String name = getMopMethodName(method, useThis);
Parameter[] parameters = method.getParameters();
String methodDescriptor = BytecodeHelper.getMethodDescrip... | [
"protected",
"void",
"generateMopCalls",
"(",
"LinkedList",
"<",
"MethodNode",
">",
"mopCalls",
",",
"boolean",
"useThis",
")",
"{",
"for",
"(",
"MethodNode",
"method",
":",
"mopCalls",
")",
"{",
"String",
"name",
"=",
"getMopMethodName",
"(",
"method",
",",
... | generates a Meta Object Protocol method, that is used to call a non public
method, or to make a call to super.
@param mopCalls list of methods a mop call method should be generated for
@param useThis true if "this" should be used for the naming | [
"generates",
"a",
"Meta",
"Object",
"Protocol",
"method",
"that",
"is",
"used",
"to",
"call",
"a",
"non",
"public",
"method",
"or",
"to",
"make",
"a",
"call",
"to",
"super",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/classgen/asm/MopWriter.java#L174-L202 |
156,494 | groovy/groovy-core | src/main/org/codehaus/groovy/ast/ClassHelper.java | ClassHelper.getWrapper | public static ClassNode getWrapper(ClassNode cn) {
cn = cn.redirect();
if (!isPrimitiveType(cn)) return cn;
if (cn==boolean_TYPE) {
return Boolean_TYPE;
} else if (cn==byte_TYPE) {
return Byte_TYPE;
} else if (cn==char_TYPE) {
return Character_... | java | public static ClassNode getWrapper(ClassNode cn) {
cn = cn.redirect();
if (!isPrimitiveType(cn)) return cn;
if (cn==boolean_TYPE) {
return Boolean_TYPE;
} else if (cn==byte_TYPE) {
return Byte_TYPE;
} else if (cn==char_TYPE) {
return Character_... | [
"public",
"static",
"ClassNode",
"getWrapper",
"(",
"ClassNode",
"cn",
")",
"{",
"cn",
"=",
"cn",
".",
"redirect",
"(",
")",
";",
"if",
"(",
"!",
"isPrimitiveType",
"(",
"cn",
")",
")",
"return",
"cn",
";",
"if",
"(",
"cn",
"==",
"boolean_TYPE",
")",... | Creates a ClassNode containing the wrapper of a ClassNode
of primitive type. Any ClassNode representing a primitive
type should be created using the predefined types used in
class. The method will check the parameter for known
references of ClassNode representing a primitive type. If
Reference is found, then a ClassNod... | [
"Creates",
"a",
"ClassNode",
"containing",
"the",
"wrapper",
"of",
"a",
"ClassNode",
"of",
"primitive",
"type",
".",
"Any",
"ClassNode",
"representing",
"a",
"primitive",
"type",
"should",
"be",
"created",
"using",
"the",
"predefined",
"types",
"used",
"in",
"... | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/ast/ClassHelper.java#L257-L282 |
156,495 | groovy/groovy-core | src/main/org/codehaus/groovy/ast/ClassHelper.java | ClassHelper.findSAM | public static MethodNode findSAM(ClassNode type) {
if (!Modifier.isAbstract(type.getModifiers())) return null;
if (type.isInterface()) {
List<MethodNode> methods = type.getMethods();
MethodNode found=null;
for (MethodNode mi : methods) {
// ignore meth... | java | public static MethodNode findSAM(ClassNode type) {
if (!Modifier.isAbstract(type.getModifiers())) return null;
if (type.isInterface()) {
List<MethodNode> methods = type.getMethods();
MethodNode found=null;
for (MethodNode mi : methods) {
// ignore meth... | [
"public",
"static",
"MethodNode",
"findSAM",
"(",
"ClassNode",
"type",
")",
"{",
"if",
"(",
"!",
"Modifier",
".",
"isAbstract",
"(",
"type",
".",
"getModifiers",
"(",
")",
")",
")",
"return",
"null",
";",
"if",
"(",
"type",
".",
"isInterface",
"(",
")"... | Returns the single abstract method of a class node, if it is a SAM type, or null otherwise.
@param type a type for which to search for a single abstract method
@return the method node if type is a SAM type, null otherwise | [
"Returns",
"the",
"single",
"abstract",
"method",
"of",
"a",
"class",
"node",
"if",
"it",
"is",
"a",
"SAM",
"type",
"or",
"null",
"otherwise",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/ast/ClassHelper.java#L395-L428 |
156,496 | groovy/groovy-core | src/main/org/codehaus/groovy/syntax/Types.java | Types.getPrecedence | public static int getPrecedence( int type, boolean throwIfInvalid ) {
switch( type ) {
case LEFT_PARENTHESIS:
return 0;
case EQUAL:
case PLUS_EQUAL:
case MINUS_EQUAL:
case MULTIPLY_EQUAL:
case DIVIDE_EQUAL:
ca... | java | public static int getPrecedence( int type, boolean throwIfInvalid ) {
switch( type ) {
case LEFT_PARENTHESIS:
return 0;
case EQUAL:
case PLUS_EQUAL:
case MINUS_EQUAL:
case MULTIPLY_EQUAL:
case DIVIDE_EQUAL:
ca... | [
"public",
"static",
"int",
"getPrecedence",
"(",
"int",
"type",
",",
"boolean",
"throwIfInvalid",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"LEFT_PARENTHESIS",
":",
"return",
"0",
";",
"case",
"EQUAL",
":",
"case",
"PLUS_EQUAL",
":",
"case",
"MINU... | Returns the precedence of the specified operator. Non-operator's will
receive -1 or a GroovyBugError, depending on your preference. | [
"Returns",
"the",
"precedence",
"of",
"the",
"specified",
"operator",
".",
"Non",
"-",
"operator",
"s",
"will",
"receive",
"-",
"1",
"or",
"a",
"GroovyBugError",
"depending",
"on",
"your",
"preference",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/syntax/Types.java#L976-L1089 |
156,497 | groovy/groovy-core | src/main/org/codehaus/groovy/runtime/NullObject.java | NullObject.with | public <T> T with( Closure<T> closure ) {
return DefaultGroovyMethods.with( null, closure ) ;
} | java | public <T> T with( Closure<T> closure ) {
return DefaultGroovyMethods.with( null, closure ) ;
} | [
"public",
"<",
"T",
">",
"T",
"with",
"(",
"Closure",
"<",
"T",
">",
"closure",
")",
"{",
"return",
"DefaultGroovyMethods",
".",
"with",
"(",
"null",
",",
"closure",
")",
";",
"}"
] | Allows the closure to be called for NullObject
@param closure the closure to call on the object
@return result of calling the closure | [
"Allows",
"the",
"closure",
"to",
"be",
"called",
"for",
"NullObject"
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/NullObject.java#L69-L71 |
156,498 | groovy/groovy-core | src/examples/org/codehaus/groovy/grails/compiler/injection/DefaultGrailsDomainClassInjector.java | DefaultGrailsDomainClassInjector.implementsMethod | private static boolean implementsMethod(ClassNode classNode, String methodName, Class[] argTypes) {
List methods = classNode.getMethods();
if (argTypes == null || argTypes.length ==0) {
for (Iterator i = methods.iterator(); i.hasNext();) {
MethodNode mn = (MethodNode) i.n... | java | private static boolean implementsMethod(ClassNode classNode, String methodName, Class[] argTypes) {
List methods = classNode.getMethods();
if (argTypes == null || argTypes.length ==0) {
for (Iterator i = methods.iterator(); i.hasNext();) {
MethodNode mn = (MethodNode) i.n... | [
"private",
"static",
"boolean",
"implementsMethod",
"(",
"ClassNode",
"classNode",
",",
"String",
"methodName",
",",
"Class",
"[",
"]",
"argTypes",
")",
"{",
"List",
"methods",
"=",
"classNode",
".",
"getMethods",
"(",
")",
";",
"if",
"(",
"argTypes",
"==",
... | Tests whether the ClassNode implements the specified method name
@param classNode The ClassNode
@param methodName The method name
@param argTypes
@return True if it implements the method | [
"Tests",
"whether",
"the",
"ClassNode",
"implements",
"the",
"specified",
"method",
"name"
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/examples/org/codehaus/groovy/grails/compiler/injection/DefaultGrailsDomainClassInjector.java#L243-L254 |
156,499 | groovy/groovy-core | src/main/org/codehaus/groovy/ast/MethodNode.java | MethodNode.getTypeDescriptor | public String getTypeDescriptor() {
if (typeDescriptor == null) {
StringBuilder buf = new StringBuilder(name.length() + parameters.length * 10);
buf.append(returnType.getName());
buf.append(' ');
buf.append(name);
buf.append('(');
for (int ... | java | public String getTypeDescriptor() {
if (typeDescriptor == null) {
StringBuilder buf = new StringBuilder(name.length() + parameters.length * 10);
buf.append(returnType.getName());
buf.append(' ');
buf.append(name);
buf.append('(');
for (int ... | [
"public",
"String",
"getTypeDescriptor",
"(",
")",
"{",
"if",
"(",
"typeDescriptor",
"==",
"null",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"name",
".",
"length",
"(",
")",
"+",
"parameters",
".",
"length",
"*",
"10",
")",
";",... | The type descriptor for a method node is a string containing the name of the method, its return type,
and its parameter types in a canonical form. For simplicity, I'm using the format of a Java declaration
without parameter names.
@return the type descriptor | [
"The",
"type",
"descriptor",
"for",
"a",
"method",
"node",
"is",
"a",
"string",
"containing",
"the",
"name",
"of",
"the",
"method",
"its",
"return",
"type",
"and",
"its",
"parameter",
"types",
"in",
"a",
"canonical",
"form",
".",
"For",
"simplicity",
"I",
... | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/ast/MethodNode.java#L76-L94 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.