repo stringclasses 199
values | path stringlengths 28 169 | func_name stringlengths 6 98 | original_string stringlengths 91 27.2k | language stringclasses 1
value | code stringlengths 91 27.2k | code_tokens listlengths 21 5.01k | docstring stringlengths 1 6.47k | docstring_tokens listlengths 1 587 | sha stringclasses 199
values | url stringlengths 117 257 | partition stringclasses 1
value | summary stringlengths 3 207 | output stringlengths 170 27.3k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/command/script/OScriptResultSets.java | OScriptResultSets.singleton | public static OScriptResultSet singleton(Object entity, OScriptTransformer transformer) {
return new OScriptResultSet(Collections.singletonList(entity).iterator(), transformer);
} | java | public static OScriptResultSet singleton(Object entity, OScriptTransformer transformer) {
return new OScriptResultSet(Collections.singletonList(entity).iterator(), transformer);
} | [
"public",
"static",
"OScriptResultSet",
"singleton",
"(",
"Object",
"entity",
",",
"OScriptTransformer",
"transformer",
")",
"{",
"return",
"new",
"OScriptResultSet",
"(",
"Collections",
".",
"singletonList",
"(",
"entity",
")",
".",
"iterator",
"(",
")",
",",
"... | Result set with a single result;
@return | [
"Result",
"set",
"with",
"a",
"single",
"result",
";"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/command/script/OScriptResultSets.java#L30-L32 | test | Create a new result set with a single entity. | Of course, here is the Java code you requested:
```java
public static OScriptResultSet singleton(Object entity, OScriptTransformer transformer) {
return new OScriptResultSet(Collections.singletonList(entity).iterator(), transformer);
}
```
Hope this helps! |
rupertlssmith/lojix | debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingComponentFactory.java | SwingComponentFactory.createBlankPanel | public JComponent createBlankPanel()
{
JPanel vbar = new JPanel();
vbar.setBackground(colorScheme.getBackground());
vbar.setForeground(colorScheme.getDisabledText());
return vbar;
} | java | public JComponent createBlankPanel()
{
JPanel vbar = new JPanel();
vbar.setBackground(colorScheme.getBackground());
vbar.setForeground(colorScheme.getDisabledText());
return vbar;
} | [
"public",
"JComponent",
"createBlankPanel",
"(",
")",
"{",
"JPanel",
"vbar",
"=",
"new",
"JPanel",
"(",
")",
";",
"vbar",
".",
"setBackground",
"(",
"colorScheme",
".",
"getBackground",
"(",
")",
")",
";",
"vbar",
".",
"setForeground",
"(",
"colorScheme",
... | {@inheritDoc} | [
"{"
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingComponentFactory.java#L156-L163 | test | Create a blank panel for the CRA. | Of course, here is the Java code you requested:
```java
public JComponent createBlankPanel()
{
JPanel vbar = new JPanel();
vbar.setBackground(colorScheme.getBackground());
vbar.setForeground(colorScheme.getDisabledText());
return vbar;
}
```
Hope this helps! |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/manager/WroManager.java | WroManager.destroyProcessors | private void destroyProcessors() throws Exception {
for (final ResourcePreProcessor processor : processorsFactory.getPreProcessors()) {
if (processor instanceof Destroyable) {
((Destroyable) processor).destroy();
}
}
for (final ResourcePostProcessor processor : processorsFactory.getPostP... | java | private void destroyProcessors() throws Exception {
for (final ResourcePreProcessor processor : processorsFactory.getPreProcessors()) {
if (processor instanceof Destroyable) {
((Destroyable) processor).destroy();
}
}
for (final ResourcePostProcessor processor : processorsFactory.getPostP... | [
"private",
"void",
"destroyProcessors",
"(",
")",
"throws",
"Exception",
"{",
"for",
"(",
"final",
"ResourcePreProcessor",
"processor",
":",
"processorsFactory",
".",
"getPreProcessors",
"(",
")",
")",
"{",
"if",
"(",
"processor",
"instanceof",
"Destroyable",
")",... | Invokes destroy method on all {@link Destroyable} processors. | [
"Invokes",
"destroy",
"method",
"on",
"all",
"{"
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/manager/WroManager.java#L227-L238 | test | Destroy all the processors. | Of course, here is the Java code you requested:
```java
private void destroyProcessors() throws Exception {
for (final ResourcePreProcessor processor : processorsFactory.getPreProcessors()) {
if (processor instanceof Destroyable) {
((Destroyable) processor).destroy();
}
}
for (final Res... |
streamsets/datacollector | container/src/main/java/com/streamsets/datacollector/event/handler/remote/RemoteDataCollector.java | RemoteDataCollector.getRemotePipelinesWithChanges | @Override
public List<PipelineAndValidationStatus> getRemotePipelinesWithChanges() throws PipelineException {
List<PipelineAndValidationStatus> pipelineAndValidationStatuses = new ArrayList<>();
for (Pair<PipelineState, Map<String, String>> pipelineStateAndOffset: stateEventListener.getPipelineStateEvents()) ... | java | @Override
public List<PipelineAndValidationStatus> getRemotePipelinesWithChanges() throws PipelineException {
List<PipelineAndValidationStatus> pipelineAndValidationStatuses = new ArrayList<>();
for (Pair<PipelineState, Map<String, String>> pipelineStateAndOffset: stateEventListener.getPipelineStateEvents()) ... | [
"@",
"Override",
"public",
"List",
"<",
"PipelineAndValidationStatus",
">",
"getRemotePipelinesWithChanges",
"(",
")",
"throws",
"PipelineException",
"{",
"List",
"<",
"PipelineAndValidationStatus",
">",
"pipelineAndValidationStatuses",
"=",
"new",
"ArrayList",
"<>",
"(",... | Returns info about remote pipelines that have changed since the last sending of events | [
"Returns",
"info",
"about",
"remote",
"pipelines",
"that",
"have",
"changed",
"since",
"the",
"last",
"sending",
"of",
"events"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/container/src/main/java/com/streamsets/datacollector/event/handler/remote/RemoteDataCollector.java#L434-L472 | test | Get the remote pipelines with changes. | Of course, here is the Java code you requested:
```java
@Override
public List<PipelineAndValidationStatus> getRemotePipelinesWithChanges() throws PipelineException {
List<PipelineAndValidationStatus> pipelineAndValidationStatuses = new ArrayList<>();
for (Pair<PipelineState, Map<String, String>> pipelineStat... |
oblac/jodd | jodd-proxetta/src/main/java/jodd/asm7/ModuleWriter.java | ModuleWriter.computeAttributesSize | int computeAttributesSize() {
symbolTable.addConstantUtf8(Constants.MODULE);
// 6 attribute header bytes, 6 bytes for name, flags and version, and 5 * 2 bytes for counts.
int size =
22 + requires.length + exports.length + opens.length + usesIndex.length + provides.length;
if (packageCount > 0) {... | java | int computeAttributesSize() {
symbolTable.addConstantUtf8(Constants.MODULE);
// 6 attribute header bytes, 6 bytes for name, flags and version, and 5 * 2 bytes for counts.
int size =
22 + requires.length + exports.length + opens.length + usesIndex.length + provides.length;
if (packageCount > 0) {... | [
"int",
"computeAttributesSize",
"(",
")",
"{",
"symbolTable",
".",
"addConstantUtf8",
"(",
"Constants",
".",
"MODULE",
")",
";",
"// 6 attribute header bytes, 6 bytes for name, flags and version, and 5 * 2 bytes for counts.",
"int",
"size",
"=",
"22",
"+",
"requires",
".",
... | Returns the size of the Module, ModulePackages and ModuleMainClass attributes generated by this
ModuleWriter. Also add the names of these attributes in the constant pool.
@return the size in bytes of the Module, ModulePackages and ModuleMainClass attributes. | [
"Returns",
"the",
"size",
"of",
"the",
"Module",
"ModulePackages",
"and",
"ModuleMainClass",
"attributes",
"generated",
"by",
"this",
"ModuleWriter",
".",
"Also",
"add",
"the",
"names",
"of",
"these",
"attributes",
"in",
"the",
"constant",
"pool",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/ModuleWriter.java#L195-L211 | test | Compute the size of the attributes of the module. | Of course, here is the Java code you requested:
```java
int computeAttributesSize() {
symbolTable.addConstantUtf8(Constants.MODULE);
// 6 attribute header bytes, 6 bytes for name, flags and version, and 5 * 2 bytes for counts.
int size =
22 + requires.length + exports.length + opens.length + usesIn... |
oblac/jodd | jodd-http/src/main/java/jodd/http/HttpRequest.java | HttpRequest.post | public static HttpRequest post(final String destination) {
return new HttpRequest()
.method(HttpMethod.POST)
.set(destination);
} | java | public static HttpRequest post(final String destination) {
return new HttpRequest()
.method(HttpMethod.POST)
.set(destination);
} | [
"public",
"static",
"HttpRequest",
"post",
"(",
"final",
"String",
"destination",
")",
"{",
"return",
"new",
"HttpRequest",
"(",
")",
".",
"method",
"(",
"HttpMethod",
".",
"POST",
")",
".",
"set",
"(",
"destination",
")",
";",
"}"
] | Builds a POST request. | [
"Builds",
"a",
"POST",
"request",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/HttpRequest.java#L235-L239 | test | Create a new POST request with the specified destination. | Of course, here is the Java code you requested:
```java
public static HttpRequest post(final String destination) {
return new HttpRequest()
.method(HttpMethod.POST)
.set(destination);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/ft/point/standard/plug/NdbcCoards.java | NdbcCoards.getConfig | public TableConfig getConfig(FeatureType wantFeatureType, NetcdfDataset ds, Formatter errlog) {
Dimension obsDim = ds.getUnlimitedDimension();
if (obsDim == null) {
CoordinateAxis axis = CoordSysEvaluator.findCoordByType(ds, AxisType.Time);
if ((axis != null) && axis.isScalar())
obsDim ... | java | public TableConfig getConfig(FeatureType wantFeatureType, NetcdfDataset ds, Formatter errlog) {
Dimension obsDim = ds.getUnlimitedDimension();
if (obsDim == null) {
CoordinateAxis axis = CoordSysEvaluator.findCoordByType(ds, AxisType.Time);
if ((axis != null) && axis.isScalar())
obsDim ... | [
"public",
"TableConfig",
"getConfig",
"(",
"FeatureType",
"wantFeatureType",
",",
"NetcdfDataset",
"ds",
",",
"Formatter",
"errlog",
")",
"{",
"Dimension",
"obsDim",
"=",
"ds",
".",
"getUnlimitedDimension",
"(",
")",
";",
"if",
"(",
"obsDim",
"==",
"null",
")"... | /*
<!-- C:/data/dt2/station/ndbc.nc -->
<stationFeature>
<stationId>":station"</stationId>
<stationDesc>":description"</stationDesc>
<coordAxis type="lat">lat</coordAxis>
<coordAxis type="lon">lon</coordAxis>
<coordAxis type="height">0</coordAxis>
<table dim="time">
<coordAxis type="time">time</coordAxis>
</table>
</st... | [
"/",
"*",
"<!",
"--",
"C",
":",
"/",
"data",
"/",
"dt2",
"/",
"station",
"/",
"ndbc",
".",
"nc",
"--",
">",
"<stationFeature",
">",
"<stationId",
">",
":",
"station",
"<",
"/",
"stationId",
">",
"<stationDesc",
">",
":",
"description",
"<",
"/",
"s... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/point/standard/plug/NdbcCoards.java#L61-L105 | test | Get the config for a feature type | Of course, here is the Java code you requested:
```java
public TableConfig getConfig(FeatureType wantFeatureType, NetcdfDataset ds, Formatter errlog) {
Dimension obsDim = ds.getUnlimitedDimension();
if (obsDim == null) {
CoordinateAxis axis = CoordSysEvaluator.findCoordByType(ds, AxisType.Time);
... |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/ferry/JNILibraryLoader.java | JNILibraryLoader.setLoadedLibrary | void setLoadedLibrary(String aLibraryName, Long aMajorVersion)
{
Set<Long> foundVersions = mLoadedLibraries.get(aLibraryName);
if (foundVersions == null)
{
foundVersions = new HashSet<Long>();
mLoadedLibraries.put(aLibraryName, foundVersions);
}
foundVersions.add(aMajorVersion);
} | java | void setLoadedLibrary(String aLibraryName, Long aMajorVersion)
{
Set<Long> foundVersions = mLoadedLibraries.get(aLibraryName);
if (foundVersions == null)
{
foundVersions = new HashSet<Long>();
mLoadedLibraries.put(aLibraryName, foundVersions);
}
foundVersions.add(aMajorVersion);
} | [
"void",
"setLoadedLibrary",
"(",
"String",
"aLibraryName",
",",
"Long",
"aMajorVersion",
")",
"{",
"Set",
"<",
"Long",
">",
"foundVersions",
"=",
"mLoadedLibraries",
".",
"get",
"(",
"aLibraryName",
")",
";",
"if",
"(",
"foundVersions",
"==",
"null",
")",
"{... | Tell the cache that we've loaded this version.
@param aLibraryName
@param aMajorVersion | [
"Tell",
"the",
"cache",
"that",
"we",
"ve",
"loaded",
"this",
"version",
"."
] | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/ferry/JNILibraryLoader.java#L293-L302 | test | Set the loaded library. | Of course, here is the Java code you requested:
```java
void setLoadedLibrary(String aLibraryName, Long aMajorVersion)
{
Set<Long> foundVersions = mLoadedLibraries.get(aLibraryName);
if (foundVersions == null)
{
foundVersions = new HashSet<Long>();
mLoadedLibraries.put(aLibraryName, foundVers... |
oblac/jodd | jodd-bean/src/main/java/jodd/typeconverter/Converter.java | Converter.toByte | public Byte toByte(final Object value) {
final TypeConverter<Byte> tc = TypeConverterManager.get().lookup(Byte.class);
return tc.convert(value);
} | java | public Byte toByte(final Object value) {
final TypeConverter<Byte> tc = TypeConverterManager.get().lookup(Byte.class);
return tc.convert(value);
} | [
"public",
"Byte",
"toByte",
"(",
"final",
"Object",
"value",
")",
"{",
"final",
"TypeConverter",
"<",
"Byte",
">",
"tc",
"=",
"TypeConverterManager",
".",
"get",
"(",
")",
".",
"lookup",
"(",
"Byte",
".",
"class",
")",
";",
"return",
"tc",
".",
"conver... | Converts value to <code>Byte</code>. | [
"Converts",
"value",
"to",
"<code",
">",
"Byte<",
"/",
"code",
">",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/typeconverter/Converter.java#L337-L340 | test | Converts value to byte. | Of course, here is the Java code you requested:
```java
public Byte toByte(final Object value) {
final TypeConverter<Byte> tc = TypeConverterManager.get().lookup(Byte.class);
return tc.convert(value);
}
```
Hope this helps! |
algolia/algoliasearch-client-android | algoliasearch/src/main/java/com/algolia/search/saas/Client.java | Client.deleteIndexAsync | public Request deleteIndexAsync(final @NonNull String indexName, @Nullable final RequestOptions requestOptions, CompletionHandler completionHandler) {
return new AsyncTaskRequest(completionHandler) {
@NonNull
@Override
protected JSONObject run() throws AlgoliaException {
... | java | public Request deleteIndexAsync(final @NonNull String indexName, @Nullable final RequestOptions requestOptions, CompletionHandler completionHandler) {
return new AsyncTaskRequest(completionHandler) {
@NonNull
@Override
protected JSONObject run() throws AlgoliaException {
... | [
"public",
"Request",
"deleteIndexAsync",
"(",
"final",
"@",
"NonNull",
"String",
"indexName",
",",
"@",
"Nullable",
"final",
"RequestOptions",
"requestOptions",
",",
"CompletionHandler",
"completionHandler",
")",
"{",
"return",
"new",
"AsyncTaskRequest",
"(",
"complet... | Delete an index.
@param indexName Name of index to delete.
@param requestOptions Request-specific options.
@param completionHandler The listener that will be notified of the request's outcome.
@return A cancellable request. | [
"Delete",
"an",
"index",
"."
] | 3293ba6e6116a4f6c1face2cc606bc047d6d4a3c | https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/Client.java#L198-L206 | test | Asynchronously delete a single index. | Of course, here is the Java code you requested:
```java
public Request deleteIndexAsync(final @NonNull String indexName, @Nullable final RequestOptions requestOptions, CompletionHandler completionHandler) {
return new AsyncTaskRequest(completionHandler) {
@NonNull
@Override
... |
RestComm/jain-slee | container/jmx-property-editors/src/main/java/org/mobicents/slee/container/management/jmx/editors/SleePropertyEditorRegistrator.java | SleePropertyEditorRegistrator.register | public void register() {
PropertyEditorManager.registerEditor(ComponentID.class,
ComponentIDPropertyEditor.class);
PropertyEditorManager.registerEditor(EventTypeID.class,
ComponentIDPropertyEditor.class);
PropertyEditorManager.registerEditor(LibraryID.class,
ComponentIDPropertyEditor.class);
Prop... | java | public void register() {
PropertyEditorManager.registerEditor(ComponentID.class,
ComponentIDPropertyEditor.class);
PropertyEditorManager.registerEditor(EventTypeID.class,
ComponentIDPropertyEditor.class);
PropertyEditorManager.registerEditor(LibraryID.class,
ComponentIDPropertyEditor.class);
Prop... | [
"public",
"void",
"register",
"(",
")",
"{",
"PropertyEditorManager",
".",
"registerEditor",
"(",
"ComponentID",
".",
"class",
",",
"ComponentIDPropertyEditor",
".",
"class",
")",
";",
"PropertyEditorManager",
".",
"registerEditor",
"(",
"EventTypeID",
".",
"class",... | Register the property editors for jboss jmx console, so non string SLEE api types can be used in specs mbeans methods as args | [
"Register",
"the",
"property",
"editors",
"for",
"jboss",
"jmx",
"console",
"so",
"non",
"string",
"SLEE",
"api",
"types",
"can",
"be",
"used",
"in",
"specs",
"mbeans",
"methods",
"as",
"args"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/jmx-property-editors/src/main/java/org/mobicents/slee/container/management/jmx/editors/SleePropertyEditorRegistrator.java#L56-L116 | test | Register the property editors. | Of course, here is the Java code you requested:
```java
public void register() {
PropertyEditorManager.registerEditor(ComponentID.class,
ComponentIDPropertyEditor.class);
PropertyEditorManager.registerEditor(EventTypeID.class,
ComponentIDPropertyEditor.class);
PropertyEditorManager.registerEditor(Libr... |
lestard/FluxFX | fluxfx/src/main/java/eu/lestard/fluxfx/utils/ViewCellFactory.java | ViewCellFactory.updateViews | public void updateViews() {
cache.entrySet()
.forEach(entry -> updateFunction.accept(entry.getKey(), entry.getValue().getController()));
} | java | public void updateViews() {
cache.entrySet()
.forEach(entry -> updateFunction.accept(entry.getKey(), entry.getValue().getController()));
} | [
"public",
"void",
"updateViews",
"(",
")",
"{",
"cache",
".",
"entrySet",
"(",
")",
".",
"forEach",
"(",
"entry",
"->",
"updateFunction",
".",
"accept",
"(",
"entry",
".",
"getKey",
"(",
")",
",",
"entry",
".",
"getValue",
"(",
")",
".",
"getController... | Update all views by invoking the update function ({@link #getUpdateFunction()}). | [
"Update",
"all",
"views",
"by",
"invoking",
"the",
"update",
"function",
"(",
"{"
] | aa292f3ec63685dcf6ee7fbbfb4b9d98e518645b | https://github.com/lestard/FluxFX/blob/aa292f3ec63685dcf6ee7fbbfb4b9d98e518645b/fluxfx/src/main/java/eu/lestard/fluxfx/utils/ViewCellFactory.java#L60-L63 | test | Update views. | Of course, here is the Java code you requested:
```java
public void updateViews() {
cache.entrySet()
.forEach(entry -> updateFunction.accept(entry.getKey(), entry.getValue().getController()));
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/unidata/io/RandomAccessFile.java | RandomAccessFile.getAllFiles | static public List<String> getAllFiles() {
if (null == allFiles) return null;
List<String> result = new ArrayList<>();
result.addAll(allFiles);
Collections.sort(result);
return result;
} | java | static public List<String> getAllFiles() {
if (null == allFiles) return null;
List<String> result = new ArrayList<>();
result.addAll(allFiles);
Collections.sort(result);
return result;
} | [
"static",
"public",
"List",
"<",
"String",
">",
"getAllFiles",
"(",
")",
"{",
"if",
"(",
"null",
"==",
"allFiles",
")",
"return",
"null",
";",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"result",
".",
"addAll"... | Debugging, do not use.
@return list of all files used. | [
"Debugging",
"do",
"not",
"use",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/io/RandomAccessFile.java#L119-L125 | test | Returns a list of all the files in the file system. | Of course, here is the Java code you requested:
```java
static public List<String> getAllFiles() {
if (null == allFiles) return null;
List<String> result = new ArrayList<>();
result.addAll(allFiles);
Collections.sort(result);
return result;
}
```
Hope this helps! |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/service/ValidationHandler.java | ValidationHandler.valueChangeEvent | public void valueChangeEvent(final AjaxBehaviorEvent event) {
try {
FacesContext facesContext = FacesContext.getCurrentInstance();
String tblName = parent.getWebFormClientId();
UIComponent target = event.getComponent();
boolean pass = validateCell(target);
if (pass) {
// to improve perform... | java | public void valueChangeEvent(final AjaxBehaviorEvent event) {
try {
FacesContext facesContext = FacesContext.getCurrentInstance();
String tblName = parent.getWebFormClientId();
UIComponent target = event.getComponent();
boolean pass = validateCell(target);
if (pass) {
// to improve perform... | [
"public",
"void",
"valueChangeEvent",
"(",
"final",
"AjaxBehaviorEvent",
"event",
")",
"{",
"try",
"{",
"FacesContext",
"facesContext",
"=",
"FacesContext",
".",
"getCurrentInstance",
"(",
")",
";",
"String",
"tblName",
"=",
"parent",
".",
"getWebFormClientId",
"(... | Triggered when value in cells changed. e.g. user edit cell.
@param event
ajax event. | [
"Triggered",
"when",
"value",
"in",
"cells",
"changed",
".",
"e",
".",
"g",
".",
"user",
"edit",
"cell",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/service/ValidationHandler.java#L388-L407 | test | Handle a value change event. | Of course, here is the Java code you requested:
```java
public void valueChangeEvent(final AjaxBehaviorEvent event) {
try {
FacesContext facesContext = FacesContext.getCurrentInstance();
String tblName = parent.getWebFormClientId();
UIComponent target = event.getComponent();
boolean pass = validat... |
oblac/jodd | jodd-servlet/src/main/java/jodd/servlet/upload/MultipartRequest.java | MultipartRequest.getInstance | public static MultipartRequest getInstance(final HttpServletRequest request, final FileUploadFactory fileUploadFactory, final String encoding) throws IOException {
MultipartRequest mreq = (MultipartRequest) request.getAttribute(MREQ_ATTR_NAME);
if (mreq == null) {
mreq = new MultipartRequest(request, fileUploadF... | java | public static MultipartRequest getInstance(final HttpServletRequest request, final FileUploadFactory fileUploadFactory, final String encoding) throws IOException {
MultipartRequest mreq = (MultipartRequest) request.getAttribute(MREQ_ATTR_NAME);
if (mreq == null) {
mreq = new MultipartRequest(request, fileUploadF... | [
"public",
"static",
"MultipartRequest",
"getInstance",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"FileUploadFactory",
"fileUploadFactory",
",",
"final",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"MultipartRequest",
"mreq",
"=",
"(",
"... | Returns new or existing instance of <code>MultipartRequest</code>. | [
"Returns",
"new",
"or",
"existing",
"instance",
"of",
"<code",
">",
"MultipartRequest<",
"/",
"code",
">",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-servlet/src/main/java/jodd/servlet/upload/MultipartRequest.java#L127-L137 | test | Gets the instance of the MultipartRequest from the request. | Of course, here is the Java code you requested:
```java
public static MultipartRequest getInstance(final HttpServletRequest request, final FileUploadFactory fileUploadFactory, final String encoding) throws IOException {
MultipartRequest mreq = (MultipartRequest) request.getAttribute(MREQ_ATTR_NAME);
if (mreq == nu... |
kolotyluk/java-file-utilities | src/main/java/net/kolotyluk/java/files/Files.java | Files.cleanDirectByteBuffer | public static void cleanDirectByteBuffer(final ByteBuffer byteBuffer)
{
if (byteBuffer == null) return;
if (!byteBuffer.isDirect())
throw new IllegalArgumentException("byteBuffer isn't direct!");
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
... | java | public static void cleanDirectByteBuffer(final ByteBuffer byteBuffer)
{
if (byteBuffer == null) return;
if (!byteBuffer.isDirect())
throw new IllegalArgumentException("byteBuffer isn't direct!");
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
... | [
"public",
"static",
"void",
"cleanDirectByteBuffer",
"(",
"final",
"ByteBuffer",
"byteBuffer",
")",
"{",
"if",
"(",
"byteBuffer",
"==",
"null",
")",
"return",
";",
"if",
"(",
"!",
"byteBuffer",
".",
"isDirect",
"(",
")",
")",
"throw",
"new",
"IllegalArgument... | Clean or unmap a direct ByteBuffer
<p>DirectByteBuffers are garbage collected by using a phantom reference and a
reference queue. Every once a while, the JVM checks the reference queue and
cleans the DirectByteBuffers. However, as this doesn't happen immediately
after discarding all references to a DirectByteBuffer, i... | [
"Clean",
"or",
"unmap",
"a",
"direct",
"ByteBuffer"
] | 58838ddb759f7ded8d54e55abfc67b3ba1561c58 | https://github.com/kolotyluk/java-file-utilities/blob/58838ddb759f7ded8d54e55abfc67b3ba1561c58/src/main/java/net/kolotyluk/java/files/Files.java#L162-L190 | test | Clean a ByteBuffer using direct byte buffers. | Of course, here is the Java code you requested:
```java
public static void cleanDirectByteBuffer(final ByteBuffer byteBuffer)
{
if (byteBuffer == null) return;
if (!byteBuffer.isDirect())
throw new IllegalArgumentException("byteBuffer isn't direct!");
AccessController.doPrivileged(new Privile... |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java | RTreeIndexTableDao.getBoundingBox | @Override
public BoundingBox getBoundingBox() {
BoundingBox boundingBox = null;
String sql = "SELECT MIN(" + RTreeIndexExtension.COLUMN_MIN_X + "), MIN("
+ RTreeIndexExtension.COLUMN_MIN_Y + "), MAX("
+ RTreeIndexExtension.COLUMN_MAX_X + "), MAX("
+ ... | java | @Override
public BoundingBox getBoundingBox() {
BoundingBox boundingBox = null;
String sql = "SELECT MIN(" + RTreeIndexExtension.COLUMN_MIN_X + "), MIN("
+ RTreeIndexExtension.COLUMN_MIN_Y + "), MAX("
+ RTreeIndexExtension.COLUMN_MAX_X + "), MAX("
+ ... | [
"@",
"Override",
"public",
"BoundingBox",
"getBoundingBox",
"(",
")",
"{",
"BoundingBox",
"boundingBox",
"=",
"null",
";",
"String",
"sql",
"=",
"\"SELECT MIN(\"",
"+",
"RTreeIndexExtension",
".",
"COLUMN_MIN_X",
"+",
"\"), MIN(\"",
"+",
"RTreeIndexExtension",
".",
... | {@inheritDoc} | [
"{"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java#L281-L305 | test | Get the CRS bounding box | Of course, here is the Java code you requested:
```java
@Override
public BoundingBox getBoundingBox() {
BoundingBox boundingBox = null;
String sql = "SELECT MIN(" + RTreeIndexExtension.COLUMN_MIN_X + "), MIN("
+ RTreeIndexExtension.COLUMN_MIN_Y + "), MAX("
+ RTreeI... |
robeio/robe | robe-assets/src/main/java/io/robe/assets/file/FileAssetServlet.java | FileAssetServlet.fixPath | private String fixPath(String path) {
if (!path.isEmpty()) {
if (!path.endsWith("/"))
return path + '/';
else
return path;
} else
return path;
} | java | private String fixPath(String path) {
if (!path.isEmpty()) {
if (!path.endsWith("/"))
return path + '/';
else
return path;
} else
return path;
} | [
"private",
"String",
"fixPath",
"(",
"String",
"path",
")",
"{",
"if",
"(",
"!",
"path",
".",
"isEmpty",
"(",
")",
")",
"{",
"if",
"(",
"!",
"path",
".",
"endsWith",
"(",
"\"/\"",
")",
")",
"return",
"path",
"+",
"'",
"'",
";",
"else",
"return",
... | Helps to fix path
@param path to fix
@return | [
"Helps",
"to",
"fix",
"path"
] | a0a8c7cebd1f70f78cf24a66a002859e937badfe | https://github.com/robeio/robe/blob/a0a8c7cebd1f70f78cf24a66a002859e937badfe/robe-assets/src/main/java/io/robe/assets/file/FileAssetServlet.java#L64-L72 | test | Fix path. | Of course, here is the Java code you requested:
```java
private String fixPath(String path) {
if (!path.isEmpty()) {
if (!path.endsWith("/"))
return path + '/';
else
return path;
} else
return path;
}
```
Hope this helps! |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/vo/form/Form.java | Form.toJsonObject | @Override
@XmlTransient
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//Form Type...
if(this.getFormType() != null) {
returnVal.put(JSONMapping.FORM_TYPE, this.getFormType());
}
//Form Type Id...
if(this.getFormTypeId() != null) {
returnVal.pu... | java | @Override
@XmlTransient
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//Form Type...
if(this.getFormType() != null) {
returnVal.put(JSONMapping.FORM_TYPE, this.getFormType());
}
//Form Type Id...
if(this.getFormTypeId() != null) {
returnVal.pu... | [
"@",
"Override",
"@",
"XmlTransient",
"public",
"JSONObject",
"toJsonObject",
"(",
")",
"throws",
"JSONException",
"{",
"JSONObject",
"returnVal",
"=",
"super",
".",
"toJsonObject",
"(",
")",
";",
"//Form Type...",
"if",
"(",
"this",
".",
"getFormType",
"(",
"... | Conversion to {@code JSONObject} from Java Object.
@return {@code JSONObject} representation of {@code Form}
@throws JSONException If there is a problem with the JSON Body.
@see ABaseFluidJSONObject#toJsonObject() | [
"Conversion",
"to",
"{",
"@code",
"JSONObject",
"}",
"from",
"Java",
"Object",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/vo/form/Form.java#L814-L936 | test | Override toJsonObject to return a JSONObject with all the properties of this object. | Of course, here is the Java code you requested:
```java
@Override
@XmlTransient
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//Form Type...
if(this.getFormType() != null) {
returnVal.put(JSONMapping.FORM_TYPE, this.getFormType());
}
//Form Type I... |
markhobson/microbrowser | tck/src/main/java/org/hobsoft/microbrowser/tck/MicrodataPropertyTck.java | MicrodataPropertyTck.getValueWhenMetaReturnsContent | @Test
public void getValueWhenMetaReturnsContent()
{
server().enqueue(new MockResponse().setBody("<html><body>"
+ "<div itemscope='itemscope' itemtype='http://i'>"
+ "<meta itemprop='p' content='x'/>"
+ "</div>"
+ "</body></html>"));
String actual = newBrowser().get(url(server()))
.getItem("http... | java | @Test
public void getValueWhenMetaReturnsContent()
{
server().enqueue(new MockResponse().setBody("<html><body>"
+ "<div itemscope='itemscope' itemtype='http://i'>"
+ "<meta itemprop='p' content='x'/>"
+ "</div>"
+ "</body></html>"));
String actual = newBrowser().get(url(server()))
.getItem("http... | [
"@",
"Test",
"public",
"void",
"getValueWhenMetaReturnsContent",
"(",
")",
"{",
"server",
"(",
")",
".",
"enqueue",
"(",
"new",
"MockResponse",
"(",
")",
".",
"setBody",
"(",
"\"<html><body>\"",
"+",
"\"<div itemscope='itemscope' itemtype='http://i'>\"",
"+",
"\"<me... | ---------------------------------------------------------------------------------------------------------------- | [
"----------------------------------------------------------------------------------------------------------------"
] | 732d2dadc1c3eaad688de31dc09f360df580faf1 | https://github.com/markhobson/microbrowser/blob/732d2dadc1c3eaad688de31dc09f360df580faf1/tck/src/main/java/org/hobsoft/microbrowser/tck/MicrodataPropertyTck.java#L58-L73 | test | Test if a meta returns a value. | Of course, here is the Java code you requested:
```java
@Test
public void getValueWhenMetaReturnsContent()
{
server().enqueue(new MockResponse().setBody("<html><body>"
+ "<div itemscope='itemscope' itemtype='http://i'>"
+ "<meta itemprop='p' content='x'/>"
+ "</div>"
+ "</body></html>"));
String a... |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/chart/objects/BarChart.java | BarChart.getShapePropertiesFromCTSer | @Override
public final CTShapeProperties getShapePropertiesFromCTSer(
final Object ctObjSer) {
if (ctObjSer instanceof CTBarSer) {
return ((CTBarSer) ctObjSer).getSpPr();
}
return null;
} | java | @Override
public final CTShapeProperties getShapePropertiesFromCTSer(
final Object ctObjSer) {
if (ctObjSer instanceof CTBarSer) {
return ((CTBarSer) ctObjSer).getSpPr();
}
return null;
} | [
"@",
"Override",
"public",
"final",
"CTShapeProperties",
"getShapePropertiesFromCTSer",
"(",
"final",
"Object",
"ctObjSer",
")",
"{",
"if",
"(",
"ctObjSer",
"instanceof",
"CTBarSer",
")",
"{",
"return",
"(",
"(",
"CTBarSer",
")",
"ctObjSer",
")",
".",
"getSpPr",... | /*
(non-Javadoc)
@see org.tiefaces.components.websheet.chart.objects.ChartObject#
getShapePropertiesFromCTSer(java.lang.Object) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/chart/objects/BarChart.java#L99-L106 | test | Override to return the CTShapeProperties object from the CTSer. | Of course, here is the Java code you requested:
```java
@Override
public final CTShapeProperties getShapePropertiesFromCTSer(
final Object ctObjSer) {
if (ctObjSer instanceof CTBarSer) {
return ((CTBarSer) ctObjSer).getSpPr();
}
return null;
}
```
Hope this helps! |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/model/transformer/WildcardExpanderModelTransformer.java | WildcardExpanderModelTransformer.transform | public synchronized WroModel transform(final WroModel input) {
final WroModel model = input;
for (final Group group : model.getGroups()) {
final List<Resource> resources = group.getResources();
for (final Resource resource : resources) {
processResource(group, resource);
}
}
L... | java | public synchronized WroModel transform(final WroModel input) {
final WroModel model = input;
for (final Group group : model.getGroups()) {
final List<Resource> resources = group.getResources();
for (final Resource resource : resources) {
processResource(group, resource);
}
}
L... | [
"public",
"synchronized",
"WroModel",
"transform",
"(",
"final",
"WroModel",
"input",
")",
"{",
"final",
"WroModel",
"model",
"=",
"input",
";",
"for",
"(",
"final",
"Group",
"group",
":",
"model",
".",
"getGroups",
"(",
")",
")",
"{",
"final",
"List",
"... | {@inheritDoc} | [
"{"
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/transformer/WildcardExpanderModelTransformer.java#L79-L90 | test | Transform a WroModel into a CRS model. | Of course, here is the Java code you requested:
```java
public synchronized WroModel transform(final WroModel input) {
final WroModel model = input;
for (final Group group : model.getGroups()) {
final List<Resource> resources = group.getResources();
for (final Resource resource : resources) {
... |
sialcasa/mvvmFX | mvvmfx-validation/src/main/java/de/saxsys/mvvmfx/utils/validation/ValidationStatus.java | ValidationStatus.getHighestMessage | public Optional<ValidationMessage> getHighestMessage() {
final Optional<ValidationMessage> error = getMessages().stream()
.filter(message -> message.getSeverity().equals(Severity.ERROR))
.findFirst();
if (error.isPresent()) {
return error;
} else {
final Optional<ValidationMessage> warning = getM... | java | public Optional<ValidationMessage> getHighestMessage() {
final Optional<ValidationMessage> error = getMessages().stream()
.filter(message -> message.getSeverity().equals(Severity.ERROR))
.findFirst();
if (error.isPresent()) {
return error;
} else {
final Optional<ValidationMessage> warning = getM... | [
"public",
"Optional",
"<",
"ValidationMessage",
">",
"getHighestMessage",
"(",
")",
"{",
"final",
"Optional",
"<",
"ValidationMessage",
">",
"error",
"=",
"getMessages",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"message",
"->",
"message",
".",
... | Returns the message with the highest priority using the following algorithm: - if there are messages with
{@link Severity#ERROR}, take the first one. - otherwise, if there are messages with {@link Severity#WARNING},
take the first one. - otherwise, an empty Optional is returned.
@return an Optional containing the Vali... | [
"Returns",
"the",
"message",
"with",
"the",
"highest",
"priority",
"using",
"the",
"following",
"algorithm",
":",
"-",
"if",
"there",
"are",
"messages",
"with",
"{",
"@link",
"Severity#ERROR",
"}",
"take",
"the",
"first",
"one",
".",
"-",
"otherwise",
"if",
... | 240566a358a8e01c94c0bbb99228140a69690d02 | https://github.com/sialcasa/mvvmFX/blob/240566a358a8e01c94c0bbb99228140a69690d02/mvvmfx-validation/src/main/java/de/saxsys/mvvmfx/utils/validation/ValidationStatus.java#L121-L135 | test | Gets the highest validation message. | Of course, here is the Java code you requested:
```java
public Optional<ValidationMessage> getHighestMessage() {
final Optional<ValidationMessage> error = getMessages().stream()
.filter(message -> message.getSeverity().equals(Severity.ERROR))
.findFirst();
if (error.isPresent()) {
return error;
} e... |
1gravity/Android-RTEditor | RTEditor/src/main/java/com/onegravity/rteditor/RTEditText.java | RTEditText.setRichTextEditing | public void setRichTextEditing(boolean useRTFormatting, boolean autoConvert) {
assertRegistration();
if (useRTFormatting != mUseRTFormatting) {
mUseRTFormatting = useRTFormatting;
if (autoConvert) {
RTFormat targetFormat = useRTFormatting ? RTFormat.PLAIN_TEXT :... | java | public void setRichTextEditing(boolean useRTFormatting, boolean autoConvert) {
assertRegistration();
if (useRTFormatting != mUseRTFormatting) {
mUseRTFormatting = useRTFormatting;
if (autoConvert) {
RTFormat targetFormat = useRTFormatting ? RTFormat.PLAIN_TEXT :... | [
"public",
"void",
"setRichTextEditing",
"(",
"boolean",
"useRTFormatting",
",",
"boolean",
"autoConvert",
")",
"{",
"assertRegistration",
"(",
")",
";",
"if",
"(",
"useRTFormatting",
"!=",
"mUseRTFormatting",
")",
"{",
"mUseRTFormatting",
"=",
"useRTFormatting",
";"... | Sets the edit mode to plain or rich text. The text will be converted
automatically to rich/plain text if autoConvert is True.
@param useRTFormatting True if the edit mode should be rich text, False if the edit
mode should be plain text
@param autoConvert Automatically convert the content to plain or rich text if
t... | [
"Sets",
"the",
"edit",
"mode",
"to",
"plain",
"or",
"rich",
"text",
".",
"The",
"text",
"will",
"be",
"converted",
"automatically",
"to",
"rich",
"/",
"plain",
"text",
"if",
"autoConvert",
"is",
"True",
"."
] | 9d8fb4bb865b3b3d011e7633afedcdfb8d21754f | https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/RTEditText.java#L266-L281 | test | Sets the rich text editing flag. | Of course, here is the Java code you requested:
```java
public void setRichTextEditing(boolean useRTFormatting, boolean autoConvert) {
assertRegistration();
if (useRTFormatting != mUseRTFormatting) {
mUseRTFormatting = useRTFormatting;
if (autoConvert) {
RTForm... |
playframework/playframework | core/play/src/main/java/play/mvc/Results.java | Results.internalServerError | public static Result internalServerError(Path content, String filename) {
return internalServerError(content, filename, StaticFileMimeTypes.fileMimeTypes());
} | java | public static Result internalServerError(Path content, String filename) {
return internalServerError(content, filename, StaticFileMimeTypes.fileMimeTypes());
} | [
"public",
"static",
"Result",
"internalServerError",
"(",
"Path",
"content",
",",
"String",
"filename",
")",
"{",
"return",
"internalServerError",
"(",
"content",
",",
"filename",
",",
"StaticFileMimeTypes",
".",
"fileMimeTypes",
"(",
")",
")",
";",
"}"
] | Generates a 500 Internal Server Error result.
@param content The path to send.
@param filename The name to send the file as.
@return the result | [
"Generates",
"a",
"500",
"Internal",
"Server",
"Error",
"result",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L4133-L4135 | test | Returns an error response with an error message. | Of course, here is the Java code you requested:
```java
public static Result internalServerError(Path content, String filename) {
return internalServerError(content, filename, StaticFileMimeTypes.fileMimeTypes());
}
```
Hope this helps! |
orientechnologies/orientdb | object/src/main/java/com/orientechnologies/common/reflection/OReflectionHelper.java | OReflectionHelper.getGenericTypes | public static Type[] getGenericTypes(final Class<?> iClass) {
final Type genericType = iClass.getGenericInterfaces()[0];
if (genericType != null && genericType instanceof ParameterizedType) {
final ParameterizedType pt = (ParameterizedType) genericType;
if (pt.getActualTypeArguments() != null && pt.... | java | public static Type[] getGenericTypes(final Class<?> iClass) {
final Type genericType = iClass.getGenericInterfaces()[0];
if (genericType != null && genericType instanceof ParameterizedType) {
final ParameterizedType pt = (ParameterizedType) genericType;
if (pt.getActualTypeArguments() != null && pt.... | [
"public",
"static",
"Type",
"[",
"]",
"getGenericTypes",
"(",
"final",
"Class",
"<",
"?",
">",
"iClass",
")",
"{",
"final",
"Type",
"genericType",
"=",
"iClass",
".",
"getGenericInterfaces",
"(",
")",
"[",
"0",
"]",
";",
"if",
"(",
"genericType",
"!=",
... | Returns the declared generic types of a class.
@param iClass
Class to examine
@return The array of Type if any, otherwise null | [
"Returns",
"the",
"declared",
"generic",
"types",
"of",
"a",
"class",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/object/src/main/java/com/orientechnologies/common/reflection/OReflectionHelper.java#L189-L197 | test | Get generic types of the class. | Of course, here is the Java code you requested:
```java
public static Type[] getGenericTypes(final Class<?> iClass) {
final Type genericType = iClass.getGenericInterfaces()[0];
if (genericType != null && genericType instanceof ParameterizedType) {
final ParameterizedType pt = (ParameterizedType) genericT... |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/util/command/impl/DocumentToPDFConvert.java | DocumentToPDFConvert.convertDocumentToPDF | public File convertDocumentToPDF(File inputDocumentParam) {
if(inputDocumentParam == null ||
!inputDocumentParam.exists())
{
throw new UtilException(
"Input document to convert not provided or does not exist.",
UtilException.ErrorCode.COMMAND);
}
if(!inputDocumentParam.isFile())
{
throw ... | java | public File convertDocumentToPDF(File inputDocumentParam) {
if(inputDocumentParam == null ||
!inputDocumentParam.exists())
{
throw new UtilException(
"Input document to convert not provided or does not exist.",
UtilException.ErrorCode.COMMAND);
}
if(!inputDocumentParam.isFile())
{
throw ... | [
"public",
"File",
"convertDocumentToPDF",
"(",
"File",
"inputDocumentParam",
")",
"{",
"if",
"(",
"inputDocumentParam",
"==",
"null",
"||",
"!",
"inputDocumentParam",
".",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"UtilException",
"(",
"\"Input document to con... | Makes use of the Fluid Core to convert a document into a PDF file.
@param inputDocumentParam The file to convert to PDF.
@return The {@code File} object of the result PDF.
@throws UtilException If anything goes wrong during execution. | [
"Makes",
"use",
"of",
"the",
"Fluid",
"Core",
"to",
"convert",
"a",
"document",
"into",
"a",
"PDF",
"file",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/util/command/impl/DocumentToPDFConvert.java#L56-L125 | test | Convert a document to a PDF file. | Of course, here is the Java code you requested:
```java
public File convertDocumentToPDF(File inputDocumentParam) {
if(inputDocumentParam == null ||
!inputDocumentParam.exists())
{
throw new UtilException(
"Input document to convert not provided or does not exist.",
UtilException.ErrorCode.COMMAN... |
RuedigerMoeller/fast-serialization | src/main/java/org/nustaq/serialization/FSTConfiguration.java | FSTConfiguration.prettyPrintJson | public static void prettyPrintJson(Object o) {
FSTConfiguration conf = constructJsonConf(true, true, null);
System.out.println(conf.asJsonString(o));
} | java | public static void prettyPrintJson(Object o) {
FSTConfiguration conf = constructJsonConf(true, true, null);
System.out.println(conf.asJsonString(o));
} | [
"public",
"static",
"void",
"prettyPrintJson",
"(",
"Object",
"o",
")",
"{",
"FSTConfiguration",
"conf",
"=",
"constructJsonConf",
"(",
"true",
",",
"true",
",",
"null",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"conf",
".",
"asJsonString",
"(",... | debug only, very slow (creates config with each call). Creates new conf so custom serializers are ignored.
@param o | [
"debug",
"only",
"very",
"slow",
"(",
"creates",
"config",
"with",
"each",
"call",
")",
".",
"Creates",
"new",
"conf",
"so",
"custom",
"serializers",
"are",
"ignored",
"."
] | 59f8f800b79479d0b9c80901cf55903d9b027f26 | https://github.com/RuedigerMoeller/fast-serialization/blob/59f8f800b79479d0b9c80901cf55903d9b027f26/src/main/java/org/nustaq/serialization/FSTConfiguration.java#L384-L387 | test | Pretty prints the object to stdout. | Of course, here is the Java code you requested:
```java
public static void prettyPrintJson(Object o) {
FSTConfiguration conf = constructJsonConf(true, true, null);
System.out.println(conf.asJsonString(o));
}
```
Hope this helps! |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/ldap/LdapServerBeanDefinitionParser.java | LdapServerBeanDefinitionParser.createEmbeddedServer | private RootBeanDefinition createEmbeddedServer(Element element,
ParserContext parserContext) {
Object source = parserContext.extractSource(element);
String suffix = element.getAttribute(ATT_ROOT_SUFFIX);
if (!StringUtils.hasText(suffix)) {
suffix = OPT_DEFAULT_ROOT_SUFFIX;
}
String port = element.ge... | java | private RootBeanDefinition createEmbeddedServer(Element element,
ParserContext parserContext) {
Object source = parserContext.extractSource(element);
String suffix = element.getAttribute(ATT_ROOT_SUFFIX);
if (!StringUtils.hasText(suffix)) {
suffix = OPT_DEFAULT_ROOT_SUFFIX;
}
String port = element.ge... | [
"private",
"RootBeanDefinition",
"createEmbeddedServer",
"(",
"Element",
"element",
",",
"ParserContext",
"parserContext",
")",
"{",
"Object",
"source",
"=",
"parserContext",
".",
"extractSource",
"(",
"element",
")",
";",
"String",
"suffix",
"=",
"element",
".",
... | Will be called if no url attribute is supplied.
Registers beans to create an embedded apache directory server.
@return the BeanDefinition for the ContextSource for the embedded server.
@see ApacheDSContainer | [
"Will",
"be",
"called",
"if",
"no",
"url",
"attribute",
"is",
"supplied",
"."
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/ldap/LdapServerBeanDefinitionParser.java#L118-L171 | test | Creates the embedded server bean definition. | Of course, here is the Java code you requested:
```java
private RootBeanDefinition createEmbeddedServer(Element element,
ParserContext parserContext) {
Object source = parserContext.extractSource(element);
String suffix = element.getAttribute(ATT_ROOT_SUFFIX);
if (!StringUtils.hasText(suffix)) {
suffix =... |
ReactiveX/RxJava | src/main/java/io/reactivex/processors/MulticastProcessor.java | MulticastProcessor.startUnbounded | public void startUnbounded() {
if (SubscriptionHelper.setOnce(upstream, EmptySubscription.INSTANCE)) {
queue = new SpscLinkedArrayQueue<T>(bufferSize);
}
} | java | public void startUnbounded() {
if (SubscriptionHelper.setOnce(upstream, EmptySubscription.INSTANCE)) {
queue = new SpscLinkedArrayQueue<T>(bufferSize);
}
} | [
"public",
"void",
"startUnbounded",
"(",
")",
"{",
"if",
"(",
"SubscriptionHelper",
".",
"setOnce",
"(",
"upstream",
",",
"EmptySubscription",
".",
"INSTANCE",
")",
")",
"{",
"queue",
"=",
"new",
"SpscLinkedArrayQueue",
"<",
"T",
">",
"(",
"bufferSize",
")",... | Initializes this Processor by setting an upstream Subscription that
ignores request amounts, uses an unbounded buffer
and allows using the onXXX and offer methods
afterwards. | [
"Initializes",
"this",
"Processor",
"by",
"setting",
"an",
"upstream",
"Subscription",
"that",
"ignores",
"request",
"amounts",
"uses",
"an",
"unbounded",
"buffer",
"and",
"allows",
"using",
"the",
"onXXX",
"and",
"offer",
"methods",
"afterwards",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/processors/MulticastProcessor.java#L253-L257 | test | Start the empty subscription. | Of course, here is the Java code you requested:
```java
public void startUnbounded() {
if (SubscriptionHelper.setOnce(upstream, EmptySubscription.INSTANCE)) {
queue = new SpscLinkedArrayQueue<T>(bufferSize);
}
}
```
Hope this helps! |
deeplearning4j/nd4j | nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java | BigDecimalMath.cosh | static public BigDecimal cosh(final BigDecimal x) {
if (x.compareTo(BigDecimal.ZERO) < 0) {
return cos(x.negate());
} else if (x.compareTo(BigDecimal.ZERO) == 0) {
return BigDecimal.ONE;
} else {
if (x.doubleValue() > 1.5) {
/* cosh^2(x) = 1+ s... | java | static public BigDecimal cosh(final BigDecimal x) {
if (x.compareTo(BigDecimal.ZERO) < 0) {
return cos(x.negate());
} else if (x.compareTo(BigDecimal.ZERO) == 0) {
return BigDecimal.ONE;
} else {
if (x.doubleValue() > 1.5) {
/* cosh^2(x) = 1+ s... | [
"static",
"public",
"BigDecimal",
"cosh",
"(",
"final",
"BigDecimal",
"x",
")",
"{",
"if",
"(",
"x",
".",
"compareTo",
"(",
"BigDecimal",
".",
"ZERO",
")",
"<",
"0",
")",
"{",
"return",
"cos",
"(",
"x",
".",
"negate",
"(",
")",
")",
";",
"}",
"el... | The hyperbolic cosine.
@param x The argument.
@return The cosh(x) = (exp(x)+exp(-x))/2 . | [
"The",
"hyperbolic",
"cosine",
"."
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java#L1203-L1266 | test | Cosh method. | Of course, here is the Java code you requested:
```java
static public BigDecimal cosh(final BigDecimal x) {
if (x.compareTo(BigDecimal.ZERO) < 0) {
return cos(x.negate());
} else if (x.compareTo(BigDecimal.ZERO) == 0) {
return BigDecimal.ONE;
} else {
if (x.d... |
chenlb/mmseg4j-from-googlecode | src/com/chenlb/mmseg4j/Chunk.java | Chunk.getCount | public int getCount() {
if(count < 0) {
count = 0;
for(Word word : words) {
if(word != null) {
count++;
}
}
}
return count;
} | java | public int getCount() {
if(count < 0) {
count = 0;
for(Word word : words) {
if(word != null) {
count++;
}
}
}
return count;
} | [
"public",
"int",
"getCount",
"(",
")",
"{",
"if",
"(",
"count",
"<",
"0",
")",
"{",
"count",
"=",
"0",
";",
"for",
"(",
"Word",
"word",
":",
"words",
")",
"{",
"if",
"(",
"word",
"!=",
"null",
")",
"{",
"count",
"++",
";",
"}",
"}",
"}",
"r... | 有多少个词,最多3个。 | [
"有多少个词,最多3个。"
] | 3053a70c29c1bc8e7c280a8098fb41b5ad9ec3cb | https://github.com/chenlb/mmseg4j-from-googlecode/blob/3053a70c29c1bc8e7c280a8098fb41b5ad9ec3cb/src/com/chenlb/mmseg4j/Chunk.java#L40-L50 | test | Gets the count of related entities. | Of course, here is the Java code you requested:
```java
public int getCount() {
if(count < 0) {
count = 0;
for(Word word : words) {
if(word != null) {
count++;
}
}
}
return count;
}
```
Hope this helps! |
ReactiveX/RxJava | src/main/java/io/reactivex/plugins/RxJavaPlugins.java | RxJavaPlugins.setOnSingleAssembly | @SuppressWarnings("rawtypes")
public static void setOnSingleAssembly(@Nullable Function<? super Single, ? extends Single> onSingleAssembly) {
if (lockdown) {
throw new IllegalStateException("Plugins can't be changed anymore");
}
RxJavaPlugins.onSingleAssembly = onSingleAssembly;
... | java | @SuppressWarnings("rawtypes")
public static void setOnSingleAssembly(@Nullable Function<? super Single, ? extends Single> onSingleAssembly) {
if (lockdown) {
throw new IllegalStateException("Plugins can't be changed anymore");
}
RxJavaPlugins.onSingleAssembly = onSingleAssembly;
... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"void",
"setOnSingleAssembly",
"(",
"@",
"Nullable",
"Function",
"<",
"?",
"super",
"Single",
",",
"?",
"extends",
"Single",
">",
"onSingleAssembly",
")",
"{",
"if",
"(",
"lockdown",
")",
... | Sets the specific hook function.
@param onSingleAssembly the hook function to set, null allowed | [
"Sets",
"the",
"specific",
"hook",
"function",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/plugins/RxJavaPlugins.java#L892-L898 | test | Sets the onSingleAssembly function. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("rawtypes")
public static void setOnSingleAssembly(@Nullable Function<? super Single, ? extends Single> onSingleAssembly) {
if (lockdown) {
throw new IllegalStateException("Plugins can't be changed anymore");
}
... |
jcuda/jcublas | JCublasJava/src/main/java/jcuda/jcublas/JCublas.java | JCublas.cublasDspr | public static void cublasDspr(char uplo, int n, double alpha, Pointer x, int incx, Pointer AP)
{
cublasDsprNative(uplo, n, alpha, x, incx, AP);
checkResultBLAS();
} | java | public static void cublasDspr(char uplo, int n, double alpha, Pointer x, int incx, Pointer AP)
{
cublasDsprNative(uplo, n, alpha, x, incx, AP);
checkResultBLAS();
} | [
"public",
"static",
"void",
"cublasDspr",
"(",
"char",
"uplo",
",",
"int",
"n",
",",
"double",
"alpha",
",",
"Pointer",
"x",
",",
"int",
"incx",
",",
"Pointer",
"AP",
")",
"{",
"cublasDsprNative",
"(",
"uplo",
",",
"n",
",",
"alpha",
",",
"x",
",",
... | <pre>
void
cublasDspr (char uplo, int n, double alpha, const double *x, int incx,
double *AP)
performs the symmetric rank 1 operation
A = alpha * x * transpose(x) + A,
where alpha is a double precision scalar and x is an n element double
precision vector. A is a symmetric n x n matrix consisting of double
precision ... | [
"<pre",
">",
"void",
"cublasDspr",
"(",
"char",
"uplo",
"int",
"n",
"double",
"alpha",
"const",
"double",
"*",
"x",
"int",
"incx",
"double",
"*",
"AP",
")"
] | 80875235d24562073f4d66651dd17263f306427d | https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L7840-L7844 | test | CUBLAS - D SENSE | Of course, here is the Java code you requested:
```java
public static void cublasDspr(char uplo, int n, double alpha, Pointer x, int incx, Pointer AP)
{
cublasDsprNative(uplo, n, alpha, x, incx, AP);
checkResultBLAS();
}
```
Hope this helps! |
oblac/jodd | jodd-servlet/src/main/java/jodd/servlet/filter/GzipResponseStream.java | GzipResponseStream.close | @Override
public void close() throws IOException {
if (closed) {
return;
}
if (gzipstream != null) {
flushToGZip();
gzipstream.close();
gzipstream = null;
} else {
if (bufferCount > 0) {
output.write(buffer, 0, bufferCount);
bufferCount = 0;
}
}
output.close();
closed = true;
} | java | @Override
public void close() throws IOException {
if (closed) {
return;
}
if (gzipstream != null) {
flushToGZip();
gzipstream.close();
gzipstream = null;
} else {
if (bufferCount > 0) {
output.write(buffer, 0, bufferCount);
bufferCount = 0;
}
}
output.close();
closed = true;
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"closed",
")",
"{",
"return",
";",
"}",
"if",
"(",
"gzipstream",
"!=",
"null",
")",
"{",
"flushToGZip",
"(",
")",
";",
"gzipstream",
".",
"close",
"(",
")"... | Closes this output stream, causing any buffered data to be flushed and any
further output data to throw an IOException. | [
"Closes",
"this",
"output",
"stream",
"causing",
"any",
"buffered",
"data",
"to",
"be",
"flushed",
"and",
"any",
"further",
"output",
"data",
"to",
"throw",
"an",
"IOException",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-servlet/src/main/java/jodd/servlet/filter/GzipResponseStream.java#L113-L130 | test | Close the underlying stream. | Of course, here is the Java code you requested:
```java
@Override
public void close() throws IOException {
if (closed) {
return;
}
if (gzipstream != null) {
flushToGZip();
gzipstream.close();
gzipstream = null;
} else {
if (bufferCount > 0) {
output.write(buffer, 0, bufferCount);
buffer... |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/video/MediaRaw.java | MediaRaw.getTimeBase | public Rational getTimeBase() {
long cPtr = VideoJNI.MediaRaw_getTimeBase(swigCPtr, this);
return (cPtr == 0) ? null : new Rational(cPtr, false);
} | java | public Rational getTimeBase() {
long cPtr = VideoJNI.MediaRaw_getTimeBase(swigCPtr, this);
return (cPtr == 0) ? null : new Rational(cPtr, false);
} | [
"public",
"Rational",
"getTimeBase",
"(",
")",
"{",
"long",
"cPtr",
"=",
"VideoJNI",
".",
"MediaRaw_getTimeBase",
"(",
"swigCPtr",
",",
"this",
")",
";",
"return",
"(",
"cPtr",
"==",
"0",
")",
"?",
"null",
":",
"new",
"Rational",
"(",
"cPtr",
",",
"fal... | Get the time base that time stamps of this object are represented in.<br>
<br>
@return the time base. | [
"Get",
"the",
"time",
"base",
"that",
"time",
"stamps",
"of",
"this",
"object",
"are",
"represented",
"in",
".",
"<br",
">",
"<br",
">"
] | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/MediaRaw.java#L138-L141 | test | Get the time base of this media. | Of course, here is the Java code you requested:
```java
public Rational getTimeBase() {
long cPtr = VideoJNI.MediaRaw_getTimeBase(swigCPtr, this);
return (cPtr == 0) ? null : new Rational(cPtr, false);
}
```
Hope this helps! |
oblac/jodd | jodd-lagarto/src/main/java/jodd/lagarto/dom/LagartoDOMBuilder.java | LagartoDOMBuilder.parse | @Override
public Document parse(final char[] content) {
LagartoParser lagartoParser = new LagartoParser(content);
return doParse(lagartoParser);
} | java | @Override
public Document parse(final char[] content) {
LagartoParser lagartoParser = new LagartoParser(content);
return doParse(lagartoParser);
} | [
"@",
"Override",
"public",
"Document",
"parse",
"(",
"final",
"char",
"[",
"]",
"content",
")",
"{",
"LagartoParser",
"lagartoParser",
"=",
"new",
"LagartoParser",
"(",
"content",
")",
";",
"return",
"doParse",
"(",
"lagartoParser",
")",
";",
"}"
] | Creates DOM tree from provided content. | [
"Creates",
"DOM",
"tree",
"from",
"provided",
"content",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/lagarto/dom/LagartoDOMBuilder.java#L133-L137 | test | Parse the content of the content. | Of course, here is the Java code you requested:
```java
@Override
public Document parse(final char[] content) {
LagartoParser lagartoParser = new LagartoParser(content);
return doParse(lagartoParser);
}
```
Hope this helps! |
PeterisP/morphology | src/main/java/lv/semti/morphology/analyzer/Splitting.java | Splitting.tokenize | public static LinkedList<Word> tokenize(Analyzer morphoAnalyzer, String chunk) {
LinkedList<Word> tokens = new LinkedList<Word>();
if (chunk == null) return tokens;
Trie automats = morphoAnalyzer.automats;
//bug fix - pievienota beigās whitespace
String str = chunk+" ";
//workaround dubulta... | java | public static LinkedList<Word> tokenize(Analyzer morphoAnalyzer, String chunk) {
LinkedList<Word> tokens = new LinkedList<Word>();
if (chunk == null) return tokens;
Trie automats = morphoAnalyzer.automats;
//bug fix - pievienota beigās whitespace
String str = chunk+" ";
//workaround dubulta... | [
"public",
"static",
"LinkedList",
"<",
"Word",
">",
"tokenize",
"(",
"Analyzer",
"morphoAnalyzer",
",",
"String",
"chunk",
")",
"{",
"LinkedList",
"<",
"Word",
">",
"tokens",
"=",
"new",
"LinkedList",
"<",
"Word",
">",
"(",
")",
";",
"if",
"(",
"chunk",
... | /*
Tokenizes the string (sentence?) and runs morphoanalysis on each word. | [
"/",
"*",
"Tokenizes",
"the",
"string",
"(",
"sentence?",
")",
"and",
"runs",
"morphoanalysis",
"on",
"each",
"word",
"."
] | a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783 | https://github.com/PeterisP/morphology/blob/a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783/src/main/java/lv/semti/morphology/analyzer/Splitting.java#L74-L176 | test | tokenize a string | Of course, here is the Java code you requested:
```java
public static LinkedList<Word> tokenize(Analyzer morphoAnalyzer, String chunk) {
LinkedList<Word> tokens = new LinkedList<Word>();
if (chunk == null) return tokens;
Trie automats = morphoAnalyzer.automats;
//bug fix - pievienota beigās whit... |
oblac/jodd | jodd-bean/src/main/java/jodd/bean/BeanVisitor.java | BeanVisitor.getAllBeanPropertyNames | protected String[] getAllBeanPropertyNames(final Class type, final boolean declared) {
ClassDescriptor classDescriptor = ClassIntrospector.get().lookup(type);
PropertyDescriptor[] propertyDescriptors = classDescriptor.getAllPropertyDescriptors();
ArrayList<String> names = new ArrayList<>(propertyDescriptors.len... | java | protected String[] getAllBeanPropertyNames(final Class type, final boolean declared) {
ClassDescriptor classDescriptor = ClassIntrospector.get().lookup(type);
PropertyDescriptor[] propertyDescriptors = classDescriptor.getAllPropertyDescriptors();
ArrayList<String> names = new ArrayList<>(propertyDescriptors.len... | [
"protected",
"String",
"[",
"]",
"getAllBeanPropertyNames",
"(",
"final",
"Class",
"type",
",",
"final",
"boolean",
"declared",
")",
"{",
"ClassDescriptor",
"classDescriptor",
"=",
"ClassIntrospector",
".",
"get",
"(",
")",
".",
"lookup",
"(",
"type",
")",
";"... | Returns all bean property names. | [
"Returns",
"all",
"bean",
"property",
"names",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/bean/BeanVisitor.java#L90-L115 | test | Returns a list of all property names of the given type. | Of course, here is the Java code you requested:
```java
protected String[] getAllBeanPropertyNames(final Class type, final boolean declared) {
ClassDescriptor classDescriptor = ClassIntrospector.get().lookup(type);
PropertyDescriptor[] propertyDescriptors = classDescriptor.getAllPropertyDescriptors();
ArrayLis... |
rupertlssmith/lojix | base/run-plugin/src/main/com/thesett/maven/run/ProductionScriptGenMojo.java | ProductionScriptGenMojo.execute | public void execute() throws MojoExecutionException, MojoFailureException
{
//log.debug("public void execute() throws MojoExecutionException: called");
// Turn each of the test runner command lines into a script.
for (String commandName : commands.keySet())
{
if (prodScr... | java | public void execute() throws MojoExecutionException, MojoFailureException
{
//log.debug("public void execute() throws MojoExecutionException: called");
// Turn each of the test runner command lines into a script.
for (String commandName : commands.keySet())
{
if (prodScr... | [
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
",",
"MojoFailureException",
"{",
"//log.debug(\"public void execute() throws MojoExecutionException: called\");",
"// Turn each of the test runner command lines into a script.",
"for",
"(",
"String",
"commandNa... | Implementation of the prod-script goal.
@throws org.apache.maven.plugin.MojoExecutionException | [
"Implementation",
"of",
"the",
"prod",
"-",
"script",
"goal",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/run-plugin/src/main/com/thesett/maven/run/ProductionScriptGenMojo.java#L50-L63 | test | Execute the test runner. | Of course, here is the Java code you requested:
```java
public void execute() throws MojoExecutionException, MojoFailureException
{
//log.debug("public void execute() throws MojoExecutionException: called");
// Turn each of the test runner command lines into a script.
for (String commandNa... |
leanix/leanix-sdk-java | src/main/java/net/leanix/api/TodosApi.java | TodosApi.getTodos | public TodoListResponse getTodos(String type, String status, UUID factSheetId, UUID userId, UUID workspaceId, Boolean getArchived, Integer size, Integer page) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/todos".replaceAll("\\{format\\}",... | java | public TodoListResponse getTodos(String type, String status, UUID factSheetId, UUID userId, UUID workspaceId, Boolean getArchived, Integer size, Integer page) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/todos".replaceAll("\\{format\\}",... | [
"public",
"TodoListResponse",
"getTodos",
"(",
"String",
"type",
",",
"String",
"status",
",",
"UUID",
"factSheetId",
",",
"UUID",
"userId",
",",
"UUID",
"workspaceId",
",",
"Boolean",
"getArchived",
",",
"Integer",
"size",
",",
"Integer",
"page",
")",
"throws... | getTodos
Retrieves all todos a user can read.
@param type Specifies the todo type (optional)
@param status Specifies the todo status (optional)
@param factSheetId Specifies the ID of the Fact Sheet the todo is connected to - only works with manual Todos (optional)
@param userId Specify the user Id for the user to look ... | [
"getTodos",
"Retrieves",
"all",
"todos",
"a",
"user",
"can",
"read",
"."
] | 9516ac593d6a8f73baccc516a45877b4e5920c47 | https://github.com/leanix/leanix-sdk-java/blob/9516ac593d6a8f73baccc516a45877b4e5920c47/src/main/java/net/leanix/api/TodosApi.java#L177-L213 | test | Get TodoList Todos Get TodoList for a specific type of document | Of course, here is the Java code you requested:
```java
public TodoListResponse getTodos(String type, String status, UUID factSheetId, UUID userId, UUID workspaceId, Boolean getArchived, Integer size, Integer page) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
... |
google/guice | extensions/grapher/src/com/google/inject/grapher/graphviz/GraphvizGrapher.java | GraphvizGrapher.getNodeLabel | protected String getNodeLabel(GraphvizNode node) {
String cellborder = node.getStyle() == NodeStyle.INVISIBLE ? "1" : "0";
StringBuilder html = new StringBuilder();
html.append("<");
html.append("<table cellspacing=\"0\" cellpadding=\"5\" cellborder=\"");
html.append(cellborder).append("\" border=\... | java | protected String getNodeLabel(GraphvizNode node) {
String cellborder = node.getStyle() == NodeStyle.INVISIBLE ? "1" : "0";
StringBuilder html = new StringBuilder();
html.append("<");
html.append("<table cellspacing=\"0\" cellpadding=\"5\" cellborder=\"");
html.append(cellborder).append("\" border=\... | [
"protected",
"String",
"getNodeLabel",
"(",
"GraphvizNode",
"node",
")",
"{",
"String",
"cellborder",
"=",
"node",
".",
"getStyle",
"(",
")",
"==",
"NodeStyle",
".",
"INVISIBLE",
"?",
"\"1\"",
":",
"\"0\"",
";",
"StringBuilder",
"html",
"=",
"new",
"StringBu... | Creates the "label" for a node. This is a string of HTML that defines a table with a heading at
the top and (in the case of {@link ImplementationNode}s) rows for each of the member fields. | [
"Creates",
"the",
"label",
"for",
"a",
"node",
".",
"This",
"is",
"a",
"string",
"of",
"HTML",
"that",
"defines",
"a",
"table",
"with",
"a",
"heading",
"at",
"the",
"top",
"and",
"(",
"in",
"the",
"case",
"of",
"{"
] | a0552a16d813ead98fe73737fb001db336650251 | https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/extensions/grapher/src/com/google/inject/grapher/graphviz/GraphvizGrapher.java#L133-L165 | test | Get the label for a node | Of course, here is the Java code you requested:
```java
protected String getNodeLabel(GraphvizNode node) {
String cellborder = node.getStyle() == NodeStyle.INVISIBLE ? "1" : "0";
StringBuilder html = new StringBuilder();
html.append("<");
html.append("<table cellspacing=\"0\" cellpadding=\"5\" cellbor... |
rupertlssmith/lojix | base/struts-tools/src/main/com/thesett/common/webapp/tags/DebugTag.java | DebugTag.getHeaders | public String getHeaders()
{
Map info = new TreeMap();
HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
Enumeration names = req.getHeaderNames();
while (names.hasMoreElements())
{
String name = (String) names.nextElement();
Enum... | java | public String getHeaders()
{
Map info = new TreeMap();
HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
Enumeration names = req.getHeaderNames();
while (names.hasMoreElements())
{
String name = (String) names.nextElement();
Enum... | [
"public",
"String",
"getHeaders",
"(",
")",
"{",
"Map",
"info",
"=",
"new",
"TreeMap",
"(",
")",
";",
"HttpServletRequest",
"req",
"=",
"(",
"HttpServletRequest",
")",
"pageContext",
".",
"getRequest",
"(",
")",
";",
"Enumeration",
"names",
"=",
"req",
"."... | Returns a String with all header information as an HTML table.
@return A String with all header information as an HTML table. | [
"Returns",
"a",
"String",
"with",
"all",
"header",
"information",
"as",
"an",
"HTML",
"table",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/struts-tools/src/main/com/thesett/common/webapp/tags/DebugTag.java#L87-L115 | test | Get the headers of the application as HTML table. | Of course, here is the Java code you requested:
```java
public String getHeaders()
{
Map info = new TreeMap();
HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
Enumeration names = req.getHeaderNames();
while (names.hasMoreElements())
{
Str... |
real-logic/aeron | aeron-driver/src/main/java/io/aeron/driver/Configuration.java | Configuration.validatePageSize | public static void validatePageSize(final int pageSize)
{
if (pageSize < PAGE_MIN_SIZE)
{
throw new ConfigurationException(
"page size less than min size of " + PAGE_MIN_SIZE + ": " + pageSize);
}
if (pageSize > PAGE_MAX_SIZE)
{
throw ... | java | public static void validatePageSize(final int pageSize)
{
if (pageSize < PAGE_MIN_SIZE)
{
throw new ConfigurationException(
"page size less than min size of " + PAGE_MIN_SIZE + ": " + pageSize);
}
if (pageSize > PAGE_MAX_SIZE)
{
throw ... | [
"public",
"static",
"void",
"validatePageSize",
"(",
"final",
"int",
"pageSize",
")",
"{",
"if",
"(",
"pageSize",
"<",
"PAGE_MIN_SIZE",
")",
"{",
"throw",
"new",
"ConfigurationException",
"(",
"\"page size less than min size of \"",
"+",
"PAGE_MIN_SIZE",
"+",
"\": \... | Validate that page size is valid and alignment is valid.
@param pageSize to be checked.
@throws ConfigurationException if the size is not as expected. | [
"Validate",
"that",
"page",
"size",
"is",
"valid",
"and",
"alignment",
"is",
"valid",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-driver/src/main/java/io/aeron/driver/Configuration.java#L1228-L1246 | test | Validate the page size. | Of course, here is the Java code you requested:
```java
public static void validatePageSize(final int pageSize)
{
if (pageSize < PAGE_MIN_SIZE)
{
throw new ConfigurationException(
"page size less than min size of " + PAGE_MIN_SIZE + ": " + pageSize);
}
i... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/dataset/conv/Cosmic1Convention.java | Cosmic1Convention.spin | public double[] spin(double[] v1, double[] vs, double a) {
// implicit real*8(a-h,o-z)
// dimension v1(3),vs(3),vsn(3),v2(3),v3(3),s(3,3)
// Calculation of the unit vector around which
// the rotation should be done.
double[] v2 = new double[3];
double[] vsn = new double[... | java | public double[] spin(double[] v1, double[] vs, double a) {
// implicit real*8(a-h,o-z)
// dimension v1(3),vs(3),vsn(3),v2(3),v3(3),s(3,3)
// Calculation of the unit vector around which
// the rotation should be done.
double[] v2 = new double[3];
double[] vsn = new double[... | [
"public",
"double",
"[",
"]",
"spin",
"(",
"double",
"[",
"]",
"v1",
",",
"double",
"[",
"]",
"vs",
",",
"double",
"a",
")",
"{",
"// implicit real*8(a-h,o-z)\r",
"// dimension v1(3),vs(3),vsn(3),v2(3),v3(3),s(3,3)\r",
"// Calculation of the unit vector around... | ----------------------------------------------------------------------
file spin.f
<p/>
This subroutine rotates vector V1 around vector VS
at angle A. V2 is the vector after the rotation.
<p/>
<p/>
parameter Input parameters:
v1 - Vector to be rotated
vs - Vector around which to rotate v1
a - angle of rot... | [
"----------------------------------------------------------------------",
"file",
"spin",
".",
"f",
"<p",
"/",
">",
"This",
"subroutine",
"rotates",
"vector",
"V1",
"around",
"vector",
"VS",
"at",
"angle",
"A",
".",
"V2",
"is",
"the",
"vector",
"after",
"the",
"ro... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/conv/Cosmic1Convention.java#L576-L619 | test | Spins the specified vector. | Of course, here is the Java code you requested:
```java
public double[] spin(double[] v1, double[] vs, double a) {
// implicit real*8(a-h,o-z)
// dimension v1(3),vs(3),vsn(3),v2(3),v3(3),s(3,3)
// Calculation of the unit vector around which
// the rotation should be done.
dou... |
jcodec/jcodec | src/main/java/org/jcodec/scale/BaseResampler.java | BaseResampler.normalizeAndGenerateFixedPrecision | public static void normalizeAndGenerateFixedPrecision(double[] taps, int precBits, short[] out) {
double sum = 0;
for (int i = 0; i < taps.length; i++) {
sum += taps[i];
}
int sumFix = 0;
int precNum = 1 << precBits;
for (int i = 0; i < taps.length; i++) {
... | java | public static void normalizeAndGenerateFixedPrecision(double[] taps, int precBits, short[] out) {
double sum = 0;
for (int i = 0; i < taps.length; i++) {
sum += taps[i];
}
int sumFix = 0;
int precNum = 1 << precBits;
for (int i = 0; i < taps.length; i++) {
... | [
"public",
"static",
"void",
"normalizeAndGenerateFixedPrecision",
"(",
"double",
"[",
"]",
"taps",
",",
"int",
"precBits",
",",
"short",
"[",
"]",
"out",
")",
"{",
"double",
"sum",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"taps... | Converts floating point taps to fixed precision taps.
@param taps
The 64 bit double representation
@param precBits
Precision bits
@param out
Taps converted to fixed precision | [
"Converts",
"floating",
"point",
"taps",
"to",
"fixed",
"precision",
"taps",
"."
] | cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75 | https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/scale/BaseResampler.java#L60-L91 | test | Normalizes and generates fixed precision. | Of course, here is the Java code you requested:
```java
public static void normalizeAndGenerateFixedPrecision(double[] taps, int precBits, short[] out) {
double sum = 0;
for (int i = 0; i < taps.length; i++) {
sum += taps[i];
}
int sumFix = 0;
int precNum = 1 << prec... |
jcuda/jcublas | JCublasJava/src/main/java/jcuda/jcublas/JCublas.java | JCublas.cublasCtpsv | public static void cublasCtpsv(char uplo, char trans, char diag, int n, Pointer AP, Pointer x, int incx)
{
cublasCtpsvNative(uplo, trans, diag, n, AP, x, incx);
checkResultBLAS();
} | java | public static void cublasCtpsv(char uplo, char trans, char diag, int n, Pointer AP, Pointer x, int incx)
{
cublasCtpsvNative(uplo, trans, diag, n, AP, x, incx);
checkResultBLAS();
} | [
"public",
"static",
"void",
"cublasCtpsv",
"(",
"char",
"uplo",
",",
"char",
"trans",
",",
"char",
"diag",
",",
"int",
"n",
",",
"Pointer",
"AP",
",",
"Pointer",
"x",
",",
"int",
"incx",
")",
"{",
"cublasCtpsvNative",
"(",
"uplo",
",",
"trans",
",",
... | <pre>
void
cublasCtpsv (char uplo, char trans, char diag, int n, const cuComplex *AP,
cuComplex *X, int incx)
solves one of the systems of equations op(A)*x = b, where op(A) is either
op(A) = A , op(A) = transpose(A) or op(A) = conjugate(transpose)). b and
x are n element complex vectors, and A is an n x n unit or non... | [
"<pre",
">",
"void",
"cublasCtpsv",
"(",
"char",
"uplo",
"char",
"trans",
"char",
"diag",
"int",
"n",
"const",
"cuComplex",
"*",
"AP",
"cuComplex",
"*",
"X",
"int",
"incx",
")"
] | 80875235d24562073f4d66651dd17263f306427d | https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L5291-L5295 | test | Cublas composed of single segment vectors. | Of course, here is the Java code you requested:
```java
public static void cublasCtpsv(char uplo, char trans, char diag, int n, Pointer AP, Pointer x, int incx)
{
cublasCtpsvNative(uplo, trans, diag, n, AP, x, incx);
checkResultBLAS();
}
```
Hope this helps! |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/command/OBasicCommandContext.java | OBasicCommandContext.setChild | public OCommandContext setChild(final OCommandContext iContext) {
if (iContext == null) {
if (child != null) {
// REMOVE IT
child.setParent(null);
child = null;
}
} else if (child != iContext) {
// ADD IT
child = iContext;
iContext.setParent(this... | java | public OCommandContext setChild(final OCommandContext iContext) {
if (iContext == null) {
if (child != null) {
// REMOVE IT
child.setParent(null);
child = null;
}
} else if (child != iContext) {
// ADD IT
child = iContext;
iContext.setParent(this... | [
"public",
"OCommandContext",
"setChild",
"(",
"final",
"OCommandContext",
"iContext",
")",
"{",
"if",
"(",
"iContext",
"==",
"null",
")",
"{",
"if",
"(",
"child",
"!=",
"null",
")",
"{",
"// REMOVE IT\r",
"child",
".",
"setParent",
"(",
"null",
")",
";",
... | Set the inherited context avoiding to copy all the values every time.
@return | [
"Set",
"the",
"inherited",
"context",
"avoiding",
"to",
"copy",
"all",
"the",
"values",
"every",
"time",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/command/OBasicCommandContext.java#L252-L266 | test | Sets the child. | Of course, here is the Java code you requested:
```java
public OCommandContext setChild(final OCommandContext iContext) {
if (iContext == null) {
if (child != null) {
// REMOVE IT
child.setParent(null);
child = null;
}
} else if (child != iContext) {
// ADD I... |
RestComm/jain-slee | container/profiles/src/main/java/org/mobicents/slee/container/deployment/profile/jpa/JPAProfileEntityFramework.java | JPAProfileEntityFramework.findProfile | public ProfileEntity findProfile(String profileTable, String profileName) {
EntityManager em = getEntityManager();
Query query = em.createQuery(
"FROM " + profileEntityClassName
+ " WHERE tableName = ?1 AND profileName = ?2")
.setParameter(1, profileTable).setParameter(2, profileName);
List<?> res... | java | public ProfileEntity findProfile(String profileTable, String profileName) {
EntityManager em = getEntityManager();
Query query = em.createQuery(
"FROM " + profileEntityClassName
+ " WHERE tableName = ?1 AND profileName = ?2")
.setParameter(1, profileTable).setParameter(2, profileName);
List<?> res... | [
"public",
"ProfileEntity",
"findProfile",
"(",
"String",
"profileTable",
",",
"String",
"profileName",
")",
"{",
"EntityManager",
"em",
"=",
"getEntityManager",
"(",
")",
";",
"Query",
"query",
"=",
"em",
".",
"createQuery",
"(",
"\"FROM \"",
"+",
"profileEntity... | /*
(non-Javadoc)
@see
org.mobicents.slee.container.component.profile.ProfileEntityFramework
#findProfile(java.lang.String, java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/profiles/src/main/java/org/mobicents/slee/container/deployment/profile/jpa/JPAProfileEntityFramework.java#L284-L298 | test | Find the profile entity. | Of course, here is the Java code you requested:
```java
public ProfileEntity findProfile(String profileTable, String profileName) {
EntityManager em = getEntityManager();
Query query = em.createQuery(
"FROM " + profileEntityClassName
+ " WHERE tableName = ?1 AND profileName = ?2")
.setParameter(1, p... |
1gravity/Android-RTEditor | RTEditor/src/main/java/com/onegravity/rteditor/ClonedSpannableString.java | ClonedSpannableString.setSpan | @Override
public void setSpan(Object what, int start, int end, int flags) {
if (mSpanCount + 1 >= mSpans.length) {
int newsize = mSpanCount + 10;
Object[] newtags = new Object[newsize];
int[] newdata = new int[newsize * 3];
System.arraycopy(mSpans, 0, newtags... | java | @Override
public void setSpan(Object what, int start, int end, int flags) {
if (mSpanCount + 1 >= mSpans.length) {
int newsize = mSpanCount + 10;
Object[] newtags = new Object[newsize];
int[] newdata = new int[newsize * 3];
System.arraycopy(mSpans, 0, newtags... | [
"@",
"Override",
"public",
"void",
"setSpan",
"(",
"Object",
"what",
",",
"int",
"start",
",",
"int",
"end",
",",
"int",
"flags",
")",
"{",
"if",
"(",
"mSpanCount",
"+",
"1",
">=",
"mSpans",
".",
"length",
")",
"{",
"int",
"newsize",
"=",
"mSpanCount... | ****************************************** SpannableString Methods ******************************************* | [
"******************************************",
"SpannableString",
"Methods",
"*******************************************"
] | 9d8fb4bb865b3b3d011e7633afedcdfb8d21754f | https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/ClonedSpannableString.java#L78-L97 | test | Set a span of a class. | Of course, here is the Java code you requested:
```java
@Override
public void setSpan(Object what, int start, int end, int flags) {
if (mSpanCount + 1 >= mSpans.length) {
int newsize = mSpanCount + 10;
Object[] newtags = new Object[newsize];
int[] newdata = new int[newsi... |
eclipse/packagedrone | bundles/org.tukani.xz/src/org/tukaani/xz/lz/LZEncoder.java | LZEncoder.setPresetDict | public void setPresetDict(int dictSize, byte[] presetDict) {
assert !isStarted();
assert writePos == 0;
if (presetDict != null) {
// If the preset dictionary buffer is bigger than the dictionary
// size, copy only the tail of the preset dictionary.
int copySi... | java | public void setPresetDict(int dictSize, byte[] presetDict) {
assert !isStarted();
assert writePos == 0;
if (presetDict != null) {
// If the preset dictionary buffer is bigger than the dictionary
// size, copy only the tail of the preset dictionary.
int copySi... | [
"public",
"void",
"setPresetDict",
"(",
"int",
"dictSize",
",",
"byte",
"[",
"]",
"presetDict",
")",
"{",
"assert",
"!",
"isStarted",
"(",
")",
";",
"assert",
"writePos",
"==",
"0",
";",
"if",
"(",
"presetDict",
"!=",
"null",
")",
"{",
"// If the preset ... | Sets a preset dictionary. If a preset dictionary is wanted, this
function must be called immediately after creating the LZEncoder
before any data has been encoded. | [
"Sets",
"a",
"preset",
"dictionary",
".",
"If",
"a",
"preset",
"dictionary",
"is",
"wanted",
"this",
"function",
"must",
"be",
"called",
"immediately",
"after",
"creating",
"the",
"LZEncoder",
"before",
"any",
"data",
"has",
"been",
"encoded",
"."
] | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.tukani.xz/src/org/tukaani/xz/lz/LZEncoder.java#L162-L175 | test | Set the preset dictionary buffer. | Of course, here is the Java code you requested:
```java
public void setPresetDict(int dictSize, byte[] presetDict) {
assert !isStarted();
assert writePos == 0;
if (presetDict != null) {
// If the preset dictionary buffer is bigger than the dictionary
// size, copy only ... |
kiegroup/droolsjbpm-tools | drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/HrefSet.java | HrefSet.addHref | public void addHref(String href) {
String encodedHref = encodeHref(href);
if (isDuplicate(encodedHref))
return;
appendChild(root, "href", encodedHref); //$NON-NLS-1$
} | java | public void addHref(String href) {
String encodedHref = encodeHref(href);
if (isDuplicate(encodedHref))
return;
appendChild(root, "href", encodedHref); //$NON-NLS-1$
} | [
"public",
"void",
"addHref",
"(",
"String",
"href",
")",
"{",
"String",
"encodedHref",
"=",
"encodeHref",
"(",
"href",
")",
";",
"if",
"(",
"isDuplicate",
"(",
"encodedHref",
")",
")",
"return",
";",
"appendChild",
"(",
"root",
",",
"\"href\"",
",",
"enc... | Adds the given href to the end of the set of hrefs. If the href
already exists it is not added.
@param href the href to add to the end of the set of hrefs | [
"Adds",
"the",
"given",
"href",
"to",
"the",
"end",
"of",
"the",
"set",
"of",
"hrefs",
".",
"If",
"the",
"href",
"already",
"exists",
"it",
"is",
"not",
"added",
"."
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/HrefSet.java#L57-L62 | test | Add a href to the calendar. | Of course, here is the Java code you requested:
```java
public void addHref(String href) {
String encodedHref = encodeHref(href);
if (isDuplicate(encodedHref))
return;
appendChild(root, "href", encodedHref); //$NON-NLS-1$
}
```
Hope this helps! |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/http/WebConfigUtils.java | WebConfigUtils.validateHttpRedirect | static void validateHttpRedirect(String url, ParserContext pc, Object source) {
if (!StringUtils.hasText(url) || UrlUtils.isValidRedirectUrl(url)
|| url.startsWith("$") || url.startsWith("#")) {
return;
}
pc.getReaderContext().warning(
url + " is not a valid redirect URL (must start with '/' or http(s)... | java | static void validateHttpRedirect(String url, ParserContext pc, Object source) {
if (!StringUtils.hasText(url) || UrlUtils.isValidRedirectUrl(url)
|| url.startsWith("$") || url.startsWith("#")) {
return;
}
pc.getReaderContext().warning(
url + " is not a valid redirect URL (must start with '/' or http(s)... | [
"static",
"void",
"validateHttpRedirect",
"(",
"String",
"url",
",",
"ParserContext",
"pc",
",",
"Object",
"source",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"url",
")",
"||",
"UrlUtils",
".",
"isValidRedirectUrl",
"(",
"url",
")",
"||... | Checks the value of an XML attribute which represents a redirect URL. If not empty
or starting with "$" (potential placeholder), or starting with "#" (potential
SpEL), "/" or "http" it will raise an error. | [
"Checks",
"the",
"value",
"of",
"an",
"XML",
"attribute",
"which",
"represents",
"a",
"redirect",
"URL",
".",
"If",
"not",
"empty",
"or",
"starting",
"with",
"$",
"(",
"potential",
"placeholder",
")",
"or",
"starting",
"with",
"#",
"(",
"potential",
"SpEL"... | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/http/WebConfigUtils.java#L48-L56 | test | Validate the redirect URL. | Of course, here is the Java code you requested:
```java
static void validateHttpRedirect(String url, ParserContext pc, Object source) {
if (!StringUtils.hasText(url) || UrlUtils.isValidRedirectUrl(url)
|| url.startsWith("$") || url.startsWith("#")) {
return;
}
pc.getReaderContext().warning(
url + " is... |
eclipse/packagedrone | bundles/org.tukani.xz/src/org/tukaani/xz/lz/LZEncoder.java | LZEncoder.verifyMatches | public boolean verifyMatches(Matches matches) {
int lenLimit = Math.min(getAvail(), matchLenMax);
for (int i = 0; i < matches.count; ++i)
if (getMatchLen(matches.dist[i], lenLimit) != matches.len[i])
return false;
return true;
} | java | public boolean verifyMatches(Matches matches) {
int lenLimit = Math.min(getAvail(), matchLenMax);
for (int i = 0; i < matches.count; ++i)
if (getMatchLen(matches.dist[i], lenLimit) != matches.len[i])
return false;
return true;
} | [
"public",
"boolean",
"verifyMatches",
"(",
"Matches",
"matches",
")",
"{",
"int",
"lenLimit",
"=",
"Math",
".",
"min",
"(",
"getAvail",
"(",
")",
",",
"matchLenMax",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"matches",
".",
"count",
... | Verifies that the matches returned by the match finder are valid.
This is meant to be used in an assert statement. This is totally
useless for actual encoding since match finder's results should
naturally always be valid if it isn't broken.
@param matches return value from <code>getMatches</code>
@return ... | [
"Verifies",
"that",
"the",
"matches",
"returned",
"by",
"the",
"match",
"finder",
"are",
"valid",
".",
"This",
"is",
"meant",
"to",
"be",
"used",
"in",
"an",
"assert",
"statement",
".",
"This",
"is",
"totally",
"useless",
"for",
"actual",
"encoding",
"sinc... | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.tukani.xz/src/org/tukaani/xz/lz/LZEncoder.java#L376-L384 | test | Verify matches. | Of course, here is the Java code you requested:
```java
public boolean verifyMatches(Matches matches) {
int lenLimit = Math.min(getAvail(), matchLenMax);
for (int i = 0; i < matches.count; ++i)
if (getMatchLen(matches.dist[i], lenLimit) != matches.len[i])
return false;
... |
turbomanage/storm-gen | storm-sample/app/src/main/java/com/turbomanage/storm/sample/activity/ContactActivity.java | ContactActivity.setEmptyText | public void setEmptyText(CharSequence emptyText) {
if (mListView != null){
View emptyView = mListView.getEmptyView();
if (emptyText instanceof TextView) {
((TextView) emptyView).setText(emptyText);
}
}
} | java | public void setEmptyText(CharSequence emptyText) {
if (mListView != null){
View emptyView = mListView.getEmptyView();
if (emptyText instanceof TextView) {
((TextView) emptyView).setText(emptyText);
}
}
} | [
"public",
"void",
"setEmptyText",
"(",
"CharSequence",
"emptyText",
")",
"{",
"if",
"(",
"mListView",
"!=",
"null",
")",
"{",
"View",
"emptyView",
"=",
"mListView",
".",
"getEmptyView",
"(",
")",
";",
"if",
"(",
"emptyText",
"instanceof",
"TextView",
")",
... | The default content for this Activity has a TextView that is shown when
the list is empty. If you would like to change the text, call this method
to supply the text it should use. | [
"The",
"default",
"content",
"for",
"this",
"Activity",
"has",
"a",
"TextView",
"that",
"is",
"shown",
"when",
"the",
"list",
"is",
"empty",
".",
"If",
"you",
"would",
"like",
"to",
"change",
"the",
"text",
"call",
"this",
"method",
"to",
"supply",
"the"... | 22caa69439548a074d035745215bce5aff55853d | https://github.com/turbomanage/storm-gen/blob/22caa69439548a074d035745215bce5aff55853d/storm-sample/app/src/main/java/com/turbomanage/storm/sample/activity/ContactActivity.java#L62-L70 | test | Set the empty text of the list view. | Of course, here is the Java code you requested:
```java
public void setEmptyText(CharSequence emptyText) {
if (mListView != null){
View emptyView = mListView.getEmptyView();
if (emptyText instanceof TextView) {
((TextView) emptyView).setText(emptyText);
}
}
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java | NetcdfDataset.acquireFile | static public NetcdfFile acquireFile(ucar.nc2.util.cache.FileFactory factory, Object hashKey,
DatasetUrl location, int buffer_size, ucar.nc2.util.CancelTask cancelTask, Object spiObject) throws IOException {
// must use the factory if there is one but no fileCache
if ((ne... | java | static public NetcdfFile acquireFile(ucar.nc2.util.cache.FileFactory factory, Object hashKey,
DatasetUrl location, int buffer_size, ucar.nc2.util.CancelTask cancelTask, Object spiObject) throws IOException {
// must use the factory if there is one but no fileCache
if ((ne... | [
"static",
"public",
"NetcdfFile",
"acquireFile",
"(",
"ucar",
".",
"nc2",
".",
"util",
".",
"cache",
".",
"FileFactory",
"factory",
",",
"Object",
"hashKey",
",",
"DatasetUrl",
"location",
",",
"int",
"buffer_size",
",",
"ucar",
".",
"nc2",
".",
"util",
".... | Same as openFile, but file is acquired through the File Cache.
You still close with NetcdfFile.close(), the release is handled automatically.
You must first call initNetcdfFileCache() for caching to actually take place.
@param factory if not null, use this factory to read the file. If null, use the default factory... | [
"Same",
"as",
"openFile",
"but",
"file",
"is",
"acquired",
"through",
"the",
"File",
"Cache",
".",
"You",
"still",
"close",
"with",
"NetcdfFile",
".",
"close",
"()",
"the",
"release",
"is",
"handled",
"automatically",
".",
"You",
"must",
"first",
"call",
"... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java#L636-L645 | test | Acquire a file from the cache. | Of course, here is the Java code you requested:
```java
static public NetcdfFile acquireFile(ucar.nc2.util.cache.FileFactory factory, Object hashKey,
DatasetUrl location, int buffer_size, ucar.nc2.util.CancelTask cancelTask, Object spiObject) throws IOException {
// must use... |
algolia/algoliasearch-client-android | algoliasearch/src/main/java/com/algolia/search/saas/Client.java | Client.multipleQueriesAsync | public Request multipleQueriesAsync(final @NonNull List<IndexQuery> queries, final MultipleQueriesStrategy strategy, @Nullable final RequestOptions requestOptions, @NonNull CompletionHandler completionHandler) {
return new AsyncTaskRequest(completionHandler) {
@NonNull
@Override
... | java | public Request multipleQueriesAsync(final @NonNull List<IndexQuery> queries, final MultipleQueriesStrategy strategy, @Nullable final RequestOptions requestOptions, @NonNull CompletionHandler completionHandler) {
return new AsyncTaskRequest(completionHandler) {
@NonNull
@Override
... | [
"public",
"Request",
"multipleQueriesAsync",
"(",
"final",
"@",
"NonNull",
"List",
"<",
"IndexQuery",
">",
"queries",
",",
"final",
"MultipleQueriesStrategy",
"strategy",
",",
"@",
"Nullable",
"final",
"RequestOptions",
"requestOptions",
",",
"@",
"NonNull",
"Comple... | Run multiple queries, potentially targeting multiple indexes, with one API call.
@param queries The queries to run.
@param strategy The strategy to use.
@param requestOptions Request-specific options.
@param completionHandler The listener that will be notified of the request's outcome.
@return A ... | [
"Run",
"multiple",
"queries",
"potentially",
"targeting",
"multiple",
"indexes",
"with",
"one",
"API",
"call",
"."
] | 3293ba6e6116a4f6c1face2cc606bc047d6d4a3c | https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/Client.java#L318-L326 | test | Asynchronously sends a list of multiple queries request to Algolia. | Of course, here is the Java code you requested:
```java
public Request multipleQueriesAsync(final @NonNull List<IndexQuery> queries, final MultipleQueriesStrategy strategy, @Nullable final RequestOptions requestOptions, @NonNull CompletionHandler completionHandler) {
return new AsyncTaskRequest(completionHandl... |
eclipse/packagedrone | bundles/org.tukani.xz/src/org/tukaani/xz/SeekableXZInputStream.java | SeekableXZInputStream.seek | public void seek(long pos) throws IOException {
if (in == null)
throw new XZIOException("Stream closed");
if (pos < 0)
throw new XZIOException("Negative seek position: " + pos);
seekPos = pos;
seekNeeded = true;
} | java | public void seek(long pos) throws IOException {
if (in == null)
throw new XZIOException("Stream closed");
if (pos < 0)
throw new XZIOException("Negative seek position: " + pos);
seekPos = pos;
seekNeeded = true;
} | [
"public",
"void",
"seek",
"(",
"long",
"pos",
")",
"throws",
"IOException",
"{",
"if",
"(",
"in",
"==",
"null",
")",
"throw",
"new",
"XZIOException",
"(",
"\"Stream closed\"",
")",
";",
"if",
"(",
"pos",
"<",
"0",
")",
"throw",
"new",
"XZIOException",
... | Seeks to the specified absolute uncompressed position in the stream.
This only stores the new position, so this function itself is always
very fast. The actual seek is done when <code>read</code> is called
to read at least one byte.
<p>
Seeking past the end of the stream is possible. In that case
<code>read</code> will... | [
"Seeks",
"to",
"the",
"specified",
"absolute",
"uncompressed",
"position",
"in",
"the",
"stream",
".",
"This",
"only",
"stores",
"the",
"new",
"position",
"so",
"this",
"function",
"itself",
"is",
"always",
"very",
"fast",
".",
"The",
"actual",
"seek",
"is",... | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.tukani.xz/src/org/tukaani/xz/SeekableXZInputStream.java#L963-L972 | test | Seek to the specified position. | Of course, here is the Java code you requested:
```java
public void seek(long pos) throws IOException {
if (in == null)
throw new XZIOException("Stream closed");
if (pos < 0)
throw new XZIOException("Negative seek position: " + pos);
seekPos = pos;
seekNeeded =... |
GojaFramework/goja | goja-core/src/main/java/goja/core/libs/XML.java | XML.getDocument | public static Document getDocument(InputStream stream) {
try {
return newDocumentBuilder().parse(stream);
} catch (SAXException e) {
logger.warn("Parsing error when building Document object from xml data.", e);
} catch (IOException e) {
logger.warn("Reading er... | java | public static Document getDocument(InputStream stream) {
try {
return newDocumentBuilder().parse(stream);
} catch (SAXException e) {
logger.warn("Parsing error when building Document object from xml data.", e);
} catch (IOException e) {
logger.warn("Reading er... | [
"public",
"static",
"Document",
"getDocument",
"(",
"InputStream",
"stream",
")",
"{",
"try",
"{",
"return",
"newDocumentBuilder",
"(",
")",
".",
"parse",
"(",
"stream",
")",
";",
"}",
"catch",
"(",
"SAXException",
"e",
")",
"{",
"logger",
".",
"warn",
"... | Parse an XML coming from an input stream to DOM
@return null if an error occurs during parsing. | [
"Parse",
"an",
"XML",
"coming",
"from",
"an",
"input",
"stream",
"to",
"DOM"
] | 77179b495f668fc1fa20accc912991df6bb2d917 | https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/libs/XML.java#L124-L133 | test | Gets a Document object from an input stream. | Of course, here is the Java code you requested:
```java
public static Document getDocument(InputStream stream) {
try {
return newDocumentBuilder().parse(stream);
} catch (SAXException e) {
logger.warn("Parsing error when building Document object from xml data.", e);
} ca... |
wildfly/wildfly | jsr77/src/main/java/org/jboss/as/jsr77/subsystem/JSR77ManagementExtension.java | JSR77ManagementExtension.initialize | @Override
public void initialize(ExtensionContext context) {
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
// Register the root subsystem resource.
final ManagementResourceRegistration rootResource = subsystem.registerSubsystemMode... | java | @Override
public void initialize(ExtensionContext context) {
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
// Register the root subsystem resource.
final ManagementResourceRegistration rootResource = subsystem.registerSubsystemMode... | [
"@",
"Override",
"public",
"void",
"initialize",
"(",
"ExtensionContext",
"context",
")",
"{",
"final",
"SubsystemRegistration",
"subsystem",
"=",
"context",
".",
"registerSubsystem",
"(",
"SUBSYSTEM_NAME",
",",
"CURRENT_MODEL_VERSION",
")",
";",
"// Register the root s... | {@inheritDoc} | [
"{"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jsr77/src/main/java/org/jboss/as/jsr77/subsystem/JSR77ManagementExtension.java#L58-L69 | test | Initialize the JSR77 subsystem. | Of course, here is the Java code you requested:
```java
@Override
public void initialize(ExtensionContext context) {
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
// Register the root subsystem resource.
final ManagementResourceRe... |
orientechnologies/orientdb | server/src/main/java/com/orientechnologies/orient/server/distributed/OModifiableDistributedConfiguration.java | OModifiableDistributedConfiguration.setServerOffline | public List<String> setServerOffline(final String iNode, final String newLockManagerServer) {
final List<String> changedPartitions = new ArrayList<String>();
final String[] clusters = getClusterNames();
synchronized (configuration) {
for (String clusterName : clusters) {
final List<String> no... | java | public List<String> setServerOffline(final String iNode, final String newLockManagerServer) {
final List<String> changedPartitions = new ArrayList<String>();
final String[] clusters = getClusterNames();
synchronized (configuration) {
for (String clusterName : clusters) {
final List<String> no... | [
"public",
"List",
"<",
"String",
">",
"setServerOffline",
"(",
"final",
"String",
"iNode",
",",
"final",
"String",
"newLockManagerServer",
")",
"{",
"final",
"List",
"<",
"String",
">",
"changedPartitions",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"... | Set a server offline. It assures the offline server is never on top of the list.<br>
NOTE: It must be executed in distributed database lock.
@param iNode
Server name
@param newLockManagerServer
New Lock Manager server name
@return | [
"Set",
"a",
"server",
"offline",
".",
"It",
"assures",
"the",
"offline",
"server",
"is",
"never",
"on",
"top",
"of",
"the",
"list",
".",
"<br",
">",
"NOTE",
":",
"It",
"must",
"be",
"executed",
"in",
"distributed",
"database",
"lock",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/server/src/main/java/com/orientechnologies/orient/server/distributed/OModifiableDistributedConfiguration.java#L201-L241 | test | Sets the server offline. | Of course, here is the Java code you requested:
```java
public List<String> setServerOffline(final String iNode, final String newLockManagerServer) {
final List<String> changedPartitions = new ArrayList<String>();
final String[] clusters = getClusterNames();
synchronized (configuration) {
for (Strin... |
ReactiveX/RxJava | src/main/java/io/reactivex/parallel/ParallelFlowable.java | ParallelFlowable.sequential | @BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
@CheckReturnValue
@NonNull
public final Flowable<T> sequential(int prefetch) {
ObjectHelper.verifyPositive(prefetch, "prefetch");
return RxJavaPlugins.onAssembly(new ParallelJoin<T>(this, prefetch, false... | java | @BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
@CheckReturnValue
@NonNull
public final Flowable<T> sequential(int prefetch) {
ObjectHelper.verifyPositive(prefetch, "prefetch");
return RxJavaPlugins.onAssembly(new ParallelJoin<T>(this, prefetch, false... | [
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"@",
"CheckReturnValue",
"@",
"NonNull",
"public",
"final",
"Flowable",
"<",
"T",
">",
"sequential",
"(",
"int",
"prefetch"... | Merges the values from each 'rail' in a round-robin or same-order fashion and
exposes it as a regular Publisher sequence, running with a give prefetch value
for the rails.
<img width="640" height="602" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/parallelflowable.sequential.png" alt="">
<dl>
<d... | [
"Merges",
"the",
"values",
"from",
"each",
"rail",
"in",
"a",
"round",
"-",
"robin",
"or",
"same",
"-",
"order",
"fashion",
"and",
"exposes",
"it",
"as",
"a",
"regular",
"Publisher",
"sequence",
"running",
"with",
"a",
"give",
"prefetch",
"value",
"for",
... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/parallel/ParallelFlowable.java#L379-L386 | test | Returns a sequence of tokens from this stream using a sequential sequence of tokens. | Of course, here is the Java code you requested:
```java
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
@CheckReturnValue
@NonNull
public final Flowable<T> sequential(int prefetch) {
ObjectHelper.verifyPositive(prefetch, "prefetch");
return RxJavaPlu... |
square/retrofit | retrofit/src/main/java/retrofit2/Response.java | Response.success | public static <T> Response<T> success(@Nullable T body, okhttp3.Response rawResponse) {
checkNotNull(rawResponse, "rawResponse == null");
if (!rawResponse.isSuccessful()) {
throw new IllegalArgumentException("rawResponse must be successful response");
}
return new Response<>(rawResponse, body, nul... | java | public static <T> Response<T> success(@Nullable T body, okhttp3.Response rawResponse) {
checkNotNull(rawResponse, "rawResponse == null");
if (!rawResponse.isSuccessful()) {
throw new IllegalArgumentException("rawResponse must be successful response");
}
return new Response<>(rawResponse, body, nul... | [
"public",
"static",
"<",
"T",
">",
"Response",
"<",
"T",
">",
"success",
"(",
"@",
"Nullable",
"T",
"body",
",",
"okhttp3",
".",
"Response",
"rawResponse",
")",
"{",
"checkNotNull",
"(",
"rawResponse",
",",
"\"rawResponse == null\"",
")",
";",
"if",
"(",
... | Create a successful response from {@code rawResponse} with {@code body} as the deserialized
body. | [
"Create",
"a",
"successful",
"response",
"from",
"{"
] | 81a6193a7b3f2b1bf25e78adc2638681b0514fe8 | https://github.com/square/retrofit/blob/81a6193a7b3f2b1bf25e78adc2638681b0514fe8/retrofit/src/main/java/retrofit2/Response.java#L73-L79 | test | Create a successful response. | Of course, here is the Java code you requested:
```java
public static <T> Response<T> success(@Nullable T body, okhttp3.Response rawResponse) {
checkNotNull(rawResponse, "rawResponse == null");
if (!rawResponse.isSuccessful()) {
throw new IllegalArgumentException("rawResponse must be successful response"... |
ReactiveX/RxJava | src/main/java/io/reactivex/plugins/RxJavaPlugins.java | RxJavaPlugins.onSingleScheduler | @NonNull
public static Scheduler onSingleScheduler(@NonNull Scheduler defaultScheduler) {
Function<? super Scheduler, ? extends Scheduler> f = onSingleHandler;
if (f == null) {
return defaultScheduler;
}
return apply(f, defaultScheduler);
} | java | @NonNull
public static Scheduler onSingleScheduler(@NonNull Scheduler defaultScheduler) {
Function<? super Scheduler, ? extends Scheduler> f = onSingleHandler;
if (f == null) {
return defaultScheduler;
}
return apply(f, defaultScheduler);
} | [
"@",
"NonNull",
"public",
"static",
"Scheduler",
"onSingleScheduler",
"(",
"@",
"NonNull",
"Scheduler",
"defaultScheduler",
")",
"{",
"Function",
"<",
"?",
"super",
"Scheduler",
",",
"?",
"extends",
"Scheduler",
">",
"f",
"=",
"onSingleHandler",
";",
"if",
"("... | Calls the associated hook function.
@param defaultScheduler the hook's input value
@return the value returned by the hook | [
"Calls",
"the",
"associated",
"hook",
"function",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/plugins/RxJavaPlugins.java#L481-L488 | test | On single scheduler. | Of course, here is the Java code you requested:
```java
@NonNull
public static Scheduler onSingleScheduler(@NonNull Scheduler defaultScheduler) {
Function<? super Scheduler, ? extends Scheduler> f = onSingleHandler;
if (f == null) {
return defaultScheduler;
}
return appl... |
basis-technology-corp/tcl-regex-java | src/main/java/com/basistech/tclre/Compiler.java | Compiler.cbracket | private void cbracket(State lp, State rp) throws RegexException {
State left = nfa.newstate();
State right = nfa.newstate();
bracket(left, right);
if (0 != (cflags & Flags.REG_NLSTOP)) {
nfa.newarc(PLAIN, nlcolor, left, right);
}
assert lp.nouts == 0; ... | java | private void cbracket(State lp, State rp) throws RegexException {
State left = nfa.newstate();
State right = nfa.newstate();
bracket(left, right);
if (0 != (cflags & Flags.REG_NLSTOP)) {
nfa.newarc(PLAIN, nlcolor, left, right);
}
assert lp.nouts == 0; ... | [
"private",
"void",
"cbracket",
"(",
"State",
"lp",
",",
"State",
"rp",
")",
"throws",
"RegexException",
"{",
"State",
"left",
"=",
"nfa",
".",
"newstate",
"(",
")",
";",
"State",
"right",
"=",
"nfa",
".",
"newstate",
"(",
")",
";",
"bracket",
"(",
"l... | cbracket - handle complemented bracket expression
We do it by calling bracket() with dummy endpoints, and then complementing
the result. The alternative would be to invoke rainbow(), and then delete
arcs as the b.e. is seen... but that gets messy. | [
"cbracket",
"-",
"handle",
"complemented",
"bracket",
"expression",
"We",
"do",
"it",
"by",
"calling",
"bracket",
"()",
"with",
"dummy",
"endpoints",
"and",
"then",
"complementing",
"the",
"result",
".",
"The",
"alternative",
"would",
"be",
"to",
"invoke",
"ra... | de0d5eaccf9a61b694cb8793f234cc229c395b43 | https://github.com/basis-technology-corp/tcl-regex-java/blob/de0d5eaccf9a61b694cb8793f234cc229c395b43/src/main/java/com/basistech/tclre/Compiler.java#L1409-L1427 | test | C bracket. | Of course, here is the Java code you requested:
```java
private void cbracket(State lp, State rp) throws RegexException {
State left = nfa.newstate();
State right = nfa.newstate();
bracket(left, right);
if (0 != (cflags & Flags.REG_NLSTOP)) {
nfa.newarc(PLAIN, nlcolor, left... |
TeachingKidsProgramming/TeachingKidsProgramming.Source.Java | src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdDraw.java | StdDraw.text | public static void text(double x, double y, String text, double degrees)
{
if (text == null)
throw new NullPointerException();
double xs = scaleX(x);
double ys = scaleY(y);
offscreen.rotate(Math.toRadians(-degrees), xs, ys);
text(x, y, text);
offscreen.rotate(Math.toRadians(+degrees), xs... | java | public static void text(double x, double y, String text, double degrees)
{
if (text == null)
throw new NullPointerException();
double xs = scaleX(x);
double ys = scaleY(y);
offscreen.rotate(Math.toRadians(-degrees), xs, ys);
text(x, y, text);
offscreen.rotate(Math.toRadians(+degrees), xs... | [
"public",
"static",
"void",
"text",
"(",
"double",
"x",
",",
"double",
"y",
",",
"String",
"text",
",",
"double",
"degrees",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"double",
"xs",
"=",
"... | Write the given text string in the current font, centered at (<em>x</em>, <em>y</em>) and
rotated by the specified number of degrees.
@param x the center <em>x</em>-coordinate of the text
@param y the center <em>y</em>-coordinate of the text
@param text the text to write
@param degrees is the number of degrees to r... | [
"Write",
"the",
"given",
"text",
"string",
"in",
"the",
"current",
"font",
"centered",
"at",
"(",
"<em",
">",
"x<",
"/",
"em",
">",
"<em",
">",
"y<",
"/",
"em",
">",
")",
"and",
"rotated",
"by",
"the",
"specified",
"number",
"of",
"degrees",
"."
] | 516fee15e537ecdb3f4dcbe3695c5cfde7e930da | https://github.com/TeachingKidsProgramming/TeachingKidsProgramming.Source.Java/blob/516fee15e537ecdb3f4dcbe3695c5cfde7e930da/src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdDraw.java#L806-L815 | test | Text on a single segment of a CRA SURVENT document. | Of course, here is the Java code you requested:
```java
public static void text(double x, double y, String text, double degrees)
{
if (text == null)
throw new NullPointerException();
double xs = scaleX(x);
double ys = scaleY(y);
offscreen.rotate(Math.toRadians(-degrees), xs, ys);
text(x, y,... |
GlenKPeterson/Paguro | src/main/java/org/organicdesign/fp/collections/PersistentVector.java | PersistentVector.listIterator | @Override public UnmodListIterator<E> listIterator(int index) {
if( (index < 0) || (index > size) ) {
// To match ArrayList and other java.util.List expectations
throw new IndexOutOfBoundsException("Index: " + index);
}
return new UnmodListIterator<E>() {
priv... | java | @Override public UnmodListIterator<E> listIterator(int index) {
if( (index < 0) || (index > size) ) {
// To match ArrayList and other java.util.List expectations
throw new IndexOutOfBoundsException("Index: " + index);
}
return new UnmodListIterator<E>() {
priv... | [
"@",
"Override",
"public",
"UnmodListIterator",
"<",
"E",
">",
"listIterator",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"(",
"index",
"<",
"0",
")",
"||",
"(",
"index",
">",
"size",
")",
")",
"{",
"// To match ArrayList and other java.util.List expectations",... | {@inheritDoc} | [
"{"
] | eac0d64b2eb9496967334f635cdb270cffb2197b | https://github.com/GlenKPeterson/Paguro/blob/eac0d64b2eb9496967334f635cdb270cffb2197b/src/main/java/org/organicdesign/fp/collections/PersistentVector.java#L317-L367 | test | Returns an iterator over the elements in this list. | Of course, here is the Java code you requested:
```java
@Override public UnmodListIterator<E> listIterator(int index) {
if( (index < 0) || (index > size) ) {
// To match ArrayList and other java.util.List expectations
throw new IndexOutOfBoundsException("Index: " + index);
}
... |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/serializable/SerialDataContext.java | SerialDataContext.readObject | private void readObject(final java.io.ObjectInputStream in)
throws IOException {
try {
in.defaultReadObject();
Gson objGson = new GsonBuilder().setPrettyPrinting().create();
Type listType = new TypeToken<Map<String, Object>>() {
}.getType();
this.dataContext = objGson.fromJson(mapToJson, list... | java | private void readObject(final java.io.ObjectInputStream in)
throws IOException {
try {
in.defaultReadObject();
Gson objGson = new GsonBuilder().setPrettyPrinting().create();
Type listType = new TypeToken<Map<String, Object>>() {
}.getType();
this.dataContext = objGson.fromJson(mapToJson, list... | [
"private",
"void",
"readObject",
"(",
"final",
"java",
".",
"io",
".",
"ObjectInputStream",
"in",
")",
"throws",
"IOException",
"{",
"try",
"{",
"in",
".",
"defaultReadObject",
"(",
")",
";",
"Gson",
"objGson",
"=",
"new",
"GsonBuilder",
"(",
")",
".",
"... | load the workbook from saving.
@param in
inputstream.
@throws IOException
io exception. | [
"load",
"the",
"workbook",
"from",
"saving",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/serializable/SerialDataContext.java#L66-L80 | test | Read a
PrivateContext object from the given input stream. | Of course, here is the Java code you requested:
```java
private void readObject(final java.io.ObjectInputStream in)
throws IOException {
try {
in.defaultReadObject();
Gson objGson = new GsonBuilder().setPrettyPrinting().create();
Type listType = new TypeToken<Map<String, Object>>() {
}.getType()... |
rupertlssmith/lojix | lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java | Functor.isGround | public boolean isGround()
{
for (int i = 0; i < arity; i++)
{
if (!arguments[i].isGround())
{
return false;
}
}
return true;
} | java | public boolean isGround()
{
for (int i = 0; i < arity; i++)
{
if (!arguments[i].isGround())
{
return false;
}
}
return true;
} | [
"public",
"boolean",
"isGround",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"arity",
";",
"i",
"++",
")",
"{",
"if",
"(",
"!",
"arguments",
"[",
"i",
"]",
".",
"isGround",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
... | Reports whether or not this term is a ground term. Constants (functors of arity zero) and numbers are ground
terms, as are functors all of the arguments of which are ground term.
@return <tt>true</tt> if this functor is a ground term, <tt>false</tt> othewise. | [
"Reports",
"whether",
"or",
"not",
"this",
"term",
"is",
"a",
"ground",
"term",
".",
"Constants",
"(",
"functors",
"of",
"arity",
"zero",
")",
"and",
"numbers",
"are",
"ground",
"terms",
"as",
"are",
"functors",
"all",
"of",
"the",
"arguments",
"of",
"wh... | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java#L130-L141 | test | isGround returns true if the sequence contains a single SECTYPE | Of course, here is the Java code you requested:
```java
public boolean isGround()
{
for (int i = 0; i < arity; i++)
{
if (!arguments[i].isGround())
{
return false;
}
}
return true;
}
```
Hope this helps! |
rest-assured/rest-assured | xml-path/src/main/java/io/restassured/path/xml/XmlPath.java | XmlPath.getByte | public byte getByte(String path) {
Object object = get(path);
return convertObjectTo(object, Byte.class);
} | java | public byte getByte(String path) {
Object object = get(path);
return convertObjectTo(object, Byte.class);
} | [
"public",
"byte",
"getByte",
"(",
"String",
"path",
")",
"{",
"Object",
"object",
"=",
"get",
"(",
"path",
")",
";",
"return",
"convertObjectTo",
"(",
"object",
",",
"Byte",
".",
"class",
")",
";",
"}"
] | Get the result of an XML path expression as a byte. For syntax details please refer to
<a href="http://www.groovy-lang.org/processing-xml.html#_manipulating_xml">this</a> url.
@param path The XML path.
@return The object matching the XML path. A {@link java.lang.ClassCastException} will be thrown if the object
cannot ... | [
"Get",
"the",
"result",
"of",
"an",
"XML",
"path",
"expression",
"as",
"a",
"byte",
".",
"For",
"syntax",
"details",
"please",
"refer",
"to",
"<a",
"href",
"=",
"http",
":",
"//",
"www",
".",
"groovy",
"-",
"lang",
".",
"org",
"/",
"processing",
"-",... | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/xml-path/src/main/java/io/restassured/path/xml/XmlPath.java#L505-L508 | test | Gets a byte value from the cache. | Of course, here is the Java code you requested:
```java
public byte getByte(String path) {
Object object = get(path);
return convertObjectTo(object, Byte.class);
}
```
Hope this helps! |
deliveredtechnologies/rulebook | rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/lang/GivenRuleBuilder.java | GivenRuleBuilder.given | @SafeVarargs
public final GivenRuleBuilder<T, U> given(NameValueReferable... facts) {
_rule.addFacts(facts);
return this;
} | java | @SafeVarargs
public final GivenRuleBuilder<T, U> given(NameValueReferable... facts) {
_rule.addFacts(facts);
return this;
} | [
"@",
"SafeVarargs",
"public",
"final",
"GivenRuleBuilder",
"<",
"T",
",",
"U",
">",
"given",
"(",
"NameValueReferable",
"...",
"facts",
")",
"{",
"_rule",
".",
"addFacts",
"(",
"facts",
")",
";",
"return",
"this",
";",
"}"
] | Adds one or more facts into the Rule.
@param facts one or more facts
@return the current builder object | [
"Adds",
"one",
"or",
"more",
"facts",
"into",
"the",
"Rule",
"."
] | 253738f6bc1e7804bb8649863e969956075a19ae | https://github.com/deliveredtechnologies/rulebook/blob/253738f6bc1e7804bb8649863e969956075a19ae/rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/lang/GivenRuleBuilder.java#L57-L61 | test | Adds a facts to the rule. | Of course, here is the Java code you requested:
```java
@SafeVarargs
public final GivenRuleBuilder<T, U> given(NameValueReferable... facts) {
_rule.addFacts(facts);
return this;
}
```
Hope this helps! |
boonproject/boon | boon/src/main/java/org/boon/sort/Sorting.java | Sorting.compare | public static int compare( Object value1, Object value2, boolean nullsLast ) {
if ( value1 == null && value2 == null ) {
return 0;
} else if ( value1 == null && value2 != null ) {
return nullsLast ? -1 : 1;
} else if ( value1 != null && value2 == null ) {
ret... | java | public static int compare( Object value1, Object value2, boolean nullsLast ) {
if ( value1 == null && value2 == null ) {
return 0;
} else if ( value1 == null && value2 != null ) {
return nullsLast ? -1 : 1;
} else if ( value1 != null && value2 == null ) {
ret... | [
"public",
"static",
"int",
"compare",
"(",
"Object",
"value1",
",",
"Object",
"value2",
",",
"boolean",
"nullsLast",
")",
"{",
"if",
"(",
"value1",
"==",
"null",
"&&",
"value2",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"else",
"if",
"(",
"val... | This compares two values.
If the objects are strings (CharSequence) they are always compared lexicographically.
If the objects are comparable they are always compared using a natural order.
@param value1 value1
@param value2 value2
@param nullsLast put nulls last
@return | [
"This",
"compares",
"two",
"values",
".",
"If",
"the",
"objects",
"are",
"strings",
"(",
"CharSequence",
")",
"they",
"are",
"always",
"compared",
"lexicographically",
".",
"If",
"the",
"objects",
"are",
"comparable",
"they",
"are",
"always",
"compared",
"usin... | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/sort/Sorting.java#L694-L749 | test | Compare two values. | Of course, here is the Java code you requested:
```java
public static int compare( Object value1, Object value2, boolean nullsLast ) {
if ( value1 == null && value2 == null ) {
return 0;
} else if ( value1 == null && value2 != null ) {
return nullsLast ? -1 : 1;
} else ... |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_0.java | OpenImmo_1_2_0.downgradeToPreviousVersion | @Override
public void downgradeToPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_1);
if (doc instanceof OpenImmoTransferDocument) {
try {
this.downgradeUebertragungElements(doc.getDocument());
} catch (Exception ex) {
... | java | @Override
public void downgradeToPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_1);
if (doc instanceof OpenImmoTransferDocument) {
try {
this.downgradeUebertragungElements(doc.getDocument());
} catch (Exception ex) {
... | [
"@",
"Override",
"public",
"void",
"downgradeToPreviousVersion",
"(",
"OpenImmoDocument",
"doc",
")",
"{",
"doc",
".",
"setDocumentVersion",
"(",
"OpenImmoVersion",
".",
"V1_1",
")",
";",
"if",
"(",
"doc",
"instanceof",
"OpenImmoTransferDocument",
")",
"{",
"try",... | Downgrade an OpenImmo document from version 1.2.0 to 1.1.
@param doc OpenImmo document in version 1.2.0 | [
"Downgrade",
"an",
"OpenImmo",
"document",
"from",
"version",
"1",
".",
"2",
".",
"0",
"to",
"1",
".",
"1",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_0.java#L53-L142 | test | Downgrades the contents of an open immo document to the previous version of the immo document. | Of course, here is the Java code you requested:
```java
@Override
public void downgradeToPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_1);
if (doc instanceof OpenImmoTransferDocument) {
try {
this.downgradeUebertragungElements(doc.get... |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/annotation/web/configurers/HeadersConfigurer.java | HeadersConfigurer.createHeaderWriterFilter | private HeaderWriterFilter createHeaderWriterFilter() {
List<HeaderWriter> writers = getHeaderWriters();
if (writers.isEmpty()) {
throw new IllegalStateException(
"Headers security is enabled, but no headers will be added. Either add headers or disable headers security");
}
HeaderWriterFilter headersFil... | java | private HeaderWriterFilter createHeaderWriterFilter() {
List<HeaderWriter> writers = getHeaderWriters();
if (writers.isEmpty()) {
throw new IllegalStateException(
"Headers security is enabled, but no headers will be added. Either add headers or disable headers security");
}
HeaderWriterFilter headersFil... | [
"private",
"HeaderWriterFilter",
"createHeaderWriterFilter",
"(",
")",
"{",
"List",
"<",
"HeaderWriter",
">",
"writers",
"=",
"getHeaderWriters",
"(",
")",
";",
"if",
"(",
"writers",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
... | Creates the {@link HeaderWriter}
@return the {@link HeaderWriter} | [
"Creates",
"the",
"{",
"@link",
"HeaderWriter",
"}"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/configurers/HeadersConfigurer.java#L775-L784 | test | Creates a HeaderWriterFilter. | Of course, here is the Java code you requested:
```java
private HeaderWriterFilter createHeaderWriterFilter() {
List<HeaderWriter> writers = getHeaderWriters();
if (writers.isEmpty()) {
throw new IllegalStateException(
"Headers security is enabled, but no headers will be added. Either add headers or disabl... |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_2.java | OpenImmo_1_2_2.downgradeToPreviousVersion | @Override
public void downgradeToPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_2_1);
if (doc instanceof OpenImmoTransferDocument) {
try {
this.downgradeUebertragungElements(doc.getDocument());
} catch (Exception ex) {
... | java | @Override
public void downgradeToPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_2_1);
if (doc instanceof OpenImmoTransferDocument) {
try {
this.downgradeUebertragungElements(doc.getDocument());
} catch (Exception ex) {
... | [
"@",
"Override",
"public",
"void",
"downgradeToPreviousVersion",
"(",
"OpenImmoDocument",
"doc",
")",
"{",
"doc",
".",
"setDocumentVersion",
"(",
"OpenImmoVersion",
".",
"V1_2_1",
")",
";",
"if",
"(",
"doc",
"instanceof",
"OpenImmoTransferDocument",
")",
"{",
"try... | Downgrade an OpenImmo document from version 1.2.2 to 1.2.1.
@param doc OpenImmo document in version 1.2.2 | [
"Downgrade",
"an",
"OpenImmo",
"document",
"from",
"version",
"1",
".",
"2",
".",
"2",
"to",
"1",
".",
"2",
".",
"1",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_2.java#L52-L176 | test | Downgrades the elements in the document to the previous version of the document. | Of course, here is the Java code you requested:
```java
@Override
public void downgradeToPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_2_1);
if (doc instanceof OpenImmoTransferDocument) {
try {
this.downgradeUebertragungElements(doc.g... |
nyla-solutions/gedi-geode | gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/GemFireJmxClient.java | GemFireJmxClient.listRootRegions | public static Collection<Region<?,?>> listRootRegions(String regionPattern, JMX jmx)
{
//Use JMX to query for distributed regions
//Ex: name GemFire:service=Region,name=/exampleRegion,type=Distributed
String regionJmxPattern = String.format("GemFire:service=Region,name=/%s,type=Distributed",regionPattern);
... | java | public static Collection<Region<?,?>> listRootRegions(String regionPattern, JMX jmx)
{
//Use JMX to query for distributed regions
//Ex: name GemFire:service=Region,name=/exampleRegion,type=Distributed
String regionJmxPattern = String.format("GemFire:service=Region,name=/%s,type=Distributed",regionPattern);
... | [
"public",
"static",
"Collection",
"<",
"Region",
"<",
"?",
",",
"?",
">",
">",
"listRootRegions",
"(",
"String",
"regionPattern",
",",
"JMX",
"jmx",
")",
"{",
"//Use JMX to query for distributed regions",
"//Ex: name GemFire:service=Region,name=/exampleRegion,type=Distribut... | <pre>
List all regions that match a wildcard expression (ex: R*).
Note that special internal regions that begin with the name __ will be skipped.
</pre>
@param regionPattern the region pattern
@param jmx the JMX manager connection
@return the collection of region | [
"<pre",
">",
"List",
"all",
"regions",
"that",
"match",
"a",
"wildcard",
"expression",
"(",
"ex",
":",
"R",
"*",
")",
".",
"Note",
"that",
"special",
"internal",
"regions",
"that",
"begin",
"with",
"the",
"name",
"__",
"will",
"be",
"skipped",
".",
"<"... | 3dd71d6e66e941ce350b306b70677ee95a7d9eee | https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/GemFireJmxClient.java#L295-L350 | test | List all the root regions in the given region pattern. | Of course, here is the Java code you requested:
```java
public static Collection<Region<?,?>> listRootRegions(String regionPattern, JMX jmx)
{
//Use JMX to query for distributed regions
//Ex: name GemFire:service=Region,name=/exampleRegion,type=Distributed
String regionJmxPattern = String.format("GemFire:s... |
eclipse/packagedrone | bundles/org.tukani.xz/src/org/tukaani/xz/FilterOptions.java | FilterOptions.getDecoderMemoryUsage | public static int getDecoderMemoryUsage(FilterOptions[] options) {
int m = 0;
for (int i = 0; i < options.length; ++i)
m += options[i].getDecoderMemoryUsage();
return m;
} | java | public static int getDecoderMemoryUsage(FilterOptions[] options) {
int m = 0;
for (int i = 0; i < options.length; ++i)
m += options[i].getDecoderMemoryUsage();
return m;
} | [
"public",
"static",
"int",
"getDecoderMemoryUsage",
"(",
"FilterOptions",
"[",
"]",
"options",
")",
"{",
"int",
"m",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"options",
".",
"length",
";",
"++",
"i",
")",
"m",
"+=",
"options"... | Gets how much memory the decoder will need with
the given filter chain. This function simply calls
<code>getDecoderMemoryUsage()</code> for every filter
in the array and returns the sum of the returned values. | [
"Gets",
"how",
"much",
"memory",
"the",
"decoder",
"will",
"need",
"with",
"the",
"given",
"filter",
"chain",
".",
"This",
"function",
"simply",
"calls",
"<code",
">",
"getDecoderMemoryUsage",
"()",
"<",
"/",
"code",
">",
"for",
"every",
"filter",
"in",
"t... | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.tukani.xz/src/org/tukaani/xz/FilterOptions.java#L41-L48 | test | Get the memory usage of the decoder. | Of course, here is the Java code you requested:
```java
public static int getDecoderMemoryUsage(FilterOptions[] options) {
int m = 0;
for (int i = 0; i < options.length; ++i)
m += options[i].getDecoderMemoryUsage();
return m;
}
```
Hope this helps! |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/GeometryMetadataDataSource.java | GeometryMetadataDataSource.query | public Cursor query(long geoPackageId, String tableName) {
String selection = GeometryMetadata.COLUMN_GEOPACKAGE_ID
+ " = ? AND " + GeometryMetadata.COLUMN_TABLE_NAME + " = ?";
String[] selectionArgs = new String[]{String.valueOf(geoPackageId), tableName};
Cursor cursor = db.quer... | java | public Cursor query(long geoPackageId, String tableName) {
String selection = GeometryMetadata.COLUMN_GEOPACKAGE_ID
+ " = ? AND " + GeometryMetadata.COLUMN_TABLE_NAME + " = ?";
String[] selectionArgs = new String[]{String.valueOf(geoPackageId), tableName};
Cursor cursor = db.quer... | [
"public",
"Cursor",
"query",
"(",
"long",
"geoPackageId",
",",
"String",
"tableName",
")",
"{",
"String",
"selection",
"=",
"GeometryMetadata",
".",
"COLUMN_GEOPACKAGE_ID",
"+",
"\" = ? AND \"",
"+",
"GeometryMetadata",
".",
"COLUMN_TABLE_NAME",
"+",
"\" = ?\"",
";"... | Query for all table geometry metadata
@param geoPackageId GeoPackage id
@param tableName table name
@return cursor that must be closed | [
"Query",
"for",
"all",
"table",
"geometry",
"metadata"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/GeometryMetadataDataSource.java#L431-L439 | test | Query for the records in the CRS table. | Of course, here is the Java code you requested:
```java
public Cursor query(long geoPackageId, String tableName) {
String selection = GeometryMetadata.COLUMN_GEOPACKAGE_ID
+ " = ? AND " + GeometryMetadata.COLUMN_TABLE_NAME + " = ?";
String[] selectionArgs = new String[]{String.valueOf(g... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/binary/OBinaryComparatorV0.java | OBinaryComparatorV0.isEqual | @Override
public boolean isEqual(final OBinaryField iField1, final OBinaryField iField2) {
final BytesContainer fieldValue1 = iField1.bytes;
final int offset1 = fieldValue1.offset;
final BytesContainer fieldValue2 = iField2.bytes;
final int offset2 = fieldValue2.offset;
try {
switch (iFiel... | java | @Override
public boolean isEqual(final OBinaryField iField1, final OBinaryField iField2) {
final BytesContainer fieldValue1 = iField1.bytes;
final int offset1 = fieldValue1.offset;
final BytesContainer fieldValue2 = iField2.bytes;
final int offset2 = fieldValue2.offset;
try {
switch (iFiel... | [
"@",
"Override",
"public",
"boolean",
"isEqual",
"(",
"final",
"OBinaryField",
"iField1",
",",
"final",
"OBinaryField",
"iField2",
")",
"{",
"final",
"BytesContainer",
"fieldValue1",
"=",
"iField1",
".",
"bytes",
";",
"final",
"int",
"offset1",
"=",
"fieldValue1... | Compares if 2 field values are the same.
@param iField1 First value to compare
@param iField2 Second value to compare
@return true if they match, otherwise false | [
"Compares",
"if",
"2",
"field",
"values",
"are",
"the",
"same",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/binary/OBinaryComparatorV0.java#L81-L632 | test | Checks if two fields are equal. | Of course, here is the Java code you requested:
```java
@Override
public boolean isEqual(final OBinaryField iField1, final OBinaryField iField2) {
final BytesContainer fieldValue1 = iField1.bytes;
final int offset1 = fieldValue1.offset;
final BytesContainer fieldValue2 = iField2.bytes;
final int off... |
basis-technology-corp/tcl-regex-java | src/main/java/com/basistech/tclre/ColorMap.java | ColorMap.okcolors | void okcolors(Nfa nfa) {
ColorDesc cd;
ColorDesc scd;
Arc a;
short sco;
for (short co = 0; co < colorDescs.size(); co++) {
cd = colorDescs.get(co);
if (cd == null) {
continue; // not in use at all, so can't have a subcolor.
}
... | java | void okcolors(Nfa nfa) {
ColorDesc cd;
ColorDesc scd;
Arc a;
short sco;
for (short co = 0; co < colorDescs.size(); co++) {
cd = colorDescs.get(co);
if (cd == null) {
continue; // not in use at all, so can't have a subcolor.
}
... | [
"void",
"okcolors",
"(",
"Nfa",
"nfa",
")",
"{",
"ColorDesc",
"cd",
";",
"ColorDesc",
"scd",
";",
"Arc",
"a",
";",
"short",
"sco",
";",
"for",
"(",
"short",
"co",
"=",
"0",
";",
"co",
"<",
"colorDescs",
".",
"size",
"(",
")",
";",
"co",
"++",
"... | okcolors - promote subcolors to full colors | [
"okcolors",
"-",
"promote",
"subcolors",
"to",
"full",
"colors"
] | de0d5eaccf9a61b694cb8793f234cc229c395b43 | https://github.com/basis-technology-corp/tcl-regex-java/blob/de0d5eaccf9a61b694cb8793f234cc229c395b43/src/main/java/com/basistech/tclre/ColorMap.java#L261-L312 | test | okcolors is called to check if all color descriptors are in use. | Of course, here is the Java code you requested:
```java
void okcolors(Nfa nfa) {
ColorDesc cd;
ColorDesc scd;
Arc a;
short sco;
for (short co = 0; co < colorDescs.size(); co++) {
cd = colorDescs.get(co);
if (cd == null) {
continue; // not... |
spring-projects/spring-security | crypto/src/main/java/org/springframework/security/crypto/encrypt/Encryptors.java | Encryptors.delux | public static TextEncryptor delux(CharSequence password, CharSequence salt) {
return new HexEncodingTextEncryptor(stronger(password, salt));
} | java | public static TextEncryptor delux(CharSequence password, CharSequence salt) {
return new HexEncodingTextEncryptor(stronger(password, salt));
} | [
"public",
"static",
"TextEncryptor",
"delux",
"(",
"CharSequence",
"password",
",",
"CharSequence",
"salt",
")",
"{",
"return",
"new",
"HexEncodingTextEncryptor",
"(",
"stronger",
"(",
"password",
",",
"salt",
")",
")",
";",
"}"
] | Creates a text encryptor that uses "stronger" password-based encryption. Encrypted
text is hex-encoded.
@param password the password used to generate the encryptor's secret key; should
not be shared
@see Encryptors#stronger(CharSequence, CharSequence) | [
"Creates",
"a",
"text",
"encryptor",
"that",
"uses",
"stronger",
"password",
"-",
"based",
"encryption",
".",
"Encrypted",
"text",
"is",
"hex",
"-",
"encoded",
"."
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/crypto/src/main/java/org/springframework/security/crypto/encrypt/Encryptors.java#L77-L79 | test | Create a HexEncodingTextEncryptor that encrypts the given password using the given salt. | Of course, here is the Java code you requested:
```java
public static TextEncryptor delux(CharSequence password, CharSequence salt) {
return new HexEncodingTextEncryptor(stronger(password, salt));
}
```
Hope this helps! |
snakerflow/snakerflow | snaker-core/src/main/java/org/snaker/engine/model/NodeModel.java | NodeModel.execute | public void execute(Execution execution) {
intercept(preInterceptorList, execution);
exec(execution);
intercept(postInterceptorList, execution);
} | java | public void execute(Execution execution) {
intercept(preInterceptorList, execution);
exec(execution);
intercept(postInterceptorList, execution);
} | [
"public",
"void",
"execute",
"(",
"Execution",
"execution",
")",
"{",
"intercept",
"(",
"preInterceptorList",
",",
"execution",
")",
";",
"exec",
"(",
"execution",
")",
";",
"intercept",
"(",
"postInterceptorList",
",",
"execution",
")",
";",
"}"
] | 对执行逻辑增加前置、后置拦截处理
@param execution 执行对象 | [
"对执行逻辑增加前置、后置拦截处理"
] | 9c8cb3148a76702f1eda22f1d113053cb44b1eff | https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/model/NodeModel.java#L79-L83 | test | Execute the interceptor. | Of course, here is the Java code you requested:
```java
public void execute(Execution execution) {
intercept(preInterceptorList, execution);
exec(execution);
intercept(postInterceptorList, execution);
}
```
Hope this helps! |
tony19/logback-android | logback-android/src/main/java/ch/qos/logback/classic/net/server/SSLServerSocketReceiver.java | SSLServerSocketReceiver.getServerSocketFactory | @Override
protected ServerSocketFactory getServerSocketFactory() throws Exception {
if (socketFactory == null) {
SSLContext sslContext = getSsl().createContext(this);
SSLParametersConfiguration parameters = getSsl().getParameters();
parameters.setContext(getContext());
socketFactory = new ... | java | @Override
protected ServerSocketFactory getServerSocketFactory() throws Exception {
if (socketFactory == null) {
SSLContext sslContext = getSsl().createContext(this);
SSLParametersConfiguration parameters = getSsl().getParameters();
parameters.setContext(getContext());
socketFactory = new ... | [
"@",
"Override",
"protected",
"ServerSocketFactory",
"getServerSocketFactory",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"socketFactory",
"==",
"null",
")",
"{",
"SSLContext",
"sslContext",
"=",
"getSsl",
"(",
")",
".",
"createContext",
"(",
"this",
")",
... | {@inheritDoc} | [
"{"
] | 028489c11ccfc1237a53923db06f22a90b41809c | https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/classic/net/server/SSLServerSocketReceiver.java#L40-L50 | test | Get the server socket factory. | Of course, here is the Java code you requested:
```java
@Override
protected ServerSocketFactory getServerSocketFactory() throws Exception {
if (socketFactory == null) {
SSLContext sslContext = getSsl().createContext(this);
SSLParametersConfiguration parameters = getSsl().getParameters();
parame... |
subchen/jetbrick-all-1x | jetbrick-commons/src/main/java/jetbrick/collections/ListUtils.java | ListUtils.asArray | public static <T> T[] asArray(Collection<T> items, Class<T> elementType) {
if (items == null) {
return null;
}
@SuppressWarnings("unchecked")
T[] results = (T[]) Array.newInstance(elementType, items.size());
int i = 0;
for (T item : items) {
result... | java | public static <T> T[] asArray(Collection<T> items, Class<T> elementType) {
if (items == null) {
return null;
}
@SuppressWarnings("unchecked")
T[] results = (T[]) Array.newInstance(elementType, items.size());
int i = 0;
for (T item : items) {
result... | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"asArray",
"(",
"Collection",
"<",
"T",
">",
"items",
",",
"Class",
"<",
"T",
">",
"elementType",
")",
"{",
"if",
"(",
"items",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"@",
"SuppressWa... | ----------------------------------------------------------------------- | [
"-----------------------------------------------------------------------"
] | abe54629a508592287afe5ca4ffc93bf8bf4940c | https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/collections/ListUtils.java#L80-L91 | test | A method to convert a collection of objects to an array of the specified type. | Of course, here is the Java code you requested:
```java
public static <T> T[] asArray(Collection<T> items, Class<T> elementType) {
if (items == null) {
return null;
}
@SuppressWarnings("unchecked")
T[] results = (T[]) Array.newInstance(elementType, items.size());
int... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/NetcdfFileWriter.java | NetcdfFileWriter.write | public void write(String varname, Array values) throws java.io.IOException, InvalidRangeException {
write(findVariable(varname), values);
} | java | public void write(String varname, Array values) throws java.io.IOException, InvalidRangeException {
write(findVariable(varname), values);
} | [
"public",
"void",
"write",
"(",
"String",
"varname",
",",
"Array",
"values",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
",",
"InvalidRangeException",
"{",
"write",
"(",
"findVariable",
"(",
"varname",
")",
",",
"values",
")",
";",
"}"
] | // use these calls to write data to the file | [
"//",
"use",
"these",
"calls",
"to",
"write",
"data",
"to",
"the",
"file"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/NetcdfFileWriter.java#L984-L986 | test | Write a sequence of values to the output stream. | Of course, here is the Java code you requested:
```java
public void write(String varname, Array values) throws java.io.IOException, InvalidRangeException {
write(findVariable(varname), values);
}
```
Hope this helps! |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/db/tool/ODatabaseRepair.java | ODatabaseRepair.fixLink | protected boolean fixLink(final Object fieldValue) {
if (fieldValue instanceof OIdentifiable) {
final ORID id = ((OIdentifiable) fieldValue).getIdentity();
if (id.getClusterId() == 0 && id.getClusterPosition() == 0)
return true;
if (id.isValid())
if (id.isPersistent()) {
... | java | protected boolean fixLink(final Object fieldValue) {
if (fieldValue instanceof OIdentifiable) {
final ORID id = ((OIdentifiable) fieldValue).getIdentity();
if (id.getClusterId() == 0 && id.getClusterPosition() == 0)
return true;
if (id.isValid())
if (id.isPersistent()) {
... | [
"protected",
"boolean",
"fixLink",
"(",
"final",
"Object",
"fieldValue",
")",
"{",
"if",
"(",
"fieldValue",
"instanceof",
"OIdentifiable",
")",
"{",
"final",
"ORID",
"id",
"=",
"(",
"(",
"OIdentifiable",
")",
"fieldValue",
")",
".",
"getIdentity",
"(",
")",
... | Checks if the link must be fixed.
@param fieldValue
Field containing the OIdentifiable (RID or Record)
@return true to fix it, otherwise false | [
"Checks",
"if",
"the",
"link",
"must",
"be",
"fixed",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/db/tool/ODatabaseRepair.java#L131-L147 | test | Fix a link. | Of course, here is the Java code you requested:
```java
protected boolean fixLink(final Object fieldValue) {
if (fieldValue instanceof OIdentifiable) {
final ORID id = ((OIdentifiable) fieldValue).getIdentity();
if (id.getClusterId() == 0 && id.getClusterPosition() == 0)
return true;
if... |
jkuhnert/ognl | src/main/java/ognl/OgnlRuntime.java | OgnlRuntime.getChildSource | public static String getChildSource(OgnlContext context, Object target, Node child)
throws OgnlException
{
return getChildSource(context, target, child, false);
} | java | public static String getChildSource(OgnlContext context, Object target, Node child)
throws OgnlException
{
return getChildSource(context, target, child, false);
} | [
"public",
"static",
"String",
"getChildSource",
"(",
"OgnlContext",
"context",
",",
"Object",
"target",
",",
"Node",
"child",
")",
"throws",
"OgnlException",
"{",
"return",
"getChildSource",
"(",
"context",
",",
"target",
",",
"child",
",",
"false",
")",
";",
... | Attempts to get the java source string represented by the specific child expression
via the {@link JavaSource#toGetSourceString(OgnlContext,Object)} interface method.
@param context The ognl context to pass to the child.
@param target The current object target to use.
@param child The child expression.
@return The ... | [
"Attempts",
"to",
"get",
"the",
"java",
"source",
"string",
"represented",
"by",
"the",
"specific",
"child",
"expression",
"via",
"the",
"{",
"@link",
"JavaSource#toGetSourceString",
"(",
"OgnlContext",
"Object",
")",
"}",
"interface",
"method",
"."
] | 53d51a30c8c299b750dede779d05cb84beee73c3 | https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/OgnlRuntime.java#L3206-L3210 | test | Get the source of the child node. | Of course, here is the Java code you requested:
```java
public static String getChildSource(OgnlContext context, Object target, Node child)
throws OgnlException
{
return getChildSource(context, target, child, false);
}
```
Hope this helps! |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/record/impl/ODocumentHelper.java | ODocumentHelper.hasSameContentOf | @SuppressWarnings("unchecked")
public static boolean hasSameContentOf(final ODocument iCurrent, final ODatabaseDocumentInternal iMyDb, final ODocument iOther,
final ODatabaseDocumentInternal iOtherDb, RIDMapper ridMapper) {
return hasSameContentOf(iCurrent, iMyDb, iOther, iOtherDb, ridMapper, true);
} | java | @SuppressWarnings("unchecked")
public static boolean hasSameContentOf(final ODocument iCurrent, final ODatabaseDocumentInternal iMyDb, final ODocument iOther,
final ODatabaseDocumentInternal iOtherDb, RIDMapper ridMapper) {
return hasSameContentOf(iCurrent, iMyDb, iOther, iOtherDb, ridMapper, true);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"boolean",
"hasSameContentOf",
"(",
"final",
"ODocument",
"iCurrent",
",",
"final",
"ODatabaseDocumentInternal",
"iMyDb",
",",
"final",
"ODocument",
"iOther",
",",
"final",
"ODatabaseDocumentInterna... | Makes a deep comparison field by field to check if the passed ODocument instance is identical as identity and content to the
current one. Instead equals() just checks if the RID are the same.
@param iOther ODocument instance
@return true if the two document are identical, otherwise false
@see #equals(Object) | [
"Makes",
"a",
"deep",
"comparison",
"field",
"by",
"field",
"to",
"check",
"if",
"the",
"passed",
"ODocument",
"instance",
"is",
"identical",
"as",
"identity",
"and",
"content",
"to",
"the",
"current",
"one",
".",
"Instead",
"equals",
"()",
"just",
"checks",... | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/record/impl/ODocumentHelper.java#L1022-L1026 | test | Returns true if the current document has the same content as the other document. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public static boolean hasSameContentOf(final ODocument iCurrent, final ODatabaseDocumentInternal iMyDb, final ODocument iOther,
final ODatabaseDocumentInternal iOtherDb, RIDMapper ridMapper) {
return hasSameContentOf(... |
orientechnologies/orientdb | graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientEdge.java | OrientEdge.getProperty | @Override
public <T> T getProperty(final String key) {
setCurrentGraphInThreadLocal();
if (rawElement == null)
// LIGHTWEIGHT EDGE
return null;
return super.getProperty(key);
} | java | @Override
public <T> T getProperty(final String key) {
setCurrentGraphInThreadLocal();
if (rawElement == null)
// LIGHTWEIGHT EDGE
return null;
return super.getProperty(key);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"getProperty",
"(",
"final",
"String",
"key",
")",
"{",
"setCurrentGraphInThreadLocal",
"(",
")",
";",
"if",
"(",
"rawElement",
"==",
"null",
")",
"// LIGHTWEIGHT EDGE",
"return",
"null",
";",
"return",
"super",... | Returns a Property value.
@param key Property name
@return Property value if any, otherwise NULL. | [
"Returns",
"a",
"Property",
"value",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientEdge.java#L272-L281 | test | Override getProperty to return null if the property is not set. | Of course, here is the Java code you requested:
```java
@Override
public <T> T getProperty(final String key) {
setCurrentGraphInThreadLocal();
if (rawElement == null)
// LIGHTWEIGHT EDGE
return null;
return super.getProperty(key);
}
```
Hope this helps! |
kiegroup/droolsjbpm-tools | drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/http/client/HttpConnection.java | HttpConnection.getInputStream | public InputStream getInputStream() throws IOException {
if (is != null)
return is;
sendRequest();
String transferEncoding = responseHeader.getFieldValue("Transfer-Encoding"); //$NON-NLS-1$
String contentLength = responseHeader.getFieldValue("Content-Length"); //$NON-NLS-1$
... | java | public InputStream getInputStream() throws IOException {
if (is != null)
return is;
sendRequest();
String transferEncoding = responseHeader.getFieldValue("Transfer-Encoding"); //$NON-NLS-1$
String contentLength = responseHeader.getFieldValue("Content-Length"); //$NON-NLS-1$
... | [
"public",
"InputStream",
"getInputStream",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"is",
"!=",
"null",
")",
"return",
"is",
";",
"sendRequest",
"(",
")",
";",
"String",
"transferEncoding",
"=",
"responseHeader",
".",
"getFieldValue",
"(",
"\"Transfe... | Returns this connection's <code>InputStream</code>.
@return this connection's <code>InputStream</code>
@exception IOException if an I/O error occurs while sending the
request | [
"Returns",
"this",
"connection",
"s",
"<code",
">",
"InputStream<",
"/",
"code",
">",
"."
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/http/client/HttpConnection.java#L705-L728 | test | Get an InputStream for the response. | Of course, here is the Java code you requested:
```java
public InputStream getInputStream() throws IOException {
if (is != null)
return is;
sendRequest();
String transferEncoding = responseHeader.getFieldValue("Transfer-Encoding"); //$NON-NLS-1$
String contentLength = respon... |
eclipse/packagedrone | bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspRuntimeContext.java | JspRuntimeContext.initClassPath | private void initClassPath() {
/* Classpath can be specified in one of two ways, depending on
whether the compilation is embedded or invoked from Jspc.
1. Calculated by the web container, and passed to Jasper in the
context attribute.
2. Jspc directly invoke JspCo... | java | private void initClassPath() {
/* Classpath can be specified in one of two ways, depending on
whether the compilation is embedded or invoked from Jspc.
1. Calculated by the web container, and passed to Jasper in the
context attribute.
2. Jspc directly invoke JspCo... | [
"private",
"void",
"initClassPath",
"(",
")",
"{",
"/* Classpath can be specified in one of two ways, depending on\n whether the compilation is embedded or invoked from Jspc.\n 1. Calculated by the web container, and passed to Jasper in the\n context attribute.\n ... | Method used to initialize classpath for compiles. | [
"Method",
"used",
"to",
"initialize",
"classpath",
"for",
"compiles",
"."
] | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspRuntimeContext.java#L492-L527 | test | Initialize the classpath. | Of course, here is the Java code you requested:
```java
private void initClassPath() {
/* Classpath can be specified in one of two ways, depending on
whether the compilation is embedded or invoked from Jspc.
1. Calculated by the web container, and passed to Jasper in the
co... |
dschulten/hydra-java | spring-hateoas-ext/src/main/java/de/escalon/hypermedia/spring/AffordanceBuilder.java | AffordanceBuilder.build | public Affordance build() {
Assert.state(!(rels.isEmpty() && reverseRels.isEmpty()),
"no rels or reverse rels found, call rel() or rev() before building the affordance");
final Affordance affordance;
affordance = new Affordance(new PartialUriTemplate(this.toString()), actionDescr... | java | public Affordance build() {
Assert.state(!(rels.isEmpty() && reverseRels.isEmpty()),
"no rels or reverse rels found, call rel() or rev() before building the affordance");
final Affordance affordance;
affordance = new Affordance(new PartialUriTemplate(this.toString()), actionDescr... | [
"public",
"Affordance",
"build",
"(",
")",
"{",
"Assert",
".",
"state",
"(",
"!",
"(",
"rels",
".",
"isEmpty",
"(",
")",
"&&",
"reverseRels",
".",
"isEmpty",
"(",
")",
")",
",",
"\"no rels or reverse rels found, call rel() or rev() before building the affordance\"",... | Builds affordance with one or multiple rels which must have been defined previously using {@link #rel(String)} or
{@link #reverseRel(String, String)}. <p>The motivation for multiple rels is this statement in the web linking
rfc-5988: "Note that link-values can convey multiple links between the same target and cont... | [
"Builds",
"affordance",
"with",
"one",
"or",
"multiple",
"rels",
"which",
"must",
"have",
"been",
"defined",
"previously",
"using",
"{",
"@link",
"#rel",
"(",
"String",
")",
"}",
"or",
"{",
"@link",
"#reverseRel",
"(",
"String",
"String",
")",
"}",
".",
... | 21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a | https://github.com/dschulten/hydra-java/blob/21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a/spring-hateoas-ext/src/main/java/de/escalon/hypermedia/spring/AffordanceBuilder.java#L187-L204 | test | Build the affordance. | Of course, here is the Java code you requested:
```java
public Affordance build() {
Assert.state(!(rels.isEmpty() && reverseRels.isEmpty()),
"no rels or reverse rels found, call rel() or rev() before building the affordance");
final Affordance affordance;
affordance = new Afford... |
vdmeer/execs | src/main/java/de/vandermeer/execs/ExecS.java | ExecS.setJarFilter | protected final void setJarFilter(String[] filter){
this.jarFilter = (filter==null)?null:Collections.unmodifiableList(Arrays.asList(filter));
} | java | protected final void setJarFilter(String[] filter){
this.jarFilter = (filter==null)?null:Collections.unmodifiableList(Arrays.asList(filter));
} | [
"protected",
"final",
"void",
"setJarFilter",
"(",
"String",
"[",
"]",
"filter",
")",
"{",
"this",
".",
"jarFilter",
"=",
"(",
"filter",
"==",
"null",
")",
"?",
"null",
":",
"Collections",
".",
"unmodifiableList",
"(",
"Arrays",
".",
"asList",
"(",
"filt... | Sets the jar filter for the executor.
This filter can contain any name of a jar file that should be considered during search.
If not set, no filter is applied. If the argument is null, no filter is used. Otherwise, all
strings in the argument are used as jar files and only those jar files will be used in a search.
Usin... | [
"Sets",
"the",
"jar",
"filter",
"for",
"the",
"executor",
".",
"This",
"filter",
"can",
"contain",
"any",
"name",
"of",
"a",
"jar",
"file",
"that",
"should",
"be",
"considered",
"during",
"search",
".",
"If",
"not",
"set",
"no",
"filter",
"is",
"applied"... | ac73170bfd449de1f460248d56ece57ff3b0c761 | https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/ExecS.java#L110-L112 | test | Sets the jar filter. | Of course, here is the Java code you requested:
```java
protected final void setJarFilter(String[] filter){
this.jarFilter = (filter==null)?null:Collections.unmodifiableList(Arrays.asList(filter));
}
```
Hope this helps! |
oblac/jodd | jodd-db/src/main/java/jodd/db/DbCallResult.java | DbCallResult.getDouble | public double getDouble(final int index) {
try {
return statement.getDouble(index);
} catch (SQLException sex) {
throw newGetParamError(index, sex);
}
} | java | public double getDouble(final int index) {
try {
return statement.getDouble(index);
} catch (SQLException sex) {
throw newGetParamError(index, sex);
}
} | [
"public",
"double",
"getDouble",
"(",
"final",
"int",
"index",
")",
"{",
"try",
"{",
"return",
"statement",
".",
"getDouble",
"(",
"index",
")",
";",
"}",
"catch",
"(",
"SQLException",
"sex",
")",
"{",
"throw",
"newGetParamError",
"(",
"index",
",",
"sex... | ---------------------------------------------------------------- doublw | [
"----------------------------------------------------------------",
"doublw"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/DbCallResult.java#L149-L155 | test | Gets a double value from the designated column. | Of course, here is the Java code you requested:
```java
public double getDouble(final int index) {
try {
return statement.getDouble(index);
} catch (SQLException sex) {
throw newGetParamError(index, sex);
}
}
```
Hope this helps! |
1gravity/Android-RTEditor | RTEditor/src/main/java/com/onegravity/rteditor/media/crop/BitmapManager.java | BitmapManager.canThreadDecoding | public synchronized boolean canThreadDecoding(Thread t) {
ThreadStatus status = mThreadStatus.get(t);
if (status == null) {
// allow decoding by default
return true;
}
return (status.mState != State.CANCEL);
} | java | public synchronized boolean canThreadDecoding(Thread t) {
ThreadStatus status = mThreadStatus.get(t);
if (status == null) {
// allow decoding by default
return true;
}
return (status.mState != State.CANCEL);
} | [
"public",
"synchronized",
"boolean",
"canThreadDecoding",
"(",
"Thread",
"t",
")",
"{",
"ThreadStatus",
"status",
"=",
"mThreadStatus",
".",
"get",
"(",
"t",
")",
";",
"if",
"(",
"status",
"==",
"null",
")",
"{",
"// allow decoding by default",
"return",
"true... | The following three methods are used to keep track of which thread is
being disabled for bitmap decoding. | [
"The",
"following",
"three",
"methods",
"are",
"used",
"to",
"keep",
"track",
"of",
"which",
"thread",
"is",
"being",
"disabled",
"for",
"bitmap",
"decoding",
"."
] | 9d8fb4bb865b3b3d011e7633afedcdfb8d21754f | https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/media/crop/BitmapManager.java#L144-L152 | test | Check if the thread is allowed to decode by the application. | Of course, here is the Java code you requested:
```java
public synchronized boolean canThreadDecoding(Thread t) {
ThreadStatus status = mThreadStatus.get(t);
if (status == null) {
// allow decoding by default
return true;
}
return (status.mState != State.CANCEL)... |
GlenKPeterson/Paguro | src/main/java/org/organicdesign/fp/xform/Xform.java | Xform._fold | @SuppressWarnings("unchecked")
private static <H> H _fold(Iterable source, Operation[] ops, int opIdx, H ident, Fn2 reducer) {
Object ret = ident;
// This is a label - the first one I have used in Java in years, or maybe ever.
// I'm assuming this is fast, but will have to test to confirm i... | java | @SuppressWarnings("unchecked")
private static <H> H _fold(Iterable source, Operation[] ops, int opIdx, H ident, Fn2 reducer) {
Object ret = ident;
// This is a label - the first one I have used in Java in years, or maybe ever.
// I'm assuming this is fast, but will have to test to confirm i... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"<",
"H",
">",
"H",
"_fold",
"(",
"Iterable",
"source",
",",
"Operation",
"[",
"]",
"ops",
",",
"int",
"opIdx",
",",
"H",
"ident",
",",
"Fn2",
"reducer",
")",
"{",
"Object",
"ret"... | than lazily evaluated and cached linked-list, Sequence model. | [
"than",
"lazily",
"evaluated",
"and",
"cached",
"linked",
"-",
"list",
"Sequence",
"model",
"."
] | eac0d64b2eb9496967334f635cdb270cffb2197b | https://github.com/GlenKPeterson/Paguro/blob/eac0d64b2eb9496967334f635cdb270cffb2197b/src/main/java/org/organicdesign/fp/xform/Xform.java#L473-L508 | test | Fold the source sequence into a single sequence of operations. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
private static <H> H _fold(Iterable source, Operation[] ops, int opIdx, H ident, Fn2 reducer) {
Object ret = ident;
// This is a label - the first one I have used in Java in years, or maybe ever.
// I'm ... |
kocakosm/pitaya | src/org/kocakosm/pitaya/net/URLs.java | URLs.relativize | public static String relativize(URL base, URL full)
{
try {
return base.toURI().relativize(full.toURI())
.normalize().toString();
} catch (URISyntaxException ex) {
throw new IllegalArgumentException(ex);
}
} | java | public static String relativize(URL base, URL full)
{
try {
return base.toURI().relativize(full.toURI())
.normalize().toString();
} catch (URISyntaxException ex) {
throw new IllegalArgumentException(ex);
}
} | [
"public",
"static",
"String",
"relativize",
"(",
"URL",
"base",
",",
"URL",
"full",
")",
"{",
"try",
"{",
"return",
"base",
".",
"toURI",
"(",
")",
".",
"relativize",
"(",
"full",
".",
"toURI",
"(",
")",
")",
".",
"normalize",
"(",
")",
".",
"toStr... | Relativizes the specified full {@code URL} against the given base.
Behaves as {@link java.net.URI#relativize(java.net.URI)}.
@param base the base {@code URL}.
@param full the full {@code URL}.
@return the relativized path.
@throws NullPointerException if one of the arguments is {@code null}.
@throws IllegalArgumentE... | [
"Relativizes",
"the",
"specified",
"full",
"{",
"@code",
"URL",
"}",
"against",
"the",
"given",
"base",
".",
"Behaves",
"as",
"{",
"@link",
"java",
".",
"net",
".",
"URI#relativize",
"(",
"java",
".",
"net",
".",
"URI",
")",
"}",
"."
] | f2b203b6cdb32723bd1249a1325a3bb5918bf99a | https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/net/URLs.java#L69-L77 | test | Relativize a URL to a full URL. | Of course, here is the Java code you requested:
```java
public static String relativize(URL base, URL full)
{
try {
return base.toURI().relativize(full.toURI())
.normalize().toString();
} catch (URISyntaxException ex) {
throw new IllegalArgumentException(ex);
}
}
```
Hope this helps! |
jbundle/util | jbackup/src/main/java/org/jbundle/jbackup/source/FilesystemSource.java | FilesystemSource.next | public SourceFile next() {
if (this.isPend())
return this.getPend();
if (m_iCurrentLevel == -1)
{ // First time
File fileDir = new File(m_strRootPath);
m_iCurrentLevel++;
if (!fileDir.isDirectory())
return null; // Never // pend(don) Return 1 file?
m_rgfileCurrentFilelist[m_iCurrentLevel] = f... | java | public SourceFile next() {
if (this.isPend())
return this.getPend();
if (m_iCurrentLevel == -1)
{ // First time
File fileDir = new File(m_strRootPath);
m_iCurrentLevel++;
if (!fileDir.isDirectory())
return null; // Never // pend(don) Return 1 file?
m_rgfileCurrentFilelist[m_iCurrentLevel] = f... | [
"public",
"SourceFile",
"next",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isPend",
"(",
")",
")",
"return",
"this",
".",
"getPend",
"(",
")",
";",
"if",
"(",
"m_iCurrentLevel",
"==",
"-",
"1",
")",
"{",
"// First time",
"File",
"fileDir",
"=",
"new",
... | Returns the next element in the iteration.
(Returns a SourceFileObject).
@returns the next element in the iteration.
@exception NoSuchElementException iteration has no more elements. | [
"Returns",
"the",
"next",
"element",
"in",
"the",
"iteration",
".",
"(",
"Returns",
"a",
"SourceFileObject",
")",
"."
] | 5af0f2292f56f29f70cbc26d0bfa72f89ae31be0 | https://github.com/jbundle/util/blob/5af0f2292f56f29f70cbc26d0bfa72f89ae31be0/jbackup/src/main/java/org/jbundle/jbackup/source/FilesystemSource.java#L84-L148 | test | Get the next SourceFile in the list. | Of course, here is the Java code you requested:
```java
public SourceFile next() {
if (this.isPend())
return this.getPend();
if (m_iCurrentLevel == -1)
{ // First time
File fileDir = new File(m_strRootPath);
m_iCurrentLevel++;
if (!fileDir.isDirectory())
return null; // Never // pend(don) Retur... |
liveontologies/elk-reasoner | elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/stages/ClassTaxonomyState.java | ClassTaxonomyState.pruneToAdd | private int pruneToAdd() {
final Iterator<IndexedClass> iter = toAdd_.iterator();
int size = 0;
while (iter.hasNext()) {
final IndexedClass cls = iter.next();
/* @formatter:off
*
* Should be pruned when:
* it is not in ontology, or
* it is in the top node, or
* it has super-nodes in tax... | java | private int pruneToAdd() {
final Iterator<IndexedClass> iter = toAdd_.iterator();
int size = 0;
while (iter.hasNext()) {
final IndexedClass cls = iter.next();
/* @formatter:off
*
* Should be pruned when:
* it is not in ontology, or
* it is in the top node, or
* it has super-nodes in tax... | [
"private",
"int",
"pruneToAdd",
"(",
")",
"{",
"final",
"Iterator",
"<",
"IndexedClass",
">",
"iter",
"=",
"toAdd_",
".",
"iterator",
"(",
")",
";",
"int",
"size",
"=",
"0",
";",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",
"final",
"I... | Prunes {@link #toAdd_}.
<p>
<strong>{@code taxonomy_} must not be {@code null}!</strong>
@return The resulting size of {@link #toAdd_}. | [
"Prunes",
"{",
"@link",
"#toAdd_",
"}",
".",
"<p",
">",
"<strong",
">",
"{",
"@code",
"taxonomy_",
"}",
"must",
"not",
"be",
"{",
"@code",
"null",
"}",
"!<",
"/",
"strong",
">"
] | cfbe5279a57e0433d45c1676c7658ddb6e29b9eb | https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/stages/ClassTaxonomyState.java#L198-L246 | test | Prunes all the classes that are not in the to_list. | Of course, here is the Java code you requested:
```java
private int pruneToAdd() {
final Iterator<IndexedClass> iter = toAdd_.iterator();
int size = 0;
while (iter.hasNext()) {
final IndexedClass cls = iter.next();
/* @formatter:off
*
* Should be pruned when:
* it is not in ontology, or
* ... |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.reduce | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Single<R> reduce(R seed, BiFunction<R, ? super T, R> reducer) {
ObjectHelper.requireNonNull(seed, "seed is null");
ObjectHelper.requireNonNull(reducer, "reducer is null");
return RxJavaPlugins.onAssembly(new Obse... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Single<R> reduce(R seed, BiFunction<R, ? super T, R> reducer) {
ObjectHelper.requireNonNull(seed, "seed is null");
ObjectHelper.requireNonNull(reducer, "reducer is null");
return RxJavaPlugins.onAssembly(new Obse... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"<",
"R",
">",
"Single",
"<",
"R",
">",
"reduce",
"(",
"R",
"seed",
",",
"BiFunction",
"<",
"R",
",",
"?",
"super",
"T",
",",
"R",
">",
"r... | Returns a Single that applies a specified accumulator function to the first item emitted by a source
ObservableSource and a specified seed value, then feeds the result of that function along with the second item
emitted by an ObservableSource into the same function, and so on until all items have been emitted by the
fi... | [
"Returns",
"a",
"Single",
"that",
"applies",
"a",
"specified",
"accumulator",
"function",
"to",
"the",
"first",
"item",
"emitted",
"by",
"a",
"source",
"ObservableSource",
"and",
"a",
"specified",
"seed",
"value",
"then",
"feeds",
"the",
"result",
"of",
"that"... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L10345-L10351 | test | Reduces the elements of this sequence by applying the given BiFunction to each element of the sequence. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Single<R> reduce(R seed, BiFunction<R, ? super T, R> reducer) {
ObjectHelper.requireNonNull(seed, "seed is null");
ObjectHelper.requireNonNull(reducer, "reducer is... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.