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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
12,500 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-datastore/src/main/java/com/google/cloud/datastore/KeyFactory.java | KeyFactory.reset | public KeyFactory reset() {
setProjectId(pi);
setNamespace(ns);
kind = null;
ancestors.clear();
return this;
} | java | public KeyFactory reset() {
setProjectId(pi);
setNamespace(ns);
kind = null;
ancestors.clear();
return this;
} | [
"public",
"KeyFactory",
"reset",
"(",
")",
"{",
"setProjectId",
"(",
"pi",
")",
";",
"setNamespace",
"(",
"ns",
")",
";",
"kind",
"=",
"null",
";",
"ancestors",
".",
"clear",
"(",
")",
";",
"return",
"this",
";",
"}"
] | Resets the KeyFactory to its initial state.
@return {@code this} for chaining | [
"Resets",
"the",
"KeyFactory",
"to",
"its",
"initial",
"state",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-datastore/src/main/java/com/google/cloud/datastore/KeyFactory.java#L70-L76 |
12,501 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/Cors.java | Cors.toBuilder | public Builder toBuilder() {
return newBuilder()
.setMaxAgeSeconds(maxAgeSeconds)
.setMethods(methods)
.setOrigins(origins)
.setResponseHeaders(responseHeaders);
} | java | public Builder toBuilder() {
return newBuilder()
.setMaxAgeSeconds(maxAgeSeconds)
.setMethods(methods)
.setOrigins(origins)
.setResponseHeaders(responseHeaders);
} | [
"public",
"Builder",
"toBuilder",
"(",
")",
"{",
"return",
"newBuilder",
"(",
")",
".",
"setMaxAgeSeconds",
"(",
"maxAgeSeconds",
")",
".",
"setMethods",
"(",
"methods",
")",
".",
"setOrigins",
"(",
"origins",
")",
".",
"setResponseHeaders",
"(",
"responseHead... | Returns a builder for this CORS configuration. | [
"Returns",
"a",
"builder",
"for",
"this",
"CORS",
"configuration",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/Cors.java#L196-L202 |
12,502 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java | BackendBucketClient.deleteSignedUrlKeyBackendBucket | @BetaApi
public final Operation deleteSignedUrlKeyBackendBucket(
ProjectGlobalBackendBucketName backendBucket, String keyName) {
DeleteSignedUrlKeyBackendBucketHttpRequest request =
DeleteSignedUrlKeyBackendBucketHttpRequest.newBuilder()
.setBackendBucket(backendBucket == null ? null : ... | java | @BetaApi
public final Operation deleteSignedUrlKeyBackendBucket(
ProjectGlobalBackendBucketName backendBucket, String keyName) {
DeleteSignedUrlKeyBackendBucketHttpRequest request =
DeleteSignedUrlKeyBackendBucketHttpRequest.newBuilder()
.setBackendBucket(backendBucket == null ? null : ... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"deleteSignedUrlKeyBackendBucket",
"(",
"ProjectGlobalBackendBucketName",
"backendBucket",
",",
"String",
"keyName",
")",
"{",
"DeleteSignedUrlKeyBackendBucketHttpRequest",
"request",
"=",
"DeleteSignedUrlKeyBackendBucketHttpRequest",... | Deletes a key for validating requests with signed URLs for this backend bucket.
<p>Sample code:
<pre><code>
try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
String keyName =... | [
"Deletes",
"a",
"key",
"for",
"validating",
"requests",
"with",
"signed",
"URLs",
"for",
"this",
"backend",
"bucket",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java#L391-L401 |
12,503 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java | BackendBucketClient.updateBackendBucket | @BetaApi
public final Operation updateBackendBucket(
String backendBucket, BackendBucket backendBucketResource, List<String> fieldMask) {
UpdateBackendBucketHttpRequest request =
UpdateBackendBucketHttpRequest.newBuilder()
.setBackendBucket(backendBucket)
.setBackendBucketRe... | java | @BetaApi
public final Operation updateBackendBucket(
String backendBucket, BackendBucket backendBucketResource, List<String> fieldMask) {
UpdateBackendBucketHttpRequest request =
UpdateBackendBucketHttpRequest.newBuilder()
.setBackendBucket(backendBucket)
.setBackendBucketRe... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"updateBackendBucket",
"(",
"String",
"backendBucket",
",",
"BackendBucket",
"backendBucketResource",
",",
"List",
"<",
"String",
">",
"fieldMask",
")",
"{",
"UpdateBackendBucketHttpRequest",
"request",
"=",
"UpdateBackend... | Updates the specified BackendBucket resource with the data included in the request.
<p>Sample code:
<pre><code>
try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
BackendBucke... | [
"Updates",
"the",
"specified",
"BackendBucket",
"resource",
"with",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java#L1042-L1053 |
12,504 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java | Table.list | public TableResult list(Schema schema, TableDataListOption... options) throws BigQueryException {
return bigquery.listTableData(getTableId(), schema, options);
} | java | public TableResult list(Schema schema, TableDataListOption... options) throws BigQueryException {
return bigquery.listTableData(getTableId(), schema, options);
} | [
"public",
"TableResult",
"list",
"(",
"Schema",
"schema",
",",
"TableDataListOption",
"...",
"options",
")",
"throws",
"BigQueryException",
"{",
"return",
"bigquery",
".",
"listTableData",
"(",
"getTableId",
"(",
")",
",",
"schema",
",",
"options",
")",
";",
"... | Returns the paginated list rows in this table.
<p>Example of listing rows in the table given a schema.
<pre>{@code
Schema schema = ...;
String field = "my_field";
Page<FieldValueList> page = table.list(schema);
for (FieldValueList row : page.iterateAll()) {
row.get(field);
}
}</pre>
@param options table data list op... | [
"Returns",
"the",
"paginated",
"list",
"rows",
"in",
"this",
"table",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java#L369-L371 |
12,505 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/Role.java | Role.of | public static Role of(String value) {
checkNotNull(value);
if (!value.contains("/")) {
value = ROLE_PREFIX + value;
}
return new Role(value);
} | java | public static Role of(String value) {
checkNotNull(value);
if (!value.contains("/")) {
value = ROLE_PREFIX + value;
}
return new Role(value);
} | [
"public",
"static",
"Role",
"of",
"(",
"String",
"value",
")",
"{",
"checkNotNull",
"(",
"value",
")",
";",
"if",
"(",
"!",
"value",
".",
"contains",
"(",
"\"/\"",
")",
")",
"{",
"value",
"=",
"ROLE_PREFIX",
"+",
"value",
";",
"}",
"return",
"new",
... | Returns a new role given its string value.
<p>If the value contains no slash character ({@code '/'}), the prefix {@code "roles/""} is
prepended. This slightly simplifies usage for <a
href="https://cloud.google.com/iam/docs/understanding-roles">predefined roles</a>. For <a
href="https://cloud.google.com/iam/docs/creati... | [
"Returns",
"a",
"new",
"role",
"given",
"its",
"string",
"value",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/Role.java#L94-L100 |
12,506 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisClient.java | CloudRedisClient.createInstanceAsync | @BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<Instance, OperationMetadata> createInstanceAsync(
LocationName parent, String instanceId, Instance instance) {
CreateInstanceRequest request =
CreateInstanceReques... | java | @BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<Instance, OperationMetadata> createInstanceAsync(
LocationName parent, String instanceId, Instance instance) {
CreateInstanceRequest request =
CreateInstanceReques... | [
"@",
"BetaApi",
"(",
"\"The surface for long-running operations is not stable yet and may change in the future.\"",
")",
"public",
"final",
"OperationFuture",
"<",
"Instance",
",",
"OperationMetadata",
">",
"createInstanceAsync",
"(",
"LocationName",
"parent",
",",
"String",
"i... | Creates a Redis instance based on the specified tier and memory size.
<p>By default, the instance is accessible from the project's [default
network](/compute/docs/networks-and-firewalls#networks).
<p>The creation is executed asynchronously and callers may check the returned operation to
track its progress. Once the o... | [
"Creates",
"a",
"Redis",
"instance",
"based",
"on",
"the",
"specified",
"tier",
"and",
"memory",
"size",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisClient.java#L487-L499 |
12,507 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java | ZoneOperationId.of | public static ZoneOperationId of(ZoneId zoneId, String operation) {
return new ZoneOperationId(zoneId.getProject(), zoneId.getZone(), operation);
} | java | public static ZoneOperationId of(ZoneId zoneId, String operation) {
return new ZoneOperationId(zoneId.getProject(), zoneId.getZone(), operation);
} | [
"public",
"static",
"ZoneOperationId",
"of",
"(",
"ZoneId",
"zoneId",
",",
"String",
"operation",
")",
"{",
"return",
"new",
"ZoneOperationId",
"(",
"zoneId",
".",
"getProject",
"(",
")",
",",
"zoneId",
".",
"getZone",
"(",
")",
",",
"operation",
")",
";",... | Returns a zone operation identity given the zone identity and the operation name. | [
"Returns",
"a",
"zone",
"operation",
"identity",
"given",
"the",
"zone",
"identity",
"and",
"the",
"operation",
"name",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java#L91-L93 |
12,508 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java | ZoneOperationId.of | public static ZoneOperationId of(String zone, String operation) {
return new ZoneOperationId(null, zone, operation);
} | java | public static ZoneOperationId of(String zone, String operation) {
return new ZoneOperationId(null, zone, operation);
} | [
"public",
"static",
"ZoneOperationId",
"of",
"(",
"String",
"zone",
",",
"String",
"operation",
")",
"{",
"return",
"new",
"ZoneOperationId",
"(",
"null",
",",
"zone",
",",
"operation",
")",
";",
"}"
] | Returns a zone operation identity given the zone and operation names. | [
"Returns",
"a",
"zone",
"operation",
"identity",
"given",
"the",
"zone",
"and",
"operation",
"names",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java#L96-L98 |
12,509 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java | ZoneOperationId.of | public static ZoneOperationId of(String project, String zone, String operation) {
return new ZoneOperationId(project, zone, operation);
} | java | public static ZoneOperationId of(String project, String zone, String operation) {
return new ZoneOperationId(project, zone, operation);
} | [
"public",
"static",
"ZoneOperationId",
"of",
"(",
"String",
"project",
",",
"String",
"zone",
",",
"String",
"operation",
")",
"{",
"return",
"new",
"ZoneOperationId",
"(",
"project",
",",
"zone",
",",
"operation",
")",
";",
"}"
] | Returns a zone operation identity given project, zone and operation names. | [
"Returns",
"a",
"zone",
"operation",
"identity",
"given",
"project",
"zone",
"and",
"operation",
"names",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java#L101-L103 |
12,510 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-iot/src/main/java/com/google/cloud/iot/v1/DeviceManagerClient.java | DeviceManagerClient.updateDeviceRegistry | public final DeviceRegistry updateDeviceRegistry(
DeviceRegistry deviceRegistry, FieldMask updateMask) {
UpdateDeviceRegistryRequest request =
UpdateDeviceRegistryRequest.newBuilder()
.setDeviceRegistry(deviceRegistry)
.setUpdateMask(updateMask)
.build();
retur... | java | public final DeviceRegistry updateDeviceRegistry(
DeviceRegistry deviceRegistry, FieldMask updateMask) {
UpdateDeviceRegistryRequest request =
UpdateDeviceRegistryRequest.newBuilder()
.setDeviceRegistry(deviceRegistry)
.setUpdateMask(updateMask)
.build();
retur... | [
"public",
"final",
"DeviceRegistry",
"updateDeviceRegistry",
"(",
"DeviceRegistry",
"deviceRegistry",
",",
"FieldMask",
"updateMask",
")",
"{",
"UpdateDeviceRegistryRequest",
"request",
"=",
"UpdateDeviceRegistryRequest",
".",
"newBuilder",
"(",
")",
".",
"setDeviceRegistry... | Updates a device registry configuration.
<p>Sample code:
<pre><code>
try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
DeviceRegistry deviceRegistry = DeviceRegistry.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
DeviceRegistry response = deviceManagerClient.... | [
"Updates",
"a",
"device",
"registry",
"configuration",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-iot/src/main/java/com/google/cloud/iot/v1/DeviceManagerClient.java#L393-L402 |
12,511 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-iot/src/main/java/com/google/cloud/iot/v1/DeviceManagerClient.java | DeviceManagerClient.updateDevice | public final Device updateDevice(Device device, FieldMask updateMask) {
UpdateDeviceRequest request =
UpdateDeviceRequest.newBuilder().setDevice(device).setUpdateMask(updateMask).build();
return updateDevice(request);
} | java | public final Device updateDevice(Device device, FieldMask updateMask) {
UpdateDeviceRequest request =
UpdateDeviceRequest.newBuilder().setDevice(device).setUpdateMask(updateMask).build();
return updateDevice(request);
} | [
"public",
"final",
"Device",
"updateDevice",
"(",
"Device",
"device",
",",
"FieldMask",
"updateMask",
")",
"{",
"UpdateDeviceRequest",
"request",
"=",
"UpdateDeviceRequest",
".",
"newBuilder",
"(",
")",
".",
"setDevice",
"(",
"device",
")",
".",
"setUpdateMask",
... | Updates a device.
<p>Sample code:
<pre><code>
try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
Device device = Device.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Device response = deviceManagerClient.updateDevice(device, updateMask);
}
</code></pre>
@par... | [
"Updates",
"a",
"device",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-iot/src/main/java/com/google/cloud/iot/v1/DeviceManagerClient.java#L907-L912 |
12,512 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-iot/src/main/java/com/google/cloud/iot/v1/DeviceManagerClient.java | DeviceManagerClient.bindDeviceToGateway | public final BindDeviceToGatewayResponse bindDeviceToGateway(
String parent, String gatewayId, String deviceId) {
BindDeviceToGatewayRequest request =
BindDeviceToGatewayRequest.newBuilder()
.setParent(parent)
.setGatewayId(gatewayId)
.setDeviceId(deviceId)
... | java | public final BindDeviceToGatewayResponse bindDeviceToGateway(
String parent, String gatewayId, String deviceId) {
BindDeviceToGatewayRequest request =
BindDeviceToGatewayRequest.newBuilder()
.setParent(parent)
.setGatewayId(gatewayId)
.setDeviceId(deviceId)
... | [
"public",
"final",
"BindDeviceToGatewayResponse",
"bindDeviceToGateway",
"(",
"String",
"parent",
",",
"String",
"gatewayId",
",",
"String",
"deviceId",
")",
"{",
"BindDeviceToGatewayRequest",
"request",
"=",
"BindDeviceToGatewayRequest",
".",
"newBuilder",
"(",
")",
".... | Associates the device with the gateway.
<p>Sample code:
<pre><code>
try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
RegistryName parent = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");
String gatewayId = "";
String deviceId = "";
BindDeviceToGatewayResponse response = deviceM... | [
"Associates",
"the",
"device",
"with",
"the",
"gateway",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-iot/src/main/java/com/google/cloud/iot/v1/DeviceManagerClient.java#L2051-L2061 |
12,513 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-iot/src/main/java/com/google/cloud/iot/v1/DeviceManagerClient.java | DeviceManagerClient.unbindDeviceFromGateway | public final UnbindDeviceFromGatewayResponse unbindDeviceFromGateway(
RegistryName parent, String gatewayId, String deviceId) {
UnbindDeviceFromGatewayRequest request =
UnbindDeviceFromGatewayRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setGatewa... | java | public final UnbindDeviceFromGatewayResponse unbindDeviceFromGateway(
RegistryName parent, String gatewayId, String deviceId) {
UnbindDeviceFromGatewayRequest request =
UnbindDeviceFromGatewayRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setGatewa... | [
"public",
"final",
"UnbindDeviceFromGatewayResponse",
"unbindDeviceFromGateway",
"(",
"RegistryName",
"parent",
",",
"String",
"gatewayId",
",",
"String",
"deviceId",
")",
"{",
"UnbindDeviceFromGatewayRequest",
"request",
"=",
"UnbindDeviceFromGatewayRequest",
".",
"newBuilde... | Deletes the association between the device and the gateway.
<p>Sample code:
<pre><code>
try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
RegistryName parent = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");
String gatewayId = "";
String deviceId = "";
UnbindDeviceFromGatewayRes... | [
"Deletes",
"the",
"association",
"between",
"the",
"device",
"and",
"the",
"gateway",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-iot/src/main/java/com/google/cloud/iot/v1/DeviceManagerClient.java#L2140-L2150 |
12,514 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java | SessionPool.releaseSession | private void releaseSession(PooledSession session) {
Preconditions.checkNotNull(session);
synchronized (lock) {
if (closureFuture != null) {
return;
}
if (readWaiters.size() == 0 && numSessionsBeingPrepared >= readWriteWaiters.size()) {
// No pending waiters
if (shouldP... | java | private void releaseSession(PooledSession session) {
Preconditions.checkNotNull(session);
synchronized (lock) {
if (closureFuture != null) {
return;
}
if (readWaiters.size() == 0 && numSessionsBeingPrepared >= readWriteWaiters.size()) {
// No pending waiters
if (shouldP... | [
"private",
"void",
"releaseSession",
"(",
"PooledSession",
"session",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"session",
")",
";",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"closureFuture",
"!=",
"null",
")",
"{",
"return",
";",
"}",
"... | Releases a session back to the pool. This might cause one of the waiters to be unblocked.
<p>Implementation note:
<ol>
<li>If there are no pending waiters, either add to the read sessions queue or start preparing
for write depending on what fraction of sessions are already prepared for writes.
<li>Otherwise either un... | [
"Releases",
"a",
"session",
"back",
"to",
"the",
"pool",
".",
"This",
"might",
"cause",
"one",
"of",
"the",
"waiters",
"to",
"be",
"unblocked",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java#L968-L987 |
12,515 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java | UptimeCheckServiceClient.listUptimeCheckConfigs | public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(String parent) {
ListUptimeCheckConfigsRequest request =
ListUptimeCheckConfigsRequest.newBuilder().setParent(parent).build();
return listUptimeCheckConfigs(request);
} | java | public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(String parent) {
ListUptimeCheckConfigsRequest request =
ListUptimeCheckConfigsRequest.newBuilder().setParent(parent).build();
return listUptimeCheckConfigs(request);
} | [
"public",
"final",
"ListUptimeCheckConfigsPagedResponse",
"listUptimeCheckConfigs",
"(",
"String",
"parent",
")",
"{",
"ListUptimeCheckConfigsRequest",
"request",
"=",
"ListUptimeCheckConfigsRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
")",
".",... | Lists the existing valid uptime check configurations for the project, leaving out any invalid
configurations.
<p>Sample code:
<pre><code>
try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
String formattedParent = ProjectName.format("[PROJECT]");
for (UptimeCheckConfig eleme... | [
"Lists",
"the",
"existing",
"valid",
"uptime",
"check",
"configurations",
"for",
"the",
"project",
"leaving",
"out",
"any",
"invalid",
"configurations",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java#L193-L197 |
12,516 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java | UptimeCheckServiceClient.createUptimeCheckConfig | public final UptimeCheckConfig createUptimeCheckConfig(
String parent, UptimeCheckConfig uptimeCheckConfig) {
CreateUptimeCheckConfigRequest request =
CreateUptimeCheckConfigRequest.newBuilder()
.setParent(parent)
.setUptimeCheckConfig(uptimeCheckConfig)
.build();
... | java | public final UptimeCheckConfig createUptimeCheckConfig(
String parent, UptimeCheckConfig uptimeCheckConfig) {
CreateUptimeCheckConfigRequest request =
CreateUptimeCheckConfigRequest.newBuilder()
.setParent(parent)
.setUptimeCheckConfig(uptimeCheckConfig)
.build();
... | [
"public",
"final",
"UptimeCheckConfig",
"createUptimeCheckConfig",
"(",
"String",
"parent",
",",
"UptimeCheckConfig",
"uptimeCheckConfig",
")",
"{",
"CreateUptimeCheckConfigRequest",
"request",
"=",
"CreateUptimeCheckConfigRequest",
".",
"newBuilder",
"(",
")",
".",
"setPar... | Creates a new uptime check configuration.
<p>Sample code:
<pre><code>
try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
String formattedParent = ProjectName.format("[PROJECT]");
UptimeCheckConfig uptimeCheckConfig = UptimeCheckConfig.newBuilder().build();
UptimeCheckConfig ... | [
"Creates",
"a",
"new",
"uptime",
"check",
"configuration",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java#L400-L409 |
12,517 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java | UptimeCheckServiceClient.updateUptimeCheckConfig | public final UptimeCheckConfig updateUptimeCheckConfig(UptimeCheckConfig uptimeCheckConfig) {
UpdateUptimeCheckConfigRequest request =
UpdateUptimeCheckConfigRequest.newBuilder().setUptimeCheckConfig(uptimeCheckConfig).build();
return updateUptimeCheckConfig(request);
} | java | public final UptimeCheckConfig updateUptimeCheckConfig(UptimeCheckConfig uptimeCheckConfig) {
UpdateUptimeCheckConfigRequest request =
UpdateUptimeCheckConfigRequest.newBuilder().setUptimeCheckConfig(uptimeCheckConfig).build();
return updateUptimeCheckConfig(request);
} | [
"public",
"final",
"UptimeCheckConfig",
"updateUptimeCheckConfig",
"(",
"UptimeCheckConfig",
"uptimeCheckConfig",
")",
"{",
"UpdateUptimeCheckConfigRequest",
"request",
"=",
"UpdateUptimeCheckConfigRequest",
".",
"newBuilder",
"(",
")",
".",
"setUptimeCheckConfig",
"(",
"upti... | Updates an uptime check configuration. You can either replace the entire configuration with a
new one or replace only certain fields in the current configuration by specifying the fields to
be updated via `"updateMask"`. Returns the updated configuration.
<p>Sample code:
<pre><code>
try (UptimeCheckServiceClient upti... | [
"Updates",
"an",
"uptime",
"check",
"configuration",
".",
"You",
"can",
"either",
"replace",
"the",
"entire",
"configuration",
"with",
"a",
"new",
"one",
"or",
"replace",
"only",
"certain",
"fields",
"in",
"the",
"current",
"configuration",
"by",
"specifying",
... | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java#L486-L491 |
12,518 | googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/TopicAdminClientSnippets.java | TopicAdminClientSnippets.listTopics | public ListTopicsPagedResponse listTopics() throws Exception {
// [START pubsub_list_topics]
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
ListTopicsRequest listTopicsRequest =
ListTopicsRequest.newBuilder().setProject(ProjectName.format(projectId)).build();
ListTop... | java | public ListTopicsPagedResponse listTopics() throws Exception {
// [START pubsub_list_topics]
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
ListTopicsRequest listTopicsRequest =
ListTopicsRequest.newBuilder().setProject(ProjectName.format(projectId)).build();
ListTop... | [
"public",
"ListTopicsPagedResponse",
"listTopics",
"(",
")",
"throws",
"Exception",
"{",
"// [START pubsub_list_topics]",
"try",
"(",
"TopicAdminClient",
"topicAdminClient",
"=",
"TopicAdminClient",
".",
"create",
"(",
")",
")",
"{",
"ListTopicsRequest",
"listTopicsReques... | Example of listing topics. | [
"Example",
"of",
"listing",
"topics",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/TopicAdminClientSnippets.java#L63-L76 |
12,519 | googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/TopicAdminClientSnippets.java | TopicAdminClientSnippets.listTopicSubscriptions | public ListTopicSubscriptionsPagedResponse listTopicSubscriptions(String topicId)
throws Exception {
// [START pubsub_list_topic_subscriptions]
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
ProjectTopicName topicName = ProjectTopicName.of(projectId, topicId);
ListTopicS... | java | public ListTopicSubscriptionsPagedResponse listTopicSubscriptions(String topicId)
throws Exception {
// [START pubsub_list_topic_subscriptions]
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
ProjectTopicName topicName = ProjectTopicName.of(projectId, topicId);
ListTopicS... | [
"public",
"ListTopicSubscriptionsPagedResponse",
"listTopicSubscriptions",
"(",
"String",
"topicId",
")",
"throws",
"Exception",
"{",
"// [START pubsub_list_topic_subscriptions]",
"try",
"(",
"TopicAdminClient",
"topicAdminClient",
"=",
"TopicAdminClient",
".",
"create",
"(",
... | Example of listing subscriptions for a topic. | [
"Example",
"of",
"listing",
"subscriptions",
"for",
"a",
"topic",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/TopicAdminClientSnippets.java#L79-L95 |
12,520 | googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/TopicAdminClientSnippets.java | TopicAdminClientSnippets.deleteTopic | public ProjectTopicName deleteTopic(String topicId) throws Exception {
// [START pubsub_delete_topic]
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
ProjectTopicName topicName = ProjectTopicName.of(projectId, topicId);
topicAdminClient.deleteTopic(topicName);
return topi... | java | public ProjectTopicName deleteTopic(String topicId) throws Exception {
// [START pubsub_delete_topic]
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
ProjectTopicName topicName = ProjectTopicName.of(projectId, topicId);
topicAdminClient.deleteTopic(topicName);
return topi... | [
"public",
"ProjectTopicName",
"deleteTopic",
"(",
"String",
"topicId",
")",
"throws",
"Exception",
"{",
"// [START pubsub_delete_topic]",
"try",
"(",
"TopicAdminClient",
"topicAdminClient",
"=",
"TopicAdminClient",
".",
"create",
"(",
")",
")",
"{",
"ProjectTopicName",
... | Example of deleting a topic. | [
"Example",
"of",
"deleting",
"a",
"topic",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/TopicAdminClientSnippets.java#L98-L106 |
12,521 | googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/TopicAdminClientSnippets.java | TopicAdminClientSnippets.getTopicPolicy | public Policy getTopicPolicy(String topicId) throws Exception {
// [START pubsub_get_topic_policy]
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
ProjectTopicName topicName = ProjectTopicName.of(projectId, topicId);
Policy policy = topicAdminClient.getIamPolicy(topicName.toStr... | java | public Policy getTopicPolicy(String topicId) throws Exception {
// [START pubsub_get_topic_policy]
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
ProjectTopicName topicName = ProjectTopicName.of(projectId, topicId);
Policy policy = topicAdminClient.getIamPolicy(topicName.toStr... | [
"public",
"Policy",
"getTopicPolicy",
"(",
"String",
"topicId",
")",
"throws",
"Exception",
"{",
"// [START pubsub_get_topic_policy]",
"try",
"(",
"TopicAdminClient",
"topicAdminClient",
"=",
"TopicAdminClient",
".",
"create",
"(",
")",
")",
"{",
"ProjectTopicName",
"... | Example of getting a topic policy. | [
"Example",
"of",
"getting",
"a",
"topic",
"policy",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/TopicAdminClientSnippets.java#L109-L120 |
12,522 | googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/TopicAdminClientSnippets.java | TopicAdminClientSnippets.replaceTopicPolicy | public Policy replaceTopicPolicy(String topicId) throws Exception {
// [START pubsub_set_topic_policy]
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
String topicName = ProjectTopicName.format(projectId, topicId);
Policy policy = topicAdminClient.getIamPolicy(topicName);
... | java | public Policy replaceTopicPolicy(String topicId) throws Exception {
// [START pubsub_set_topic_policy]
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
String topicName = ProjectTopicName.format(projectId, topicId);
Policy policy = topicAdminClient.getIamPolicy(topicName);
... | [
"public",
"Policy",
"replaceTopicPolicy",
"(",
"String",
"topicId",
")",
"throws",
"Exception",
"{",
"// [START pubsub_set_topic_policy]",
"try",
"(",
"TopicAdminClient",
"topicAdminClient",
"=",
"TopicAdminClient",
".",
"create",
"(",
")",
")",
"{",
"String",
"topicN... | Example of replacing a topic policy. | [
"Example",
"of",
"replacing",
"a",
"topic",
"policy",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/TopicAdminClientSnippets.java#L123-L140 |
12,523 | googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/TopicAdminClientSnippets.java | TopicAdminClientSnippets.getTopic | public Topic getTopic(String topicId) throws Exception {
// [START pubsub_get_topic]
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
ProjectTopicName topicName = ProjectTopicName.of(projectId, topicId);
Topic topic = topicAdminClient.getTopic(topicName);
return topic;
... | java | public Topic getTopic(String topicId) throws Exception {
// [START pubsub_get_topic]
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
ProjectTopicName topicName = ProjectTopicName.of(projectId, topicId);
Topic topic = topicAdminClient.getTopic(topicName);
return topic;
... | [
"public",
"Topic",
"getTopic",
"(",
"String",
"topicId",
")",
"throws",
"Exception",
"{",
"// [START pubsub_get_topic]",
"try",
"(",
"TopicAdminClient",
"topicAdminClient",
"=",
"TopicAdminClient",
".",
"create",
"(",
")",
")",
"{",
"ProjectTopicName",
"topicName",
... | Example of getting a topic. | [
"Example",
"of",
"getting",
"a",
"topic",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/TopicAdminClientSnippets.java#L160-L168 |
12,524 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java | HttpsHealthCheckClient.updateHttpsHealthCheck | @BetaApi
public final Operation updateHttpsHealthCheck(
ProjectGlobalHttpsHealthCheckName httpsHealthCheck,
HttpsHealthCheck2 httpsHealthCheckResource,
List<String> fieldMask) {
UpdateHttpsHealthCheckHttpRequest request =
UpdateHttpsHealthCheckHttpRequest.newBuilder()
.setHt... | java | @BetaApi
public final Operation updateHttpsHealthCheck(
ProjectGlobalHttpsHealthCheckName httpsHealthCheck,
HttpsHealthCheck2 httpsHealthCheckResource,
List<String> fieldMask) {
UpdateHttpsHealthCheckHttpRequest request =
UpdateHttpsHealthCheckHttpRequest.newBuilder()
.setHt... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"updateHttpsHealthCheck",
"(",
"ProjectGlobalHttpsHealthCheckName",
"httpsHealthCheck",
",",
"HttpsHealthCheck2",
"httpsHealthCheckResource",
",",
"List",
"<",
"String",
">",
"fieldMask",
")",
"{",
"UpdateHttpsHealthCheckHttpReq... | Updates a HttpsHealthCheck resource in the specified project using the data included in the
request.
<p>Sample code:
<pre><code>
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]"... | [
"Updates",
"a",
"HttpsHealthCheck",
"resource",
"in",
"the",
"specified",
"project",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/HttpsHealthCheckClient.java#L782-L795 |
12,525 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java | HttpStorageRpc.startSpan | private Span startSpan(String spanName) {
return tracer
.spanBuilder(spanName)
.setRecordEvents(censusHttpModule.isRecordEvents())
.startSpan();
} | java | private Span startSpan(String spanName) {
return tracer
.spanBuilder(spanName)
.setRecordEvents(censusHttpModule.isRecordEvents())
.startSpan();
} | [
"private",
"Span",
"startSpan",
"(",
"String",
"spanName",
")",
"{",
"return",
"tracer",
".",
"spanBuilder",
"(",
"spanName",
")",
".",
"setRecordEvents",
"(",
"censusHttpModule",
".",
"isRecordEvents",
"(",
")",
")",
".",
"startSpan",
"(",
")",
";",
"}"
] | Helper method to start a span. | [
"Helper",
"method",
"to",
"start",
"a",
"span",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java#L249-L254 |
12,526 | apache/groovy | subprojects/groovy-servlet/src/main/java/groovy/servlet/TemplateServlet.java | TemplateServlet.createAndStoreTemplate | private Template createAndStoreTemplate(String key, InputStream inputStream, File file) throws Exception {
if (verbose) {
log("Creating new template from " + key + "...");
}
Reader reader = null;
try {
String fileEncoding = (fileEncodingParamVal != null) ? fileE... | java | private Template createAndStoreTemplate(String key, InputStream inputStream, File file) throws Exception {
if (verbose) {
log("Creating new template from " + key + "...");
}
Reader reader = null;
try {
String fileEncoding = (fileEncodingParamVal != null) ? fileE... | [
"private",
"Template",
"createAndStoreTemplate",
"(",
"String",
"key",
",",
"InputStream",
"inputStream",
",",
"File",
"file",
")",
"throws",
"Exception",
"{",
"if",
"(",
"verbose",
")",
"{",
"log",
"(",
"\"Creating new template from \"",
"+",
"key",
"+",
"\"...... | Compile the template and store it in the cache.
@param key a unique key for the template, such as a file's absolutePath or a URL.
@param inputStream an InputStream for the template's source.
@param file a file to be used to determine if the cached template is stale. May be null.
@return the created template.
@throws Ex... | [
"Compile",
"the",
"template",
"and",
"store",
"it",
"in",
"the",
"cache",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-servlet/src/main/java/groovy/servlet/TemplateServlet.java#L241-L276 |
12,527 | apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/ParameterUtils.java | ParameterUtils.parametersCompatible | public static boolean parametersCompatible(Parameter[] source, Parameter[] target) {
return parametersMatch(source, target,
t -> ClassHelper.getWrapper(t.getV2()).getTypeClass()
.isAssignableFrom(ClassHelper.getWrapper(t.getV1()).getTypeClass())
);
} | java | public static boolean parametersCompatible(Parameter[] source, Parameter[] target) {
return parametersMatch(source, target,
t -> ClassHelper.getWrapper(t.getV2()).getTypeClass()
.isAssignableFrom(ClassHelper.getWrapper(t.getV1()).getTypeClass())
);
} | [
"public",
"static",
"boolean",
"parametersCompatible",
"(",
"Parameter",
"[",
"]",
"source",
",",
"Parameter",
"[",
"]",
"target",
")",
"{",
"return",
"parametersMatch",
"(",
"source",
",",
"target",
",",
"t",
"->",
"ClassHelper",
".",
"getWrapper",
"(",
"t"... | check whether parameters type are compatible
each parameter should match the following condition:
{@code targetParameter.getType().getTypeClass().isAssignableFrom(sourceParameter.getType().getTypeClass())}
@param source source parameters
@param target target parameters
@return the check result
@since 3.0.0 | [
"check",
"whether",
"parameters",
"type",
"are",
"compatible"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/ParameterUtils.java#L51-L56 |
12,528 | apache/groovy | src/main/java/org/codehaus/groovy/control/StaticImportVisitor.java | StaticImportVisitor.setSourcePosition | private static void setSourcePosition(Expression toSet, Expression origNode) {
toSet.setSourcePosition(origNode);
if (toSet instanceof PropertyExpression) {
((PropertyExpression) toSet).getProperty().setSourcePosition(origNode);
}
} | java | private static void setSourcePosition(Expression toSet, Expression origNode) {
toSet.setSourcePosition(origNode);
if (toSet instanceof PropertyExpression) {
((PropertyExpression) toSet).getProperty().setSourcePosition(origNode);
}
} | [
"private",
"static",
"void",
"setSourcePosition",
"(",
"Expression",
"toSet",
",",
"Expression",
"origNode",
")",
"{",
"toSet",
".",
"setSourcePosition",
"(",
"origNode",
")",
";",
"if",
"(",
"toSet",
"instanceof",
"PropertyExpression",
")",
"{",
"(",
"(",
"Pr... | Set the source position of toSet including its property expression if it has one.
@param toSet resulting node
@param origNode original node | [
"Set",
"the",
"source",
"position",
"of",
"toSet",
"including",
"its",
"property",
"expression",
"if",
"it",
"has",
"one",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/StaticImportVisitor.java#L232-L237 |
12,529 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/util/XmlSlurper.java | XmlSlurper.parse | public GPathResult parse(final InputSource input) throws IOException, SAXException {
reader.setContentHandler(this);
reader.parse(input);
return getDocument();
} | java | public GPathResult parse(final InputSource input) throws IOException, SAXException {
reader.setContentHandler(this);
reader.parse(input);
return getDocument();
} | [
"public",
"GPathResult",
"parse",
"(",
"final",
"InputSource",
"input",
")",
"throws",
"IOException",
",",
"SAXException",
"{",
"reader",
".",
"setContentHandler",
"(",
"this",
")",
";",
"reader",
".",
"parse",
"(",
"input",
")",
";",
"return",
"getDocument",
... | Parse the content of the specified input source into a GPathResult object
@param input the InputSource to parse
@return An object which supports GPath expressions
@throws SAXException Any SAX exception, possibly wrapping another exception.
@throws IOException An IO exception from the parser, possibly from a byte strea... | [
"Parse",
"the",
"content",
"of",
"the",
"specified",
"input",
"source",
"into",
"a",
"GPathResult",
"object"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/XmlSlurper.java#L199-L203 |
12,530 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/util/XmlSlurper.java | XmlSlurper.parse | public GPathResult parse(final File file) throws IOException, SAXException {
final FileInputStream fis = new FileInputStream(file);
final InputSource input = new InputSource(fis);
input.setSystemId("file://" + file.getAbsolutePath());
try {
return parse(input);
} fina... | java | public GPathResult parse(final File file) throws IOException, SAXException {
final FileInputStream fis = new FileInputStream(file);
final InputSource input = new InputSource(fis);
input.setSystemId("file://" + file.getAbsolutePath());
try {
return parse(input);
} fina... | [
"public",
"GPathResult",
"parse",
"(",
"final",
"File",
"file",
")",
"throws",
"IOException",
",",
"SAXException",
"{",
"final",
"FileInputStream",
"fis",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"final",
"InputSource",
"input",
"=",
"new",
"Input... | Parses the content of the given file as XML turning it into a GPathResult object
@param file the File to parse
@return An object which supports GPath expressions
@throws SAXException Any SAX exception, possibly wrapping another exception.
@throws IOException An IO exception from the parser, possibly from a byte stream... | [
"Parses",
"the",
"content",
"of",
"the",
"given",
"file",
"as",
"XML",
"turning",
"it",
"into",
"a",
"GPathResult",
"object"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/XmlSlurper.java#L214-L223 |
12,531 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/util/XmlSlurper.java | XmlSlurper.setEntityBaseUrl | public void setEntityBaseUrl(final URL base) {
reader.setEntityResolver(new EntityResolver() {
public InputSource resolveEntity(final String publicId, final String systemId) throws IOException {
return new InputSource(new URL(base, systemId).openStream());
}
});
... | java | public void setEntityBaseUrl(final URL base) {
reader.setEntityResolver(new EntityResolver() {
public InputSource resolveEntity(final String publicId, final String systemId) throws IOException {
return new InputSource(new URL(base, systemId).openStream());
}
});
... | [
"public",
"void",
"setEntityBaseUrl",
"(",
"final",
"URL",
"base",
")",
"{",
"reader",
".",
"setEntityResolver",
"(",
"new",
"EntityResolver",
"(",
")",
"{",
"public",
"InputSource",
"resolveEntity",
"(",
"final",
"String",
"publicId",
",",
"final",
"String",
... | Resolves entities against using the supplied URL as the base for relative URLs
@param base The URL used to resolve relative URLs | [
"Resolves",
"entities",
"against",
"using",
"the",
"supplied",
"URL",
"as",
"the",
"base",
"for",
"relative",
"URLs"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/XmlSlurper.java#L340-L346 |
12,532 | apache/groovy | src/main/java/org/codehaus/groovy/transform/AbstractInterruptibleASTTransformation.java | AbstractInterruptibleASTTransformation.wrapBlock | protected final Statement wrapBlock(Statement statement) {
BlockStatement stmt = new BlockStatement();
stmt.addStatement(createInterruptStatement());
stmt.addStatement(statement);
return stmt;
} | java | protected final Statement wrapBlock(Statement statement) {
BlockStatement stmt = new BlockStatement();
stmt.addStatement(createInterruptStatement());
stmt.addStatement(statement);
return stmt;
} | [
"protected",
"final",
"Statement",
"wrapBlock",
"(",
"Statement",
"statement",
")",
"{",
"BlockStatement",
"stmt",
"=",
"new",
"BlockStatement",
"(",
")",
";",
"stmt",
".",
"addStatement",
"(",
"createInterruptStatement",
"(",
")",
")",
";",
"stmt",
".",
"addS... | Takes a statement and wraps it into a block statement which first element is the interruption check statement.
@param statement the statement to be wrapped
@return a {@link BlockStatement block statement} which first element is for checking interruption, and the
second one the statement to be wrapped. | [
"Takes",
"a",
"statement",
"and",
"wraps",
"it",
"into",
"a",
"block",
"statement",
"which",
"first",
"element",
"is",
"the",
"interruption",
"check",
"statement",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/AbstractInterruptibleASTTransformation.java#L199-L204 |
12,533 | apache/groovy | src/main/java/org/codehaus/groovy/transform/AbstractInterruptibleASTTransformation.java | AbstractInterruptibleASTTransformation.visitLoop | private void visitLoop(LoopingStatement loopStatement) {
Statement statement = loopStatement.getLoopBlock();
loopStatement.setLoopBlock(wrapBlock(statement));
} | java | private void visitLoop(LoopingStatement loopStatement) {
Statement statement = loopStatement.getLoopBlock();
loopStatement.setLoopBlock(wrapBlock(statement));
} | [
"private",
"void",
"visitLoop",
"(",
"LoopingStatement",
"loopStatement",
")",
"{",
"Statement",
"statement",
"=",
"loopStatement",
".",
"getLoopBlock",
"(",
")",
";",
"loopStatement",
".",
"setLoopBlock",
"(",
"wrapBlock",
"(",
"statement",
")",
")",
";",
"}"
] | Shortcut method which avoids duplicating code for every type of loop.
Actually wraps the loopBlock of different types of loop statements. | [
"Shortcut",
"method",
"which",
"avoids",
"duplicating",
"code",
"for",
"every",
"type",
"of",
"loop",
".",
"Actually",
"wraps",
"the",
"loopBlock",
"of",
"different",
"types",
"of",
"loop",
"statements",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/AbstractInterruptibleASTTransformation.java#L216-L219 |
12,534 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java | MetaClassRegistryImpl.installMetaClassCreationHandle | private void installMetaClassCreationHandle() {
try {
final Class customMetaClassHandle = Class.forName("groovy.runtime.metaclass.CustomMetaClassCreationHandle");
final Constructor customMetaClassHandleConstructor = customMetaClassHandle.getConstructor();
this.m... | java | private void installMetaClassCreationHandle() {
try {
final Class customMetaClassHandle = Class.forName("groovy.runtime.metaclass.CustomMetaClassCreationHandle");
final Constructor customMetaClassHandleConstructor = customMetaClassHandle.getConstructor();
this.m... | [
"private",
"void",
"installMetaClassCreationHandle",
"(",
")",
"{",
"try",
"{",
"final",
"Class",
"customMetaClassHandle",
"=",
"Class",
".",
"forName",
"(",
"\"groovy.runtime.metaclass.CustomMetaClassCreationHandle\"",
")",
";",
"final",
"Constructor",
"customMetaClassHand... | Looks for a class called 'groovy.runtime.metaclass.CustomMetaClassCreationHandle' and if it exists uses it as the MetaClassCreationHandle
otherwise uses the default
@see groovy.lang.MetaClassRegistry.MetaClassCreationHandle | [
"Looks",
"for",
"a",
"class",
"called",
"groovy",
".",
"runtime",
".",
"metaclass",
".",
"CustomMetaClassCreationHandle",
"and",
"if",
"it",
"exists",
"uses",
"it",
"as",
"the",
"MetaClassCreationHandle",
"otherwise",
"uses",
"the",
"default"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java#L182-L192 |
12,535 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java | MetaClassRegistryImpl.setMetaClass | private void setMetaClass(Class theClass, MetaClass oldMc, MetaClass newMc) {
final ClassInfo info = ClassInfo.getClassInfo(theClass);
MetaClass mc = null;
info.lock();
try {
mc = info.getStrongMetaClass();
info.setStrongMetaClass(newMc);
} finall... | java | private void setMetaClass(Class theClass, MetaClass oldMc, MetaClass newMc) {
final ClassInfo info = ClassInfo.getClassInfo(theClass);
MetaClass mc = null;
info.lock();
try {
mc = info.getStrongMetaClass();
info.setStrongMetaClass(newMc);
} finall... | [
"private",
"void",
"setMetaClass",
"(",
"Class",
"theClass",
",",
"MetaClass",
"oldMc",
",",
"MetaClass",
"newMc",
")",
"{",
"final",
"ClassInfo",
"info",
"=",
"ClassInfo",
".",
"getClassInfo",
"(",
"theClass",
")",
";",
"MetaClass",
"mc",
"=",
"null",
";",
... | if oldMc is null, newMc will replace whatever meta class was used before.
if oldMc is not null, then newMc will be used only if he stored mc is
the same as oldMc | [
"if",
"oldMc",
"is",
"null",
"newMc",
"will",
"replace",
"whatever",
"meta",
"class",
"was",
"used",
"before",
".",
"if",
"oldMc",
"is",
"not",
"null",
"then",
"newMc",
"will",
"be",
"used",
"only",
"if",
"he",
"stored",
"mc",
"is",
"the",
"same",
"as"... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java#L283-L297 |
12,536 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java | MetaClassRegistryImpl.fireConstantMetaClassUpdate | protected void fireConstantMetaClassUpdate(Object obj, Class c, final MetaClass oldMC, MetaClass newMc) {
MetaClassRegistryChangeEventListener[] listener = getMetaClassRegistryChangeEventListeners();
MetaClassRegistryChangeEvent cmcu = new MetaClassRegistryChangeEvent(this, obj, c, oldMC, newMc);
... | java | protected void fireConstantMetaClassUpdate(Object obj, Class c, final MetaClass oldMC, MetaClass newMc) {
MetaClassRegistryChangeEventListener[] listener = getMetaClassRegistryChangeEventListeners();
MetaClassRegistryChangeEvent cmcu = new MetaClassRegistryChangeEvent(this, obj, c, oldMC, newMc);
... | [
"protected",
"void",
"fireConstantMetaClassUpdate",
"(",
"Object",
"obj",
",",
"Class",
"c",
",",
"final",
"MetaClass",
"oldMC",
",",
"MetaClass",
"newMc",
")",
"{",
"MetaClassRegistryChangeEventListener",
"[",
"]",
"listener",
"=",
"getMetaClassRegistryChangeEventListe... | Causes the execution of all registered listeners. This method is used mostly
internal to kick of the listener notification. It can also be used by subclasses
to achieve the same.
@param obj object instance if the MetaClass change is on a per-instance metaclass (or null if global)
@param c the class
@param oldMC the ol... | [
"Causes",
"the",
"execution",
"of",
"all",
"registered",
"listeners",
".",
"This",
"method",
"is",
"used",
"mostly",
"internal",
"to",
"kick",
"of",
"the",
"listener",
"notification",
".",
"It",
"can",
"also",
"be",
"used",
"by",
"subclasses",
"to",
"achieve... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java#L402-L408 |
12,537 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java | MetaClassRegistryImpl.iterator | public Iterator iterator() {
final MetaClass[] refs = metaClassInfo.toArray(EMPTY_METACLASS_ARRAY);
return new Iterator() {
// index in the ref array
private int index = 0;
// the current meta class
private MetaClass currentMeta;
// us... | java | public Iterator iterator() {
final MetaClass[] refs = metaClassInfo.toArray(EMPTY_METACLASS_ARRAY);
return new Iterator() {
// index in the ref array
private int index = 0;
// the current meta class
private MetaClass currentMeta;
// us... | [
"public",
"Iterator",
"iterator",
"(",
")",
"{",
"final",
"MetaClass",
"[",
"]",
"refs",
"=",
"metaClassInfo",
".",
"toArray",
"(",
"EMPTY_METACLASS_ARRAY",
")",
";",
"return",
"new",
"Iterator",
"(",
")",
"{",
"// index in the ref array",
"private",
"int",
"i... | Returns an iterator to iterate over all constant meta classes.
This iterator can be seen as making a snapshot of the current state
of the registry. The snapshot will include all meta classes that has
been used unless they are already collected. Collected meta classes
will be skipped automatically, so you can expect tha... | [
"Returns",
"an",
"iterator",
"to",
"iterate",
"over",
"all",
"constant",
"meta",
"classes",
".",
"This",
"iterator",
"can",
"be",
"seen",
"as",
"making",
"a",
"snapshot",
"of",
"the",
"current",
"state",
"of",
"the",
"registry",
".",
"The",
"snapshot",
"wi... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java#L462-L506 |
12,538 | apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.checkValueIsType | public static boolean checkValueIsType(Object value, Object name, Class type) {
if (value != null) {
if (type.isAssignableFrom(value.getClass())) {
return true;
} else {
throw new RuntimeException("The value argument of '" + name + "' must be of type "
... | java | public static boolean checkValueIsType(Object value, Object name, Class type) {
if (value != null) {
if (type.isAssignableFrom(value.getClass())) {
return true;
} else {
throw new RuntimeException("The value argument of '" + name + "' must be of type "
... | [
"public",
"static",
"boolean",
"checkValueIsType",
"(",
"Object",
"value",
",",
"Object",
"name",
",",
"Class",
"type",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"if",
"(",
"type",
".",
"isAssignableFrom",
"(",
"value",
".",
"getClass",
"(",
... | Checks type of value against builder type
@param value the node's value
@param name the node's name
@param type a Class that may be assignable to the value's class
@return true if type is assignable to the value's class, false if value
is null. | [
"Checks",
"type",
"of",
"value",
"against",
"builder",
"type"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L104-L115 |
12,539 | apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.autoRegisterNodes | public void autoRegisterNodes() {
// if java did atomic blocks, this would be one
synchronized (this) {
if (autoRegistrationRunning || autoRegistrationComplete) {
// registration already done or in process, abort
return;
}
}
autoReg... | java | public void autoRegisterNodes() {
// if java did atomic blocks, this would be one
synchronized (this) {
if (autoRegistrationRunning || autoRegistrationComplete) {
// registration already done or in process, abort
return;
}
}
autoReg... | [
"public",
"void",
"autoRegisterNodes",
"(",
")",
"{",
"// if java did atomic blocks, this would be one",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"autoRegistrationRunning",
"||",
"autoRegistrationComplete",
")",
"{",
"// registration already done or in process, abort",... | Ask the nodes to be registered | [
"Ask",
"the",
"nodes",
"to",
"be",
"registered"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L185-L200 |
12,540 | apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.registerFactory | public void registerFactory(String name, String groupName, Factory factory) {
getProxyBuilder().factories.put(name, factory);
getRegistrationGroup(groupName).add(name);
factory.onFactoryRegistration(this, name, groupName);
} | java | public void registerFactory(String name, String groupName, Factory factory) {
getProxyBuilder().factories.put(name, factory);
getRegistrationGroup(groupName).add(name);
factory.onFactoryRegistration(this, name, groupName);
} | [
"public",
"void",
"registerFactory",
"(",
"String",
"name",
",",
"String",
"groupName",
",",
"Factory",
"factory",
")",
"{",
"getProxyBuilder",
"(",
")",
".",
"factories",
".",
"put",
"(",
"name",
",",
"factory",
")",
";",
"getRegistrationGroup",
"(",
"group... | Registers a factory for a node name.
@param name the name of the node
@param groupName thr group to register this node in
@param factory the factory to return the values | [
"Registers",
"a",
"factory",
"for",
"a",
"node",
"name",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L690-L694 |
12,541 | apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.createNode | protected Object createNode(Object name, Map attributes, Object value) {
Object node;
Factory factory = getProxyBuilder().resolveFactory(name, attributes, value);
if (factory == null) {
LOG.log(Level.WARNING, "Could not find match for name '" + name + "'");
throw new Mis... | java | protected Object createNode(Object name, Map attributes, Object value) {
Object node;
Factory factory = getProxyBuilder().resolveFactory(name, attributes, value);
if (factory == null) {
LOG.log(Level.WARNING, "Could not find match for name '" + name + "'");
throw new Mis... | [
"protected",
"Object",
"createNode",
"(",
"Object",
"name",
",",
"Map",
"attributes",
",",
"Object",
"value",
")",
"{",
"Object",
"node",
";",
"Factory",
"factory",
"=",
"getProxyBuilder",
"(",
")",
".",
"resolveFactory",
"(",
"name",
",",
"attributes",
",",... | This method is responsible for instantiating a node and configure its
properties.
@param name the name of the node
@param attributes the attributes for the node
@param value the value arguments for the node
@return the object return from the factory | [
"This",
"method",
"is",
"responsible",
"for",
"instantiating",
"a",
"node",
"and",
"configure",
"its",
"properties",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L705-L734 |
12,542 | apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.resolveFactory | protected Factory resolveFactory(Object name, Map attributes, Object value) {
getProxyBuilder().getContext().put(CHILD_BUILDER, getProxyBuilder());
return getProxyBuilder().getFactories().get(name);
} | java | protected Factory resolveFactory(Object name, Map attributes, Object value) {
getProxyBuilder().getContext().put(CHILD_BUILDER, getProxyBuilder());
return getProxyBuilder().getFactories().get(name);
} | [
"protected",
"Factory",
"resolveFactory",
"(",
"Object",
"name",
",",
"Map",
"attributes",
",",
"Object",
"value",
")",
"{",
"getProxyBuilder",
"(",
")",
".",
"getContext",
"(",
")",
".",
"put",
"(",
"CHILD_BUILDER",
",",
"getProxyBuilder",
"(",
")",
")",
... | This is a hook for subclasses to plugin a custom strategy for mapping
names to factories.
@param name the name of the factory
@param attributes the attributes from the node
@param value value arguments from te node
@return the Factory associated with name.<br> | [
"This",
"is",
"a",
"hook",
"for",
"subclasses",
"to",
"plugin",
"a",
"custom",
"strategy",
"for",
"mapping",
"names",
"to",
"factories",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L745-L748 |
12,543 | apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.resolveExplicitMethod | @SuppressWarnings({"UnusedDeclaration"})
protected Closure resolveExplicitMethod(String methodName, Object args) {
return getExplicitMethods().get(methodName);
} | java | @SuppressWarnings({"UnusedDeclaration"})
protected Closure resolveExplicitMethod(String methodName, Object args) {
return getExplicitMethods().get(methodName);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"UnusedDeclaration\"",
"}",
")",
"protected",
"Closure",
"resolveExplicitMethod",
"(",
"String",
"methodName",
",",
"Object",
"args",
")",
"{",
"return",
"getExplicitMethods",
"(",
")",
".",
"get",
"(",
"methodName",
")",
";"... | This is a hook for subclasses to plugin a custom strategy for mapping
names to explicit methods.
@param methodName the name of the explicit method
@param args the arguments for the method
@return the closure for the matched explicit method.<br> | [
"This",
"is",
"a",
"hook",
"for",
"subclasses",
"to",
"plugin",
"a",
"custom",
"strategy",
"for",
"mapping",
"names",
"to",
"explicit",
"methods",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L758-L761 |
12,544 | apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.doInvokeMethod | private Object doInvokeMethod(String methodName, Object name, Object args) {
Reference explicitResult = new Reference();
if (checkExplicitMethod(methodName, args, explicitResult)) {
return explicitResult.get();
} else {
try {
return dispatchNodeCall(name, ... | java | private Object doInvokeMethod(String methodName, Object name, Object args) {
Reference explicitResult = new Reference();
if (checkExplicitMethod(methodName, args, explicitResult)) {
return explicitResult.get();
} else {
try {
return dispatchNodeCall(name, ... | [
"private",
"Object",
"doInvokeMethod",
"(",
"String",
"methodName",
",",
"Object",
"name",
",",
"Object",
"args",
")",
"{",
"Reference",
"explicitResult",
"=",
"new",
"Reference",
"(",
")",
";",
"if",
"(",
"checkExplicitMethod",
"(",
"methodName",
",",
"args",... | This method is the workhorse of the builder.
@param methodName the name of the method being invoked
@param name the name of the node
@param args the arguments passed into the node
@return the object from the factory | [
"This",
"method",
"is",
"the",
"workhorse",
"of",
"the",
"builder",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L782-L796 |
12,545 | apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.getName | public Object getName(String methodName) {
if (getProxyBuilder().nameMappingClosure != null) {
return getProxyBuilder().nameMappingClosure.call(methodName);
}
return methodName;
} | java | public Object getName(String methodName) {
if (getProxyBuilder().nameMappingClosure != null) {
return getProxyBuilder().nameMappingClosure.call(methodName);
}
return methodName;
} | [
"public",
"Object",
"getName",
"(",
"String",
"methodName",
")",
"{",
"if",
"(",
"getProxyBuilder",
"(",
")",
".",
"nameMappingClosure",
"!=",
"null",
")",
"{",
"return",
"getProxyBuilder",
"(",
")",
".",
"nameMappingClosure",
".",
"call",
"(",
"methodName",
... | A hook to allow names to be converted into some other object such as a
QName in XML or ObjectName in JMX.
@param methodName the name of the desired method
@return the object representing the name | [
"A",
"hook",
"to",
"allow",
"names",
"to",
"be",
"converted",
"into",
"some",
"other",
"object",
"such",
"as",
"a",
"QName",
"in",
"XML",
"or",
"ObjectName",
"in",
"JMX",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L921-L926 |
12,546 | apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.getProxyBuilder | protected FactoryBuilderSupport getProxyBuilder() {
FactoryBuilderSupport proxy = localProxyBuilder.get();
if (proxy == null) {
return globalProxyBuilder;
} else {
return proxy;
}
} | java | protected FactoryBuilderSupport getProxyBuilder() {
FactoryBuilderSupport proxy = localProxyBuilder.get();
if (proxy == null) {
return globalProxyBuilder;
} else {
return proxy;
}
} | [
"protected",
"FactoryBuilderSupport",
"getProxyBuilder",
"(",
")",
"{",
"FactoryBuilderSupport",
"proxy",
"=",
"localProxyBuilder",
".",
"get",
"(",
")",
";",
"if",
"(",
"proxy",
"==",
"null",
")",
"{",
"return",
"globalProxyBuilder",
";",
"}",
"else",
"{",
"r... | Proxy builders are useful for changing the building context, thus
enabling mix & match builders.
@return the current builder that serves as a proxy.<br> | [
"Proxy",
"builders",
"are",
"useful",
"for",
"changing",
"the",
"building",
"context",
"thus",
"enabling",
"mix",
"&",
";",
"match",
"builders",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L934-L941 |
12,547 | apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.nodeCompleted | protected void nodeCompleted(Object parent, Object node) {
getProxyBuilder().getCurrentFactory().onNodeCompleted(getProxyBuilder().getChildBuilder(), parent, node);
} | java | protected void nodeCompleted(Object parent, Object node) {
getProxyBuilder().getCurrentFactory().onNodeCompleted(getProxyBuilder().getChildBuilder(), parent, node);
} | [
"protected",
"void",
"nodeCompleted",
"(",
"Object",
"parent",
",",
"Object",
"node",
")",
"{",
"getProxyBuilder",
"(",
")",
".",
"getCurrentFactory",
"(",
")",
".",
"onNodeCompleted",
"(",
"getProxyBuilder",
"(",
")",
".",
"getChildBuilder",
"(",
")",
",",
... | A hook to allow nodes to be processed once they have had all of their
children applied.
@param node the current node being processed
@param parent the parent of the node being processed | [
"A",
"hook",
"to",
"allow",
"nodes",
"to",
"be",
"processed",
"once",
"they",
"have",
"had",
"all",
"of",
"their",
"children",
"applied",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L1004-L1006 |
12,548 | apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.popContext | protected Map<String, Object> popContext() {
if (!getProxyBuilder().getContexts().isEmpty()) {
return getProxyBuilder().getContexts().removeFirst();
}
return null;
} | java | protected Map<String, Object> popContext() {
if (!getProxyBuilder().getContexts().isEmpty()) {
return getProxyBuilder().getContexts().removeFirst();
}
return null;
} | [
"protected",
"Map",
"<",
"String",
",",
"Object",
">",
"popContext",
"(",
")",
"{",
"if",
"(",
"!",
"getProxyBuilder",
"(",
")",
".",
"getContexts",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"getProxyBuilder",
"(",
")",
".",
"getContexts"... | Removes the last context from the stack.
@return the content just removed | [
"Removes",
"the",
"last",
"context",
"from",
"the",
"stack",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L1013-L1018 |
12,549 | apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.getContinuationData | protected Map<String, Object> getContinuationData() {
Map<String, Object> data = new HashMap<String, Object>();
data.put("proxyBuilder", localProxyBuilder.get());
data.put("contexts", contexts.get());
return data;
} | java | protected Map<String, Object> getContinuationData() {
Map<String, Object> data = new HashMap<String, Object>();
data.put("proxyBuilder", localProxyBuilder.get());
data.put("contexts", contexts.get());
return data;
} | [
"protected",
"Map",
"<",
"String",
",",
"Object",
">",
"getContinuationData",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"data",
".",
"put",
"(",
"\"proxyB... | Stores the thread local states in a Map that can be passed across threads
@return the map | [
"Stores",
"the",
"thread",
"local",
"states",
"in",
"a",
"Map",
"that",
"can",
"be",
"passed",
"across",
"threads"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L1138-L1143 |
12,550 | apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.restoreFromContinuationData | protected void restoreFromContinuationData(Map<String, Object> data) {
//noinspection unchecked
localProxyBuilder.set((FactoryBuilderSupport) data.get("proxyBuilder"));
//noinspection unchecked
contexts.set((LinkedList<Map<String, Object>>) data.get("contexts"));
} | java | protected void restoreFromContinuationData(Map<String, Object> data) {
//noinspection unchecked
localProxyBuilder.set((FactoryBuilderSupport) data.get("proxyBuilder"));
//noinspection unchecked
contexts.set((LinkedList<Map<String, Object>>) data.get("contexts"));
} | [
"protected",
"void",
"restoreFromContinuationData",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
")",
"{",
"//noinspection unchecked",
"localProxyBuilder",
".",
"set",
"(",
"(",
"FactoryBuilderSupport",
")",
"data",
".",
"get",
"(",
"\"proxyBuilder\"",
"... | Restores the state of the current builder to the same state as an older build.
Caution, this will destroy rather than merge the current build context if there is any,
@param data the data retrieved from a compatible getContinuationData call | [
"Restores",
"the",
"state",
"of",
"the",
"current",
"builder",
"to",
"the",
"same",
"state",
"as",
"an",
"older",
"build",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L1151-L1156 |
12,551 | apache/groovy | src/main/java/org/codehaus/groovy/tools/Utilities.java | Utilities.repeatString | public static String repeatString( String pattern, int repeats )
{
StringBuilder buffer = new StringBuilder( pattern.length() * repeats );
for( int i = 0; i < repeats; i++ )
{
buffer.append( pattern );
}
return new String( buffer );
} | java | public static String repeatString( String pattern, int repeats )
{
StringBuilder buffer = new StringBuilder( pattern.length() * repeats );
for( int i = 0; i < repeats; i++ )
{
buffer.append( pattern );
}
return new String( buffer );
} | [
"public",
"static",
"String",
"repeatString",
"(",
"String",
"pattern",
",",
"int",
"repeats",
")",
"{",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
"pattern",
".",
"length",
"(",
")",
"*",
"repeats",
")",
";",
"for",
"(",
"int",
"i",
"=... | Returns a string made up of repetitions of the specified string. | [
"Returns",
"a",
"string",
"made",
"up",
"of",
"repetitions",
"of",
"the",
"specified",
"string",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/tools/Utilities.java#L41-L50 |
12,552 | apache/groovy | src/main/java/org/codehaus/groovy/tools/Utilities.java | Utilities.isJavaIdentifier | public static boolean isJavaIdentifier(String name) {
if (name.length() == 0 || INVALID_JAVA_IDENTIFIERS.contains(name)) return false;
char[] chars = name.toCharArray();
if (!Character.isJavaIdentifierStart(chars[0])) return false;
for (int i = 1; i < chars.length; i++ ) {
if... | java | public static boolean isJavaIdentifier(String name) {
if (name.length() == 0 || INVALID_JAVA_IDENTIFIERS.contains(name)) return false;
char[] chars = name.toCharArray();
if (!Character.isJavaIdentifierStart(chars[0])) return false;
for (int i = 1; i < chars.length; i++ ) {
if... | [
"public",
"static",
"boolean",
"isJavaIdentifier",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
".",
"length",
"(",
")",
"==",
"0",
"||",
"INVALID_JAVA_IDENTIFIERS",
".",
"contains",
"(",
"name",
")",
")",
"return",
"false",
";",
"char",
"[",
"]",... | Tells if the given string is a valid Java identifier. | [
"Tells",
"if",
"the",
"given",
"string",
"is",
"a",
"valid",
"Java",
"identifier",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/tools/Utilities.java#L65-L73 |
12,553 | apache/groovy | subprojects/groovy-swing/src/main/java/groovy/inspect/swingui/TableSorter.java | TableSorter.shuttlesort | public void shuttlesort(int from[], int to[], int low, int high) {
if (high - low < 2) {
return;
}
int middle = (low + high) / 2;
shuttlesort(to, from, low, middle);
shuttlesort(to, from, middle, high);
int p = low;
int q = middle;
/* This is... | java | public void shuttlesort(int from[], int to[], int low, int high) {
if (high - low < 2) {
return;
}
int middle = (low + high) / 2;
shuttlesort(to, from, low, middle);
shuttlesort(to, from, middle, high);
int p = low;
int q = middle;
/* This is... | [
"public",
"void",
"shuttlesort",
"(",
"int",
"from",
"[",
"]",
",",
"int",
"to",
"[",
"]",
",",
"int",
"low",
",",
"int",
"high",
")",
"{",
"if",
"(",
"high",
"-",
"low",
"<",
"2",
")",
"{",
"return",
";",
"}",
"int",
"middle",
"=",
"(",
"low... | using it here is that, unlike qsort, it is stable. | [
"using",
"it",
"here",
"is",
"that",
"unlike",
"qsort",
"it",
"is",
"stable",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-swing/src/main/java/groovy/inspect/swingui/TableSorter.java#L228-L268 |
12,554 | apache/groovy | subprojects/groovy-swing/src/main/java/groovy/inspect/swingui/TableSorter.java | TableSorter.addMouseListenerToHeaderInTable | public void addMouseListenerToHeaderInTable(JTable table) {
final TableSorter sorter = this;
final JTable tableView = table;
tableView.setColumnSelectionAllowed(false);
MouseAdapter listMouseListener = new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
... | java | public void addMouseListenerToHeaderInTable(JTable table) {
final TableSorter sorter = this;
final JTable tableView = table;
tableView.setColumnSelectionAllowed(false);
MouseAdapter listMouseListener = new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
... | [
"public",
"void",
"addMouseListenerToHeaderInTable",
"(",
"JTable",
"table",
")",
"{",
"final",
"TableSorter",
"sorter",
"=",
"this",
";",
"final",
"JTable",
"tableView",
"=",
"table",
";",
"tableView",
".",
"setColumnSelectionAllowed",
"(",
"false",
")",
";",
"... | when a column heading is clicked in the JTable. | [
"when",
"a",
"column",
"heading",
"is",
"clicked",
"in",
"the",
"JTable",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-swing/src/main/java/groovy/inspect/swingui/TableSorter.java#L304-L322 |
12,555 | apache/groovy | src/main/java/org/codehaus/groovy/control/messages/ExceptionMessage.java | ExceptionMessage.write | public void write(PrintWriter output, Janitor janitor) {
String description = "General error during " + owner.getPhaseDescription() + ": ";
String message = cause.getMessage();
if (message != null) {
output.println(description + message);
} else {
output.println(... | java | public void write(PrintWriter output, Janitor janitor) {
String description = "General error during " + owner.getPhaseDescription() + ": ";
String message = cause.getMessage();
if (message != null) {
output.println(description + message);
} else {
output.println(... | [
"public",
"void",
"write",
"(",
"PrintWriter",
"output",
",",
"Janitor",
"janitor",
")",
"{",
"String",
"description",
"=",
"\"General error during \"",
"+",
"owner",
".",
"getPhaseDescription",
"(",
")",
"+",
"\": \"",
";",
"String",
"message",
"=",
"cause",
... | Writes out a nicely formatted summary of the exception. | [
"Writes",
"out",
"a",
"nicely",
"formatted",
"summary",
"of",
"the",
"exception",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/messages/ExceptionMessage.java#L54-L68 |
12,556 | apache/groovy | src/main/groovy/groovy/util/Node.java | Node.appendNode | public Node appendNode(Object name, Map attributes, Object value) {
return new Node(this, name, attributes, value);
} | java | public Node appendNode(Object name, Map attributes, Object value) {
return new Node(this, name, attributes, value);
} | [
"public",
"Node",
"appendNode",
"(",
"Object",
"name",
",",
"Map",
"attributes",
",",
"Object",
"value",
")",
"{",
"return",
"new",
"Node",
"(",
"this",
",",
"name",
",",
"attributes",
",",
"value",
")",
";",
"}"
] | Creates a new node as a child of the current node.
@param name the name of the new node
@param attributes the attributes of the new node
@param value the value of the new node
@return the newly created <code>Node</code> | [
"Creates",
"a",
"new",
"node",
"as",
"a",
"child",
"of",
"the",
"current",
"node",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/Node.java#L218-L220 |
12,557 | apache/groovy | src/main/groovy/groovy/util/Node.java | Node.replaceNode | public Node replaceNode(Closure c) {
if (parent() == null) {
throw new UnsupportedOperationException("Replacing the root node is not supported");
}
appendNodes(c);
getParentList(parent()).remove(this);
this.setParent(null);
return this;
} | java | public Node replaceNode(Closure c) {
if (parent() == null) {
throw new UnsupportedOperationException("Replacing the root node is not supported");
}
appendNodes(c);
getParentList(parent()).remove(this);
this.setParent(null);
return this;
} | [
"public",
"Node",
"replaceNode",
"(",
"Closure",
"c",
")",
"{",
"if",
"(",
"parent",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"Replacing the root node is not supported\"",
")",
";",
"}",
"appendNodes",
"(",
"c",
... | Replaces the current node with nodes defined using builder-style notation via a Closure.
@param c A Closure defining the new nodes using builder-style notation.
@return the original now replaced node | [
"Replaces",
"the",
"current",
"node",
"with",
"nodes",
"defined",
"using",
"builder",
"-",
"style",
"notation",
"via",
"a",
"Closure",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/Node.java#L228-L236 |
12,558 | apache/groovy | src/main/groovy/groovy/util/Node.java | Node.replaceNode | public Node replaceNode(Node n) {
if (parent() == null) {
throw new UnsupportedOperationException("Replacing the root node is not supported");
}
List tail = getTail();
parent().appendNode(n.name(), n.attributes(), n.value());
parent().children().addAll(tail);
... | java | public Node replaceNode(Node n) {
if (parent() == null) {
throw new UnsupportedOperationException("Replacing the root node is not supported");
}
List tail = getTail();
parent().appendNode(n.name(), n.attributes(), n.value());
parent().children().addAll(tail);
... | [
"public",
"Node",
"replaceNode",
"(",
"Node",
"n",
")",
"{",
"if",
"(",
"parent",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"Replacing the root node is not supported\"",
")",
";",
"}",
"List",
"tail",
"=",
"getTa... | Replaces the current node with the supplied node.
@param n the new Node
@return the original now replaced node | [
"Replaces",
"the",
"current",
"node",
"with",
"the",
"supplied",
"node",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/Node.java#L244-L254 |
12,559 | apache/groovy | src/main/groovy/groovy/util/Node.java | Node.text | public String text() {
if (value instanceof String) {
return (String) value;
}
if (value instanceof NodeList) {
return ((NodeList) value).text();
}
if (value instanceof Collection) {
Collection coll = (Collection) value;
String prev... | java | public String text() {
if (value instanceof String) {
return (String) value;
}
if (value instanceof NodeList) {
return ((NodeList) value).text();
}
if (value instanceof Collection) {
Collection coll = (Collection) value;
String prev... | [
"public",
"String",
"text",
"(",
")",
"{",
"if",
"(",
"value",
"instanceof",
"String",
")",
"{",
"return",
"(",
"String",
")",
"value",
";",
"}",
"if",
"(",
"value",
"instanceof",
"NodeList",
")",
"{",
"return",
"(",
"(",
"NodeList",
")",
"value",
")... | Returns the textual representation of the current node and all its child nodes.
@return the text value of the node including child text | [
"Returns",
"the",
"textual",
"representation",
"of",
"the",
"current",
"node",
"and",
"all",
"its",
"child",
"nodes",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/Node.java#L340-L380 |
12,560 | apache/groovy | src/main/groovy/groovy/util/Node.java | Node.attribute | public Object attribute(Object key) {
return (attributes != null) ? attributes.get(key) : null;
} | java | public Object attribute(Object key) {
return (attributes != null) ? attributes.get(key) : null;
} | [
"public",
"Object",
"attribute",
"(",
"Object",
"key",
")",
"{",
"return",
"(",
"attributes",
"!=",
"null",
")",
"?",
"attributes",
".",
"get",
"(",
"key",
")",
":",
"null",
";",
"}"
] | Provides lookup of attributes by key.
@param key the key of interest
@return the attribute matching the key or <code>null</code> if no match exists | [
"Provides",
"lookup",
"of",
"attributes",
"by",
"key",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/Node.java#L425-L427 |
12,561 | apache/groovy | src/main/groovy/groovy/util/Node.java | Node.get | public Object get(String key) {
if (key != null && key.charAt(0) == '@') {
String attributeName = key.substring(1);
return attributes().get(attributeName);
}
if ("..".equals(key)) {
return parent();
}
if ("*".equals(key)) {
return c... | java | public Object get(String key) {
if (key != null && key.charAt(0) == '@') {
String attributeName = key.substring(1);
return attributes().get(attributeName);
}
if ("..".equals(key)) {
return parent();
}
if ("*".equals(key)) {
return c... | [
"public",
"Object",
"get",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"key",
"!=",
"null",
"&&",
"key",
".",
"charAt",
"(",
"0",
")",
"==",
"'",
"'",
")",
"{",
"String",
"attributeName",
"=",
"key",
".",
"substring",
"(",
"1",
")",
";",
"return",... | Provides lookup of elements by non-namespaced name
@param key the name (or shortcut key) of the node(s) of interest
@return the nodes which match key | [
"Provides",
"lookup",
"of",
"elements",
"by",
"non",
"-",
"namespaced",
"name"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/Node.java#L480-L495 |
12,562 | apache/groovy | src/main/groovy/groovy/util/Node.java | Node.getByName | private NodeList getByName(String name) {
NodeList answer = new NodeList();
for (Object child : children()) {
if (child instanceof Node) {
Node childNode = (Node) child;
Object childNodeName = childNode.name();
if (childNodeName instanceof QNam... | java | private NodeList getByName(String name) {
NodeList answer = new NodeList();
for (Object child : children()) {
if (child instanceof Node) {
Node childNode = (Node) child;
Object childNodeName = childNode.name();
if (childNodeName instanceof QNam... | [
"private",
"NodeList",
"getByName",
"(",
"String",
"name",
")",
"{",
"NodeList",
"answer",
"=",
"new",
"NodeList",
"(",
")",
";",
"for",
"(",
"Object",
"child",
":",
"children",
"(",
")",
")",
"{",
"if",
"(",
"child",
"instanceof",
"Node",
")",
"{",
... | Provides lookup of elements by name.
@param name the name of interest
@return the nodes matching name | [
"Provides",
"lookup",
"of",
"elements",
"by",
"name",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/Node.java#L523-L540 |
12,563 | apache/groovy | src/main/groovy/groovy/util/Node.java | Node.depthFirst | public List depthFirst(boolean preorder) {
List answer = new NodeList();
if (preorder) answer.add(this);
answer.addAll(depthFirstRest(preorder));
if (!preorder) answer.add(this);
return answer;
} | java | public List depthFirst(boolean preorder) {
List answer = new NodeList();
if (preorder) answer.add(this);
answer.addAll(depthFirstRest(preorder));
if (!preorder) answer.add(this);
return answer;
} | [
"public",
"List",
"depthFirst",
"(",
"boolean",
"preorder",
")",
"{",
"List",
"answer",
"=",
"new",
"NodeList",
"(",
")",
";",
"if",
"(",
"preorder",
")",
"answer",
".",
"add",
"(",
"this",
")",
";",
"answer",
".",
"addAll",
"(",
"depthFirstRest",
"(",... | Provides a collection of all the nodes in the tree
using a depth-first traversal.
@param preorder if false, a postorder depth-first traversal will be performed
@return the list of (depth-first) ordered nodes
@since 2.5.0 | [
"Provides",
"a",
"collection",
"of",
"all",
"the",
"nodes",
"in",
"the",
"tree",
"using",
"a",
"depth",
"-",
"first",
"traversal",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/Node.java#L560-L566 |
12,564 | apache/groovy | src/main/groovy/groovy/util/Node.java | Node.depthFirst | public void depthFirst(Closure c) {
Map<String, Object> options = new ListHashMap<String, Object>();
options.put("preorder", true);
depthFirst(options, c);
} | java | public void depthFirst(Closure c) {
Map<String, Object> options = new ListHashMap<String, Object>();
options.put("preorder", true);
depthFirst(options, c);
} | [
"public",
"void",
"depthFirst",
"(",
"Closure",
"c",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
"=",
"new",
"ListHashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"options",
".",
"put",
"(",
"\"preorder\"",
",",
"true",
... | Provides a collection of all the nodes in the tree
using a depth-first preorder traversal.
@param c the closure to run for each node (a one or two parameter can be used; if one parameter is given the
closure will be passed the node, for a two param closure the second parameter will be the level).
@since 2.5.0 | [
"Provides",
"a",
"collection",
"of",
"all",
"the",
"nodes",
"in",
"the",
"tree",
"using",
"a",
"depth",
"-",
"first",
"preorder",
"traversal",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/Node.java#L593-L597 |
12,565 | apache/groovy | src/main/groovy/groovy/util/Node.java | Node.depthFirst | public void depthFirst(Map<String, Object> options, Closure c) {
boolean preorder = Boolean.valueOf(options.get("preorder").toString());
if (preorder) callClosureForNode(c, this, 1);
depthFirstRest(preorder, 2, c);
if (!preorder) callClosureForNode(c, this, 1);
} | java | public void depthFirst(Map<String, Object> options, Closure c) {
boolean preorder = Boolean.valueOf(options.get("preorder").toString());
if (preorder) callClosureForNode(c, this, 1);
depthFirstRest(preorder, 2, c);
if (!preorder) callClosureForNode(c, this, 1);
} | [
"public",
"void",
"depthFirst",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
",",
"Closure",
"c",
")",
"{",
"boolean",
"preorder",
"=",
"Boolean",
".",
"valueOf",
"(",
"options",
".",
"get",
"(",
"\"preorder\"",
")",
".",
"toString",
"(",
... | Provides a collection of all the nodes in the tree
using a depth-first traversal.
A boolean 'preorder' options is supported.
@param options map containing options
@param c the closure to run for each node (a one or two parameter can be used; if one parameter is given the
closure will be passed the node, for a two para... | [
"Provides",
"a",
"collection",
"of",
"all",
"the",
"nodes",
"in",
"the",
"tree",
"using",
"a",
"depth",
"-",
"first",
"traversal",
".",
"A",
"boolean",
"preorder",
"options",
"is",
"supported",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/Node.java#L609-L614 |
12,566 | apache/groovy | src/main/groovy/groovy/util/Node.java | Node.breadthFirst | public void breadthFirst(Map<String, Object> options, Closure c) {
boolean preorder = Boolean.valueOf(options.get("preorder").toString());
if (preorder) callClosureForNode(c, this, 1);
breadthFirstRest(preorder, 2, c);
if (!preorder) callClosureForNode(c, this, 1);
} | java | public void breadthFirst(Map<String, Object> options, Closure c) {
boolean preorder = Boolean.valueOf(options.get("preorder").toString());
if (preorder) callClosureForNode(c, this, 1);
breadthFirstRest(preorder, 2, c);
if (!preorder) callClosureForNode(c, this, 1);
} | [
"public",
"void",
"breadthFirst",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
",",
"Closure",
"c",
")",
"{",
"boolean",
"preorder",
"=",
"Boolean",
".",
"valueOf",
"(",
"options",
".",
"get",
"(",
"\"preorder\"",
")",
".",
"toString",
"(",
... | Calls the provided closure for all the nodes in the tree
using a breadth-first traversal.
A boolean 'preorder' options is supported.
@param options map containing options
@param c the closure to run for each node (a one or two parameter can be used; if one parameter is given the
closure will be passed the node, for a ... | [
"Calls",
"the",
"provided",
"closure",
"for",
"all",
"the",
"nodes",
"in",
"the",
"tree",
"using",
"a",
"breadth",
"-",
"first",
"traversal",
".",
"A",
"boolean",
"preorder",
"options",
"is",
"supported",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/Node.java#L711-L716 |
12,567 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java | GPathResult.setMetaClass | @Override
public void setMetaClass(final MetaClass metaClass) {
final MetaClass newMetaClass = new DelegatingMetaClass(metaClass) {
@Override
public Object getAttribute(final Object object, final String attribute) {
return GPathResult.this.getProperty("@" + attribute)... | java | @Override
public void setMetaClass(final MetaClass metaClass) {
final MetaClass newMetaClass = new DelegatingMetaClass(metaClass) {
@Override
public Object getAttribute(final Object object, final String attribute) {
return GPathResult.this.getProperty("@" + attribute)... | [
"@",
"Override",
"public",
"void",
"setMetaClass",
"(",
"final",
"MetaClass",
"metaClass",
")",
"{",
"final",
"MetaClass",
"newMetaClass",
"=",
"new",
"DelegatingMetaClass",
"(",
"metaClass",
")",
"{",
"@",
"Override",
"public",
"Object",
"getAttribute",
"(",
"f... | Replaces the MetaClass of this GPathResult.
@param metaClass the new MetaClass | [
"Replaces",
"the",
"MetaClass",
"of",
"this",
"GPathResult",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java#L89-L103 |
12,568 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java | GPathResult.setProperty | public void setProperty(final String property, final Object newValue) {
if (property.startsWith("@")) {
if (newValue instanceof String || newValue instanceof GString) {
final Iterator iter = iterator();
while (iter.hasNext()) {
final NodeChild chi... | java | public void setProperty(final String property, final Object newValue) {
if (property.startsWith("@")) {
if (newValue instanceof String || newValue instanceof GString) {
final Iterator iter = iterator();
while (iter.hasNext()) {
final NodeChild chi... | [
"public",
"void",
"setProperty",
"(",
"final",
"String",
"property",
",",
"final",
"Object",
"newValue",
")",
"{",
"if",
"(",
"property",
".",
"startsWith",
"(",
"\"@\"",
")",
")",
"{",
"if",
"(",
"newValue",
"instanceof",
"String",
"||",
"newValue",
"inst... | Replaces the specified property of this GPathResult with a new value.
@param property the property of this GPathResult to replace
@param newValue the new value of the property | [
"Replaces",
"the",
"specified",
"property",
"of",
"this",
"GPathResult",
"with",
"a",
"new",
"value",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java#L147-L174 |
12,569 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java | GPathResult.plus | public Object plus(final Object newValue) {
this.replaceNode(new Closure(this) {
public void doCall(Object[] args) {
final GroovyObject delegate = (GroovyObject) getDelegate();
delegate.getProperty("mkp");
delegate.invokeMethod("yield", args);
... | java | public Object plus(final Object newValue) {
this.replaceNode(new Closure(this) {
public void doCall(Object[] args) {
final GroovyObject delegate = (GroovyObject) getDelegate();
delegate.getProperty("mkp");
delegate.invokeMethod("yield", args);
... | [
"public",
"Object",
"plus",
"(",
"final",
"Object",
"newValue",
")",
"{",
"this",
".",
"replaceNode",
"(",
"new",
"Closure",
"(",
"this",
")",
"{",
"public",
"void",
"doCall",
"(",
"Object",
"[",
"]",
"args",
")",
"{",
"final",
"GroovyObject",
"delegate"... | Lazily adds the specified Object to this GPathResult.
@param newValue the Object to add
@return <code>this</code> | [
"Lazily",
"adds",
"the",
"specified",
"Object",
"to",
"this",
"GPathResult",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java#L194-L206 |
12,570 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java | GPathResult.putAt | public void putAt(final int index, final Object newValue) {
final GPathResult result = (GPathResult)getAt(index);
if (newValue instanceof Closure) {
result.replaceNode((Closure)newValue);
} else {
result.replaceBody(newValue);
}
} | java | public void putAt(final int index, final Object newValue) {
final GPathResult result = (GPathResult)getAt(index);
if (newValue instanceof Closure) {
result.replaceNode((Closure)newValue);
} else {
result.replaceBody(newValue);
}
} | [
"public",
"void",
"putAt",
"(",
"final",
"int",
"index",
",",
"final",
"Object",
"newValue",
")",
"{",
"final",
"GPathResult",
"result",
"=",
"(",
"GPathResult",
")",
"getAt",
"(",
"index",
")",
";",
"if",
"(",
"newValue",
"instanceof",
"Closure",
")",
"... | A helper method to allow GPathResults to work with subscript operators
@param index an index
@param newValue the value to put at the given index | [
"A",
"helper",
"method",
"to",
"allow",
"GPathResults",
"to",
"work",
"with",
"subscript",
"operators"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java#L477-L484 |
12,571 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java | GPathResult.depthFirst | public Iterator depthFirst() {
return new Iterator() {
private final List list = new LinkedList();
private final Stack stack = new Stack();
private Iterator iter = iterator();
private GPathResult next = getNextByDepth();
public boolean hasNext() {
... | java | public Iterator depthFirst() {
return new Iterator() {
private final List list = new LinkedList();
private final Stack stack = new Stack();
private Iterator iter = iterator();
private GPathResult next = getNextByDepth();
public boolean hasNext() {
... | [
"public",
"Iterator",
"depthFirst",
"(",
")",
"{",
"return",
"new",
"Iterator",
"(",
")",
"{",
"private",
"final",
"List",
"list",
"=",
"new",
"LinkedList",
"(",
")",
";",
"private",
"final",
"Stack",
"stack",
"=",
"new",
"Stack",
"(",
")",
";",
"priva... | Provides an Iterator over all the nodes of this GPathResult using a depth-first traversal.
@return the <code>Iterator</code> of (depth-first) ordered GPathResults | [
"Provides",
"an",
"Iterator",
"over",
"all",
"the",
"nodes",
"of",
"this",
"GPathResult",
"using",
"a",
"depth",
"-",
"first",
"traversal",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java#L491-L532 |
12,572 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java | GPathResult.breadthFirst | public Iterator breadthFirst() {
return new Iterator() {
private final List list = new LinkedList();
private Iterator iter = iterator();
private GPathResult next = getNextByBreadth();
public boolean hasNext() {
return this.next != null;
... | java | public Iterator breadthFirst() {
return new Iterator() {
private final List list = new LinkedList();
private Iterator iter = iterator();
private GPathResult next = getNextByBreadth();
public boolean hasNext() {
return this.next != null;
... | [
"public",
"Iterator",
"breadthFirst",
"(",
")",
"{",
"return",
"new",
"Iterator",
"(",
")",
"{",
"private",
"final",
"List",
"list",
"=",
"new",
"LinkedList",
"(",
")",
";",
"private",
"Iterator",
"iter",
"=",
"iterator",
"(",
")",
";",
"private",
"GPath... | Provides an Iterator over all the nodes of this GPathResult using a breadth-first traversal.
@return the <code>Iterator</code> of (breadth-first) ordered GPathResults | [
"Provides",
"an",
"Iterator",
"over",
"all",
"the",
"nodes",
"of",
"this",
"GPathResult",
"using",
"a",
"breadth",
"-",
"first",
"traversal",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java#L539-L593 |
12,573 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java | GPathResult.list | public List list() {
final Iterator iter = nodeIterator();
final List result = new LinkedList();
while (iter.hasNext()) {
result.add(new NodeChild((Node) iter.next(), this.parent, this.namespacePrefix, this.namespaceTagHints));
}
return result;
} | java | public List list() {
final Iterator iter = nodeIterator();
final List result = new LinkedList();
while (iter.hasNext()) {
result.add(new NodeChild((Node) iter.next(), this.parent, this.namespacePrefix, this.namespaceTagHints));
}
return result;
} | [
"public",
"List",
"list",
"(",
")",
"{",
"final",
"Iterator",
"iter",
"=",
"nodeIterator",
"(",
")",
";",
"final",
"List",
"result",
"=",
"new",
"LinkedList",
"(",
")",
";",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",
"result",
".",
"... | Creates a list of objects representing this GPathResult.
@return a list representing of this GPathResult | [
"Creates",
"a",
"list",
"of",
"objects",
"representing",
"this",
"GPathResult",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java#L600-L607 |
12,574 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java | GPathResult.getBody | public Closure getBody() {
return new Closure(this.parent,this) {
public void doCall(Object[] args) {
final GroovyObject delegate = (GroovyObject)getDelegate();
final GPathResult thisObject = (GPathResult)getThisObject();
Node node = (Node)thisObject.... | java | public Closure getBody() {
return new Closure(this.parent,this) {
public void doCall(Object[] args) {
final GroovyObject delegate = (GroovyObject)getDelegate();
final GPathResult thisObject = (GPathResult)getThisObject();
Node node = (Node)thisObject.... | [
"public",
"Closure",
"getBody",
"(",
")",
"{",
"return",
"new",
"Closure",
"(",
"this",
".",
"parent",
",",
"this",
")",
"{",
"public",
"void",
"doCall",
"(",
"Object",
"[",
"]",
"args",
")",
"{",
"final",
"GroovyObject",
"delegate",
"=",
"(",
"GroovyO... | Creates a Closure representing the body of this GPathResult.
@return the body of this GPathResult, converted to a <code>Closure</code> | [
"Creates",
"a",
"Closure",
"representing",
"the",
"body",
"of",
"this",
"GPathResult",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java#L623-L642 |
12,575 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ArrayTypeUtils.java | ArrayTypeUtils.dimension | public static int dimension(Class clazz) {
checkArrayType(clazz);
int result = 0;
while (clazz.isArray()) {
result++;
clazz = clazz.getComponentType();
}
return result;
} | java | public static int dimension(Class clazz) {
checkArrayType(clazz);
int result = 0;
while (clazz.isArray()) {
result++;
clazz = clazz.getComponentType();
}
return result;
} | [
"public",
"static",
"int",
"dimension",
"(",
"Class",
"clazz",
")",
"{",
"checkArrayType",
"(",
"clazz",
")",
";",
"int",
"result",
"=",
"0",
";",
"while",
"(",
"clazz",
".",
"isArray",
"(",
")",
")",
"{",
"result",
"++",
";",
"clazz",
"=",
"clazz",
... | Calculate the dimension of array
@param clazz the type of array
@return the dimension of array | [
"Calculate",
"the",
"dimension",
"of",
"array"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ArrayTypeUtils.java#L33-L43 |
12,576 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ArrayTypeUtils.java | ArrayTypeUtils.elementType | public static Class elementType(Class clazz) {
checkArrayType(clazz);
while (clazz.isArray()) {
clazz = clazz.getComponentType();
}
return clazz;
} | java | public static Class elementType(Class clazz) {
checkArrayType(clazz);
while (clazz.isArray()) {
clazz = clazz.getComponentType();
}
return clazz;
} | [
"public",
"static",
"Class",
"elementType",
"(",
"Class",
"clazz",
")",
"{",
"checkArrayType",
"(",
"clazz",
")",
";",
"while",
"(",
"clazz",
".",
"isArray",
"(",
")",
")",
"{",
"clazz",
"=",
"clazz",
".",
"getComponentType",
"(",
")",
";",
"}",
"retur... | Get the type of array elements
@param clazz the type of array
@return the type of elements | [
"Get",
"the",
"type",
"of",
"array",
"elements"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ArrayTypeUtils.java#L51-L59 |
12,577 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ArrayTypeUtils.java | ArrayTypeUtils.elementType | public static Class elementType(Class clazz, int dim) {
checkArrayType(clazz);
if (dim < 0) {
throw new IllegalArgumentException("The target dimension should not be less than zero: " + dim);
}
while (clazz.isArray() && dimension(clazz) > dim) {
clazz = clazz.get... | java | public static Class elementType(Class clazz, int dim) {
checkArrayType(clazz);
if (dim < 0) {
throw new IllegalArgumentException("The target dimension should not be less than zero: " + dim);
}
while (clazz.isArray() && dimension(clazz) > dim) {
clazz = clazz.get... | [
"public",
"static",
"Class",
"elementType",
"(",
"Class",
"clazz",
",",
"int",
"dim",
")",
"{",
"checkArrayType",
"(",
"clazz",
")",
";",
"if",
"(",
"dim",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The target dimension should not ... | Get the type of array elements by the dimension
@param clazz the type of array
@param dim the target dimension
@return the result array | [
"Get",
"the",
"type",
"of",
"array",
"elements",
"by",
"the",
"dimension"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ArrayTypeUtils.java#L68-L80 |
12,578 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ArrayTypeUtils.java | ArrayTypeUtils.checkArrayType | private static void checkArrayType(Class clazz) {
if (null == clazz) {
throw new IllegalArgumentException("clazz can not be null");
}
if (!clazz.isArray()) {
throw new IllegalArgumentException(clazz.getCanonicalName() + " is not array type");
}
} | java | private static void checkArrayType(Class clazz) {
if (null == clazz) {
throw new IllegalArgumentException("clazz can not be null");
}
if (!clazz.isArray()) {
throw new IllegalArgumentException(clazz.getCanonicalName() + " is not array type");
}
} | [
"private",
"static",
"void",
"checkArrayType",
"(",
"Class",
"clazz",
")",
"{",
"if",
"(",
"null",
"==",
"clazz",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"clazz can not be null\"",
")",
";",
"}",
"if",
"(",
"!",
"clazz",
".",
"isArray",
... | Check whether the type passed in is array type.
If the type is not array type, throw IllegalArgumentException. | [
"Check",
"whether",
"the",
"type",
"passed",
"in",
"is",
"array",
"type",
".",
"If",
"the",
"type",
"is",
"not",
"array",
"type",
"throw",
"IllegalArgumentException",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ArrayTypeUtils.java#L86-L94 |
12,579 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java | ProcessGroovyMethods.getText | public static String getText(Process self) throws IOException {
String text = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(self.getInputStream())));
closeStreams(self);
return text;
} | java | public static String getText(Process self) throws IOException {
String text = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(self.getInputStream())));
closeStreams(self);
return text;
} | [
"public",
"static",
"String",
"getText",
"(",
"Process",
"self",
")",
"throws",
"IOException",
"{",
"String",
"text",
"=",
"IOGroovyMethods",
".",
"getText",
"(",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"self",
".",
"getInputStream",
"(",
... | Read the text of the output stream of the Process.
Closes all the streams associated with the process after retrieving the text.
@param self a Process instance
@return the text of the output
@throws java.io.IOException if an IOException occurs.
@since 1.0 | [
"Read",
"the",
"text",
"of",
"the",
"output",
"stream",
"of",
"the",
"Process",
".",
"Closes",
"all",
"the",
"streams",
"associated",
"with",
"the",
"process",
"after",
"retrieving",
"the",
"text",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java#L74-L78 |
12,580 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java | ProcessGroovyMethods.leftShift | public static OutputStream leftShift(Process self, byte[] value) throws IOException {
return IOGroovyMethods.leftShift(self.getOutputStream(), value);
} | java | public static OutputStream leftShift(Process self, byte[] value) throws IOException {
return IOGroovyMethods.leftShift(self.getOutputStream(), value);
} | [
"public",
"static",
"OutputStream",
"leftShift",
"(",
"Process",
"self",
",",
"byte",
"[",
"]",
"value",
")",
"throws",
"IOException",
"{",
"return",
"IOGroovyMethods",
".",
"leftShift",
"(",
"self",
".",
"getOutputStream",
"(",
")",
",",
"value",
")",
";",
... | Overloads the left shift operator to provide an append mechanism
to pipe into a Process
@param self a Process instance
@param value data to append
@return an OutputStream
@throws java.io.IOException if an IOException occurs.
@since 1.0 | [
"Overloads",
"the",
"left",
"shift",
"operator",
"to",
"provide",
"an",
"append",
"mechanism",
"to",
"pipe",
"into",
"a",
"Process"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java#L128-L130 |
12,581 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java | ProcessGroovyMethods.waitForOrKill | public static void waitForOrKill(Process self, long numberOfMillis) {
ProcessRunner runnable = new ProcessRunner(self);
Thread thread = new Thread(runnable);
thread.start();
runnable.waitForOrKill(numberOfMillis);
} | java | public static void waitForOrKill(Process self, long numberOfMillis) {
ProcessRunner runnable = new ProcessRunner(self);
Thread thread = new Thread(runnable);
thread.start();
runnable.waitForOrKill(numberOfMillis);
} | [
"public",
"static",
"void",
"waitForOrKill",
"(",
"Process",
"self",
",",
"long",
"numberOfMillis",
")",
"{",
"ProcessRunner",
"runnable",
"=",
"new",
"ProcessRunner",
"(",
"self",
")",
";",
"Thread",
"thread",
"=",
"new",
"Thread",
"(",
"runnable",
")",
";"... | Wait for the process to finish during a certain amount of time, otherwise stops the process.
@param self a Process
@param numberOfMillis the number of milliseconds to wait before stopping the process
@since 1.0 | [
"Wait",
"for",
"the",
"process",
"to",
"finish",
"during",
"a",
"certain",
"amount",
"of",
"time",
"otherwise",
"stops",
"the",
"process",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java#L139-L144 |
12,582 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java | ProcessGroovyMethods.consumeProcessErrorStream | public static Thread consumeProcessErrorStream(Process self, OutputStream err) {
Thread thread = new Thread(new ByteDumper(self.getErrorStream(), err));
thread.start();
return thread;
} | java | public static Thread consumeProcessErrorStream(Process self, OutputStream err) {
Thread thread = new Thread(new ByteDumper(self.getErrorStream(), err));
thread.start();
return thread;
} | [
"public",
"static",
"Thread",
"consumeProcessErrorStream",
"(",
"Process",
"self",
",",
"OutputStream",
"err",
")",
"{",
"Thread",
"thread",
"=",
"new",
"Thread",
"(",
"new",
"ByteDumper",
"(",
"self",
".",
"getErrorStream",
"(",
")",
",",
"err",
")",
")",
... | Gets the error stream from a process and reads it
to keep the process from blocking due to a full buffer.
The processed stream data is appended to the supplied OutputStream.
A new Thread is started, so this method will return immediately.
@param self a Process
@param err an OutputStream to capture the process stderr
@... | [
"Gets",
"the",
"error",
"stream",
"from",
"a",
"process",
"and",
"reads",
"it",
"to",
"keep",
"the",
"process",
"from",
"blocking",
"due",
"to",
"a",
"full",
"buffer",
".",
"The",
"processed",
"stream",
"data",
"is",
"appended",
"to",
"the",
"supplied",
... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java#L283-L287 |
12,583 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java | ProcessGroovyMethods.consumeProcessErrorStream | public static Thread consumeProcessErrorStream(Process self, Appendable error) {
Thread thread = new Thread(new TextDumper(self.getErrorStream(), error));
thread.start();
return thread;
} | java | public static Thread consumeProcessErrorStream(Process self, Appendable error) {
Thread thread = new Thread(new TextDumper(self.getErrorStream(), error));
thread.start();
return thread;
} | [
"public",
"static",
"Thread",
"consumeProcessErrorStream",
"(",
"Process",
"self",
",",
"Appendable",
"error",
")",
"{",
"Thread",
"thread",
"=",
"new",
"Thread",
"(",
"new",
"TextDumper",
"(",
"self",
".",
"getErrorStream",
"(",
")",
",",
"error",
")",
")",... | Gets the error stream from a process and reads it
to keep the process from blocking due to a full buffer.
The processed stream data is appended to the supplied Appendable.
A new Thread is started, so this method will return immediately.
@param self a Process
@param error an Appendable to capture the process stderr
@re... | [
"Gets",
"the",
"error",
"stream",
"from",
"a",
"process",
"and",
"reads",
"it",
"to",
"keep",
"the",
"process",
"from",
"blocking",
"due",
"to",
"a",
"full",
"buffer",
".",
"The",
"processed",
"stream",
"data",
"is",
"appended",
"to",
"the",
"supplied",
... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java#L300-L304 |
12,584 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java | ProcessGroovyMethods.consumeProcessOutputStream | public static Thread consumeProcessOutputStream(Process self, Appendable output) {
Thread thread = new Thread(new TextDumper(self.getInputStream(), output));
thread.start();
return thread;
} | java | public static Thread consumeProcessOutputStream(Process self, Appendable output) {
Thread thread = new Thread(new TextDumper(self.getInputStream(), output));
thread.start();
return thread;
} | [
"public",
"static",
"Thread",
"consumeProcessOutputStream",
"(",
"Process",
"self",
",",
"Appendable",
"output",
")",
"{",
"Thread",
"thread",
"=",
"new",
"Thread",
"(",
"new",
"TextDumper",
"(",
"self",
".",
"getInputStream",
"(",
")",
",",
"output",
")",
"... | Gets the output stream from a process and reads it
to keep the process from blocking due to a full output buffer.
The processed stream data is appended to the supplied Appendable.
A new Thread is started, so this method will return immediately.
@param self a Process
@param output an Appendable to capture the process s... | [
"Gets",
"the",
"output",
"stream",
"from",
"a",
"process",
"and",
"reads",
"it",
"to",
"keep",
"the",
"process",
"from",
"blocking",
"due",
"to",
"a",
"full",
"output",
"buffer",
".",
"The",
"processed",
"stream",
"data",
"is",
"appended",
"to",
"the",
"... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java#L317-L321 |
12,585 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java | ProcessGroovyMethods.consumeProcessOutputStream | public static Thread consumeProcessOutputStream(Process self, OutputStream output) {
Thread thread = new Thread(new ByteDumper(self.getInputStream(), output));
thread.start();
return thread;
} | java | public static Thread consumeProcessOutputStream(Process self, OutputStream output) {
Thread thread = new Thread(new ByteDumper(self.getInputStream(), output));
thread.start();
return thread;
} | [
"public",
"static",
"Thread",
"consumeProcessOutputStream",
"(",
"Process",
"self",
",",
"OutputStream",
"output",
")",
"{",
"Thread",
"thread",
"=",
"new",
"Thread",
"(",
"new",
"ByteDumper",
"(",
"self",
".",
"getInputStream",
"(",
")",
",",
"output",
")",
... | Gets the output stream from a process and reads it
to keep the process from blocking due to a full output buffer.
The processed stream data is appended to the supplied OutputStream.
A new Thread is started, so this method will return immediately.
@param self a Process
@param output an OutputStream to capture the proce... | [
"Gets",
"the",
"output",
"stream",
"from",
"a",
"process",
"and",
"reads",
"it",
"to",
"keep",
"the",
"process",
"from",
"blocking",
"due",
"to",
"a",
"full",
"output",
"buffer",
".",
"The",
"processed",
"stream",
"data",
"is",
"appended",
"to",
"the",
"... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java#L334-L338 |
12,586 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java | ProcessGroovyMethods.withWriter | public static void withWriter(final Process self, final Closure closure) {
new Thread(new Runnable() {
public void run() {
try {
IOGroovyMethods.withWriter(new BufferedOutputStream(getOut(self)), closure);
} catch (IOException e) {
... | java | public static void withWriter(final Process self, final Closure closure) {
new Thread(new Runnable() {
public void run() {
try {
IOGroovyMethods.withWriter(new BufferedOutputStream(getOut(self)), closure);
} catch (IOException e) {
... | [
"public",
"static",
"void",
"withWriter",
"(",
"final",
"Process",
"self",
",",
"final",
"Closure",
"closure",
")",
"{",
"new",
"Thread",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"IOGroovyMethods",
".",
... | Creates a new BufferedWriter as stdin for this process,
passes it to the closure, and ensures the stream is flushed
and closed after the closure returns.
A new Thread is started, so this method will return immediately.
@param self a Process
@param closure a closure
@since 1.5.2 | [
"Creates",
"a",
"new",
"BufferedWriter",
"as",
"stdin",
"for",
"this",
"process",
"passes",
"it",
"to",
"the",
"closure",
"and",
"ensures",
"the",
"stream",
"is",
"flushed",
"and",
"closed",
"after",
"the",
"closure",
"returns",
".",
"A",
"new",
"Thread",
... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java#L350-L360 |
12,587 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java | ProcessGroovyMethods.pipeTo | public static Process pipeTo(final Process left, final Process right) throws IOException {
new Thread(new Runnable() {
public void run() {
InputStream in = new BufferedInputStream(getIn(left));
OutputStream out = new BufferedOutputStream(getOut(right));
... | java | public static Process pipeTo(final Process left, final Process right) throws IOException {
new Thread(new Runnable() {
public void run() {
InputStream in = new BufferedInputStream(getIn(left));
OutputStream out = new BufferedOutputStream(getOut(right));
... | [
"public",
"static",
"Process",
"pipeTo",
"(",
"final",
"Process",
"left",
",",
"final",
"Process",
"right",
")",
"throws",
"IOException",
"{",
"new",
"Thread",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"InputStream",
... | Allows one Process to asynchronously pipe data to another Process.
@param left a Process instance
@param right a Process to pipe output to
@return the second Process to allow chaining
@throws java.io.IOException if an IOException occurs.
@since 1.5.2 | [
"Allows",
"one",
"Process",
"to",
"asynchronously",
"pipe",
"data",
"to",
"another",
"Process",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java#L393-L413 |
12,588 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java | ProcessGroovyMethods.or | public static Process or(final Process left, final Process right) throws IOException {
return pipeTo(left, right);
} | java | public static Process or(final Process left, final Process right) throws IOException {
return pipeTo(left, right);
} | [
"public",
"static",
"Process",
"or",
"(",
"final",
"Process",
"left",
",",
"final",
"Process",
"right",
")",
"throws",
"IOException",
"{",
"return",
"pipeTo",
"(",
"left",
",",
"right",
")",
";",
"}"
] | Overrides the or operator to allow one Process to asynchronously
pipe data to another Process.
@param left a Process instance
@param right a Process to pipe output to
@return the second Process to allow chaining
@throws java.io.IOException if an IOException occurs.
@since 1.5.1 | [
"Overrides",
"the",
"or",
"operator",
"to",
"allow",
"one",
"Process",
"to",
"asynchronously",
"pipe",
"data",
"to",
"another",
"Process",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java#L425-L427 |
12,589 | apache/groovy | src/main/java/org/codehaus/groovy/ast/MethodInvocationTrap.java | MethodInvocationTrap.visitMethodCallExpression | public void visitMethodCallExpression(MethodCallExpression call) {
boolean shouldContinueWalking = true;
if (isBuildInvocation(call)) {
shouldContinueWalking = handleTargetMethodCallExpression(call);
}
if (shouldContinueWalking) {
// continue normal tree walking... | java | public void visitMethodCallExpression(MethodCallExpression call) {
boolean shouldContinueWalking = true;
if (isBuildInvocation(call)) {
shouldContinueWalking = handleTargetMethodCallExpression(call);
}
if (shouldContinueWalking) {
// continue normal tree walking... | [
"public",
"void",
"visitMethodCallExpression",
"(",
"MethodCallExpression",
"call",
")",
"{",
"boolean",
"shouldContinueWalking",
"=",
"true",
";",
"if",
"(",
"isBuildInvocation",
"(",
"call",
")",
")",
"{",
"shouldContinueWalking",
"=",
"handleTargetMethodCallExpressio... | Attempts to find AstBuilder 'from code' invocations. When found, converts them into calls
to the 'from string' approach.
@param call the method call expression that may or may not be an AstBuilder 'from code' invocation. | [
"Attempts",
"to",
"find",
"AstBuilder",
"from",
"code",
"invocations",
".",
"When",
"found",
"converts",
"them",
"into",
"calls",
"to",
"the",
"from",
"string",
"approach",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/MethodInvocationTrap.java#L47-L60 |
12,590 | apache/groovy | subprojects/groovy-sql/src/main/java/groovy/sql/GroovyResultSetProxy.java | GroovyResultSetProxy.invoke | public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
String name = method.getName();
if (method.getDeclaringClass() == GroovyObject.class) {
if (name.equals("getMetaClass")) {
return getMetaClass();
} else if (name.equals("setMetaCla... | java | public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
String name = method.getName();
if (method.getDeclaringClass() == GroovyObject.class) {
if (name.equals("getMetaClass")) {
return getMetaClass();
} else if (name.equals("setMetaCla... | [
"public",
"Object",
"invoke",
"(",
"Object",
"proxy",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"Throwable",
"{",
"String",
"name",
"=",
"method",
".",
"getName",
"(",
")",
";",
"if",
"(",
"method",
".",
"getDeclaringClass"... | Invokes a method for the GroovyResultSet.
This will try to invoke the given method first on the extension
and then on the result set given as proxy parameter.
@param proxy the result set
@param method the method name of this method will be used
to make a call on the extension. If this fails the call will be
done on t... | [
"Invokes",
"a",
"method",
"for",
"the",
"GroovyResultSet",
".",
"This",
"will",
"try",
"to",
"invoke",
"the",
"given",
"method",
"first",
"on",
"the",
"extension",
"and",
"then",
"on",
"the",
"result",
"set",
"given",
"as",
"proxy",
"parameter",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/GroovyResultSetProxy.java#L80-L91 |
12,591 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/xml/DOMBuilder.java | DOMBuilder.parse | public static Document parse(Reader reader) throws SAXException, IOException, ParserConfigurationException {
return parse(reader, false, true);
} | java | public static Document parse(Reader reader) throws SAXException, IOException, ParserConfigurationException {
return parse(reader, false, true);
} | [
"public",
"static",
"Document",
"parse",
"(",
"Reader",
"reader",
")",
"throws",
"SAXException",
",",
"IOException",
",",
"ParserConfigurationException",
"{",
"return",
"parse",
"(",
"reader",
",",
"false",
",",
"true",
")",
";",
"}"
] | Creates a DocumentBuilder and uses it to parse the XML text read from the given reader.
A non-validating, namespace aware parser which does not allow DOCTYPE declarations is used.
@param reader the reader to read the XML text from
@return the root node of the parsed tree of Nodes
@throws SAXException A... | [
"Creates",
"a",
"DocumentBuilder",
"and",
"uses",
"it",
"to",
"parse",
"the",
"XML",
"text",
"read",
"from",
"the",
"given",
"reader",
".",
"A",
"non",
"-",
"validating",
"namespace",
"aware",
"parser",
"which",
"does",
"not",
"allow",
"DOCTYPE",
"declaratio... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/xml/DOMBuilder.java#L70-L72 |
12,592 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/xml/DOMBuilder.java | DOMBuilder.parse | public static Document parse(Reader reader, boolean validating, boolean namespaceAware)
throws SAXException, IOException, ParserConfigurationException {
return parse(reader, validating, namespaceAware, false);
} | java | public static Document parse(Reader reader, boolean validating, boolean namespaceAware)
throws SAXException, IOException, ParserConfigurationException {
return parse(reader, validating, namespaceAware, false);
} | [
"public",
"static",
"Document",
"parse",
"(",
"Reader",
"reader",
",",
"boolean",
"validating",
",",
"boolean",
"namespaceAware",
")",
"throws",
"SAXException",
",",
"IOException",
",",
"ParserConfigurationException",
"{",
"return",
"parse",
"(",
"reader",
",",
"v... | Creates a DocumentBuilder and uses it to parse the XML text read from the given reader, allowing
parser validation and namespace awareness to be controlled. Documents are not allowed to contain
DOCYTYPE declarations.
@param reader the reader to read the XML text from
@param validating whether to validate t... | [
"Creates",
"a",
"DocumentBuilder",
"and",
"uses",
"it",
"to",
"parse",
"the",
"XML",
"text",
"read",
"from",
"the",
"given",
"reader",
"allowing",
"parser",
"validation",
"and",
"namespace",
"awareness",
"to",
"be",
"controlled",
".",
"Documents",
"are",
"not"... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/xml/DOMBuilder.java#L89-L92 |
12,593 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/xml/DOMBuilder.java | DOMBuilder.parse | public static Document parse(Reader reader, boolean validating, boolean namespaceAware, boolean allowDocTypeDeclaration)
throws SAXException, IOException, ParserConfigurationException {
DocumentBuilderFactory factory = FactorySupport.createDocumentBuilderFactory();
factory.setNamespaceAware(... | java | public static Document parse(Reader reader, boolean validating, boolean namespaceAware, boolean allowDocTypeDeclaration)
throws SAXException, IOException, ParserConfigurationException {
DocumentBuilderFactory factory = FactorySupport.createDocumentBuilderFactory();
factory.setNamespaceAware(... | [
"public",
"static",
"Document",
"parse",
"(",
"Reader",
"reader",
",",
"boolean",
"validating",
",",
"boolean",
"namespaceAware",
",",
"boolean",
"allowDocTypeDeclaration",
")",
"throws",
"SAXException",
",",
"IOException",
",",
"ParserConfigurationException",
"{",
"D... | Creates a DocumentBuilder and uses it to parse the XML text read from the given reader, allowing
parser validation, namespace awareness and permission of DOCTYPE declarations to be controlled.
@param reader the reader to read the XML text from
@param validating whether to validate the XML... | [
"Creates",
"a",
"DocumentBuilder",
"and",
"uses",
"it",
"to",
"parse",
"the",
"XML",
"text",
"read",
"from",
"the",
"given",
"reader",
"allowing",
"parser",
"validation",
"namespace",
"awareness",
"and",
"permission",
"of",
"DOCTYPE",
"declarations",
"to",
"be",... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/xml/DOMBuilder.java#L109-L118 |
12,594 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/xml/DOMBuilder.java | DOMBuilder.parseText | public Document parseText(String text) throws SAXException, IOException, ParserConfigurationException {
return parse(new StringReader(text));
} | java | public Document parseText(String text) throws SAXException, IOException, ParserConfigurationException {
return parse(new StringReader(text));
} | [
"public",
"Document",
"parseText",
"(",
"String",
"text",
")",
"throws",
"SAXException",
",",
"IOException",
",",
"ParserConfigurationException",
"{",
"return",
"parse",
"(",
"new",
"StringReader",
"(",
"text",
")",
")",
";",
"}"
] | A helper method to parse the given text as XML.
@param text the XML text to parse
@return the root node of the parsed tree of Nodes
@throws SAXException Any SAX exception, possibly wrapping another exception.
@throws IOException An IO exception from the parser, possibly from a byte
str... | [
"A",
"helper",
"method",
"to",
"parse",
"the",
"given",
"text",
"as",
"XML",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/xml/DOMBuilder.java#L139-L141 |
12,595 | apache/groovy | subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java | AstBuilder.visit | @Override
public Object visit(ParseTree tree) {
if (!asBoolean(tree)) {
return null;
}
return super.visit(tree);
} | java | @Override
public Object visit(ParseTree tree) {
if (!asBoolean(tree)) {
return null;
}
return super.visit(tree);
} | [
"@",
"Override",
"public",
"Object",
"visit",
"(",
"ParseTree",
"tree",
")",
"{",
"if",
"(",
"!",
"asBoolean",
"(",
"tree",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"super",
".",
"visit",
"(",
"tree",
")",
";",
"}"
] | Visit tree safely, no NPE occurred when the tree is null.
@param tree an AST node
@return the visiting result | [
"Visit",
"tree",
"safely",
"no",
"NPE",
"occurred",
"when",
"the",
"tree",
"is",
"null",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java#L4306-L4313 |
12,596 | apache/groovy | subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java | AstBuilder.configureScriptClassNode | private void configureScriptClassNode() {
ClassNode scriptClassNode = moduleNode.getScriptClassDummy();
if (!asBoolean(scriptClassNode)) {
return;
}
List<Statement> statements = moduleNode.getStatementBlock().getStatements();
if (!statements.isEmpty()) {
... | java | private void configureScriptClassNode() {
ClassNode scriptClassNode = moduleNode.getScriptClassDummy();
if (!asBoolean(scriptClassNode)) {
return;
}
List<Statement> statements = moduleNode.getStatementBlock().getStatements();
if (!statements.isEmpty()) {
... | [
"private",
"void",
"configureScriptClassNode",
"(",
")",
"{",
"ClassNode",
"scriptClassNode",
"=",
"moduleNode",
".",
"getScriptClassDummy",
"(",
")",
";",
"if",
"(",
"!",
"asBoolean",
"(",
"scriptClassNode",
")",
")",
"{",
"return",
";",
"}",
"List",
"<",
"... | set the script source position | [
"set",
"the",
"script",
"source",
"position"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java#L4591-L4608 |
12,597 | apache/groovy | src/main/java/org/codehaus/groovy/vmplugin/v7/Selector.java | Selector.getSelector | public static Selector getSelector(MutableCallSite callSite, Class sender, String methodName, int callID, boolean safeNavigation, boolean thisCall, boolean spreadCall, Object[] arguments) {
CALL_TYPES callType = CALL_TYPES_VALUES[callID];
switch (callType) {
case INIT: return new InitSelecto... | java | public static Selector getSelector(MutableCallSite callSite, Class sender, String methodName, int callID, boolean safeNavigation, boolean thisCall, boolean spreadCall, Object[] arguments) {
CALL_TYPES callType = CALL_TYPES_VALUES[callID];
switch (callType) {
case INIT: return new InitSelecto... | [
"public",
"static",
"Selector",
"getSelector",
"(",
"MutableCallSite",
"callSite",
",",
"Class",
"sender",
",",
"String",
"methodName",
",",
"int",
"callID",
",",
"boolean",
"safeNavigation",
",",
"boolean",
"thisCall",
",",
"boolean",
"spreadCall",
",",
"Object",... | Returns the Selector | [
"Returns",
"the",
"Selector"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/vmplugin/v7/Selector.java#L123-L135 |
12,598 | apache/groovy | src/main/java/org/codehaus/groovy/vmplugin/v7/Selector.java | Selector.getMetaClassImpl | private static MetaClassImpl getMetaClassImpl(MetaClass mc, boolean includeEMC) {
Class mcc = mc.getClass();
boolean valid = mcc == MetaClassImpl.class ||
mcc == AdaptingMetaClass.class ||
mcc == ClosureMetaClass.class ||
(includ... | java | private static MetaClassImpl getMetaClassImpl(MetaClass mc, boolean includeEMC) {
Class mcc = mc.getClass();
boolean valid = mcc == MetaClassImpl.class ||
mcc == AdaptingMetaClass.class ||
mcc == ClosureMetaClass.class ||
(includ... | [
"private",
"static",
"MetaClassImpl",
"getMetaClassImpl",
"(",
"MetaClass",
"mc",
",",
"boolean",
"includeEMC",
")",
"{",
"Class",
"mcc",
"=",
"mc",
".",
"getClass",
"(",
")",
";",
"boolean",
"valid",
"=",
"mcc",
"==",
"MetaClassImpl",
".",
"class",
"||",
... | Returns the MetaClassImpl if the given MetaClass is one of
MetaClassImpl, AdaptingMetaClass or ClosureMetaClass. If
none of these cases matches, this method returns null. | [
"Returns",
"the",
"MetaClassImpl",
"if",
"the",
"given",
"MetaClass",
"is",
"one",
"of",
"MetaClassImpl",
"AdaptingMetaClass",
"or",
"ClosureMetaClass",
".",
"If",
"none",
"of",
"these",
"cases",
"matches",
"this",
"method",
"returns",
"null",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/vmplugin/v7/Selector.java#L1045-L1057 |
12,599 | apache/groovy | src/main/java/org/codehaus/groovy/vmplugin/v7/Selector.java | Selector.removeRealReceiver | private static Object[] removeRealReceiver(Object[] args) {
Object[] ar = new Object[args.length-1];
System.arraycopy(args, 1, ar, 0, args.length - 1);
return ar;
} | java | private static Object[] removeRealReceiver(Object[] args) {
Object[] ar = new Object[args.length-1];
System.arraycopy(args, 1, ar, 0, args.length - 1);
return ar;
} | [
"private",
"static",
"Object",
"[",
"]",
"removeRealReceiver",
"(",
"Object",
"[",
"]",
"args",
")",
"{",
"Object",
"[",
"]",
"ar",
"=",
"new",
"Object",
"[",
"args",
".",
"length",
"-",
"1",
"]",
";",
"System",
".",
"arraycopy",
"(",
"args",
",",
... | Helper method to remove the receiver from the argument array
by producing a new array. | [
"Helper",
"method",
"to",
"remove",
"the",
"receiver",
"from",
"the",
"argument",
"array",
"by",
"producing",
"a",
"new",
"array",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/vmplugin/v7/Selector.java#L1063-L1067 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.