repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
openxc/openxc-android | library/src/main/java/com/openxc/sources/WakeLockManager.java | WakeLockManager.acquireWakeLock | public void acquireWakeLock() {
if(mWakeLock == null) {
PowerManager manager = (PowerManager) mContext.getSystemService(
Context.POWER_SERVICE);
mWakeLock = manager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, mTag);
mWakeLock.acquire();
Log.d(m... | java | public void acquireWakeLock() {
if(mWakeLock == null) {
PowerManager manager = (PowerManager) mContext.getSystemService(
Context.POWER_SERVICE);
mWakeLock = manager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, mTag);
mWakeLock.acquire();
Log.d(m... | [
"public",
"void",
"acquireWakeLock",
"(",
")",
"{",
"if",
"(",
"mWakeLock",
"==",
"null",
")",
"{",
"PowerManager",
"manager",
"=",
"(",
"PowerManager",
")",
"mContext",
".",
"getSystemService",
"(",
"Context",
".",
"POWER_SERVICE",
")",
";",
"mWakeLock",
"=... | Acquire a wake lock if we don't already have one.
If we already have a lock, keeps the one we have. | [
"Acquire",
"a",
"wake",
"lock",
"if",
"we",
"don",
"t",
"already",
"have",
"one",
"."
] | 799adbdcd107a72fe89737bbf19c039dc2881665 | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/sources/WakeLockManager.java#L23-L33 | train |
openxc/openxc-android | library/src/main/java/com/openxc/sources/WakeLockManager.java | WakeLockManager.releaseWakeLock | public void releaseWakeLock() {
if(mWakeLock != null && mWakeLock.isHeld()) {
mWakeLock.release();
mWakeLock = null;
Log.d(mTag, "Wake lock released");
}
} | java | public void releaseWakeLock() {
if(mWakeLock != null && mWakeLock.isHeld()) {
mWakeLock.release();
mWakeLock = null;
Log.d(mTag, "Wake lock released");
}
} | [
"public",
"void",
"releaseWakeLock",
"(",
")",
"{",
"if",
"(",
"mWakeLock",
"!=",
"null",
"&&",
"mWakeLock",
".",
"isHeld",
"(",
")",
")",
"{",
"mWakeLock",
".",
"release",
"(",
")",
";",
"mWakeLock",
"=",
"null",
";",
"Log",
".",
"d",
"(",
"mTag",
... | If we have an active wake lock, release it. | [
"If",
"we",
"have",
"an",
"active",
"wake",
"lock",
"release",
"it",
"."
] | 799adbdcd107a72fe89737bbf19c039dc2881665 | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/sources/WakeLockManager.java#L38-L44 | train |
openxc/openxc-android | library/src/main/java/com/openxc/VehicleLocationProvider.java | VehicleLocationProvider.setOverwritingStatus | public void setOverwritingStatus(boolean enabled) {
mOverwriteNativeStatus = enabled;
mNativeGpsOverridden = false;
if(mLocationManager != null && !enabled) {
try {
mLocationManager.removeTestProvider(
LocationManager.GPS_PROVIDER);
... | java | public void setOverwritingStatus(boolean enabled) {
mOverwriteNativeStatus = enabled;
mNativeGpsOverridden = false;
if(mLocationManager != null && !enabled) {
try {
mLocationManager.removeTestProvider(
LocationManager.GPS_PROVIDER);
... | [
"public",
"void",
"setOverwritingStatus",
"(",
"boolean",
"enabled",
")",
"{",
"mOverwriteNativeStatus",
"=",
"enabled",
";",
"mNativeGpsOverridden",
"=",
"false",
";",
"if",
"(",
"mLocationManager",
"!=",
"null",
"&&",
"!",
"enabled",
")",
"{",
"try",
"{",
"m... | Enable or disable overwriting Android's native GPS values with those from
the vehicle.
If enabled, the GPS_PROVIDER from Android will respond with data taken
from the vehicle interface. The native GPS values will be used until GPS
data is actually received from the vehicle, so if the specific car you're
plugged into d... | [
"Enable",
"or",
"disable",
"overwriting",
"Android",
"s",
"native",
"GPS",
"values",
"with",
"those",
"from",
"the",
"vehicle",
"."
] | 799adbdcd107a72fe89737bbf19c039dc2881665 | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/VehicleLocationProvider.java#L83-L106 | train |
openxc/openxc-android | library/src/main/java/com/openxc/interfaces/UriBasedVehicleInterfaceMixin.java | UriBasedVehicleInterfaceMixin.sameResource | public static boolean sameResource(URI uri, String otherResource) {
try {
return createUri(otherResource).equals(uri);
} catch(DataSourceException e) {
return false;
}
} | java | public static boolean sameResource(URI uri, String otherResource) {
try {
return createUri(otherResource).equals(uri);
} catch(DataSourceException e) {
return false;
}
} | [
"public",
"static",
"boolean",
"sameResource",
"(",
"URI",
"uri",
",",
"String",
"otherResource",
")",
"{",
"try",
"{",
"return",
"createUri",
"(",
"otherResource",
")",
".",
"equals",
"(",
"uri",
")",
";",
"}",
"catch",
"(",
"DataSourceException",
"e",
")... | Determine if two URIs refer to the same resource.
The function safely attempts to convert the otherResource parameter to a
URI object before comparing.
@return true if the address and port match the current in-use values. | [
"Determine",
"if",
"two",
"URIs",
"refer",
"to",
"the",
"same",
"resource",
"."
] | 799adbdcd107a72fe89737bbf19c039dc2881665 | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/interfaces/UriBasedVehicleInterfaceMixin.java#L26-L32 | train |
openxc/openxc-android | library/src/main/java/com/openxc/interfaces/UriBasedVehicleInterfaceMixin.java | UriBasedVehicleInterfaceMixin.validateResource | public static boolean validateResource(String uriString) {
if(uriString == null) {
return false;
}
try {
return validateResource(createUri(uriString));
} catch(DataSourceException e) {
Log.d(TAG, "URI is not valid", e);
return false;
... | java | public static boolean validateResource(String uriString) {
if(uriString == null) {
return false;
}
try {
return validateResource(createUri(uriString));
} catch(DataSourceException e) {
Log.d(TAG, "URI is not valid", e);
return false;
... | [
"public",
"static",
"boolean",
"validateResource",
"(",
"String",
"uriString",
")",
"{",
"if",
"(",
"uriString",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"return",
"validateResource",
"(",
"createUri",
"(",
"uriString",
")",
")",
";... | Convert the parameter to a URI and validate the correctness of its host
and port.
@return true if the address and port are valid. | [
"Convert",
"the",
"parameter",
"to",
"a",
"URI",
"and",
"validate",
"the",
"correctness",
"of",
"its",
"host",
"and",
"port",
"."
] | 799adbdcd107a72fe89737bbf19c039dc2881665 | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/interfaces/UriBasedVehicleInterfaceMixin.java#L40-L51 | train |
openxc/openxc-android | library/src/main/java/com/openxc/interfaces/UriBasedVehicleInterfaceMixin.java | UriBasedVehicleInterfaceMixin.validateResource | public static boolean validateResource(URI uri) {
return uri != null && uri.getPort() != -1 && uri.getHost() != null;
} | java | public static boolean validateResource(URI uri) {
return uri != null && uri.getPort() != -1 && uri.getHost() != null;
} | [
"public",
"static",
"boolean",
"validateResource",
"(",
"URI",
"uri",
")",
"{",
"return",
"uri",
"!=",
"null",
"&&",
"uri",
".",
"getPort",
"(",
")",
"!=",
"-",
"1",
"&&",
"uri",
".",
"getHost",
"(",
")",
"!=",
"null",
";",
"}"
] | Validate the correctness of the host and port in a given URI.
@return true if the address and port are valid. | [
"Validate",
"the",
"correctness",
"of",
"the",
"host",
"and",
"port",
"in",
"a",
"given",
"URI",
"."
] | 799adbdcd107a72fe89737bbf19c039dc2881665 | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/interfaces/UriBasedVehicleInterfaceMixin.java#L58-L60 | train |
openxc/openxc-android | library/src/main/java/com/openxc/interfaces/UriBasedVehicleInterfaceMixin.java | UriBasedVehicleInterfaceMixin.createUri | public static URI createUri(String uriString) throws DataSourceException {
if(uriString == null) {
throw new DataSourceResourceException("URI string is null");
}
try {
return new URI(uriString);
} catch(URISyntaxException e) {
throw new DataSourceReso... | java | public static URI createUri(String uriString) throws DataSourceException {
if(uriString == null) {
throw new DataSourceResourceException("URI string is null");
}
try {
return new URI(uriString);
} catch(URISyntaxException e) {
throw new DataSourceReso... | [
"public",
"static",
"URI",
"createUri",
"(",
"String",
"uriString",
")",
"throws",
"DataSourceException",
"{",
"if",
"(",
"uriString",
"==",
"null",
")",
"{",
"throw",
"new",
"DataSourceResourceException",
"(",
"\"URI string is null\"",
")",
";",
"}",
"try",
"{"... | Attempt to construct an instance of URI from the given String.
@param uriString the String representation of the possible URI.
@throws DataSourceException if the parameter is not a valid URI. | [
"Attempt",
"to",
"construct",
"an",
"instance",
"of",
"URI",
"from",
"the",
"given",
"String",
"."
] | 799adbdcd107a72fe89737bbf19c039dc2881665 | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/interfaces/UriBasedVehicleInterfaceMixin.java#L68-L79 | train |
openxc/openxc-android | enabler/src/main/java/com/openxc/enabler/SettingsActivity.java | SettingsActivity.getPath | @TargetApi(Build.VERSION_CODES.KITKAT)
// (http://stackoverflow.com/questions/19834842/android-gallery-on-kitkat-returns-different-uri-for-intent-action-get-content)
@SuppressLint("NewApi")
public static String getPath(final Context context, final Uri uri) {
final boolean isKitKat = Build.VERSION.SDK_INT ... | java | @TargetApi(Build.VERSION_CODES.KITKAT)
// (http://stackoverflow.com/questions/19834842/android-gallery-on-kitkat-returns-different-uri-for-intent-action-get-content)
@SuppressLint("NewApi")
public static String getPath(final Context context, final Uri uri) {
final boolean isKitKat = Build.VERSION.SDK_INT ... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"KITKAT",
")",
"// (http://stackoverflow.com/questions/19834842/android-gallery-on-kitkat-returns-different-uri-for-intent-action-get-content)",
"@",
"SuppressLint",
"(",
"\"NewApi\"",
")",
"public",
"static",
"String",
"... | Thanks to Paul Burke on Stack Overflow | [
"Thanks",
"to",
"Paul",
"Burke",
"on",
"Stack",
"Overflow"
] | 799adbdcd107a72fe89737bbf19c039dc2881665 | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/enabler/src/main/java/com/openxc/enabler/SettingsActivity.java#L131-L168 | train |
openxc/openxc-android | library/src/main/java/com/openxc/DataPipeline.java | DataPipeline.receive | @Override
public void receive(VehicleMessage message) {
if(message == null) {
return;
}
if(message instanceof KeyedMessage) {
KeyedMessage keyedMessage = message.asKeyedMessage();
mKeyedMessages.put(keyedMessage.getKey(), keyedMessage);
}
... | java | @Override
public void receive(VehicleMessage message) {
if(message == null) {
return;
}
if(message instanceof KeyedMessage) {
KeyedMessage keyedMessage = message.asKeyedMessage();
mKeyedMessages.put(keyedMessage.getKey(), keyedMessage);
}
... | [
"@",
"Override",
"public",
"void",
"receive",
"(",
"VehicleMessage",
"message",
")",
"{",
"if",
"(",
"message",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"message",
"instanceof",
"KeyedMessage",
")",
"{",
"KeyedMessage",
"keyedMessage",
"=",
"... | Accept new values from data sources and send it out to all registered
sinks.
This method is required to implement the SourceCallback interface.
If any data sink throws a DataSinkException when receiving data, it will
be removed from the list of sinks. | [
"Accept",
"new",
"values",
"from",
"data",
"sources",
"and",
"send",
"it",
"out",
"to",
"all",
"registered",
"sinks",
"."
] | 799adbdcd107a72fe89737bbf19c039dc2881665 | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/DataPipeline.java#L67-L94 | train |
openxc/openxc-android | library/src/main/java/com/openxc/DataPipeline.java | DataPipeline.removeSink | public void removeSink(VehicleDataSink sink) {
if(sink != null) {
mSinks.remove(sink);
sink.stop();
}
} | java | public void removeSink(VehicleDataSink sink) {
if(sink != null) {
mSinks.remove(sink);
sink.stop();
}
} | [
"public",
"void",
"removeSink",
"(",
"VehicleDataSink",
"sink",
")",
"{",
"if",
"(",
"sink",
"!=",
"null",
")",
"{",
"mSinks",
".",
"remove",
"(",
"sink",
")",
";",
"sink",
".",
"stop",
"(",
")",
";",
"}",
"}"
] | Remove a previously added sink from the pipeline.
Once removed, the sink will no longer receive any new messages from
the pipeline's sources. The sink's {@link VehicleDataSink#stop()} method
is also called.
@param sink if the value is null, it is ignored. | [
"Remove",
"a",
"previously",
"added",
"sink",
"from",
"the",
"pipeline",
"."
] | 799adbdcd107a72fe89737bbf19c039dc2881665 | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/DataPipeline.java#L113-L118 | train |
openxc/openxc-android | library/src/main/java/com/openxc/DataPipeline.java | DataPipeline.addSource | public VehicleDataSource addSource(VehicleDataSource source) {
source.setCallback(this);
mSources.add(source);
if(isActive()) {
source.onPipelineActivated();
} else {
source.onPipelineDeactivated();
}
return source;
} | java | public VehicleDataSource addSource(VehicleDataSource source) {
source.setCallback(this);
mSources.add(source);
if(isActive()) {
source.onPipelineActivated();
} else {
source.onPipelineDeactivated();
}
return source;
} | [
"public",
"VehicleDataSource",
"addSource",
"(",
"VehicleDataSource",
"source",
")",
"{",
"source",
".",
"setCallback",
"(",
"this",
")",
";",
"mSources",
".",
"add",
"(",
"source",
")",
";",
"if",
"(",
"isActive",
"(",
")",
")",
"{",
"source",
".",
"onP... | Add a new source to the pipeline.
The source is given a reference to this DataPipeline as its callback. | [
"Add",
"a",
"new",
"source",
"to",
"the",
"pipeline",
"."
] | 799adbdcd107a72fe89737bbf19c039dc2881665 | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/DataPipeline.java#L125-L134 | train |
openxc/openxc-android | library/src/main/java/com/openxc/DataPipeline.java | DataPipeline.removeSource | public void removeSource(VehicleDataSource source) {
if(source != null) {
mSources.remove(source);
source.stop();
}
} | java | public void removeSource(VehicleDataSource source) {
if(source != null) {
mSources.remove(source);
source.stop();
}
} | [
"public",
"void",
"removeSource",
"(",
"VehicleDataSource",
"source",
")",
"{",
"if",
"(",
"source",
"!=",
"null",
")",
"{",
"mSources",
".",
"remove",
"(",
"source",
")",
";",
"source",
".",
"stop",
"(",
")",
";",
"}",
"}"
] | Remove a previously added source from the pipeline.
Once removed, the source should no longer use this pipeline for its
callback.
@param source if the value is null, it is ignored. | [
"Remove",
"a",
"previously",
"added",
"source",
"from",
"the",
"pipeline",
"."
] | 799adbdcd107a72fe89737bbf19c039dc2881665 | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/DataPipeline.java#L144-L149 | train |
openxc/openxc-android | library/src/main/java/com/openxc/DataPipeline.java | DataPipeline.isActive | public boolean isActive(VehicleDataSource skipSource) {
boolean connected = false;
for(VehicleDataSource s : mSources) {
if(s != skipSource) {
connected = connected || s.isConnected();
}
}
return connected;
} | java | public boolean isActive(VehicleDataSource skipSource) {
boolean connected = false;
for(VehicleDataSource s : mSources) {
if(s != skipSource) {
connected = connected || s.isConnected();
}
}
return connected;
} | [
"public",
"boolean",
"isActive",
"(",
"VehicleDataSource",
"skipSource",
")",
"{",
"boolean",
"connected",
"=",
"false",
";",
"for",
"(",
"VehicleDataSource",
"s",
":",
"mSources",
")",
"{",
"if",
"(",
"s",
"!=",
"skipSource",
")",
"{",
"connected",
"=",
"... | Return true if at least one source is active.
@param skipSource don't consider this data source when determining if the
pipeline is active. | [
"Return",
"true",
"if",
"at",
"least",
"one",
"source",
"is",
"active",
"."
] | 799adbdcd107a72fe89737bbf19c039dc2881665 | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/DataPipeline.java#L215-L223 | train |
openxc/openxc-android | library/src/main/java/com/openxc/DataPipeline.java | DataPipeline.sourceDisconnected | @Override
public void sourceDisconnected(VehicleDataSource source) {
if(mOperator != null) {
if(!isActive(source)) {
mOperator.onPipelineDeactivated();
for(VehicleDataSource s : mSources) {
s.onPipelineDeactivated();
}
... | java | @Override
public void sourceDisconnected(VehicleDataSource source) {
if(mOperator != null) {
if(!isActive(source)) {
mOperator.onPipelineDeactivated();
for(VehicleDataSource s : mSources) {
s.onPipelineDeactivated();
}
... | [
"@",
"Override",
"public",
"void",
"sourceDisconnected",
"(",
"VehicleDataSource",
"source",
")",
"{",
"if",
"(",
"mOperator",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"isActive",
"(",
"source",
")",
")",
"{",
"mOperator",
".",
"onPipelineDeactivated",
"(",
... | At least one source is not active - if all sources are inactive, notify
the operator. | [
"At",
"least",
"one",
"source",
"is",
"not",
"active",
"-",
"if",
"all",
"sources",
"are",
"inactive",
"notify",
"the",
"operator",
"."
] | 799adbdcd107a72fe89737bbf19c039dc2881665 | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/DataPipeline.java#L229-L239 | train |
openxc/openxc-android | library/src/main/java/com/openxc/DataPipeline.java | DataPipeline.sourceConnected | @Override
public void sourceConnected(VehicleDataSource source) {
if(mOperator != null) {
mOperator.onPipelineActivated();
for(VehicleDataSource s : mSources) {
s.onPipelineActivated();
}
}
} | java | @Override
public void sourceConnected(VehicleDataSource source) {
if(mOperator != null) {
mOperator.onPipelineActivated();
for(VehicleDataSource s : mSources) {
s.onPipelineActivated();
}
}
} | [
"@",
"Override",
"public",
"void",
"sourceConnected",
"(",
"VehicleDataSource",
"source",
")",
"{",
"if",
"(",
"mOperator",
"!=",
"null",
")",
"{",
"mOperator",
".",
"onPipelineActivated",
"(",
")",
";",
"for",
"(",
"VehicleDataSource",
"s",
":",
"mSources",
... | At least one source is active - notify the operator. | [
"At",
"least",
"one",
"source",
"is",
"active",
"-",
"notify",
"the",
"operator",
"."
] | 799adbdcd107a72fe89737bbf19c039dc2881665 | https://github.com/openxc/openxc-android/blob/799adbdcd107a72fe89737bbf19c039dc2881665/library/src/main/java/com/openxc/DataPipeline.java#L244-L252 | train |
ManuelPeinado/ImageLayout | library/src/com/manuelpeinado/imagelayout/ImageLayout.java | ImageLayout.setImageResource | public void setImageResource(int imageResource, int imageWidth, int imageHeight) {
bitmap = extractBitmapFromDrawable(getResources().getDrawable(imageResource));
bitmapSrcRect = bitmapRect(bitmap);
this.imageWidth = imageWidth;
this.imageHeight = imageHeight;
rebuildFitt... | java | public void setImageResource(int imageResource, int imageWidth, int imageHeight) {
bitmap = extractBitmapFromDrawable(getResources().getDrawable(imageResource));
bitmapSrcRect = bitmapRect(bitmap);
this.imageWidth = imageWidth;
this.imageHeight = imageHeight;
rebuildFitt... | [
"public",
"void",
"setImageResource",
"(",
"int",
"imageResource",
",",
"int",
"imageWidth",
",",
"int",
"imageHeight",
")",
"{",
"bitmap",
"=",
"extractBitmapFromDrawable",
"(",
"getResources",
"(",
")",
".",
"getDrawable",
"(",
"imageResource",
")",
")",
";",
... | Changes the background image and its layout dimensions. | [
"Changes",
"the",
"background",
"image",
"and",
"its",
"layout",
"dimensions",
"."
] | 6be0b5dc361ca1e1039cd8c40ad63721b7a1a154 | https://github.com/ManuelPeinado/ImageLayout/blob/6be0b5dc361ca1e1039cd8c40ad63721b7a1a154/library/src/com/manuelpeinado/imagelayout/ImageLayout.java#L156-L164 | train |
pwittchen/NetworkEvents | network-events-library/src/main/java/com/github/pwittchen/networkevents/library/NetworkHelper.java | NetworkHelper.isConnectedToWiFiOrMobileNetwork | public static boolean isConnectedToWiFiOrMobileNetwork(Context context) {
final String service = Context.CONNECTIVITY_SERVICE;
final ConnectivityManager manager = (ConnectivityManager) context.getSystemService(service);
final NetworkInfo networkInfo = manager.getActiveNetworkInfo();
if (networkInfo == ... | java | public static boolean isConnectedToWiFiOrMobileNetwork(Context context) {
final String service = Context.CONNECTIVITY_SERVICE;
final ConnectivityManager manager = (ConnectivityManager) context.getSystemService(service);
final NetworkInfo networkInfo = manager.getActiveNetworkInfo();
if (networkInfo == ... | [
"public",
"static",
"boolean",
"isConnectedToWiFiOrMobileNetwork",
"(",
"Context",
"context",
")",
"{",
"final",
"String",
"service",
"=",
"Context",
".",
"CONNECTIVITY_SERVICE",
";",
"final",
"ConnectivityManager",
"manager",
"=",
"(",
"ConnectivityManager",
")",
"co... | Helper method, which checks if device is connected to WiFi or mobile network.
@param context Activity or application context
@return boolean true if is connected to mobile or WiFi network. | [
"Helper",
"method",
"which",
"checks",
"if",
"device",
"is",
"connected",
"to",
"WiFi",
"or",
"mobile",
"network",
"."
] | 6a76a75f95bff92ac3824275fd6b2f5d92db1c7d | https://github.com/pwittchen/NetworkEvents/blob/6a76a75f95bff92ac3824275fd6b2f5d92db1c7d/network-events-library/src/main/java/com/github/pwittchen/networkevents/library/NetworkHelper.java#L33-L50 | train |
pwittchen/NetworkEvents | network-events-library/src/main/java/com/github/pwittchen/networkevents/library/NetworkEvents.java | NetworkEvents.setPingParameters | public NetworkEvents setPingParameters(String host, int port, int timeoutInMs) {
onlineChecker.setPingParameters(host, port, timeoutInMs);
return this;
} | java | public NetworkEvents setPingParameters(String host, int port, int timeoutInMs) {
onlineChecker.setPingParameters(host, port, timeoutInMs);
return this;
} | [
"public",
"NetworkEvents",
"setPingParameters",
"(",
"String",
"host",
",",
"int",
"port",
",",
"int",
"timeoutInMs",
")",
"{",
"onlineChecker",
".",
"setPingParameters",
"(",
"host",
",",
"port",
",",
"timeoutInMs",
")",
";",
"return",
"this",
";",
"}"
] | Sets ping parameters of the host used to check Internet connection.
If it's not set, library will use default ping parameters.
@param host host to be pinged
@param port port of the host
@param timeoutInMs timeout in milliseconds
@return NetworkEvents object | [
"Sets",
"ping",
"parameters",
"of",
"the",
"host",
"used",
"to",
"check",
"Internet",
"connection",
".",
"If",
"it",
"s",
"not",
"set",
"library",
"will",
"use",
"default",
"ping",
"parameters",
"."
] | 6a76a75f95bff92ac3824275fd6b2f5d92db1c7d | https://github.com/pwittchen/NetworkEvents/blob/6a76a75f95bff92ac3824275fd6b2f5d92db1c7d/network-events-library/src/main/java/com/github/pwittchen/networkevents/library/NetworkEvents.java#L117-L120 | train |
camunda/camunda-bpm-mockito | src/main/java/org/camunda/bpm/extension/mockito/answer/FluentAnswer.java | FluentAnswer.createMock | public static <T extends Query<?, R>, R extends Object> T createMock(Class<T> type) {
return Mockito.mock(type, createAnswer(type));
} | java | public static <T extends Query<?, R>, R extends Object> T createMock(Class<T> type) {
return Mockito.mock(type, createAnswer(type));
} | [
"public",
"static",
"<",
"T",
"extends",
"Query",
"<",
"?",
",",
"R",
">",
",",
"R",
"extends",
"Object",
">",
"T",
"createMock",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"Mockito",
".",
"mock",
"(",
"type",
",",
"createAnswer",
"("... | Creates a new mock of given type with a fluent default answer already set
up.
@param type
type of mock
@param <T>
generic parameter for type of mock
@return new mock instance of type T with default fluent answer. | [
"Creates",
"a",
"new",
"mock",
"of",
"given",
"type",
"with",
"a",
"fluent",
"default",
"answer",
"already",
"set",
"up",
"."
] | 77b86c9710813f0bfa59b92985e126a9dad66eef | https://github.com/camunda/camunda-bpm-mockito/blob/77b86c9710813f0bfa59b92985e126a9dad66eef/src/main/java/org/camunda/bpm/extension/mockito/answer/FluentAnswer.java#L31-L33 | train |
camunda/camunda-bpm-mockito | src/main/java/org/camunda/bpm/extension/mockito/answer/FluentAnswer.java | FluentAnswer.createAnswer | public static <T extends Query<?, R>, R extends Object> FluentAnswer<T, R> createAnswer(Class<T> type) {
return new FluentAnswer<T, R>(type);
} | java | public static <T extends Query<?, R>, R extends Object> FluentAnswer<T, R> createAnswer(Class<T> type) {
return new FluentAnswer<T, R>(type);
} | [
"public",
"static",
"<",
"T",
"extends",
"Query",
"<",
"?",
",",
"R",
">",
",",
"R",
"extends",
"Object",
">",
"FluentAnswer",
"<",
"T",
",",
"R",
">",
"createAnswer",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"new",
"FluentAnswer",
... | Creates a new instance for the given type.
@param type
the return type of the answer
@param <T>
generic parameter of the return type
@return new Answer that returns the mock itself | [
"Creates",
"a",
"new",
"instance",
"for",
"the",
"given",
"type",
"."
] | 77b86c9710813f0bfa59b92985e126a9dad66eef | https://github.com/camunda/camunda-bpm-mockito/blob/77b86c9710813f0bfa59b92985e126a9dad66eef/src/main/java/org/camunda/bpm/extension/mockito/answer/FluentAnswer.java#L44-L46 | train |
camunda/camunda-bpm-mockito | src/main/java/org/camunda/bpm/extension/mockito/process/CallActivityMock.java | CallActivityMock.onExecutionAddVariables | public CallActivityMock onExecutionAddVariables(final VariableMap variables){
return this.onExecutionDo("addVariablesServiceMock_"+ randomUUID(),
(execution) -> variables.forEach(execution::setVariable)
);
} | java | public CallActivityMock onExecutionAddVariables(final VariableMap variables){
return this.onExecutionDo("addVariablesServiceMock_"+ randomUUID(),
(execution) -> variables.forEach(execution::setVariable)
);
} | [
"public",
"CallActivityMock",
"onExecutionAddVariables",
"(",
"final",
"VariableMap",
"variables",
")",
"{",
"return",
"this",
".",
"onExecutionDo",
"(",
"\"addVariablesServiceMock_\"",
"+",
"randomUUID",
"(",
")",
",",
"(",
"execution",
")",
"-",
">",
"variables",
... | On execution, the MockProcess will add the given VariableMap to the execution
@param variables the variables to add
@return self | [
"On",
"execution",
"the",
"MockProcess",
"will",
"add",
"the",
"given",
"VariableMap",
"to",
"the",
"execution"
] | 77b86c9710813f0bfa59b92985e126a9dad66eef | https://github.com/camunda/camunda-bpm-mockito/blob/77b86c9710813f0bfa59b92985e126a9dad66eef/src/main/java/org/camunda/bpm/extension/mockito/process/CallActivityMock.java#L53-L57 | train |
camunda/camunda-bpm-mockito | src/main/java/org/camunda/bpm/extension/mockito/process/CallActivityMock.java | CallActivityMock.onExecutionAddVariable | public CallActivityMock onExecutionAddVariable(final String key, final Object val){
return this.onExecutionAddVariables(createVariables().putValue(key, val));
} | java | public CallActivityMock onExecutionAddVariable(final String key, final Object val){
return this.onExecutionAddVariables(createVariables().putValue(key, val));
} | [
"public",
"CallActivityMock",
"onExecutionAddVariable",
"(",
"final",
"String",
"key",
",",
"final",
"Object",
"val",
")",
"{",
"return",
"this",
".",
"onExecutionAddVariables",
"(",
"createVariables",
"(",
")",
".",
"putValue",
"(",
"key",
",",
"val",
")",
")... | On execution, the MockProcess will add the given process variable
@param key ... key of the process variable
@param val ... value of the process variable
@return self | [
"On",
"execution",
"the",
"MockProcess",
"will",
"add",
"the",
"given",
"process",
"variable"
] | 77b86c9710813f0bfa59b92985e126a9dad66eef | https://github.com/camunda/camunda-bpm-mockito/blob/77b86c9710813f0bfa59b92985e126a9dad66eef/src/main/java/org/camunda/bpm/extension/mockito/process/CallActivityMock.java#L66-L68 | train |
camunda/camunda-bpm-mockito | src/main/java/org/camunda/bpm/extension/mockito/process/CallActivityMock.java | CallActivityMock.onExecutionDo | public CallActivityMock onExecutionDo(final String serviceId, final Consumer<DelegateExecution> consumer) {
flowNodeBuilder = flowNodeBuilder.serviceTask(serviceId)
.camundaDelegateExpression("${id}".replace("id", serviceId));
registerInstance(serviceId, (JavaDelegate) consumer::accept);
return this;... | java | public CallActivityMock onExecutionDo(final String serviceId, final Consumer<DelegateExecution> consumer) {
flowNodeBuilder = flowNodeBuilder.serviceTask(serviceId)
.camundaDelegateExpression("${id}".replace("id", serviceId));
registerInstance(serviceId, (JavaDelegate) consumer::accept);
return this;... | [
"public",
"CallActivityMock",
"onExecutionDo",
"(",
"final",
"String",
"serviceId",
",",
"final",
"Consumer",
"<",
"DelegateExecution",
">",
"consumer",
")",
"{",
"flowNodeBuilder",
"=",
"flowNodeBuilder",
".",
"serviceTask",
"(",
"serviceId",
")",
".",
"camundaDele... | On execution, the MockProcess will execute the given consumer with a DelegateExecution.
@param serviceId ... the id of the mock delegate
@param consumer delegate for service task
@return self | [
"On",
"execution",
"the",
"MockProcess",
"will",
"execute",
"the",
"given",
"consumer",
"with",
"a",
"DelegateExecution",
"."
] | 77b86c9710813f0bfa59b92985e126a9dad66eef | https://github.com/camunda/camunda-bpm-mockito/blob/77b86c9710813f0bfa59b92985e126a9dad66eef/src/main/java/org/camunda/bpm/extension/mockito/process/CallActivityMock.java#L89-L95 | train |
camunda/camunda-bpm-mockito | src/main/java/org/camunda/bpm/extension/mockito/process/CallActivityMock.java | CallActivityMock.onExecutionSendMessage | public CallActivityMock onExecutionSendMessage(final String message) {
return onExecutionDo(execution -> execution.getProcessEngineServices()
.getRuntimeService().correlateMessage(message));
} | java | public CallActivityMock onExecutionSendMessage(final String message) {
return onExecutionDo(execution -> execution.getProcessEngineServices()
.getRuntimeService().correlateMessage(message));
} | [
"public",
"CallActivityMock",
"onExecutionSendMessage",
"(",
"final",
"String",
"message",
")",
"{",
"return",
"onExecutionDo",
"(",
"execution",
"->",
"execution",
".",
"getProcessEngineServices",
"(",
")",
".",
"getRuntimeService",
"(",
")",
".",
"correlateMessage",... | On execution, the MockProcess will send the given message to all
@param message the message to receive
@return self | [
"On",
"execution",
"the",
"MockProcess",
"will",
"send",
"the",
"given",
"message",
"to",
"all"
] | 77b86c9710813f0bfa59b92985e126a9dad66eef | https://github.com/camunda/camunda-bpm-mockito/blob/77b86c9710813f0bfa59b92985e126a9dad66eef/src/main/java/org/camunda/bpm/extension/mockito/process/CallActivityMock.java#L139-L142 | train |
camunda/camunda-bpm-mockito | src/main/java/org/camunda/bpm/extension/mockito/process/CallActivityMock.java | CallActivityMock.deploy | public Deployment deploy(final RepositoryService repositoryService){
return new DeployProcess(repositoryService).apply(processId, flowNodeBuilder.endEvent("end").done());
} | java | public Deployment deploy(final RepositoryService repositoryService){
return new DeployProcess(repositoryService).apply(processId, flowNodeBuilder.endEvent("end").done());
} | [
"public",
"Deployment",
"deploy",
"(",
"final",
"RepositoryService",
"repositoryService",
")",
"{",
"return",
"new",
"DeployProcess",
"(",
"repositoryService",
")",
".",
"apply",
"(",
"processId",
",",
"flowNodeBuilder",
".",
"endEvent",
"(",
"\"end\"",
")",
".",
... | This will deploy the mock process. | [
"This",
"will",
"deploy",
"the",
"mock",
"process",
"."
] | 77b86c9710813f0bfa59b92985e126a9dad66eef | https://github.com/camunda/camunda-bpm-mockito/blob/77b86c9710813f0bfa59b92985e126a9dad66eef/src/main/java/org/camunda/bpm/extension/mockito/process/CallActivityMock.java#L184-L186 | train |
zeroturnaround/maven-jrebel-plugin | src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java | GenerateRebelMojo.buildWar | private RebelXmlBuilder buildWar() throws MojoExecutionException {
RebelXmlBuilder builder = createXmlBuilder();
buildWeb(builder);
buildClasspath(builder);
if (war != null) {
war.setPath(fixFilePath(war.getPath()));
builder.setWar(war);
}
return builder;
} | java | private RebelXmlBuilder buildWar() throws MojoExecutionException {
RebelXmlBuilder builder = createXmlBuilder();
buildWeb(builder);
buildClasspath(builder);
if (war != null) {
war.setPath(fixFilePath(war.getPath()));
builder.setWar(war);
}
return builder;
} | [
"private",
"RebelXmlBuilder",
"buildWar",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"RebelXmlBuilder",
"builder",
"=",
"createXmlBuilder",
"(",
")",
";",
"buildWeb",
"(",
"builder",
")",
";",
"buildClasspath",
"(",
"builder",
")",
";",
"if",
"(",
"war",... | Build war configuration.
@return
@throws MojoExecutionException | [
"Build",
"war",
"configuration",
"."
] | 6a0d12529a13ae6b2b772658a714398147c091ca | https://github.com/zeroturnaround/maven-jrebel-plugin/blob/6a0d12529a13ae6b2b772658a714398147c091ca/src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java#L317-L329 | train |
zeroturnaround/maven-jrebel-plugin | src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java | GenerateRebelMojo.buildJar | private RebelXmlBuilder buildJar() throws MojoExecutionException {
RebelXmlBuilder builder = createXmlBuilder();
buildClasspath(builder);
// if user has specified any web elements, then let's generate these in the result file.
if (web != null && web.getResources() != null && web.getResources().length !... | java | private RebelXmlBuilder buildJar() throws MojoExecutionException {
RebelXmlBuilder builder = createXmlBuilder();
buildClasspath(builder);
// if user has specified any web elements, then let's generate these in the result file.
if (web != null && web.getResources() != null && web.getResources().length !... | [
"private",
"RebelXmlBuilder",
"buildJar",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"RebelXmlBuilder",
"builder",
"=",
"createXmlBuilder",
"(",
")",
";",
"buildClasspath",
"(",
"builder",
")",
";",
"// if user has specified any web elements, then let's generate these... | Build jar configuration.
@return
@throws MojoExecutionException | [
"Build",
"jar",
"configuration",
"."
] | 6a0d12529a13ae6b2b772658a714398147c091ca | https://github.com/zeroturnaround/maven-jrebel-plugin/blob/6a0d12529a13ae6b2b772658a714398147c091ca/src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java#L337-L348 | train |
zeroturnaround/maven-jrebel-plugin | src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java | GenerateRebelMojo.handleResourceAsInclude | private boolean handleResourceAsInclude(RebelResource rebelResource, Resource resource) {
File dir = new File(resource.getDirectory());
if (!dir.isAbsolute()) {
dir = new File(getProject().getBasedir(), resource.getDirectory());
}
//if directory does not exist then exclude all
if (!dir.exists(... | java | private boolean handleResourceAsInclude(RebelResource rebelResource, Resource resource) {
File dir = new File(resource.getDirectory());
if (!dir.isAbsolute()) {
dir = new File(getProject().getBasedir(), resource.getDirectory());
}
//if directory does not exist then exclude all
if (!dir.exists(... | [
"private",
"boolean",
"handleResourceAsInclude",
"(",
"RebelResource",
"rebelResource",
",",
"Resource",
"resource",
")",
"{",
"File",
"dir",
"=",
"new",
"File",
"(",
"resource",
".",
"getDirectory",
"(",
")",
")",
";",
"if",
"(",
"!",
"dir",
".",
"isAbsolut... | Set includes & excludes for filtered resources. | [
"Set",
"includes",
"&",
"excludes",
"for",
"filtered",
"resources",
"."
] | 6a0d12529a13ae6b2b772658a714398147c091ca | https://github.com/zeroturnaround/maven-jrebel-plugin/blob/6a0d12529a13ae6b2b772658a714398147c091ca/src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java#L489-L516 | train |
zeroturnaround/maven-jrebel-plugin | src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java | GenerateRebelMojo.getFilesToCopy | private String[] getFilesToCopy(Resource resource) {
DirectoryScanner scanner = new DirectoryScanner();
scanner.setBasedir(resource.getDirectory());
if (resource.getIncludes() != null && !resource.getIncludes().isEmpty()) {
scanner.setIncludes(resource.getIncludes().toArray(new String[0]));
}
... | java | private String[] getFilesToCopy(Resource resource) {
DirectoryScanner scanner = new DirectoryScanner();
scanner.setBasedir(resource.getDirectory());
if (resource.getIncludes() != null && !resource.getIncludes().isEmpty()) {
scanner.setIncludes(resource.getIncludes().toArray(new String[0]));
}
... | [
"private",
"String",
"[",
"]",
"getFilesToCopy",
"(",
"Resource",
"resource",
")",
"{",
"DirectoryScanner",
"scanner",
"=",
"new",
"DirectoryScanner",
"(",
")",
";",
"scanner",
".",
"setBasedir",
"(",
"resource",
".",
"getDirectory",
"(",
")",
")",
";",
"if"... | Taken from war plugin.
@param resource
@return array of file names that would be copied from specified resource | [
"Taken",
"from",
"war",
"plugin",
"."
] | 6a0d12529a13ae6b2b772658a714398147c091ca | https://github.com/zeroturnaround/maven-jrebel-plugin/blob/6a0d12529a13ae6b2b772658a714398147c091ca/src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java#L524-L542 | train |
zeroturnaround/maven-jrebel-plugin | src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java | GenerateRebelMojo.parseWarResources | private List<Resource> parseWarResources(Xpp3Dom warResourcesNode) {
List<Resource> resources = new ArrayList<Resource>();
Xpp3Dom[] resourceNodes = warResourcesNode.getChildren("resource");
for (Xpp3Dom resourceNode : resourceNodes) {
if (resourceNode == null || resourceNode.getChild("directory") == ... | java | private List<Resource> parseWarResources(Xpp3Dom warResourcesNode) {
List<Resource> resources = new ArrayList<Resource>();
Xpp3Dom[] resourceNodes = warResourcesNode.getChildren("resource");
for (Xpp3Dom resourceNode : resourceNodes) {
if (resourceNode == null || resourceNode.getChild("directory") == ... | [
"private",
"List",
"<",
"Resource",
">",
"parseWarResources",
"(",
"Xpp3Dom",
"warResourcesNode",
")",
"{",
"List",
"<",
"Resource",
">",
"resources",
"=",
"new",
"ArrayList",
"<",
"Resource",
">",
"(",
")",
";",
"Xpp3Dom",
"[",
"]",
"resourceNodes",
"=",
... | Parse resources node content.
@param warResourcesNode
@return | [
"Parse",
"resources",
"node",
"content",
"."
] | 6a0d12529a13ae6b2b772658a714398147c091ca | https://github.com/zeroturnaround/maven-jrebel-plugin/blob/6a0d12529a13ae6b2b772658a714398147c091ca/src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java#L680-L691 | train |
zeroturnaround/maven-jrebel-plugin | src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java | GenerateRebelMojo.parseResourceNode | private Resource parseResourceNode(Xpp3Dom rn) {
Resource r = new Resource();
if (rn.getChild("directory") != null) {
r.setDirectory(getValue(getProject(), rn.getChild("directory")));
}
if (rn.getChild("filtering") != null) {
r.setFiltering((Boolean.valueOf(getValue(getProject(), rn.getChild... | java | private Resource parseResourceNode(Xpp3Dom rn) {
Resource r = new Resource();
if (rn.getChild("directory") != null) {
r.setDirectory(getValue(getProject(), rn.getChild("directory")));
}
if (rn.getChild("filtering") != null) {
r.setFiltering((Boolean.valueOf(getValue(getProject(), rn.getChild... | [
"private",
"Resource",
"parseResourceNode",
"(",
"Xpp3Dom",
"rn",
")",
"{",
"Resource",
"r",
"=",
"new",
"Resource",
"(",
")",
";",
"if",
"(",
"rn",
".",
"getChild",
"(",
"\"directory\"",
")",
"!=",
"null",
")",
"{",
"r",
".",
"setDirectory",
"(",
"get... | Parse resouce node content.
@param rn resource node content
@return resource parsed | [
"Parse",
"resouce",
"node",
"content",
"."
] | 6a0d12529a13ae6b2b772658a714398147c091ca | https://github.com/zeroturnaround/maven-jrebel-plugin/blob/6a0d12529a13ae6b2b772658a714398147c091ca/src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java#L699-L733 | train |
zeroturnaround/maven-jrebel-plugin | src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java | GenerateRebelMojo.getPluginConfigurationDom | private static Xpp3Dom getPluginConfigurationDom(MavenProject project, String pluginId) {
Plugin plugin = project.getBuild().getPluginsAsMap().get(pluginId);
if (plugin != null) {
return (Xpp3Dom) plugin.getConfiguration();
}
return null;
} | java | private static Xpp3Dom getPluginConfigurationDom(MavenProject project, String pluginId) {
Plugin plugin = project.getBuild().getPluginsAsMap().get(pluginId);
if (plugin != null) {
return (Xpp3Dom) plugin.getConfiguration();
}
return null;
} | [
"private",
"static",
"Xpp3Dom",
"getPluginConfigurationDom",
"(",
"MavenProject",
"project",
",",
"String",
"pluginId",
")",
"{",
"Plugin",
"plugin",
"=",
"project",
".",
"getBuild",
"(",
")",
".",
"getPluginsAsMap",
"(",
")",
".",
"get",
"(",
"pluginId",
")",... | Taken from eclipse plugin. Search for the configuration Xpp3 dom of an other plugin.
@param project the current maven project to get the configuration from.
@param pluginId the group id and artifact id of the plugin to search for
@return the value of the plugin configuration | [
"Taken",
"from",
"eclipse",
"plugin",
".",
"Search",
"for",
"the",
"configuration",
"Xpp3",
"dom",
"of",
"an",
"other",
"plugin",
"."
] | 6a0d12529a13ae6b2b772658a714398147c091ca | https://github.com/zeroturnaround/maven-jrebel-plugin/blob/6a0d12529a13ae6b2b772658a714398147c091ca/src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java#L742-L749 | train |
zeroturnaround/maven-jrebel-plugin | src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java | GenerateRebelMojo.getPluginSetting | private String getPluginSetting(MavenProject project, String pluginId, String optionName, String defaultValue) {
Xpp3Dom dom = getPluginConfigurationDom(project, pluginId);
if (dom != null && dom.getChild(optionName) != null) {
return getValue(project, dom.getChild(optionName));
}
return defaultVa... | java | private String getPluginSetting(MavenProject project, String pluginId, String optionName, String defaultValue) {
Xpp3Dom dom = getPluginConfigurationDom(project, pluginId);
if (dom != null && dom.getChild(optionName) != null) {
return getValue(project, dom.getChild(optionName));
}
return defaultVa... | [
"private",
"String",
"getPluginSetting",
"(",
"MavenProject",
"project",
",",
"String",
"pluginId",
",",
"String",
"optionName",
",",
"String",
"defaultValue",
")",
"{",
"Xpp3Dom",
"dom",
"=",
"getPluginConfigurationDom",
"(",
"project",
",",
"pluginId",
")",
";",... | Search for a configuration setting of an other plugin.
@param project the current maven project to get the configuration from.
@param pluginId the group id and artifact id of the plugin to search for
@param optionName the option to get from the configuration
@param defaultValue the default value if the conf... | [
"Search",
"for",
"a",
"configuration",
"setting",
"of",
"an",
"other",
"plugin",
"."
] | 6a0d12529a13ae6b2b772658a714398147c091ca | https://github.com/zeroturnaround/maven-jrebel-plugin/blob/6a0d12529a13ae6b2b772658a714398147c091ca/src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java#L760-L766 | train |
zeroturnaround/maven-jrebel-plugin | src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java | GenerateRebelMojo.fixFilePath | protected String fixFilePath(File file) throws MojoExecutionException {
File baseDir = getProject().getFile().getParentFile();
if (file.isAbsolute() && !isRelativeToPath(new File(baseDir, getRelativePath()), file)) {
return StringUtils.replace(getCanonicalPath(file), '\\', '/');
}
if (!file.isAb... | java | protected String fixFilePath(File file) throws MojoExecutionException {
File baseDir = getProject().getFile().getParentFile();
if (file.isAbsolute() && !isRelativeToPath(new File(baseDir, getRelativePath()), file)) {
return StringUtils.replace(getCanonicalPath(file), '\\', '/');
}
if (!file.isAb... | [
"protected",
"String",
"fixFilePath",
"(",
"File",
"file",
")",
"throws",
"MojoExecutionException",
"{",
"File",
"baseDir",
"=",
"getProject",
"(",
")",
".",
"getFile",
"(",
")",
".",
"getParentFile",
"(",
")",
";",
"if",
"(",
"file",
".",
"isAbsolute",
"(... | Returns path expressed through rootPath and relativePath.
@param file to be fixed
@return fixed path
@throws MojoExecutionException if something goes wrong | [
"Returns",
"path",
"expressed",
"through",
"rootPath",
"and",
"relativePath",
"."
] | 6a0d12529a13ae6b2b772658a714398147c091ca | https://github.com/zeroturnaround/maven-jrebel-plugin/blob/6a0d12529a13ae6b2b772658a714398147c091ca/src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java#L814-L847 | train |
craftercms/engine | src/main/java/org/craftercms/engine/util/TargetingUtils.java | TargetingUtils.getMatchingRootFolder | public static String getMatchingRootFolder(String targetedUrl) {
String[] targetedRootFolders = SiteProperties.getRootFolders();
if (ArrayUtils.isNotEmpty(targetedRootFolders)) {
for (String targetedRootFolder : targetedRootFolders) {
if (targetedUrl.startsWith(targetedRootFo... | java | public static String getMatchingRootFolder(String targetedUrl) {
String[] targetedRootFolders = SiteProperties.getRootFolders();
if (ArrayUtils.isNotEmpty(targetedRootFolders)) {
for (String targetedRootFolder : targetedRootFolders) {
if (targetedUrl.startsWith(targetedRootFo... | [
"public",
"static",
"String",
"getMatchingRootFolder",
"(",
"String",
"targetedUrl",
")",
"{",
"String",
"[",
"]",
"targetedRootFolders",
"=",
"SiteProperties",
".",
"getRootFolders",
"(",
")",
";",
"if",
"(",
"ArrayUtils",
".",
"isNotEmpty",
"(",
"targetedRootFol... | Return the root folder of the specified targeted URL
@param targetedUrl the targeted URL
@return the root folder that matches the targeted URL | [
"Return",
"the",
"root",
"folder",
"of",
"the",
"specified",
"targeted",
"URL"
] | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/util/TargetingUtils.java#L40-L51 | train |
craftercms/engine | src/main/java/org/craftercms/engine/util/TargetingUtils.java | TargetingUtils.excludePath | public static boolean excludePath(String path) {
String[] excludePatterns = SiteProperties.getExcludePatterns();
if (ArrayUtils.isNotEmpty(excludePatterns)) {
return RegexUtils.matchesAny(path, excludePatterns);
} else {
return false;
}
} | java | public static boolean excludePath(String path) {
String[] excludePatterns = SiteProperties.getExcludePatterns();
if (ArrayUtils.isNotEmpty(excludePatterns)) {
return RegexUtils.matchesAny(path, excludePatterns);
} else {
return false;
}
} | [
"public",
"static",
"boolean",
"excludePath",
"(",
"String",
"path",
")",
"{",
"String",
"[",
"]",
"excludePatterns",
"=",
"SiteProperties",
".",
"getExcludePatterns",
"(",
")",
";",
"if",
"(",
"ArrayUtils",
".",
"isNotEmpty",
"(",
"excludePatterns",
")",
")",... | Returns true if the path should be excluded or ignored for targeting.
@param path the path
@return true if the path should be excluded | [
"Returns",
"true",
"if",
"the",
"path",
"should",
"be",
"excluded",
"or",
"ignored",
"for",
"targeting",
"."
] | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/util/TargetingUtils.java#L60-L67 | train |
craftercms/engine | src/main/java/org/craftercms/engine/properties/SiteProperties.java | SiteProperties.isTargetingEnabled | public static boolean isTargetingEnabled() {
Configuration config = ConfigUtils.getCurrentConfig();
if (config != null) {
return config.getBoolean(TARGETING_ENABLED_CONFIG_KEY, false);
} else {
return false;
}
} | java | public static boolean isTargetingEnabled() {
Configuration config = ConfigUtils.getCurrentConfig();
if (config != null) {
return config.getBoolean(TARGETING_ENABLED_CONFIG_KEY, false);
} else {
return false;
}
} | [
"public",
"static",
"boolean",
"isTargetingEnabled",
"(",
")",
"{",
"Configuration",
"config",
"=",
"ConfigUtils",
".",
"getCurrentConfig",
"(",
")",
";",
"if",
"(",
"config",
"!=",
"null",
")",
"{",
"return",
"config",
".",
"getBoolean",
"(",
"TARGETING_ENABL... | Returns trues if targeting is enabled. | [
"Returns",
"trues",
"if",
"targeting",
"is",
"enabled",
"."
] | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/properties/SiteProperties.java#L59-L66 | train |
craftercms/engine | src/main/java/org/craftercms/engine/properties/SiteProperties.java | SiteProperties.getAvailableTargetIds | public static String[] getAvailableTargetIds() {
Configuration config = ConfigUtils.getCurrentConfig();
if (config != null) {
return config.getStringArray(AVAILABLE_TARGET_IDS_CONFIG_KEY);
} else {
return null;
}
} | java | public static String[] getAvailableTargetIds() {
Configuration config = ConfigUtils.getCurrentConfig();
if (config != null) {
return config.getStringArray(AVAILABLE_TARGET_IDS_CONFIG_KEY);
} else {
return null;
}
} | [
"public",
"static",
"String",
"[",
"]",
"getAvailableTargetIds",
"(",
")",
"{",
"Configuration",
"config",
"=",
"ConfigUtils",
".",
"getCurrentConfig",
"(",
")",
";",
"if",
"(",
"config",
"!=",
"null",
")",
"{",
"return",
"config",
".",
"getStringArray",
"("... | Returns the list of available target IDs. | [
"Returns",
"the",
"list",
"of",
"available",
"target",
"IDs",
"."
] | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/properties/SiteProperties.java#L71-L78 | train |
craftercms/engine | src/main/java/org/craftercms/engine/properties/SiteProperties.java | SiteProperties.getFallbackTargetId | public static String getFallbackTargetId() {
Configuration config = ConfigUtils.getCurrentConfig();
if (config != null) {
return config.getString(FALLBACK_ID_CONFIG_KEY);
} else {
return null;
}
} | java | public static String getFallbackTargetId() {
Configuration config = ConfigUtils.getCurrentConfig();
if (config != null) {
return config.getString(FALLBACK_ID_CONFIG_KEY);
} else {
return null;
}
} | [
"public",
"static",
"String",
"getFallbackTargetId",
"(",
")",
"{",
"Configuration",
"config",
"=",
"ConfigUtils",
".",
"getCurrentConfig",
"(",
")",
";",
"if",
"(",
"config",
"!=",
"null",
")",
"{",
"return",
"config",
".",
"getString",
"(",
"FALLBACK_ID_CONF... | Returns the fallback target ID. The fallback target ID is used in case none of the resolved candidate targeted
URLs map to existing content. | [
"Returns",
"the",
"fallback",
"target",
"ID",
".",
"The",
"fallback",
"target",
"ID",
"is",
"used",
"in",
"case",
"none",
"of",
"the",
"resolved",
"candidate",
"targeted",
"URLs",
"map",
"to",
"existing",
"content",
"."
] | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/properties/SiteProperties.java#L84-L91 | train |
craftercms/engine | src/main/java/org/craftercms/engine/properties/SiteProperties.java | SiteProperties.getRootFolders | public static String[] getRootFolders() {
Configuration config = ConfigUtils.getCurrentConfig();
if (config != null) {
return config.getStringArray(ROOT_FOLDERS_CONFIG_KEY);
} else {
return null;
}
} | java | public static String[] getRootFolders() {
Configuration config = ConfigUtils.getCurrentConfig();
if (config != null) {
return config.getStringArray(ROOT_FOLDERS_CONFIG_KEY);
} else {
return null;
}
} | [
"public",
"static",
"String",
"[",
"]",
"getRootFolders",
"(",
")",
"{",
"Configuration",
"config",
"=",
"ConfigUtils",
".",
"getCurrentConfig",
"(",
")",
";",
"if",
"(",
"config",
"!=",
"null",
")",
"{",
"return",
"config",
".",
"getStringArray",
"(",
"RO... | Returns the folders that will be handled for targeted content. | [
"Returns",
"the",
"folders",
"that",
"will",
"be",
"handled",
"for",
"targeted",
"content",
"."
] | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/properties/SiteProperties.java#L96-L103 | train |
craftercms/engine | src/main/java/org/craftercms/engine/properties/SiteProperties.java | SiteProperties.getExcludePatterns | public static String[] getExcludePatterns() {
Configuration config = ConfigUtils.getCurrentConfig();
if (config != null) {
return config.getStringArray(EXCLUDE_PATTERNS_CONFIG_KEY);
} else {
return null;
}
} | java | public static String[] getExcludePatterns() {
Configuration config = ConfigUtils.getCurrentConfig();
if (config != null) {
return config.getStringArray(EXCLUDE_PATTERNS_CONFIG_KEY);
} else {
return null;
}
} | [
"public",
"static",
"String",
"[",
"]",
"getExcludePatterns",
"(",
")",
"{",
"Configuration",
"config",
"=",
"ConfigUtils",
".",
"getCurrentConfig",
"(",
")",
";",
"if",
"(",
"config",
"!=",
"null",
")",
"{",
"return",
"config",
".",
"getStringArray",
"(",
... | Returns the patterns that a path might match if it should be excluded | [
"Returns",
"the",
"patterns",
"that",
"a",
"path",
"might",
"match",
"if",
"it",
"should",
"be",
"excluded"
] | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/properties/SiteProperties.java#L108-L115 | train |
craftercms/engine | src/main/java/org/craftercms/engine/properties/SiteProperties.java | SiteProperties.isRedirectToTargetedUrl | public static boolean isRedirectToTargetedUrl() {
Configuration config = ConfigUtils.getCurrentConfig();
if (config != null) {
return config.getBoolean(REDIRECT_TO_TARGETED_URL_CONFIG_KEY, false);
} else {
return false;
}
} | java | public static boolean isRedirectToTargetedUrl() {
Configuration config = ConfigUtils.getCurrentConfig();
if (config != null) {
return config.getBoolean(REDIRECT_TO_TARGETED_URL_CONFIG_KEY, false);
} else {
return false;
}
} | [
"public",
"static",
"boolean",
"isRedirectToTargetedUrl",
"(",
")",
"{",
"Configuration",
"config",
"=",
"ConfigUtils",
".",
"getCurrentConfig",
"(",
")",
";",
"if",
"(",
"config",
"!=",
"null",
")",
"{",
"return",
"config",
".",
"getBoolean",
"(",
"REDIRECT_T... | Returns true if the request should be redirected when the targeted URL is different from the current URL. | [
"Returns",
"true",
"if",
"the",
"request",
"should",
"be",
"redirected",
"when",
"the",
"targeted",
"URL",
"is",
"different",
"from",
"the",
"current",
"URL",
"."
] | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/properties/SiteProperties.java#L133-L140 | train |
craftercms/engine | src/main/java/org/craftercms/engine/properties/SiteProperties.java | SiteProperties.isDisableFullModelTypeConversion | public static boolean isDisableFullModelTypeConversion() {
Configuration config = ConfigUtils.getCurrentConfig();
if (config != null) {
return config.getBoolean(DISABLE_FULL_MODEL_TYPE_CONVERSION_CONFIG_KEY, false);
} else {
return false;
}
} | java | public static boolean isDisableFullModelTypeConversion() {
Configuration config = ConfigUtils.getCurrentConfig();
if (config != null) {
return config.getBoolean(DISABLE_FULL_MODEL_TYPE_CONVERSION_CONFIG_KEY, false);
} else {
return false;
}
} | [
"public",
"static",
"boolean",
"isDisableFullModelTypeConversion",
"(",
")",
"{",
"Configuration",
"config",
"=",
"ConfigUtils",
".",
"getCurrentConfig",
"(",
")",
";",
"if",
"(",
"config",
"!=",
"null",
")",
"{",
"return",
"config",
".",
"getBoolean",
"(",
"D... | Returns true if full content model type conversion should be disabled.
Up to and including version 2:
Crafter Engine, in the FreeMarker host only, converts model elements based on a suffix type hint, but only for the first level in
the model, and not for _dt. For example, for contentModel.myvalue_i Integer is returned... | [
"Returns",
"true",
"if",
"full",
"content",
"model",
"type",
"conversion",
"should",
"be",
"disabled",
"."
] | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/properties/SiteProperties.java#L165-L172 | train |
craftercms/engine | src/main/java/org/craftercms/engine/properties/SiteProperties.java | SiteProperties.getNavigationAdditionalFields | public static String[] getNavigationAdditionalFields() {
Configuration config = ConfigUtils.getCurrentConfig();
if(config != null && config.containsKey(NAVIGATION_ADDITIONAL_FIELDS_CONFIG_KEY)) {
return config.getStringArray(NAVIGATION_ADDITIONAL_FIELDS_CONFIG_KEY);
} else {
... | java | public static String[] getNavigationAdditionalFields() {
Configuration config = ConfigUtils.getCurrentConfig();
if(config != null && config.containsKey(NAVIGATION_ADDITIONAL_FIELDS_CONFIG_KEY)) {
return config.getStringArray(NAVIGATION_ADDITIONAL_FIELDS_CONFIG_KEY);
} else {
... | [
"public",
"static",
"String",
"[",
"]",
"getNavigationAdditionalFields",
"(",
")",
"{",
"Configuration",
"config",
"=",
"ConfigUtils",
".",
"getCurrentConfig",
"(",
")",
";",
"if",
"(",
"config",
"!=",
"null",
"&&",
"config",
".",
"containsKey",
"(",
"NAVIGATI... | Returns the list of additional fields that navigation items should extract from the item descriptor. | [
"Returns",
"the",
"list",
"of",
"additional",
"fields",
"that",
"navigation",
"items",
"should",
"extract",
"from",
"the",
"item",
"descriptor",
"."
] | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/properties/SiteProperties.java#L177-L184 | train |
craftercms/engine | src/main/java/org/craftercms/engine/util/spring/BeanDefinitionUtils.java | BeanDefinitionUtils.createBeanDefinitionFromOriginal | public static BeanDefinition createBeanDefinitionFromOriginal(ApplicationContext applicationContext,
String beanName) {
ApplicationContext parentContext = applicationContext.getParent();
BeanDefinition parentDefinition = null;
if... | java | public static BeanDefinition createBeanDefinitionFromOriginal(ApplicationContext applicationContext,
String beanName) {
ApplicationContext parentContext = applicationContext.getParent();
BeanDefinition parentDefinition = null;
if... | [
"public",
"static",
"BeanDefinition",
"createBeanDefinitionFromOriginal",
"(",
"ApplicationContext",
"applicationContext",
",",
"String",
"beanName",
")",
"{",
"ApplicationContext",
"parentContext",
"=",
"applicationContext",
".",
"getParent",
"(",
")",
";",
"BeanDefinition... | Creates a bean definition for the specified bean name. If the parent context of the current context contains a
bean definition with the same name, the definition is created as a bean copy of the parent definition. This
method is useful for config parsers that want to create a bean definition from configuration but also... | [
"Creates",
"a",
"bean",
"definition",
"for",
"the",
"specified",
"bean",
"name",
".",
"If",
"the",
"parent",
"context",
"of",
"the",
"current",
"context",
"contains",
"a",
"bean",
"definition",
"with",
"the",
"same",
"name",
"the",
"definition",
"is",
"creat... | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/util/spring/BeanDefinitionUtils.java#L46-L66 | train |
craftercms/engine | src/main/java/org/craftercms/engine/util/spring/BeanDefinitionUtils.java | BeanDefinitionUtils.addPropertyIfNotNull | public static void addPropertyIfNotNull(BeanDefinition definition, String propertyName, Object propertyValue) {
if (propertyValue != null) {
definition.getPropertyValues().add(propertyName, propertyValue);
}
} | java | public static void addPropertyIfNotNull(BeanDefinition definition, String propertyName, Object propertyValue) {
if (propertyValue != null) {
definition.getPropertyValues().add(propertyName, propertyValue);
}
} | [
"public",
"static",
"void",
"addPropertyIfNotNull",
"(",
"BeanDefinition",
"definition",
",",
"String",
"propertyName",
",",
"Object",
"propertyValue",
")",
"{",
"if",
"(",
"propertyValue",
"!=",
"null",
")",
"{",
"definition",
".",
"getPropertyValues",
"(",
")",
... | Adds the property to the bean definition if the values it not empty
@param definition the bean definition
@param propertyName the property name
@param propertyValue the property value | [
"Adds",
"the",
"property",
"to",
"the",
"bean",
"definition",
"if",
"the",
"values",
"it",
"not",
"empty"
] | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/util/spring/BeanDefinitionUtils.java#L75-L79 | train |
craftercms/engine | src/main/java/org/craftercms/engine/service/context/SiteContext.java | SiteContext.setCurrent | public static void setCurrent(SiteContext current) {
threadLocal.set(current);
MDC.put(SITE_NAME_MDC_KEY, current.getSiteName());
} | java | public static void setCurrent(SiteContext current) {
threadLocal.set(current);
MDC.put(SITE_NAME_MDC_KEY, current.getSiteName());
} | [
"public",
"static",
"void",
"setCurrent",
"(",
"SiteContext",
"current",
")",
"{",
"threadLocal",
".",
"set",
"(",
"current",
")",
";",
"MDC",
".",
"put",
"(",
"SITE_NAME_MDC_KEY",
",",
"current",
".",
"getSiteName",
"(",
")",
")",
";",
"}"
] | Sets the context for the current thread. | [
"Sets",
"the",
"context",
"for",
"the",
"current",
"thread",
"."
] | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/service/context/SiteContext.java#L78-L82 | train |
craftercms/engine | src/main/java/org/craftercms/engine/servlet/filter/SiteAwareCORSFilter.java | SiteAwareCORSFilter.shouldNotFilter | @Override
protected boolean shouldNotFilter(final HttpServletRequest request) throws ServletException {
SiteContext siteContext = SiteContext.getCurrent();
HierarchicalConfiguration config = siteContext.getConfig();
try {
HierarchicalConfiguration corsConfig = config.configuratio... | java | @Override
protected boolean shouldNotFilter(final HttpServletRequest request) throws ServletException {
SiteContext siteContext = SiteContext.getCurrent();
HierarchicalConfiguration config = siteContext.getConfig();
try {
HierarchicalConfiguration corsConfig = config.configuratio... | [
"@",
"Override",
"protected",
"boolean",
"shouldNotFilter",
"(",
"final",
"HttpServletRequest",
"request",
")",
"throws",
"ServletException",
"{",
"SiteContext",
"siteContext",
"=",
"SiteContext",
".",
"getCurrent",
"(",
")",
";",
"HierarchicalConfiguration",
"config",
... | Exclude requests for sites that have no configuration or it is marked as disabled. | [
"Exclude",
"requests",
"for",
"sites",
"that",
"have",
"no",
"configuration",
"or",
"it",
"is",
"marked",
"as",
"disabled",
"."
] | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/servlet/filter/SiteAwareCORSFilter.java#L59-L72 | train |
craftercms/engine | src/main/java/org/craftercms/engine/servlet/filter/SiteAwareCORSFilter.java | SiteAwareCORSFilter.doFilterInternal | @Override
protected void doFilterInternal(final HttpServletRequest request, final HttpServletResponse response,
final FilterChain filterChain) throws ServletException, IOException {
SiteContext siteContext = SiteContext.getCurrent();
HierarchicalConfiguration cors... | java | @Override
protected void doFilterInternal(final HttpServletRequest request, final HttpServletResponse response,
final FilterChain filterChain) throws ServletException, IOException {
SiteContext siteContext = SiteContext.getCurrent();
HierarchicalConfiguration cors... | [
"@",
"Override",
"protected",
"void",
"doFilterInternal",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
",",
"final",
"FilterChain",
"filterChain",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"SiteContext... | Copy the values from the site configuration to the response headers. | [
"Copy",
"the",
"values",
"from",
"the",
"site",
"configuration",
"to",
"the",
"response",
"headers",
"."
] | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/servlet/filter/SiteAwareCORSFilter.java#L77-L89 | train |
craftercms/engine | src/main/java/org/craftercms/engine/util/ConfigUtils.java | ConfigUtils.getCurrentConfig | public static HierarchicalConfiguration getCurrentConfig() {
SiteContext siteContext = SiteContext.getCurrent();
if (siteContext != null) {
return siteContext.getConfig();
} else {
return null;
}
} | java | public static HierarchicalConfiguration getCurrentConfig() {
SiteContext siteContext = SiteContext.getCurrent();
if (siteContext != null) {
return siteContext.getConfig();
} else {
return null;
}
} | [
"public",
"static",
"HierarchicalConfiguration",
"getCurrentConfig",
"(",
")",
"{",
"SiteContext",
"siteContext",
"=",
"SiteContext",
".",
"getCurrent",
"(",
")",
";",
"if",
"(",
"siteContext",
"!=",
"null",
")",
"{",
"return",
"siteContext",
".",
"getConfig",
"... | Returns the configuration from the current site context. | [
"Returns",
"the",
"configuration",
"from",
"the",
"current",
"site",
"context",
"."
] | 6b3d0349b1598172926352cdbd97f495976a8187 | https://github.com/craftercms/engine/blob/6b3d0349b1598172926352cdbd97f495976a8187/src/main/java/org/craftercms/engine/util/ConfigUtils.java#L47-L54 | train |
lawloretienne/Trestle | library/src/main/java/com/etiennelawlor/trestle/library/Trestle.java | Trestle.getFormattedText | public static SpannableString getFormattedText(Span span) {
SpannableString ss = null;
if (span != null) {
ss = setUpSpannableString(span);
}
return ss;
} | java | public static SpannableString getFormattedText(Span span) {
SpannableString ss = null;
if (span != null) {
ss = setUpSpannableString(span);
}
return ss;
} | [
"public",
"static",
"SpannableString",
"getFormattedText",
"(",
"Span",
"span",
")",
"{",
"SpannableString",
"ss",
"=",
"null",
";",
"if",
"(",
"span",
"!=",
"null",
")",
"{",
"ss",
"=",
"setUpSpannableString",
"(",
"span",
")",
";",
"}",
"return",
"ss",
... | Set a single span | [
"Set",
"a",
"single",
"span"
] | f5d16252000a8a08807679ac8de1b6883aeb06df | https://github.com/lawloretienne/Trestle/blob/f5d16252000a8a08807679ac8de1b6883aeb06df/library/src/main/java/com/etiennelawlor/trestle/library/Trestle.java#L39-L45 | train |
lawloretienne/Trestle | library/src/main/java/com/etiennelawlor/trestle/library/Trestle.java | Trestle.getFormattedText | public static CharSequence getFormattedText(List<Span> spans) {
CharSequence formattedText = null;
if (spans != null) {
int size = spans.size();
List<SpannableString> spannableStrings = new ArrayList<>(size);
for (Span span : spans) {
SpannableString... | java | public static CharSequence getFormattedText(List<Span> spans) {
CharSequence formattedText = null;
if (spans != null) {
int size = spans.size();
List<SpannableString> spannableStrings = new ArrayList<>(size);
for (Span span : spans) {
SpannableString... | [
"public",
"static",
"CharSequence",
"getFormattedText",
"(",
"List",
"<",
"Span",
">",
"spans",
")",
"{",
"CharSequence",
"formattedText",
"=",
"null",
";",
"if",
"(",
"spans",
"!=",
"null",
")",
"{",
"int",
"size",
"=",
"spans",
".",
"size",
"(",
")",
... | Set multiple spans | [
"Set",
"multiple",
"spans"
] | f5d16252000a8a08807679ac8de1b6883aeb06df | https://github.com/lawloretienne/Trestle/blob/f5d16252000a8a08807679ac8de1b6883aeb06df/library/src/main/java/com/etiennelawlor/trestle/library/Trestle.java#L48-L64 | train |
wcm-io/wcm-io-caconfig | compat/src/main/java/io/wcm/config/spi/helpers/AbstractParameterProvider.java | AbstractParameterProvider.getParametersFromPublicFields | private static Set<Parameter<?>> getParametersFromPublicFields(Class<?> type) {
Set<Parameter<?>> params = new HashSet<>();
try {
Field[] fields = type.getFields();
for (Field field : fields) {
if (field.getType().isAssignableFrom(Parameter.class)) {
params.add((Parameter<?>)field.... | java | private static Set<Parameter<?>> getParametersFromPublicFields(Class<?> type) {
Set<Parameter<?>> params = new HashSet<>();
try {
Field[] fields = type.getFields();
for (Field field : fields) {
if (field.getType().isAssignableFrom(Parameter.class)) {
params.add((Parameter<?>)field.... | [
"private",
"static",
"Set",
"<",
"Parameter",
"<",
"?",
">",
">",
"getParametersFromPublicFields",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"Set",
"<",
"Parameter",
"<",
"?",
">",
">",
"params",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"try"... | Get all parameters defined as public static fields in the given type.
@param type Type
@return Set of parameters | [
"Get",
"all",
"parameters",
"defined",
"as",
"public",
"static",
"fields",
"in",
"the",
"given",
"type",
"."
] | 48592eadb0b62a09eec555cedfae7e00b213f6ed | https://github.com/wcm-io/wcm-io-caconfig/blob/48592eadb0b62a09eec555cedfae7e00b213f6ed/compat/src/main/java/io/wcm/config/spi/helpers/AbstractParameterProvider.java#L66-L80 | train |
wcm-io/wcm-io-caconfig | compat/src/main/java/io/wcm/config/core/management/util/ConversionStringUtils.java | ConversionStringUtils.splitPreserveAllTokens | public static String[] splitPreserveAllTokens(String value, char separatorChar) {
if (value == null) {
return ArrayUtils.EMPTY_STRING_ARRAY;
}
int len = value.length();
if (len == 0) {
return ArrayUtils.EMPTY_STRING_ARRAY;
}
List<String> list = new ArrayList<>();
int i = 0;
i... | java | public static String[] splitPreserveAllTokens(String value, char separatorChar) {
if (value == null) {
return ArrayUtils.EMPTY_STRING_ARRAY;
}
int len = value.length();
if (len == 0) {
return ArrayUtils.EMPTY_STRING_ARRAY;
}
List<String> list = new ArrayList<>();
int i = 0;
i... | [
"public",
"static",
"String",
"[",
"]",
"splitPreserveAllTokens",
"(",
"String",
"value",
",",
"char",
"separatorChar",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"ArrayUtils",
".",
"EMPTY_STRING_ARRAY",
";",
"}",
"int",
"len",
"=",
"v... | String tokenizer that preservers all tokens and ignores escaped separator chars.
@param value Value to tokenize
@param separatorChar Separator char
@return String parts. Never null. | [
"String",
"tokenizer",
"that",
"preservers",
"all",
"tokens",
"and",
"ignores",
"escaped",
"separator",
"chars",
"."
] | 48592eadb0b62a09eec555cedfae7e00b213f6ed | https://github.com/wcm-io/wcm-io-caconfig/blob/48592eadb0b62a09eec555cedfae7e00b213f6ed/compat/src/main/java/io/wcm/config/core/management/util/ConversionStringUtils.java#L52-L85 | train |
wcm-io/wcm-io-caconfig | compat/src/main/java/io/wcm/config/core/persistence/impl/MapUtil.java | MapUtil.traceOutput | public static String traceOutput(Map<String, Object> properties) {
SortedSet<String> propertyNames = new TreeSet<>(properties.keySet());
StringBuilder sb = new StringBuilder();
sb.append("{");
Iterator<String> propertyNameIterator = propertyNames.iterator();
while (propertyNameIterator.hasNext()) {
... | java | public static String traceOutput(Map<String, Object> properties) {
SortedSet<String> propertyNames = new TreeSet<>(properties.keySet());
StringBuilder sb = new StringBuilder();
sb.append("{");
Iterator<String> propertyNameIterator = propertyNames.iterator();
while (propertyNameIterator.hasNext()) {
... | [
"public",
"static",
"String",
"traceOutput",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"SortedSet",
"<",
"String",
">",
"propertyNames",
"=",
"new",
"TreeSet",
"<>",
"(",
"properties",
".",
"keySet",
"(",
")",
")",
";",
"Stri... | Produce trace output for properties map.
@param properties Properties
@return Debug output | [
"Produce",
"trace",
"output",
"for",
"properties",
"map",
"."
] | 48592eadb0b62a09eec555cedfae7e00b213f6ed | https://github.com/wcm-io/wcm-io-caconfig/blob/48592eadb0b62a09eec555cedfae7e00b213f6ed/compat/src/main/java/io/wcm/config/core/persistence/impl/MapUtil.java#L39-L54 | train |
wcm-io/wcm-io-caconfig | extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/ToolsConfigPagePersistenceStrategy.java | ToolsConfigPagePersistenceStrategy.findConfigRefs | @SuppressWarnings("unchecked")
private Iterator<String> findConfigRefs(@NotNull final Resource startResource, @NotNull final Collection<String> bucketNames) {
// collect all context path resources (but filter out those without config reference)
final Iterator<ContextResource> contextResources = new FilterIte... | java | @SuppressWarnings("unchecked")
private Iterator<String> findConfigRefs(@NotNull final Resource startResource, @NotNull final Collection<String> bucketNames) {
// collect all context path resources (but filter out those without config reference)
final Iterator<ContextResource> contextResources = new FilterIte... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"Iterator",
"<",
"String",
">",
"findConfigRefs",
"(",
"@",
"NotNull",
"final",
"Resource",
"startResource",
",",
"@",
"NotNull",
"final",
"Collection",
"<",
"String",
">",
"bucketNames",
")",
"{",
... | Searches the resource hierarchy upwards for all config references and returns them. | [
"Searches",
"the",
"resource",
"hierarchy",
"upwards",
"for",
"all",
"config",
"references",
"and",
"returns",
"them",
"."
] | 48592eadb0b62a09eec555cedfae7e00b213f6ed | https://github.com/wcm-io/wcm-io-caconfig/blob/48592eadb0b62a09eec555cedfae7e00b213f6ed/extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/ToolsConfigPagePersistenceStrategy.java#L246-L272 | train |
wcm-io/wcm-io-caconfig | extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PersistenceUtils.java | PersistenceUtils.ensurePageIfNotContainingPage | public static Resource ensurePageIfNotContainingPage(ResourceResolver resolver, String pagePath,
String resourceType, ConfigurationManagementSettings configurationManagementSettings) {
Matcher matcher = PAGE_PATH_PATTERN.matcher(pagePath);
if (matcher.matches()) {
// ensure that shorted path part th... | java | public static Resource ensurePageIfNotContainingPage(ResourceResolver resolver, String pagePath,
String resourceType, ConfigurationManagementSettings configurationManagementSettings) {
Matcher matcher = PAGE_PATH_PATTERN.matcher(pagePath);
if (matcher.matches()) {
// ensure that shorted path part th... | [
"public",
"static",
"Resource",
"ensurePageIfNotContainingPage",
"(",
"ResourceResolver",
"resolver",
",",
"String",
"pagePath",
",",
"String",
"resourceType",
",",
"ConfigurationManagementSettings",
"configurationManagementSettings",
")",
"{",
"Matcher",
"matcher",
"=",
"P... | Ensure that a page at the given path exists, if the path is not already contained in a page.
@param resolver Resource resolver
@param pagePath Page path
@param resourceType Resource type for page (if not template is set)
@param configurationManagementSettings Configuration management settings
@return Resource for AEM p... | [
"Ensure",
"that",
"a",
"page",
"at",
"the",
"given",
"path",
"exists",
"if",
"the",
"path",
"is",
"not",
"already",
"contained",
"in",
"a",
"page",
"."
] | 48592eadb0b62a09eec555cedfae7e00b213f6ed | https://github.com/wcm-io/wcm-io-caconfig/blob/48592eadb0b62a09eec555cedfae7e00b213f6ed/extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PersistenceUtils.java#L118-L128 | train |
wcm-io/wcm-io-caconfig | extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PersistenceUtils.java | PersistenceUtils.deleteChildrenNotInCollection | public static void deleteChildrenNotInCollection(Resource resource, ConfigurationCollectionPersistData data) {
Set<String> collectionItemNames = data.getItems().stream()
.map(item -> item.getCollectionItemName())
.collect(Collectors.toSet());
for (Resource child : resource.getChildren()) {
... | java | public static void deleteChildrenNotInCollection(Resource resource, ConfigurationCollectionPersistData data) {
Set<String> collectionItemNames = data.getItems().stream()
.map(item -> item.getCollectionItemName())
.collect(Collectors.toSet());
for (Resource child : resource.getChildren()) {
... | [
"public",
"static",
"void",
"deleteChildrenNotInCollection",
"(",
"Resource",
"resource",
",",
"ConfigurationCollectionPersistData",
"data",
")",
"{",
"Set",
"<",
"String",
">",
"collectionItemNames",
"=",
"data",
".",
"getItems",
"(",
")",
".",
"stream",
"(",
")"... | Delete children that are no longer contained in list of collection items.
@param resource Parent resource
@param data List of collection items | [
"Delete",
"children",
"that",
"are",
"no",
"longer",
"contained",
"in",
"list",
"of",
"collection",
"items",
"."
] | 48592eadb0b62a09eec555cedfae7e00b213f6ed | https://github.com/wcm-io/wcm-io-caconfig/blob/48592eadb0b62a09eec555cedfae7e00b213f6ed/extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PersistenceUtils.java#L215-L225 | train |
wcm-io/wcm-io-caconfig | extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PersistenceUtils.java | PersistenceUtils.deletePageOrResource | public static void deletePageOrResource(Resource resource) {
Page configPage = resource.adaptTo(Page.class);
if (configPage != null) {
try {
log.trace("! Delete page {}", configPage.getPath());
PageManager pageManager = configPage.getPageManager();
pageManager.delete(configPage, fa... | java | public static void deletePageOrResource(Resource resource) {
Page configPage = resource.adaptTo(Page.class);
if (configPage != null) {
try {
log.trace("! Delete page {}", configPage.getPath());
PageManager pageManager = configPage.getPageManager();
pageManager.delete(configPage, fa... | [
"public",
"static",
"void",
"deletePageOrResource",
"(",
"Resource",
"resource",
")",
"{",
"Page",
"configPage",
"=",
"resource",
".",
"adaptTo",
"(",
"Page",
".",
"class",
")",
";",
"if",
"(",
"configPage",
"!=",
"null",
")",
"{",
"try",
"{",
"log",
"."... | If the given resource points to an AEM page, delete the page using PageManager.
Otherwise delete the resource using ResourceResolver.
@param resource Resource to delete | [
"If",
"the",
"given",
"resource",
"points",
"to",
"an",
"AEM",
"page",
"delete",
"the",
"page",
"using",
"PageManager",
".",
"Otherwise",
"delete",
"the",
"resource",
"using",
"ResourceResolver",
"."
] | 48592eadb0b62a09eec555cedfae7e00b213f6ed | https://github.com/wcm-io/wcm-io-caconfig/blob/48592eadb0b62a09eec555cedfae7e00b213f6ed/extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PersistenceUtils.java#L289-L310 | train |
wcm-io/wcm-io-caconfig | compat/src/main/java/io/wcm/config/core/management/util/TypeConversion.java | TypeConversion.stringToObject | @SuppressWarnings("unchecked")
public static <T> T stringToObject(String value, Class<T> type) {
if (value == null) {
return null;
}
if (type == String.class) {
return (T)value;
}
else if (type == String[].class) {
return (T)decodeString(splitPreserveAllTokens(value, ARRAY_DELIMI... | java | @SuppressWarnings("unchecked")
public static <T> T stringToObject(String value, Class<T> type) {
if (value == null) {
return null;
}
if (type == String.class) {
return (T)value;
}
else if (type == String[].class) {
return (T)decodeString(splitPreserveAllTokens(value, ARRAY_DELIMI... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"stringToObject",
"(",
"String",
"value",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}... | Converts a string value to an object with the given parameter type.
@param <T> Target type
@param value String value
@param type Parameter type
@return Converted value
@throws IllegalArgumentException If type is not supported | [
"Converts",
"a",
"string",
"value",
"to",
"an",
"object",
"with",
"the",
"given",
"parameter",
"type",
"."
] | 48592eadb0b62a09eec555cedfae7e00b213f6ed | https://github.com/wcm-io/wcm-io-caconfig/blob/48592eadb0b62a09eec555cedfae7e00b213f6ed/compat/src/main/java/io/wcm/config/core/management/util/TypeConversion.java#L70-L105 | train |
wcm-io/wcm-io-caconfig | compat/src/main/java/io/wcm/config/core/management/util/TypeConversion.java | TypeConversion.objectToString | public static String objectToString(Object value) {
if (value == null) {
return null;
}
if (value instanceof String) {
return (String)value;
}
if (value instanceof String[]) {
return StringUtils.join(encodeString((String[])value), ARRAY_DELIMITER);
}
else if (value instance... | java | public static String objectToString(Object value) {
if (value == null) {
return null;
}
if (value instanceof String) {
return (String)value;
}
if (value instanceof String[]) {
return StringUtils.join(encodeString((String[])value), ARRAY_DELIMITER);
}
else if (value instance... | [
"public",
"static",
"String",
"objectToString",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"value",
"instanceof",
"String",
")",
"{",
"return",
"(",
"String",
")",
"value",
";",
... | Converts a typed value to it's string representation.
@param value Typed value
@return String value | [
"Converts",
"a",
"typed",
"value",
"to",
"it",
"s",
"string",
"representation",
"."
] | 48592eadb0b62a09eec555cedfae7e00b213f6ed | https://github.com/wcm-io/wcm-io-caconfig/blob/48592eadb0b62a09eec555cedfae7e00b213f6ed/compat/src/main/java/io/wcm/config/core/management/util/TypeConversion.java#L112-L150 | train |
wcm-io/wcm-io-caconfig | compat/src/main/java/io/wcm/config/api/ParameterBuilder.java | ParameterBuilder.defaultOsgiConfigProperty | public ParameterBuilder<T> defaultOsgiConfigProperty(String value) {
if (value == null || !OSGI_CONFIG_PROPERTY_PATTERN.matcher(value).matches()) {
throw new IllegalArgumentException("Invalid value: " + value);
}
this.defaultOsgiConfigProperty = value;
return this;
} | java | public ParameterBuilder<T> defaultOsgiConfigProperty(String value) {
if (value == null || !OSGI_CONFIG_PROPERTY_PATTERN.matcher(value).matches()) {
throw new IllegalArgumentException("Invalid value: " + value);
}
this.defaultOsgiConfigProperty = value;
return this;
} | [
"public",
"ParameterBuilder",
"<",
"T",
">",
"defaultOsgiConfigProperty",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"!",
"OSGI_CONFIG_PROPERTY_PATTERN",
".",
"matcher",
"(",
"value",
")",
".",
"matches",
"(",
")",
")",
"{",
... | References OSGi configuration property which is checked for default value if this parameter is not set
in any configuration.
@param value OSGi configuration parameter name with syntax {serviceClassName}:{propertyName}
@return this | [
"References",
"OSGi",
"configuration",
"property",
"which",
"is",
"checked",
"for",
"default",
"value",
"if",
"this",
"parameter",
"is",
"not",
"set",
"in",
"any",
"configuration",
"."
] | 48592eadb0b62a09eec555cedfae7e00b213f6ed | https://github.com/wcm-io/wcm-io-caconfig/blob/48592eadb0b62a09eec555cedfae7e00b213f6ed/compat/src/main/java/io/wcm/config/api/ParameterBuilder.java#L158-L164 | train |
wcm-io/wcm-io-caconfig | compat/src/main/java/io/wcm/config/api/ParameterBuilder.java | ParameterBuilder.properties | public ParameterBuilder<T> properties(Map<String, Object> map) {
if (map == null) {
throw new IllegalArgumentException("Map argument must not be null.");
}
this.properties.putAll(map);
return this;
} | java | public ParameterBuilder<T> properties(Map<String, Object> map) {
if (map == null) {
throw new IllegalArgumentException("Map argument must not be null.");
}
this.properties.putAll(map);
return this;
} | [
"public",
"ParameterBuilder",
"<",
"T",
">",
"properties",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"if",
"(",
"map",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Map argument must not be null.\"",
")",
"... | Further properties for documentation and configuration of behavior in configuration editor.
@param map Property map. Is merged with properties already set in builder.
@return this | [
"Further",
"properties",
"for",
"documentation",
"and",
"configuration",
"of",
"behavior",
"in",
"configuration",
"editor",
"."
] | 48592eadb0b62a09eec555cedfae7e00b213f6ed | https://github.com/wcm-io/wcm-io-caconfig/blob/48592eadb0b62a09eec555cedfae7e00b213f6ed/compat/src/main/java/io/wcm/config/api/ParameterBuilder.java#L181-L187 | train |
wcm-io/wcm-io-caconfig | compat/src/main/java/io/wcm/config/api/ParameterBuilder.java | ParameterBuilder.property | public ParameterBuilder<T> property(String key, Object value) {
if (key == null) {
throw new IllegalArgumentException("Key argument must not be null.");
}
this.properties.put(key, value);
return this;
} | java | public ParameterBuilder<T> property(String key, Object value) {
if (key == null) {
throw new IllegalArgumentException("Key argument must not be null.");
}
this.properties.put(key, value);
return this;
} | [
"public",
"ParameterBuilder",
"<",
"T",
">",
"property",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Key argument must not be null.\"",
")",
";",
"}",
"... | Further property for documentation and configuration of behavior in configuration editor.
@param key Property key
@param value Property value
@return this | [
"Further",
"property",
"for",
"documentation",
"and",
"configuration",
"of",
"behavior",
"in",
"configuration",
"editor",
"."
] | 48592eadb0b62a09eec555cedfae7e00b213f6ed | https://github.com/wcm-io/wcm-io-caconfig/blob/48592eadb0b62a09eec555cedfae7e00b213f6ed/compat/src/main/java/io/wcm/config/api/ParameterBuilder.java#L195-L201 | train |
querydsl/codegen | src/main/java/com/mysema/codegen/AbstractEvaluatorFactory.java | AbstractEvaluatorFactory.createEvaluator | @SuppressWarnings("unchecked")
@Override
public synchronized <T> Evaluator<T> createEvaluator(String source, ClassType projection, String[] names,
Type[] types, Class<?>[] classes, Map<String, Object> constants) {
try {
final String id = toId(source, projection.getJavaClass(), ty... | java | @SuppressWarnings("unchecked")
@Override
public synchronized <T> Evaluator<T> createEvaluator(String source, ClassType projection, String[] names,
Type[] types, Class<?>[] classes, Map<String, Object> constants) {
try {
final String id = toId(source, projection.getJavaClass(), ty... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"synchronized",
"<",
"T",
">",
"Evaluator",
"<",
"T",
">",
"createEvaluator",
"(",
"String",
"source",
",",
"ClassType",
"projection",
",",
"String",
"[",
"]",
"names",
",",
"Type... | Create a new Evaluator instance
@param <T>
projection type
@param source
expression in Java source code form
@param projection
type of the source expression
@param names
names of the arguments
@param types
types of the arguments
@param constants
@return | [
"Create",
"a",
"new",
"Evaluator",
"instance"
] | 60b65f97c1cfcd0a0ec073b7eadd40cdcbfb06b0 | https://github.com/querydsl/codegen/blob/60b65f97c1cfcd0a0ec073b7eadd40cdcbfb06b0/src/main/java/com/mysema/codegen/AbstractEvaluatorFactory.java#L115-L144 | train |
CloudSlang/score | engine/score-engine-jobs/src/main/java/io/cloudslang/job/ScoreEngineJobsImpl.java | ScoreEngineJobsImpl.cleanQueueJob | @Override
public void cleanQueueJob(){
try {
Set<Long> ids = queueCleanerService.getFinishedExecStateIds();
if(logger.isDebugEnabled()) logger.debug("Will clean from queue the next Exec state ids amount:"+ids.size());
Set<Long> execIds = new HashSet<>();
for... | java | @Override
public void cleanQueueJob(){
try {
Set<Long> ids = queueCleanerService.getFinishedExecStateIds();
if(logger.isDebugEnabled()) logger.debug("Will clean from queue the next Exec state ids amount:"+ids.size());
Set<Long> execIds = new HashSet<>();
for... | [
"@",
"Override",
"public",
"void",
"cleanQueueJob",
"(",
")",
"{",
"try",
"{",
"Set",
"<",
"Long",
">",
"ids",
"=",
"queueCleanerService",
".",
"getFinishedExecStateIds",
"(",
")",
";",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"logger",
... | Job that will handle the cleaning of queue table. | [
"Job",
"that",
"will",
"handle",
"the",
"cleaning",
"of",
"queue",
"table",
"."
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/engine/score-engine-jobs/src/main/java/io/cloudslang/job/ScoreEngineJobsImpl.java#L62-L84 | train |
CloudSlang/score | engine/score-engine-jobs/src/main/java/io/cloudslang/job/ScoreEngineJobsImpl.java | ScoreEngineJobsImpl.joinFinishedSplitsJob | @Override
public void joinFinishedSplitsJob(){
try {
if (logger.isDebugEnabled()) logger.debug("SplitJoinJob woke up at " + new Date());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
// try sequentially at most 'ITERATIONS' attempts
//... | java | @Override
public void joinFinishedSplitsJob(){
try {
if (logger.isDebugEnabled()) logger.debug("SplitJoinJob woke up at " + new Date());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
// try sequentially at most 'ITERATIONS' attempts
//... | [
"@",
"Override",
"public",
"void",
"joinFinishedSplitsJob",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"logger",
".",
"debug",
"(",
"\"SplitJoinJob woke up at \"",
"+",
"new",
"Date",
"(",
")",
")",
";",
"StopWatc... | Job that will handle the joining of finished branches. | [
"Job",
"that",
"will",
"handle",
"the",
"joining",
"of",
"finished",
"branches",
"."
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/engine/score-engine-jobs/src/main/java/io/cloudslang/job/ScoreEngineJobsImpl.java#L89-L109 | train |
CloudSlang/score | engine/score-engine-jobs/src/main/java/io/cloudslang/job/ScoreEngineJobsImpl.java | ScoreEngineJobsImpl.executionRecoveryJob | @Override
public void executionRecoveryJob(){
if (logger.isDebugEnabled()) {
logger.debug("ExecutionRecoveryJob woke up at " + new Date());
}
try {
executionRecoveryService.doRecovery();
}
catch (Exception e){
logger.error("Can't run queue... | java | @Override
public void executionRecoveryJob(){
if (logger.isDebugEnabled()) {
logger.debug("ExecutionRecoveryJob woke up at " + new Date());
}
try {
executionRecoveryService.doRecovery();
}
catch (Exception e){
logger.error("Can't run queue... | [
"@",
"Override",
"public",
"void",
"executionRecoveryJob",
"(",
")",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"ExecutionRecoveryJob woke up at \"",
"+",
"new",
"Date",
"(",
")",
")",
";",
"}",
"try... | Job to execute the recovery check. | [
"Job",
"to",
"execute",
"the",
"recovery",
"check",
"."
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/engine/score-engine-jobs/src/main/java/io/cloudslang/job/ScoreEngineJobsImpl.java#L124-L136 | train |
CloudSlang/score | engine/orchestrator/score-orchestrator-impl/src/main/java/io/cloudslang/orchestrator/services/CancelExecutionServiceImpl.java | CancelExecutionServiceImpl.cancelPausedRun | private void cancelPausedRun(ExecutionState executionStateToCancel) {
final List<ExecutionState> branches = executionStateService.readByExecutionId(executionStateToCancel.getExecutionId());
// If the parent is paused because one of the branches is paused, OR, it was paused by the user / no-workers-in-g... | java | private void cancelPausedRun(ExecutionState executionStateToCancel) {
final List<ExecutionState> branches = executionStateService.readByExecutionId(executionStateToCancel.getExecutionId());
// If the parent is paused because one of the branches is paused, OR, it was paused by the user / no-workers-in-g... | [
"private",
"void",
"cancelPausedRun",
"(",
"ExecutionState",
"executionStateToCancel",
")",
"{",
"final",
"List",
"<",
"ExecutionState",
">",
"branches",
"=",
"executionStateService",
".",
"readByExecutionId",
"(",
"executionStateToCancel",
".",
"getExecutionId",
"(",
"... | If it doesn't - just cancel it straight away - extract the Run Object, set its context accordingly and put into the queue. | [
"If",
"it",
"doesn",
"t",
"-",
"just",
"cancel",
"it",
"straight",
"away",
"-",
"extract",
"the",
"Run",
"Object",
"set",
"its",
"context",
"accordingly",
"and",
"put",
"into",
"the",
"queue",
"."
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/engine/orchestrator/score-orchestrator-impl/src/main/java/io/cloudslang/orchestrator/services/CancelExecutionServiceImpl.java#L101-L117 | train |
CloudSlang/score | engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/services/QueueListenerImpl.java | QueueListenerImpl.isBranch | private boolean isBranch(Execution execution) {
return execution != null && !StringUtils.isEmpty(execution.getSystemContext().getBranchId());
} | java | private boolean isBranch(Execution execution) {
return execution != null && !StringUtils.isEmpty(execution.getSystemContext().getBranchId());
} | [
"private",
"boolean",
"isBranch",
"(",
"Execution",
"execution",
")",
"{",
"return",
"execution",
"!=",
"null",
"&&",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"execution",
".",
"getSystemContext",
"(",
")",
".",
"getBranchId",
"(",
")",
")",
";",
"}"
] | Returns true when the execution is a branch with the new branch mechanism
It will return true for executions of parallel, multi-instance, sub-flows and non blocking | [
"Returns",
"true",
"when",
"the",
"execution",
"is",
"a",
"branch",
"with",
"the",
"new",
"branch",
"mechanism",
"It",
"will",
"return",
"true",
"for",
"executions",
"of",
"parallel",
"multi",
"-",
"instance",
"sub",
"-",
"flows",
"and",
"non",
"blocking"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/services/QueueListenerImpl.java#L142-L144 | train |
CloudSlang/score | worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/WorkerManager.java | WorkerManager.doRecovery | public void doRecovery() {
// Attempts to stop all actively executing tasks, halts the
// processing of waiting tasks, and returns a list of the tasks
// that were awaiting execution.
//
// This method does not wait for actively executing tasks to
// terminate.
//
// There are... | java | public void doRecovery() {
// Attempts to stop all actively executing tasks, halts the
// processing of waiting tasks, and returns a list of the tasks
// that were awaiting execution.
//
// This method does not wait for actively executing tasks to
// terminate.
//
// There are... | [
"public",
"void",
"doRecovery",
"(",
")",
"{",
"// Attempts to stop all actively executing tasks, halts the",
"// processing of waiting tasks, and returns a list of the tasks",
"// that were awaiting execution.",
"//",
"// This method does not wait for actively execut... | Must clean the buffer that holds Runnables that wait for execution and also drop all the executions that currently run | [
"Must",
"clean",
"the",
"buffer",
"that",
"holds",
"Runnables",
"that",
"wait",
"for",
"execution",
"and",
"also",
"drop",
"all",
"the",
"executions",
"that",
"currently",
"run"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/WorkerManager.java#L333-L371 | train |
CloudSlang/score | runtime-management/runtime-management-impl/src/main/java/io/cloudslang/runtime/impl/python/PythonExecutor.java | PythonExecutor.exec | public PythonExecutionResult exec(String script, Map<String, Serializable> callArguments) {
checkValidInterpreter();
initInterpreter();
prepareInterpreterContext(callArguments);
Exception originException = null;
for(int i = 0; i < RETRIES_NUMBER_ON_THREADED_ISSUE; i++) {
... | java | public PythonExecutionResult exec(String script, Map<String, Serializable> callArguments) {
checkValidInterpreter();
initInterpreter();
prepareInterpreterContext(callArguments);
Exception originException = null;
for(int i = 0; i < RETRIES_NUMBER_ON_THREADED_ISSUE; i++) {
... | [
"public",
"PythonExecutionResult",
"exec",
"(",
"String",
"script",
",",
"Map",
"<",
"String",
",",
"Serializable",
">",
"callArguments",
")",
"{",
"checkValidInterpreter",
"(",
")",
";",
"initInterpreter",
"(",
")",
";",
"prepareInterpreterContext",
"(",
"callArg... | we need this method to be synchronized so we will not have multiple scripts run in parallel on the same context | [
"we",
"need",
"this",
"method",
"to",
"be",
"synchronized",
"so",
"we",
"will",
"not",
"have",
"multiple",
"scripts",
"run",
"in",
"parallel",
"on",
"the",
"same",
"context"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/runtime-management/runtime-management-impl/src/main/java/io/cloudslang/runtime/impl/python/PythonExecutor.java#L106-L125 | train |
CloudSlang/score | engine/data/score-data-api/src/main/java/io/cloudslang/engine/data/SqlUtils.java | SqlUtils.escapeLikeExpression | public String escapeLikeExpression(String likeExpression) {
String normalizeLikeExpression = likeExpression;
if (likeExpression != null && !likeExpression.isEmpty()) {
normalizeLikeExpression = normalizeLikeExpression.replace(ESCAPE_CHAR, DOUBLE_ESCAPE_CHAR);
for (String charToEscape : currentSpecialCharsSet)... | java | public String escapeLikeExpression(String likeExpression) {
String normalizeLikeExpression = likeExpression;
if (likeExpression != null && !likeExpression.isEmpty()) {
normalizeLikeExpression = normalizeLikeExpression.replace(ESCAPE_CHAR, DOUBLE_ESCAPE_CHAR);
for (String charToEscape : currentSpecialCharsSet)... | [
"public",
"String",
"escapeLikeExpression",
"(",
"String",
"likeExpression",
")",
"{",
"String",
"normalizeLikeExpression",
"=",
"likeExpression",
";",
"if",
"(",
"likeExpression",
"!=",
"null",
"&&",
"!",
"likeExpression",
".",
"isEmpty",
"(",
")",
")",
"{",
"n... | Escaping like expressions so wildcards will not be evaluated.
The HQL query should have the ESCAPE_EXPRESSION in it's suffix for this to work!!!
The method returns an escaped expression, which would behave the same of all SQL repositories when
adding escape with the ESCAPE_CHAR to the query.
Note: 'like' expression a... | [
"Escaping",
"like",
"expressions",
"so",
"wildcards",
"will",
"not",
"be",
"evaluated",
".",
"The",
"HQL",
"query",
"should",
"have",
"the",
"ESCAPE_EXPRESSION",
"in",
"it",
"s",
"suffix",
"for",
"this",
"to",
"work!!!"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/engine/data/score-data-api/src/main/java/io/cloudslang/engine/data/SqlUtils.java#L73-L82 | train |
CloudSlang/score | worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/WorkerConfigurationUtils.java | WorkerConfigurationUtils.getMinSizeAndSizeOfInBuffer | public Pair<Integer, Integer> getMinSizeAndSizeOfInBuffer(int executionThreadsCount) {
// 20% percent of executionThreadsCount, but bigger than 1
int defaultMinInBufferSize = Math.max(1, executionThreadsCount / 5);
int minInBufferSizeLocal = getInteger(WORKER_INBUFFER_MIN_SIZE, defaultMinInBuffe... | java | public Pair<Integer, Integer> getMinSizeAndSizeOfInBuffer(int executionThreadsCount) {
// 20% percent of executionThreadsCount, but bigger than 1
int defaultMinInBufferSize = Math.max(1, executionThreadsCount / 5);
int minInBufferSizeLocal = getInteger(WORKER_INBUFFER_MIN_SIZE, defaultMinInBuffe... | [
"public",
"Pair",
"<",
"Integer",
",",
"Integer",
">",
"getMinSizeAndSizeOfInBuffer",
"(",
"int",
"executionThreadsCount",
")",
"{",
"// 20% percent of executionThreadsCount, but bigger than 1",
"int",
"defaultMinInBufferSize",
"=",
"Math",
".",
"max",
"(",
"1",
",",
"e... | 10 percent of Xmx | [
"10",
"percent",
"of",
"Xmx"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/WorkerConfigurationUtils.java#L55-L71 | train |
CloudSlang/score | worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/SimpleExecutionRunnable.java | SimpleExecutionRunnable.isExecutionPaused | private boolean isExecutionPaused(Execution nextStepExecution) {
// If execution was paused
if (nextStepExecution == null) {
//set current step to finished
executionMessage.setStatus(ExecStatus.FINISHED);
executionMessage.incMsgSeqId();
executionMessage.se... | java | private boolean isExecutionPaused(Execution nextStepExecution) {
// If execution was paused
if (nextStepExecution == null) {
//set current step to finished
executionMessage.setStatus(ExecStatus.FINISHED);
executionMessage.incMsgSeqId();
executionMessage.se... | [
"private",
"boolean",
"isExecutionPaused",
"(",
"Execution",
"nextStepExecution",
")",
"{",
"// If execution was paused",
"if",
"(",
"nextStepExecution",
"==",
"null",
")",
"{",
"//set current step to finished",
"executionMessage",
".",
"setStatus",
"(",
"ExecStatus",
"."... | If execution was paused it sends the current step with status FINISHED and that is all... | [
"If",
"execution",
"was",
"paused",
"it",
"sends",
"the",
"current",
"step",
"with",
"status",
"FINISHED",
"and",
"that",
"is",
"all",
"..."
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/SimpleExecutionRunnable.java#L184-L201 | train |
CloudSlang/score | worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/SimpleExecutionRunnable.java | SimpleExecutionRunnable.createTerminatedExecutionMessage | private ExecutionMessage createTerminatedExecutionMessage(Execution nextStepExecution) {
Payload payload = converter.createPayload(nextStepExecution); //we need the payload
ExecutionMessage finalMessage = (ExecutionMessage) executionMessage.clone();
finalMessage.setStatus(ExecStatus.TERMINATED);... | java | private ExecutionMessage createTerminatedExecutionMessage(Execution nextStepExecution) {
Payload payload = converter.createPayload(nextStepExecution); //we need the payload
ExecutionMessage finalMessage = (ExecutionMessage) executionMessage.clone();
finalMessage.setStatus(ExecStatus.TERMINATED);... | [
"private",
"ExecutionMessage",
"createTerminatedExecutionMessage",
"(",
"Execution",
"nextStepExecution",
")",
"{",
"Payload",
"payload",
"=",
"converter",
".",
"createPayload",
"(",
"nextStepExecution",
")",
";",
"//we need the payload",
"ExecutionMessage",
"finalMessage",
... | Creates termination execution message, base on current execution message | [
"Creates",
"termination",
"execution",
"message",
"base",
"on",
"current",
"execution",
"message"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/SimpleExecutionRunnable.java#L412-L419 | train |
CloudSlang/score | worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/SimpleExecutionRunnable.java | SimpleExecutionRunnable.createPendingExecutionMessage | private ExecutionMessage createPendingExecutionMessage(Execution nextStepExecution) {
// Take care of worker group
String groupName = nextStepExecution.getGroupName();
if (groupName == null) {
groupName = WorkerNode.DEFAULT_WORKER_GROUPS[0];
}
return new ExecutionMess... | java | private ExecutionMessage createPendingExecutionMessage(Execution nextStepExecution) {
// Take care of worker group
String groupName = nextStepExecution.getGroupName();
if (groupName == null) {
groupName = WorkerNode.DEFAULT_WORKER_GROUPS[0];
}
return new ExecutionMess... | [
"private",
"ExecutionMessage",
"createPendingExecutionMessage",
"(",
"Execution",
"nextStepExecution",
")",
"{",
"// Take care of worker group",
"String",
"groupName",
"=",
"nextStepExecution",
".",
"getGroupName",
"(",
")",
";",
"if",
"(",
"groupName",
"==",
"null",
")... | Creates pending execution message for the next step, base on current execution message | [
"Creates",
"pending",
"execution",
"message",
"for",
"the",
"next",
"step",
"base",
"on",
"current",
"execution",
"message"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/SimpleExecutionRunnable.java#L422-L435 | train |
CloudSlang/score | worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/SimpleExecutionRunnable.java | SimpleExecutionRunnable.createInProgressExecutionMessage | private ExecutionMessage createInProgressExecutionMessage(Execution nextStepExecution) {
// Take care of worker group
String groupName = nextStepExecution.getGroupName();
if (groupName == null) {
groupName = WorkerNode.DEFAULT_WORKER_GROUPS[0];
}
Long id = queueState... | java | private ExecutionMessage createInProgressExecutionMessage(Execution nextStepExecution) {
// Take care of worker group
String groupName = nextStepExecution.getGroupName();
if (groupName == null) {
groupName = WorkerNode.DEFAULT_WORKER_GROUPS[0];
}
Long id = queueState... | [
"private",
"ExecutionMessage",
"createInProgressExecutionMessage",
"(",
"Execution",
"nextStepExecution",
")",
"{",
"// Take care of worker group",
"String",
"groupName",
"=",
"nextStepExecution",
".",
"getGroupName",
"(",
")",
";",
"if",
"(",
"groupName",
"==",
"null",
... | Creates InProgress execution message for the next step, base on current execution message - used for short cut! | [
"Creates",
"InProgress",
"execution",
"message",
"for",
"the",
"next",
"step",
"base",
"on",
"current",
"execution",
"message",
"-",
"used",
"for",
"short",
"cut!"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/worker/worker-manager/score-worker-manager-impl/src/main/java/io/cloudslang/worker/management/services/SimpleExecutionRunnable.java#L438-L455 | train |
CloudSlang/score | score-api/src/main/java/io/cloudslang/score/lang/ExecutionRuntimeServices.java | ExecutionRuntimeServices.setFinishedChildBranchesData | public void setFinishedChildBranchesData(ArrayList<EndBranchDataContainer> data) {
Validate.isTrue(!contextMap.containsKey(ExecutionParametersConsts.FINISHED_CHILD_BRANCHES_DATA),
"not allowed to overwrite finished branches data");
contextMap.put(ExecutionParametersConsts.FINISHED_CHILD_... | java | public void setFinishedChildBranchesData(ArrayList<EndBranchDataContainer> data) {
Validate.isTrue(!contextMap.containsKey(ExecutionParametersConsts.FINISHED_CHILD_BRANCHES_DATA),
"not allowed to overwrite finished branches data");
contextMap.put(ExecutionParametersConsts.FINISHED_CHILD_... | [
"public",
"void",
"setFinishedChildBranchesData",
"(",
"ArrayList",
"<",
"EndBranchDataContainer",
">",
"data",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"!",
"contextMap",
".",
"containsKey",
"(",
"ExecutionParametersConsts",
".",
"FINISHED_CHILD_BRANCHES_DATA",
")",
... | setter for the finished child brunches data
@param data - list of EndBranchDataContainer | [
"setter",
"for",
"the",
"finished",
"child",
"brunches",
"data"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/score-api/src/main/java/io/cloudslang/score/lang/ExecutionRuntimeServices.java#L103-L107 | train |
CloudSlang/score | score-api/src/main/java/io/cloudslang/score/lang/ExecutionRuntimeServices.java | ExecutionRuntimeServices.setBranchId | public void setBranchId(String brunchId) {
Validate.isTrue(StringUtils.isEmpty(getBranchId()), "not allowed to overwrite branch id");
contextMap.put(BRANCH_ID, brunchId);
} | java | public void setBranchId(String brunchId) {
Validate.isTrue(StringUtils.isEmpty(getBranchId()), "not allowed to overwrite branch id");
contextMap.put(BRANCH_ID, brunchId);
} | [
"public",
"void",
"setBranchId",
"(",
"String",
"brunchId",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"getBranchId",
"(",
")",
")",
",",
"\"not allowed to overwrite branch id\"",
")",
";",
"contextMap",
".",
"put",
"(",
"BRA... | setter for the brunch id of the current Execution | [
"setter",
"for",
"the",
"brunch",
"id",
"of",
"the",
"current",
"Execution"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/score-api/src/main/java/io/cloudslang/score/lang/ExecutionRuntimeServices.java#L154-L157 | train |
CloudSlang/score | score-api/src/main/java/io/cloudslang/score/lang/ExecutionRuntimeServices.java | ExecutionRuntimeServices.setSplitId | public void setSplitId(String splitId) {
Validate.isTrue(StringUtils.isEmpty(getSplitId()), "not allowed to overwrite split id");
contextMap.put(NEW_SPLIT_ID, splitId);
} | java | public void setSplitId(String splitId) {
Validate.isTrue(StringUtils.isEmpty(getSplitId()), "not allowed to overwrite split id");
contextMap.put(NEW_SPLIT_ID, splitId);
} | [
"public",
"void",
"setSplitId",
"(",
"String",
"splitId",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"getSplitId",
"(",
")",
")",
",",
"\"not allowed to overwrite split id\"",
")",
";",
"contextMap",
".",
"put",
"(",
"NEW_SPL... | set teh split id | [
"set",
"teh",
"split",
"id"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/score-api/src/main/java/io/cloudslang/score/lang/ExecutionRuntimeServices.java#L277-L280 | train |
CloudSlang/score | score-api/src/main/java/io/cloudslang/score/lang/ExecutionRuntimeServices.java | ExecutionRuntimeServices.addEvent | public void addEvent(String eventType, Serializable eventData) {
@SuppressWarnings("unchecked")
Queue<ScoreEvent> eventsQueue = getFromMap(SCORE_EVENTS_QUEUE);
if (eventsQueue == null) {
eventsQueue = new ArrayDeque<>();
contextMap.put(SCORE_EVENTS_QUEUE, (ArrayDeque) eve... | java | public void addEvent(String eventType, Serializable eventData) {
@SuppressWarnings("unchecked")
Queue<ScoreEvent> eventsQueue = getFromMap(SCORE_EVENTS_QUEUE);
if (eventsQueue == null) {
eventsQueue = new ArrayDeque<>();
contextMap.put(SCORE_EVENTS_QUEUE, (ArrayDeque) eve... | [
"public",
"void",
"addEvent",
"(",
"String",
"eventType",
",",
"Serializable",
"eventData",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"Queue",
"<",
"ScoreEvent",
">",
"eventsQueue",
"=",
"getFromMap",
"(",
"SCORE_EVENTS_QUEUE",
")",
";",
"if"... | add event - for score to fire
@param eventType - string which is the key you can listen to
@param eventData - the event data | [
"add",
"event",
"-",
"for",
"score",
"to",
"fire"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/score-api/src/main/java/io/cloudslang/score/lang/ExecutionRuntimeServices.java#L327-L335 | train |
CloudSlang/score | score-api/src/main/java/io/cloudslang/score/lang/ExecutionRuntimeServices.java | ExecutionRuntimeServices.addBranch | public void addBranch(Long startPosition, String flowUuid, Map<String, Serializable> context) {
Map<String, Long> runningPlansIds = getFromMap(RUNNING_PLANS_MAP);
Long runningPlanId = runningPlansIds.get(flowUuid);
addBranch(startPosition, runningPlanId, context, new ExecutionRuntimeServices(thi... | java | public void addBranch(Long startPosition, String flowUuid, Map<String, Serializable> context) {
Map<String, Long> runningPlansIds = getFromMap(RUNNING_PLANS_MAP);
Long runningPlanId = runningPlansIds.get(flowUuid);
addBranch(startPosition, runningPlanId, context, new ExecutionRuntimeServices(thi... | [
"public",
"void",
"addBranch",
"(",
"Long",
"startPosition",
",",
"String",
"flowUuid",
",",
"Map",
"<",
"String",
",",
"Serializable",
">",
"context",
")",
"{",
"Map",
"<",
"String",
",",
"Long",
">",
"runningPlansIds",
"=",
"getFromMap",
"(",
"RUNNING_PLAN... | add brunch - means you want to split your execution
@param startPosition - the position in the execution plan the new brunch will point to
@param flowUuid - the flow uuid
@param context - the context of the created brunch | [
"add",
"brunch",
"-",
"means",
"you",
"want",
"to",
"split",
"your",
"execution"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/score-api/src/main/java/io/cloudslang/score/lang/ExecutionRuntimeServices.java#L372-L376 | train |
CloudSlang/score | worker/worker-execution/score-worker-execution-impl/src/main/java/io/cloudslang/worker/execution/services/ExecutionServiceImpl.java | ExecutionServiceImpl.handlePausedFlow | protected boolean handlePausedFlow(Execution execution) throws InterruptedException {
String branchId = execution.getSystemContext().getBranchId();
PauseReason reason = findPauseReason(execution.getExecutionId(), branchId);
if (reason != null) { // need to pause the execution
pauseFl... | java | protected boolean handlePausedFlow(Execution execution) throws InterruptedException {
String branchId = execution.getSystemContext().getBranchId();
PauseReason reason = findPauseReason(execution.getExecutionId(), branchId);
if (reason != null) { // need to pause the execution
pauseFl... | [
"protected",
"boolean",
"handlePausedFlow",
"(",
"Execution",
"execution",
")",
"throws",
"InterruptedException",
"{",
"String",
"branchId",
"=",
"execution",
".",
"getSystemContext",
"(",
")",
".",
"getBranchId",
"(",
")",
";",
"PauseReason",
"reason",
"=",
"find... | check if the execution should be Paused, and pause it if needed | [
"check",
"if",
"the",
"execution",
"should",
"be",
"Paused",
"and",
"pause",
"it",
"if",
"needed"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/worker/worker-execution/score-worker-execution-impl/src/main/java/io/cloudslang/worker/execution/services/ExecutionServiceImpl.java#L270-L278 | train |
CloudSlang/score | worker/worker-execution/score-worker-execution-impl/src/main/java/io/cloudslang/worker/execution/services/ExecutionServiceImpl.java | ExecutionServiceImpl.handlePausedFlowAfterStep | private boolean handlePausedFlowAfterStep(Execution execution) throws InterruptedException {
String branchId = execution.getSystemContext().getBranchId();
PauseReason reason = null;
ExecutionSummary execSummary = pauseService.readPausedExecution(execution.getExecutionId(), branchId);
if ... | java | private boolean handlePausedFlowAfterStep(Execution execution) throws InterruptedException {
String branchId = execution.getSystemContext().getBranchId();
PauseReason reason = null;
ExecutionSummary execSummary = pauseService.readPausedExecution(execution.getExecutionId(), branchId);
if ... | [
"private",
"boolean",
"handlePausedFlowAfterStep",
"(",
"Execution",
"execution",
")",
"throws",
"InterruptedException",
"{",
"String",
"branchId",
"=",
"execution",
".",
"getSystemContext",
"(",
")",
".",
"getBranchId",
"(",
")",
";",
"PauseReason",
"reason",
"=",
... | no need to check if paused - because this is called after the step, when the Pause flag exists in the context | [
"no",
"need",
"to",
"check",
"if",
"paused",
"-",
"because",
"this",
"is",
"called",
"after",
"the",
"step",
"when",
"the",
"Pause",
"flag",
"exists",
"in",
"the",
"context"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/worker/worker-execution/score-worker-execution-impl/src/main/java/io/cloudslang/worker/execution/services/ExecutionServiceImpl.java#L281-L293 | train |
CloudSlang/score | engine/data/score-data-api/src/main/java/io/cloudslang/engine/data/SqlInQueryReader.java | SqlInQueryReader.extractAndRemoveUpToLimit | private Set<String> extractAndRemoveUpToLimit(Set<String> source, int limit) {
Set<String> result = new HashSet<>();
Iterator<String> iterator = source.iterator();
while (iterator.hasNext() && result.size() < limit) {
result.add(iterator.next());
iterator.remove();
... | java | private Set<String> extractAndRemoveUpToLimit(Set<String> source, int limit) {
Set<String> result = new HashSet<>();
Iterator<String> iterator = source.iterator();
while (iterator.hasNext() && result.size() < limit) {
result.add(iterator.next());
iterator.remove();
... | [
"private",
"Set",
"<",
"String",
">",
"extractAndRemoveUpToLimit",
"(",
"Set",
"<",
"String",
">",
"source",
",",
"int",
"limit",
")",
"{",
"Set",
"<",
"String",
">",
"result",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"Iterator",
"<",
"String",
">",... | Extracts items from source in the ammount set in 'limit' and also removes them from source | [
"Extracts",
"items",
"from",
"source",
"in",
"the",
"ammount",
"set",
"in",
"limit",
"and",
"also",
"removes",
"them",
"from",
"source"
] | 796134e917843f4d95a90f7740d69dc5257a1a0e | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/engine/data/score-data-api/src/main/java/io/cloudslang/engine/data/SqlInQueryReader.java#L63-L71 | train |
flow/nbt | src/main/java/com/flowpowered/nbt/NBTUtils.java | NBTUtils.getTypeName | @Deprecated
public static String getTypeName(Class<? extends Tag<?>> clazz) {
return TagType.getByTagClass(clazz).getTypeName();
} | java | @Deprecated
public static String getTypeName(Class<? extends Tag<?>> clazz) {
return TagType.getByTagClass(clazz).getTypeName();
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"getTypeName",
"(",
"Class",
"<",
"?",
"extends",
"Tag",
"<",
"?",
">",
">",
"clazz",
")",
"{",
"return",
"TagType",
".",
"getByTagClass",
"(",
"clazz",
")",
".",
"getTypeName",
"(",
")",
";",
"}"
] | Gets the type name of a tag.
@param clazz The tag class.
@return The type name. | [
"Gets",
"the",
"type",
"name",
"of",
"a",
"tag",
"."
] | 7a1b6d986e6fbd01862356d47827b8b357349a22 | https://github.com/flow/nbt/blob/7a1b6d986e6fbd01862356d47827b8b357349a22/src/main/java/com/flowpowered/nbt/NBTUtils.java#L36-L39 | train |
flow/nbt | src/main/java/com/flowpowered/nbt/stream/NBTOutputStream.java | NBTOutputStream.writeTag | public void writeTag(Tag<?> tag) throws IOException {
String name = tag.getName();
byte[] nameBytes = name.getBytes(NBTConstants.CHARSET.name());
os.writeByte(tag.getType().getId());
os.writeShort(nameBytes.length);
os.write(nameBytes);
if (tag.getType() == TagType.TAG_... | java | public void writeTag(Tag<?> tag) throws IOException {
String name = tag.getName();
byte[] nameBytes = name.getBytes(NBTConstants.CHARSET.name());
os.writeByte(tag.getType().getId());
os.writeShort(nameBytes.length);
os.write(nameBytes);
if (tag.getType() == TagType.TAG_... | [
"public",
"void",
"writeTag",
"(",
"Tag",
"<",
"?",
">",
"tag",
")",
"throws",
"IOException",
"{",
"String",
"name",
"=",
"tag",
".",
"getName",
"(",
")",
";",
"byte",
"[",
"]",
"nameBytes",
"=",
"name",
".",
"getBytes",
"(",
"NBTConstants",
".",
"CH... | Writes a tag.
@param tag The tag to write.
@throws java.io.IOException if an I/O error occurs. | [
"Writes",
"a",
"tag",
"."
] | 7a1b6d986e6fbd01862356d47827b8b357349a22 | https://github.com/flow/nbt/blob/7a1b6d986e6fbd01862356d47827b8b357349a22/src/main/java/com/flowpowered/nbt/stream/NBTOutputStream.java#L99-L112 | train |
flow/nbt | src/main/java/com/flowpowered/nbt/stream/NBTOutputStream.java | NBTOutputStream.writeTagPayload | private void writeTagPayload(Tag<?> tag) throws IOException {
switch (tag.getType()) {
case TAG_END:
writeEndTagPayload((EndTag) tag);
break;
case TAG_BYTE:
writeByteTagPayload((ByteTag) tag);
break;
case TAG_S... | java | private void writeTagPayload(Tag<?> tag) throws IOException {
switch (tag.getType()) {
case TAG_END:
writeEndTagPayload((EndTag) tag);
break;
case TAG_BYTE:
writeByteTagPayload((ByteTag) tag);
break;
case TAG_S... | [
"private",
"void",
"writeTagPayload",
"(",
"Tag",
"<",
"?",
">",
"tag",
")",
"throws",
"IOException",
"{",
"switch",
"(",
"tag",
".",
"getType",
"(",
")",
")",
"{",
"case",
"TAG_END",
":",
"writeEndTagPayload",
"(",
"(",
"EndTag",
")",
"tag",
")",
";",... | Writes tag payload.
@param tag The tag.
@throws java.io.IOException if an I/O error occurs. | [
"Writes",
"tag",
"payload",
"."
] | 7a1b6d986e6fbd01862356d47827b8b357349a22 | https://github.com/flow/nbt/blob/7a1b6d986e6fbd01862356d47827b8b357349a22/src/main/java/com/flowpowered/nbt/stream/NBTOutputStream.java#L120-L177 | train |
flow/nbt | src/main/java/com/flowpowered/nbt/holder/FieldValue.java | FieldValue.load | public T load(CompoundTag tag) {
Tag subTag = tag.getValue().get(key);
if (subTag == null) {
return (value = defaultValue);
}
return (value = field.getValue(subTag));
} | java | public T load(CompoundTag tag) {
Tag subTag = tag.getValue().get(key);
if (subTag == null) {
return (value = defaultValue);
}
return (value = field.getValue(subTag));
} | [
"public",
"T",
"load",
"(",
"CompoundTag",
"tag",
")",
"{",
"Tag",
"subTag",
"=",
"tag",
".",
"getValue",
"(",
")",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"subTag",
"==",
"null",
")",
"{",
"return",
"(",
"value",
"=",
"defaultValue",
")",
"... | Get this field from a CompoundTag
@param tag The tag to get this field from
@return The value | [
"Get",
"this",
"field",
"from",
"a",
"CompoundTag"
] | 7a1b6d986e6fbd01862356d47827b8b357349a22 | https://github.com/flow/nbt/blob/7a1b6d986e6fbd01862356d47827b8b357349a22/src/main/java/com/flowpowered/nbt/holder/FieldValue.java#L55-L61 | train |
flow/nbt | src/main/java/com/flowpowered/nbt/holder/FieldValue.java | FieldValue.from | public static <T> FieldValue<T> from(String name, Field<T> field, T defaultValue) {
return new FieldValue<T>(name, field, defaultValue);
} | java | public static <T> FieldValue<T> from(String name, Field<T> field, T defaultValue) {
return new FieldValue<T>(name, field, defaultValue);
} | [
"public",
"static",
"<",
"T",
">",
"FieldValue",
"<",
"T",
">",
"from",
"(",
"String",
"name",
",",
"Field",
"<",
"T",
">",
"field",
",",
"T",
"defaultValue",
")",
"{",
"return",
"new",
"FieldValue",
"<",
"T",
">",
"(",
"name",
",",
"field",
",",
... | So generic info doesn't have to be duplicated | [
"So",
"generic",
"info",
"doesn",
"t",
"have",
"to",
"be",
"duplicated"
] | 7a1b6d986e6fbd01862356d47827b8b357349a22 | https://github.com/flow/nbt/blob/7a1b6d986e6fbd01862356d47827b8b357349a22/src/main/java/com/flowpowered/nbt/holder/FieldValue.java#L83-L85 | train |
flow/nbt | src/main/java/com/flowpowered/nbt/util/NBTMapper.java | NBTMapper.getTagValue | public static <T> T getTagValue(Tag<?> t, Class<? extends T> clazz) {
Object o = toTagValue(t);
if (o == null) {
return null;
}
try {
return clazz.cast(o);
} catch (ClassCastException e) {
return null;
}
} | java | public static <T> T getTagValue(Tag<?> t, Class<? extends T> clazz) {
Object o = toTagValue(t);
if (o == null) {
return null;
}
try {
return clazz.cast(o);
} catch (ClassCastException e) {
return null;
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getTagValue",
"(",
"Tag",
"<",
"?",
">",
"t",
",",
"Class",
"<",
"?",
"extends",
"T",
">",
"clazz",
")",
"{",
"Object",
"o",
"=",
"toTagValue",
"(",
"t",
")",
";",
"if",
"(",
"o",
"==",
"null",
")",
"{... | Takes in an NBT tag, sanely checks null status, and then returns it value. This method will return null if the value cannot be cast to the given class.
@param t Tag to get the value from
@param clazz the return type to use
@return the value as an onbject of the same type as the given class | [
"Takes",
"in",
"an",
"NBT",
"tag",
"sanely",
"checks",
"null",
"status",
"and",
"then",
"returns",
"it",
"value",
".",
"This",
"method",
"will",
"return",
"null",
"if",
"the",
"value",
"cannot",
"be",
"cast",
"to",
"the",
"given",
"class",
"."
] | 7a1b6d986e6fbd01862356d47827b8b357349a22 | https://github.com/flow/nbt/blob/7a1b6d986e6fbd01862356d47827b8b357349a22/src/main/java/com/flowpowered/nbt/util/NBTMapper.java#L53-L63 | train |
flow/nbt | src/main/java/com/flowpowered/nbt/util/NBTMapper.java | NBTMapper.toTagValue | public static <T, U extends T> T toTagValue(Tag<?> t, Class<? extends T> clazz, U defaultValue) {
Object o = toTagValue(t);
if (o == null) {
return defaultValue;
}
try {
T value = clazz.cast(o);
return value;
} catch (ClassCastException e) {
... | java | public static <T, U extends T> T toTagValue(Tag<?> t, Class<? extends T> clazz, U defaultValue) {
Object o = toTagValue(t);
if (o == null) {
return defaultValue;
}
try {
T value = clazz.cast(o);
return value;
} catch (ClassCastException e) {
... | [
"public",
"static",
"<",
"T",
",",
"U",
"extends",
"T",
">",
"T",
"toTagValue",
"(",
"Tag",
"<",
"?",
">",
"t",
",",
"Class",
"<",
"?",
"extends",
"T",
">",
"clazz",
",",
"U",
"defaultValue",
")",
"{",
"Object",
"o",
"=",
"toTagValue",
"(",
"t",
... | Takes in an NBT tag, sanely checks null status, and then returns it value. This method will return null if the value cannot be cast to the default value.
@param t Tag to get the value from
@param defaultValue the value to return if the tag or its value is null or the value cannot be cast
@return the value as an onbjec... | [
"Takes",
"in",
"an",
"NBT",
"tag",
"sanely",
"checks",
"null",
"status",
"and",
"then",
"returns",
"it",
"value",
".",
"This",
"method",
"will",
"return",
"null",
"if",
"the",
"value",
"cannot",
"be",
"cast",
"to",
"the",
"default",
"value",
"."
] | 7a1b6d986e6fbd01862356d47827b8b357349a22 | https://github.com/flow/nbt/blob/7a1b6d986e6fbd01862356d47827b8b357349a22/src/main/java/com/flowpowered/nbt/util/NBTMapper.java#L72-L83 | train |
flow/nbt | src/main/java/com/flowpowered/nbt/holder/FieldUtils.java | FieldUtils.checkTagCast | public static <T extends Tag<?>> T checkTagCast(Tag<?> tag, Class<T> type) throws IllegalArgumentException {
if (tag == null) {
throw new IllegalArgumentException("Expected tag of type " + type.getName() + ", was null");
} else if (!type.isInstance(tag)) {
throw new IllegalArgume... | java | public static <T extends Tag<?>> T checkTagCast(Tag<?> tag, Class<T> type) throws IllegalArgumentException {
if (tag == null) {
throw new IllegalArgumentException("Expected tag of type " + type.getName() + ", was null");
} else if (!type.isInstance(tag)) {
throw new IllegalArgume... | [
"public",
"static",
"<",
"T",
"extends",
"Tag",
"<",
"?",
">",
">",
"T",
"checkTagCast",
"(",
"Tag",
"<",
"?",
">",
"tag",
",",
"Class",
"<",
"T",
">",
"type",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"tag",
"==",
"null",
")",
"{"... | Checks that a tag is not null and of the required type
@param tag The tag to check
@param type The type of tag required
@param <T> The type parameter of {@code type}
@return The casted tag
@throws IllegalArgumentException if the tag is null or not of the required type | [
"Checks",
"that",
"a",
"tag",
"is",
"not",
"null",
"and",
"of",
"the",
"required",
"type"
] | 7a1b6d986e6fbd01862356d47827b8b357349a22 | https://github.com/flow/nbt/blob/7a1b6d986e6fbd01862356d47827b8b357349a22/src/main/java/com/flowpowered/nbt/holder/FieldUtils.java#L44-L51 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/TrustedCertificates.java | TrustedCertificates.getCertificates | public X509Certificate[] getCertificates() {
if (this.certSubjectDNMap == null) {
return null;
}
Collection certs = this.certSubjectDNMap.values();
return (X509Certificate[]) certs.toArray(new X509Certificate[certs.size()]);
} | java | public X509Certificate[] getCertificates() {
if (this.certSubjectDNMap == null) {
return null;
}
Collection certs = this.certSubjectDNMap.values();
return (X509Certificate[]) certs.toArray(new X509Certificate[certs.size()]);
} | [
"public",
"X509Certificate",
"[",
"]",
"getCertificates",
"(",
")",
"{",
"if",
"(",
"this",
".",
"certSubjectDNMap",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Collection",
"certs",
"=",
"this",
".",
"certSubjectDNMap",
".",
"values",
"(",
")",
... | so moved some things over to there | [
"so",
"moved",
"some",
"things",
"over",
"to",
"there"
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/TrustedCertificates.java#L125-L131 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/TrustedCertificates.java | TrustedCertificates.getSigningPolicies | public SigningPolicy[] getSigningPolicies() {
if (this.policyDNMap == null) {
return null;
}
Collection values = this.policyDNMap.values();
return (SigningPolicy[]) this.policyDNMap.values().toArray(new SigningPolicy[values.size()]);
} | java | public SigningPolicy[] getSigningPolicies() {
if (this.policyDNMap == null) {
return null;
}
Collection values = this.policyDNMap.values();
return (SigningPolicy[]) this.policyDNMap.values().toArray(new SigningPolicy[values.size()]);
} | [
"public",
"SigningPolicy",
"[",
"]",
"getSigningPolicies",
"(",
")",
"{",
"if",
"(",
"this",
".",
"policyDNMap",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Collection",
"values",
"=",
"this",
".",
"policyDNMap",
".",
"values",
"(",
")",
";",
... | Returns all signing policies | [
"Returns",
"all",
"signing",
"policies"
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/TrustedCertificates.java#L143-L149 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/TrustedCertificates.java | TrustedCertificates.getSigningPolicy | public SigningPolicy getSigningPolicy(String subject) {
if (this.policyDNMap == null) {
return null;
}
return (SigningPolicy) this.policyDNMap.get(subject);
} | java | public SigningPolicy getSigningPolicy(String subject) {
if (this.policyDNMap == null) {
return null;
}
return (SigningPolicy) this.policyDNMap.get(subject);
} | [
"public",
"SigningPolicy",
"getSigningPolicy",
"(",
"String",
"subject",
")",
"{",
"if",
"(",
"this",
".",
"policyDNMap",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"SigningPolicy",
")",
"this",
".",
"policyDNMap",
".",
"get",
"(",
... | Returns signing policy associated with the given CA subject.
@param subject
CA's subject DN for which signing policy is
required. The DN should be in Globus format (with slashes) and
not reversed. See CertificateUtil.toGlobusID();
@return
Signing policy object associated with the CA's DN. Null
if no policy was configu... | [
"Returns",
"signing",
"policy",
"associated",
"with",
"the",
"given",
"CA",
"subject",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/TrustedCertificates.java#L164-L170 | train |
jglobus/JGlobus | gss/src/main/java/org/globus/gsi/gssapi/GlobusGSSContextImpl.java | GlobusGSSContextImpl.sslDataWrap | private ByteBuffer sslDataWrap(ByteBuffer inBBuff, ByteBuffer outBBuff)
throws GSSException {
try {
if (sslEngine.getHandshakeStatus() !=
SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING) {
throw new Exception("SSLEngine handshaking needed! " +
... | java | private ByteBuffer sslDataWrap(ByteBuffer inBBuff, ByteBuffer outBBuff)
throws GSSException {
try {
if (sslEngine.getHandshakeStatus() !=
SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING) {
throw new Exception("SSLEngine handshaking needed! " +
... | [
"private",
"ByteBuffer",
"sslDataWrap",
"(",
"ByteBuffer",
"inBBuff",
",",
"ByteBuffer",
"outBBuff",
")",
"throws",
"GSSException",
"{",
"try",
"{",
"if",
"(",
"sslEngine",
".",
"getHandshakeStatus",
"(",
")",
"!=",
"SSLEngineResult",
".",
"HandshakeStatus",
".",
... | Meant for non-handshake processing | [
"Meant",
"for",
"non",
"-",
"handshake",
"processing"
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gss/src/main/java/org/globus/gsi/gssapi/GlobusGSSContextImpl.java#L699-L746 | train |
jglobus/JGlobus | gss/src/main/java/org/globus/gsi/gssapi/GlobusGSSContextImpl.java | GlobusGSSContextImpl.sslDataUnwrap | private ByteBuffer sslDataUnwrap(ByteBuffer inBBuff, ByteBuffer outBBuff)
throws GSSException {
try {
int iter = 0;
if (sslEngine.getHandshakeStatus() !=
SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING) {
throw new Exception("SSLEngine handshaking needed! " +
... | java | private ByteBuffer sslDataUnwrap(ByteBuffer inBBuff, ByteBuffer outBBuff)
throws GSSException {
try {
int iter = 0;
if (sslEngine.getHandshakeStatus() !=
SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING) {
throw new Exception("SSLEngine handshaking needed! " +
... | [
"private",
"ByteBuffer",
"sslDataUnwrap",
"(",
"ByteBuffer",
"inBBuff",
",",
"ByteBuffer",
"outBBuff",
")",
"throws",
"GSSException",
"{",
"try",
"{",
"int",
"iter",
"=",
"0",
";",
"if",
"(",
"sslEngine",
".",
"getHandshakeStatus",
"(",
")",
"!=",
"SSLEngineRe... | Not all in inBBuff might be consumed by this method!!! | [
"Not",
"all",
"in",
"inBBuff",
"might",
"be",
"consumed",
"by",
"this",
"method!!!"
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gss/src/main/java/org/globus/gsi/gssapi/GlobusGSSContextImpl.java#L749-L811 | train |
jglobus/JGlobus | gss/src/main/java/org/globus/gsi/gssapi/GlobusGSSContextImpl.java | GlobusGSSContextImpl.wrap | public byte[] wrap(byte []inBuf, int off, int len, MessageProp prop)
throws GSSException {
checkContext();
logger.debug("enter wrap");
byte [] token = null;
boolean doGSIWrap = false;
if (prop != null) {
if (prop.getQOP() != 0 && prop.getQOP() != GSSConsta... | java | public byte[] wrap(byte []inBuf, int off, int len, MessageProp prop)
throws GSSException {
checkContext();
logger.debug("enter wrap");
byte [] token = null;
boolean doGSIWrap = false;
if (prop != null) {
if (prop.getQOP() != 0 && prop.getQOP() != GSSConsta... | [
"public",
"byte",
"[",
"]",
"wrap",
"(",
"byte",
"[",
"]",
"inBuf",
",",
"int",
"off",
",",
"int",
"len",
",",
"MessageProp",
"prop",
")",
"throws",
"GSSException",
"{",
"checkContext",
"(",
")",
";",
"logger",
".",
"debug",
"(",
"\"enter wrap\"",
")",... | Wraps a message for integrity and protection.
A regular SSL-wrapped token is returned. | [
"Wraps",
"a",
"message",
"for",
"integrity",
"and",
"protection",
".",
"A",
"regular",
"SSL",
"-",
"wrapped",
"token",
"is",
"returned",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gss/src/main/java/org/globus/gsi/gssapi/GlobusGSSContextImpl.java#L1484-L1529 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.