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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/config/ConfigurationClient.java | ConfigurationClient.getAllConfigurations | public ConfigurationListing getAllConfigurations()
{
Configuration configuration = new Configuration();
if(this.serviceTicket != null)
{
configuration.setServiceTicket(this.serviceTicket);
}
return new ConfigurationListing(this.postJson(
configur... | java | public ConfigurationListing getAllConfigurations()
{
Configuration configuration = new Configuration();
if(this.serviceTicket != null)
{
configuration.setServiceTicket(this.serviceTicket);
}
return new ConfigurationListing(this.postJson(
configur... | [
"public",
"ConfigurationListing",
"getAllConfigurations",
"(",
")",
"{",
"Configuration",
"configuration",
"=",
"new",
"Configuration",
"(",
")",
";",
"if",
"(",
"this",
".",
"serviceTicket",
"!=",
"null",
")",
"{",
"configuration",
".",
"setServiceTicket",
"(",
... | Retrieves all Configurations.
@return All the Configurations. | [
"Retrieves",
"all",
"Configurations",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/config/ConfigurationClient.java#L81-L92 | test | Get all the configuration. | Of course, here is the Java code you requested:
```java
public ConfigurationListing getAllConfigurations()
{
Configuration configuration = new Configuration();
if(this.serviceTicket != null)
{
configuration.setServiceTicket(this.serviceTicket);
}
return new Con... |
OpenEstate/OpenEstate-IO | ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java | ObjectFactory.createPlz | @XmlElementDecl(namespace = "http://www.immoxml.de", name = "plz")
public JAXBElement<String> createPlz(String value) {
return new JAXBElement<String>(_Plz_QNAME, String.class, null, value);
} | java | @XmlElementDecl(namespace = "http://www.immoxml.de", name = "plz")
public JAXBElement<String> createPlz(String value) {
return new JAXBElement<String>(_Plz_QNAME, String.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.immoxml.de\"",
",",
"name",
"=",
"\"plz\"",
")",
"public",
"JAXBElement",
"<",
"String",
">",
"createPlz",
"(",
"String",
"value",
")",
"{",
"return",
"new",
"JAXBElement",
"<",
"String",
">",
"(",
... | Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"String",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L819-L822 | test | Create an instance of a PLZ element. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "plz")
public JAXBElement<String> createPlz(String value) {
return new JAXBElement<String>(_Plz_QNAME, String.class, null, value);
}
```
Hope this helps! |
deeplearning4j/nd4j | nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java | AtomicAllocator.synchronizeHostData | @Override
public void synchronizeHostData(DataBuffer buffer) {
// we don't want non-committed ops left behind
//Nd4j.getExecutioner().push();
// we don't synchronize constant buffers, since we assume they are always valid on host side
if (buffer.isConstant()) {
return;
... | java | @Override
public void synchronizeHostData(DataBuffer buffer) {
// we don't want non-committed ops left behind
//Nd4j.getExecutioner().push();
// we don't synchronize constant buffers, since we assume they are always valid on host side
if (buffer.isConstant()) {
return;
... | [
"@",
"Override",
"public",
"void",
"synchronizeHostData",
"(",
"DataBuffer",
"buffer",
")",
"{",
"// we don't want non-committed ops left behind",
"//Nd4j.getExecutioner().push();",
"// we don't synchronize constant buffers, since we assume they are always valid on host side",
"if",
"(",... | This method should be called to make sure that data on host side is actualized
@param buffer | [
"This",
"method",
"should",
"be",
"called",
"to",
"make",
"sure",
"that",
"data",
"on",
"host",
"side",
"is",
"actualized"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L338-L355 | test | Synchronize the host data of a buffer. | Of course, here is the Java code you requested:
```java
@Override
public void synchronizeHostData(DataBuffer buffer) {
// we don't want non-committed ops left behind
//Nd4j.getExecutioner().push();
// we don't synchronize constant buffers, since we assume they are always valid on host side... |
lessthanoptimal/GeoRegression | main/src/georegression/geometry/ConvertRotation3D_F64.java | ConvertRotation3D_F64.rotationAboutAxis | private static DMatrixRMaj rotationAboutAxis(int axis, double angle, DMatrixRMaj R ) {
switch( axis ) {
case 0:
return ConvertRotation3D_F64.rotX( angle, R );
case 1:
return ConvertRotation3D_F64.rotY( angle, R );
case 2:
return ConvertRotation3D_F64.rotZ( angle, R );
default:
throw new... | java | private static DMatrixRMaj rotationAboutAxis(int axis, double angle, DMatrixRMaj R ) {
switch( axis ) {
case 0:
return ConvertRotation3D_F64.rotX( angle, R );
case 1:
return ConvertRotation3D_F64.rotY( angle, R );
case 2:
return ConvertRotation3D_F64.rotZ( angle, R );
default:
throw new... | [
"private",
"static",
"DMatrixRMaj",
"rotationAboutAxis",
"(",
"int",
"axis",
",",
"double",
"angle",
",",
"DMatrixRMaj",
"R",
")",
"{",
"switch",
"(",
"axis",
")",
"{",
"case",
"0",
":",
"return",
"ConvertRotation3D_F64",
".",
"rotX",
"(",
"angle",
",",
"R... | Creates a rotation matrix about the specified axis.
@param axis 0 = x, 1 = y, 2 = z
@param angle The angle it is rotated by in radians.
@return The 3 by 3 rotation matrix. | [
"Creates",
"a",
"rotation",
"matrix",
"about",
"the",
"specified",
"axis",
"."
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/ConvertRotation3D_F64.java#L656-L670 | test | Convert rotation about axis | Of course, here is the Java code you requested:
```java
private static DMatrixRMaj rotationAboutAxis(int axis, double angle, DMatrixRMaj R ) {
switch( axis ) {
case 0:
return ConvertRotation3D_F64.rotX( angle, R );
case 1:
return ConvertRotation3D_F64.rotY( angle, R );
case 2:
return ConvertRo... |
cologneintelligence/FitGoodies | fitgoodies-db-jdbc/src/main/java/de/cologneintelligence/fitgoodies/database/SetupFixture.java | SetupFixture.connectionString | public void connectionString(final String uri) {
SetupHelper helper = DependencyManager.getOrCreate(SetupHelper.class);
helper.setConnectionString(uri);
} | java | public void connectionString(final String uri) {
SetupHelper helper = DependencyManager.getOrCreate(SetupHelper.class);
helper.setConnectionString(uri);
} | [
"public",
"void",
"connectionString",
"(",
"final",
"String",
"uri",
")",
"{",
"SetupHelper",
"helper",
"=",
"DependencyManager",
".",
"getOrCreate",
"(",
"SetupHelper",
".",
"class",
")",
";",
"helper",
".",
"setConnectionString",
"(",
"uri",
")",
";",
"}"
] | Sets the database connection string to {@code uri}.
The connection string can be received using
{@link SetupHelper#getConnectionString()}.
@param uri the database connectoin string | [
"Sets",
"the",
"database",
"connection",
"string",
"to",
"{",
"@code",
"uri",
"}",
".",
"The",
"connection",
"string",
"can",
"be",
"received",
"using",
"{",
"@link",
"SetupHelper#getConnectionString",
"()",
"}",
"."
] | 834e42d1f41b4b9226060b1e83a80cc69ea88c7b | https://github.com/cologneintelligence/FitGoodies/blob/834e42d1f41b4b9226060b1e83a80cc69ea88c7b/fitgoodies-db-jdbc/src/main/java/de/cologneintelligence/fitgoodies/database/SetupFixture.java#L96-L99 | test | Sets the connection string. | Of course, here is the Java code you requested:
```java
public void connectionString(final String uri) {
SetupHelper helper = DependencyManager.getOrCreate(SetupHelper.class);
helper.setConnectionString(uri);
}
```
Hope this helps! |
deeplearning4j/nd4j | nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java | BigDecimalMath.root | static public BigDecimal root(final int n, final BigDecimal x) {
if (x.compareTo(BigDecimal.ZERO) < 0) {
throw new ArithmeticException("negative argument " + x.toString() + " of root");
}
if (n <= 0) {
throw new ArithmeticException("negative power " + n + " of root");
... | java | static public BigDecimal root(final int n, final BigDecimal x) {
if (x.compareTo(BigDecimal.ZERO) < 0) {
throw new ArithmeticException("negative argument " + x.toString() + " of root");
}
if (n <= 0) {
throw new ArithmeticException("negative power " + n + " of root");
... | [
"static",
"public",
"BigDecimal",
"root",
"(",
"final",
"int",
"n",
",",
"final",
"BigDecimal",
"x",
")",
"{",
"if",
"(",
"x",
".",
"compareTo",
"(",
"BigDecimal",
".",
"ZERO",
")",
"<",
"0",
")",
"{",
"throw",
"new",
"ArithmeticException",
"(",
"\"neg... | The integer root.
@param n the positive argument.
@param x the non-negative argument.
@return The n-th root of the BigDecimal rounded to the precision implied by x, x^(1/n). | [
"The",
"integer",
"root",
"."
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java#L238-L275 | test | Root of a BigDecimal. | Of course, here is the Java code you requested:
```java
static public BigDecimal root(final int n, final BigDecimal x) {
if (x.compareTo(BigDecimal.ZERO) < 0) {
throw new ArithmeticException("negative argument " + x.toString() + " of root");
}
if (n <= 0) {
throw new Ari... |
GojaFramework/goja | goja-web/src/main/java/goja/mvc/render/ftl/kit/DirectiveKit.java | DirectiveKit.setTopBodyForParentBody | public static void setTopBodyForParentBody(TemplateDirectiveBodyOverrideWraper topBody,
TemplateDirectiveBodyOverrideWraper overrideBody) {
TemplateDirectiveBodyOverrideWraper parent = overrideBody;
while (parent.parentBody != null) {
parent = p... | java | public static void setTopBodyForParentBody(TemplateDirectiveBodyOverrideWraper topBody,
TemplateDirectiveBodyOverrideWraper overrideBody) {
TemplateDirectiveBodyOverrideWraper parent = overrideBody;
while (parent.parentBody != null) {
parent = p... | [
"public",
"static",
"void",
"setTopBodyForParentBody",
"(",
"TemplateDirectiveBodyOverrideWraper",
"topBody",
",",
"TemplateDirectiveBodyOverrideWraper",
"overrideBody",
")",
"{",
"TemplateDirectiveBodyOverrideWraper",
"parent",
"=",
"overrideBody",
";",
"while",
"(",
"parent",... | 对指定的Body的渲染器,指定其父亲的内容区域
@param topBody 内容渲染器
@param overrideBody 需要覆盖的内容渲染器 | [
"对指定的Body的渲染器,指定其父亲的内容区域"
] | 77179b495f668fc1fa20accc912991df6bb2d917 | https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-web/src/main/java/goja/mvc/render/ftl/kit/DirectiveKit.java#L106-L113 | test | Sets the top body of the override body. | Of course, here is the Java code you requested:
```java
public static void setTopBodyForParentBody(TemplateDirectiveBodyOverrideWraper topBody,
TemplateDirectiveBodyOverrideWraper overrideBody) {
TemplateDirectiveBodyOverrideWraper parent = overrideBody;
w... |
RestComm/jain-slee | api/jar/src/main/java/javax/slee/management/AlarmDuplicateFilter.java | AlarmDuplicateFilter.clearStaleTimeouts | private void clearStaleTimeouts() {
Iterator iterator = knownAlarms.values().iterator();
long currentTime = System.currentTimeMillis();
while (iterator.hasNext()) {
Long firstSeenTime = (Long)iterator.next();
// if period has expired remove reference to the notification
... | java | private void clearStaleTimeouts() {
Iterator iterator = knownAlarms.values().iterator();
long currentTime = System.currentTimeMillis();
while (iterator.hasNext()) {
Long firstSeenTime = (Long)iterator.next();
// if period has expired remove reference to the notification
... | [
"private",
"void",
"clearStaleTimeouts",
"(",
")",
"{",
"Iterator",
"iterator",
"=",
"knownAlarms",
".",
"values",
"(",
")",
".",
"iterator",
"(",
")",
";",
"long",
"currentTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"while",
"(",
"itera... | private | [
"private"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/api/jar/src/main/java/javax/slee/management/AlarmDuplicateFilter.java#L62-L72 | test | Clear stale timeouts. | Of course, here is the Java code you requested:
```java
private void clearStaleTimeouts() {
Iterator iterator = knownAlarms.values().iterator();
long currentTime = System.currentTimeMillis();
while (iterator.hasNext()) {
Long firstSeenTime = (Long)iterator.next();
// if ... |
Unidata/thredds | cdm/src/main/java/ucar/unidata/geoloc/projection/Gdc_To_Utm_Converter.java | Gdc_To_Utm_Converter.init | protected void init(double a, double f, int zone, boolean isNorth) {
A = a;
F = 1.0 / f; // F is flattening
this.axlon0_deg = (zone * 6 - 183);
this.axlon0 = axlon0_deg * RADIANS_PER_DEGREE;
double polx2b, polx3b, polx4b, polx5b;
// Create the ERM constants.
Eps2 = (F) * (2.0 - ... | java | protected void init(double a, double f, int zone, boolean isNorth) {
A = a;
F = 1.0 / f; // F is flattening
this.axlon0_deg = (zone * 6 - 183);
this.axlon0 = axlon0_deg * RADIANS_PER_DEGREE;
double polx2b, polx3b, polx4b, polx5b;
// Create the ERM constants.
Eps2 = (F) * (2.0 - ... | [
"protected",
"void",
"init",
"(",
"double",
"a",
",",
"double",
"f",
",",
"int",
"zone",
",",
"boolean",
"isNorth",
")",
"{",
"A",
"=",
"a",
";",
"F",
"=",
"1.0",
"/",
"f",
";",
"// F is flattening\r",
"this",
".",
"axlon0_deg",
"=",
"(",
"zone",
"... | _more_
@param a major axis
@param f inverse flattening
@param zone _more_
@param isNorth _more_ | [
"_more_"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/projection/Gdc_To_Utm_Converter.java#L120-L155 | test | Initializes the object with the data from the input parameters. | Of course, here is the Java code you requested:
```java
protected void init(double a, double f, int zone, boolean isNorth) {
A = a;
F = 1.0 / f; // F is flattening
this.axlon0_deg = (zone * 6 - 183);
this.axlon0 = axlon0_deg * RADIANS_PER_DEGREE;
double polx2b, polx3b, polx4b, polx5b;
... |
intellimate/IzouSDK | src/main/java/org/intellimate/izou/sdk/frameworks/permanentSoundOutput/events/MuteEvent.java | MuteEvent.createMuteEvent | public static Optional<MuteEvent> createMuteEvent(Identification source, Identification target) {
if (target == null || target.equals(source))
return Optional.empty();
try {
MuteEvent muteRequest = new MuteEvent(source);
muteRequest.addResource(new SelectorResource(so... | java | public static Optional<MuteEvent> createMuteEvent(Identification source, Identification target) {
if (target == null || target.equals(source))
return Optional.empty();
try {
MuteEvent muteRequest = new MuteEvent(source);
muteRequest.addResource(new SelectorResource(so... | [
"public",
"static",
"Optional",
"<",
"MuteEvent",
">",
"createMuteEvent",
"(",
"Identification",
"source",
",",
"Identification",
"target",
")",
"{",
"if",
"(",
"target",
"==",
"null",
"||",
"target",
".",
"equals",
"(",
"source",
")",
")",
"return",
"Option... | creates a new MuteEvent
@param source the caller
@param target the target who should start playing
@return the optional StartMusicRequest | [
"creates",
"a",
"new",
"MuteEvent"
] | bc8705ad48a6ca12a722f2b787be435949fa5d08 | https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/frameworks/permanentSoundOutput/events/MuteEvent.java#L38-L48 | test | Create a Mute Event object from an Identification. | Of course, here is the Java code you requested:
```java
public static Optional<MuteEvent> createMuteEvent(Identification source, Identification target) {
if (target == null || target.equals(source))
return Optional.empty();
try {
MuteEvent muteRequest = new MuteEvent(source);
... |
robeio/robe | robe-hibernate/src/main/java/io/robe/hibernate/transaction/Transaction.java | Transaction.finish | private void finish() {
try {
if (session != null) {
session.close();
}
} finally {
ManagedSessionContext.unbind(SESSION_FACTORY);
if (!SESSIONS.get().isEmpty()) {
ManagedSessionContext.bind(SESSIONS.get().pop());
... | java | private void finish() {
try {
if (session != null) {
session.close();
}
} finally {
ManagedSessionContext.unbind(SESSION_FACTORY);
if (!SESSIONS.get().isEmpty()) {
ManagedSessionContext.bind(SESSIONS.get().pop());
... | [
"private",
"void",
"finish",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"session",
"!=",
"null",
")",
"{",
"session",
".",
"close",
"(",
")",
";",
"}",
"}",
"finally",
"{",
"ManagedSessionContext",
".",
"unbind",
"(",
"SESSION_FACTORY",
")",
";",
"if",
"(... | Closes and unbinds the current session. <br/>
If {@link ManagedSessionContext} had a session before the current session, re-binds it to {@link ManagedSessionContext} | [
"Closes",
"and",
"unbinds",
"the",
"current",
"session",
".",
"<br",
"/",
">",
"If",
"{"
] | a0a8c7cebd1f70f78cf24a66a002859e937badfe | https://github.com/robeio/robe/blob/a0a8c7cebd1f70f78cf24a66a002859e937badfe/robe-hibernate/src/main/java/io/robe/hibernate/transaction/Transaction.java#L168-L179 | test | Finish the session. | Of course, here is the Java code you requested:
```java
private void finish() {
try {
if (session != null) {
session.close();
}
} finally {
ManagedSessionContext.unbind(SESSION_FACTORY);
if (!SESSIONS.get().isEmpty()) {
Man... |
jkuhnert/ognl | src/main/java/ognl/OgnlRuntime.java | OgnlRuntime.isMoreSpecific | public static final boolean isMoreSpecific(Class[] classes1, Class[] classes2)
{
for (int index = 0, count = classes1.length; index < count; ++index) {
Class c1 = classes1[index], c2 = classes2[index];
if (c1 == c2)
continue;
else if (c1.isPrimitive())
... | java | public static final boolean isMoreSpecific(Class[] classes1, Class[] classes2)
{
for (int index = 0, count = classes1.length; index < count; ++index) {
Class c1 = classes1[index], c2 = classes2[index];
if (c1 == c2)
continue;
else if (c1.isPrimitive())
... | [
"public",
"static",
"final",
"boolean",
"isMoreSpecific",
"(",
"Class",
"[",
"]",
"classes1",
",",
"Class",
"[",
"]",
"classes2",
")",
"{",
"for",
"(",
"int",
"index",
"=",
"0",
",",
"count",
"=",
"classes1",
".",
"length",
";",
"index",
"<",
"count",
... | Tells whether the first array of classes is more specific than the second. Assumes that the
two arrays are of the same length. | [
"Tells",
"whether",
"the",
"first",
"array",
"of",
"classes",
"is",
"more",
"specific",
"than",
"the",
"second",
".",
"Assumes",
"that",
"the",
"two",
"arrays",
"are",
"of",
"the",
"same",
"length",
"."
] | 53d51a30c8c299b750dede779d05cb84beee73c3 | https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/OgnlRuntime.java#L1113-L1129 | test | Is more specific than the two classes? | Of course, here is the Java code you requested:
```java
public static final boolean isMoreSpecific(Class[] classes1, Class[] classes2)
{
for (int index = 0, count = classes1.length; index < count; ++index) {
Class c1 = classes1[index], c2 = classes2[index];
if (c1 == c2)
... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/ft/point/standard/NestedTable.java | NestedTable.isExtra | private boolean isExtra(Variable v) {
return v != null && extras != null && extras.contains(v);
} | java | private boolean isExtra(Variable v) {
return v != null && extras != null && extras.contains(v);
} | [
"private",
"boolean",
"isExtra",
"(",
"Variable",
"v",
")",
"{",
"return",
"v",
"!=",
"null",
"&&",
"extras",
"!=",
"null",
"&&",
"extras",
".",
"contains",
"(",
"v",
")",
";",
"}"
] | Has v already been added to the set of extra variables? | [
"Has",
"v",
"already",
"been",
"added",
"to",
"the",
"set",
"of",
"extra",
"variables?"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/point/standard/NestedTable.java#L169-L171 | test | Returns true if the variable is an extra variable. | Of course, here is the Java code you requested:
```java
private boolean isExtra(Variable v) {
return v != null && extras != null && extras.contains(v);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/iosp/netcdf3/N3outputStreamWriter.java | N3outputStreamWriter.writeDataAll | public void writeDataAll(DataOutputStream stream) throws IOException {
for (Vinfo vinfo : vinfoList) {
if (!vinfo.isRecord) {
Variable v = vinfo.v;
assert filePos == vinfo.offset;
if (debugPos) System.out.println(" writing at "+filePos+" should be "+vinfo.offset+" "+v.getFullName());
... | java | public void writeDataAll(DataOutputStream stream) throws IOException {
for (Vinfo vinfo : vinfoList) {
if (!vinfo.isRecord) {
Variable v = vinfo.v;
assert filePos == vinfo.offset;
if (debugPos) System.out.println(" writing at "+filePos+" should be "+vinfo.offset+" "+v.getFullName());
... | [
"public",
"void",
"writeDataAll",
"(",
"DataOutputStream",
"stream",
")",
"throws",
"IOException",
"{",
"for",
"(",
"Vinfo",
"vinfo",
":",
"vinfoList",
")",
"{",
"if",
"(",
"!",
"vinfo",
".",
"isRecord",
")",
"{",
"Variable",
"v",
"=",
"vinfo",
".",
"v",... | //////////////////////////////////////////////////////////////////////////////////////////////// | [
"////////////////////////////////////////////////////////////////////////////////////////////////"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/netcdf3/N3outputStreamWriter.java#L32-L85 | test | Write all the data in the file to the output stream. | Of course, here is the Java code you requested:
```java
public void writeDataAll(DataOutputStream stream) throws IOException {
for (Vinfo vinfo : vinfoList) {
if (!vinfo.isRecord) {
Variable v = vinfo.v;
assert filePos == vinfo.offset;
if (debugPos) System.out.println(" writing at "+f... |
jcodec/jcodec | src/main/java/org/jcodec/movtool/InplaceMP4Editor.java | InplaceMP4Editor.modify | public boolean modify(File file, MP4Edit edit) throws IOException {
SeekableByteChannel fi = null;
try {
fi = NIOUtils.rwChannel(file);
List<Tuple._2<Atom, ByteBuffer>> fragments = doTheFix(fi, edit);
if (fragments == null)
return false;
... | java | public boolean modify(File file, MP4Edit edit) throws IOException {
SeekableByteChannel fi = null;
try {
fi = NIOUtils.rwChannel(file);
List<Tuple._2<Atom, ByteBuffer>> fragments = doTheFix(fi, edit);
if (fragments == null)
return false;
... | [
"public",
"boolean",
"modify",
"(",
"File",
"file",
",",
"MP4Edit",
"edit",
")",
"throws",
"IOException",
"{",
"SeekableByteChannel",
"fi",
"=",
"null",
";",
"try",
"{",
"fi",
"=",
"NIOUtils",
".",
"rwChannel",
"(",
"file",
")",
";",
"List",
"<",
"Tuple"... | Tries to modify movie header in place according to what's implemented in
the edit, the file gets pysically modified if the operation is
successful. No temporary file is created.
@param file
A file to be modified
@param edit
An edit to be carried out on a movie header
@return Whether or not edit was successful, i.e. wa... | [
"Tries",
"to",
"modify",
"movie",
"header",
"in",
"place",
"according",
"to",
"what",
"s",
"implemented",
"in",
"the",
"edit",
"the",
"file",
"gets",
"pysically",
"modified",
"if",
"the",
"operation",
"is",
"successful",
".",
"No",
"temporary",
"file",
"is",... | cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75 | https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/movtool/InplaceMP4Editor.java#L59-L78 | test | Modify the file. | Of course, here is the Java code you requested:
```java
public boolean modify(File file, MP4Edit edit) throws IOException {
SeekableByteChannel fi = null;
try {
fi = NIOUtils.rwChannel(file);
List<Tuple._2<Atom, ByteBuffer>> fragments = doTheFix(fi, edit);
if (fragm... |
rupertlssmith/lojix | base/common/src/main/com/thesett/common/util/StringUtils.java | StringUtils.convertCase | public static String convertCase(String value, String separator, boolean firstLetterUpper, boolean firstLetterOfWordUpper) {
final StringBuffer result = new StringBuffer();
boolean firstWord = true;
boolean firstLetter = true;
boolean upper = false;
WordMachineState state = Wor... | java | public static String convertCase(String value, String separator, boolean firstLetterUpper, boolean firstLetterOfWordUpper) {
final StringBuffer result = new StringBuffer();
boolean firstWord = true;
boolean firstLetter = true;
boolean upper = false;
WordMachineState state = Wor... | [
"public",
"static",
"String",
"convertCase",
"(",
"String",
"value",
",",
"String",
"separator",
",",
"boolean",
"firstLetterUpper",
",",
"boolean",
"firstLetterOfWordUpper",
")",
"{",
"final",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
")",
";",
... | Converts string between various case forms such as camel case, snake case or kebab case.
<p/>Characters in the string are characterized as whitespace, upper case, or other by the following rules.
<ol>
<li> An upper case letter is marked as upper case (U). </li>
<li> A lower case letter or digit is marked as lower cas... | [
"Converts",
"string",
"between",
"various",
"case",
"forms",
"such",
"as",
"camel",
"case",
"snake",
"case",
"or",
"kebab",
"case",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/StringUtils.java#L237-L321 | test | Convert Case. | Of course, here is the Java code you requested:
```java
public static String convertCase(String value, String separator, boolean firstLetterUpper, boolean firstLetterOfWordUpper) {
final StringBuffer result = new StringBuffer();
boolean firstWord = true;
boolean firstLetter = true;
boo... |
vigna/fastutil | src/it/unimi/dsi/fastutil/io/FastByteArrayInputStream.java | FastByteArrayInputStream.read | @Override
public int read(final byte b[], final int offset, final int length) {
if (this.length == this.position) return length == 0 ? 0 : -1;
final int n = Math.min(length, this.length - this.position);
System.arraycopy(array, this.offset + this.position, b, offset, n);
this.position += n;
return n;
} | java | @Override
public int read(final byte b[], final int offset, final int length) {
if (this.length == this.position) return length == 0 ? 0 : -1;
final int n = Math.min(length, this.length - this.position);
System.arraycopy(array, this.offset + this.position, b, offset, n);
this.position += n;
return n;
} | [
"@",
"Override",
"public",
"int",
"read",
"(",
"final",
"byte",
"b",
"[",
"]",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"length",
")",
"{",
"if",
"(",
"this",
".",
"length",
"==",
"this",
".",
"position",
")",
"return",
"length",
"==",
"... | Reads bytes from this byte-array input stream as
specified in {@link java.io.InputStream#read(byte[], int, int)}.
Note that the implementation given in {@link java.io.ByteArrayInputStream#read(byte[], int, int)}
will return -1 on a zero-length read at EOF, contrarily to the specification. We won't. | [
"Reads",
"bytes",
"from",
"this",
"byte",
"-",
"array",
"input",
"stream",
"as",
"specified",
"in",
"{"
] | 192ce83affa4a6f2ad34a96c15b5f2ec2929cf1c | https://github.com/vigna/fastutil/blob/192ce83affa4a6f2ad34a96c15b5f2ec2929cf1c/src/it/unimi/dsi/fastutil/io/FastByteArrayInputStream.java#L113-L120 | test | Read length bytes from the buffer. | Of course, here is the Java code you requested:
```java
@Override
public int read(final byte b[], final int offset, final int length) {
if (this.length == this.position) return length == 0 ? 0 : -1;
final int n = Math.min(length, this.length - this.position);
System.arraycopy(array, this.offset + this.position,... |
arnohaase/a-foundation | a-foundation/src/main/java/com/ajjpj/afoundation/collection/ACollectionHelper.java | ACollectionHelper.asJavaUtilList | public static <T> List<T> asJavaUtilList(Iterable<T> c) {
if(c instanceof List) {
return (List<T>) c;
}
return asJavaUtilCollection(c.iterator());
} | java | public static <T> List<T> asJavaUtilList(Iterable<T> c) {
if(c instanceof List) {
return (List<T>) c;
}
return asJavaUtilCollection(c.iterator());
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"asJavaUtilList",
"(",
"Iterable",
"<",
"T",
">",
"c",
")",
"{",
"if",
"(",
"c",
"instanceof",
"List",
")",
"{",
"return",
"(",
"List",
"<",
"T",
">",
")",
"c",
";",
"}",
"return",
"asJa... | Returns a <code>Collection</code> with the exact same elements as an <code>Iterable</code>, copying only if the parameter is not a collection. | [
"Returns",
"a",
"<code",
">",
"Collection<",
"/",
"code",
">",
"with",
"the",
"exact",
"same",
"elements",
"as",
"an",
"<code",
">",
"Iterable<",
"/",
"code",
">",
"copying",
"only",
"if",
"the",
"parameter",
"is",
"not",
"a",
"collection",
"."
] | f3eef2ca89d67775f202a4c28140230a6229291e | https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation/src/main/java/com/ajjpj/afoundation/collection/ACollectionHelper.java#L855-L862 | test | As java. util. List. | Of course, here is the Java code you requested:
```java
public static <T> List<T> asJavaUtilList(Iterable<T> c) {
if(c instanceof List) {
return (List<T>) c;
}
return asJavaUtilCollection(c.iterator());
}
```
Hope this helps! |
wildfly/wildfly | iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/jndi/CNNameParser.java | CNNameParser.cosNameToName | static Name cosNameToName(NameComponent[] cname) {
Name nm = new CompositeName();
for (int i = 0; cname != null && i < cname.length; i++) {
try {
nm.add(stringifyComponent(cname[i]));
} catch (InvalidNameException e) {
// ignore
}
... | java | static Name cosNameToName(NameComponent[] cname) {
Name nm = new CompositeName();
for (int i = 0; cname != null && i < cname.length; i++) {
try {
nm.add(stringifyComponent(cname[i]));
} catch (InvalidNameException e) {
// ignore
}
... | [
"static",
"Name",
"cosNameToName",
"(",
"NameComponent",
"[",
"]",
"cname",
")",
"{",
"Name",
"nm",
"=",
"new",
"CompositeName",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"cname",
"!=",
"null",
"&&",
"i",
"<",
"cname",
".",
"length",
";... | Creates a CompositeName from a NameComponent[].
Used by ExceptionMapper and CNBindingEnumeration to convert
a NameComponent[] into a composite name. | [
"Creates",
"a",
"CompositeName",
"from",
"a",
"NameComponent",
"[]",
".",
"Used",
"by",
"ExceptionMapper",
"and",
"CNBindingEnumeration",
"to",
"convert",
"a",
"NameComponent",
"[]",
"into",
"a",
"composite",
"name",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/jndi/CNNameParser.java#L126-L136 | test | Convert a name array to a composite name. | Of course, here is the Java code you requested:
```java
static Name cosNameToName(NameComponent[] cname) {
Name nm = new CompositeName();
for (int i = 0; cname != null && i < cname.length; i++) {
try {
nm.add(stringifyComponent(cname[i]));
} catch (InvalidNameExc... |
subchen/jetbrick-all-1x | jetbrick-commons/src/main/java/jetbrick/beans/ClassLoaderUtils.java | ClassLoaderUtils.loadClass | public static Class<?> loadClass(final String qualifiedClassName, ClassLoader loader) {
try {
return loadClassEx(qualifiedClassName, loader);
} catch (ClassNotFoundException e) {
return null;
}
} | java | public static Class<?> loadClass(final String qualifiedClassName, ClassLoader loader) {
try {
return loadClassEx(qualifiedClassName, loader);
} catch (ClassNotFoundException e) {
return null;
}
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"loadClass",
"(",
"final",
"String",
"qualifiedClassName",
",",
"ClassLoader",
"loader",
")",
"{",
"try",
"{",
"return",
"loadClassEx",
"(",
"qualifiedClassName",
",",
"loader",
")",
";",
"}",
"catch",
"(",
"ClassN... | 使用默认的 ClassLoader 去载入类.
@return null if class not found | [
"使用默认的",
"ClassLoader",
"去载入类",
"."
] | abe54629a508592287afe5ca4ffc93bf8bf4940c | https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/beans/ClassLoaderUtils.java#L62-L68 | test | Load Class. | Of course, here is the Java code you requested:
```java
public static Class<?> loadClass(final String qualifiedClassName, ClassLoader loader) {
try {
return loadClassEx(qualifiedClassName, loader);
} catch (ClassNotFoundException e) {
return null;
}
}
```
Hope this ... |
jkuhnert/ognl | src/main/java/ognl/OgnlParser.java | OgnlParser.equalityExpression | final public void equalityExpression() throws ParseException {
relationalExpression();
label_7:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 15:
case 16:
case 17:
case 18:
;
break;
default:
jj_la1[13] = jj_gen;
break label_7;... | java | final public void equalityExpression() throws ParseException {
relationalExpression();
label_7:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 15:
case 16:
case 17:
case 18:
;
break;
default:
jj_la1[13] = jj_gen;
break label_7;... | [
"final",
"public",
"void",
"equalityExpression",
"(",
")",
"throws",
"ParseException",
"{",
"relationalExpression",
"(",
")",
";",
"label_7",
":",
"while",
"(",
"true",
")",
"{",
"switch",
"(",
"(",
"jj_ntk",
"==",
"-",
"1",
")",
"?",
"jj_ntk",
"(",
")",... | equality/inequality (==/!=) (level 6) | [
"equality",
"/",
"inequality",
"(",
"==",
"/",
"!",
"=",
")",
"(",
"level",
"6",
")"
] | 53d51a30c8c299b750dede779d05cb84beee73c3 | https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/OgnlParser.java#L404-L504 | test | 11. 2 The equality expression | Of course, here is the Java code you requested:
```java
final public void equalityExpression() throws ParseException {
relationalExpression();
label_7:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 15:
case 16:
case 17:
case 18:
;
break;
def... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerCSVAbstract.java | ORecordSerializerCSVAbstract.linkToStream | private static OIdentifiable linkToStream(final StringBuilder buffer, final ODocument iParentRecord, Object iLinked) {
if (iLinked == null)
// NULL REFERENCE
return null;
OIdentifiable resultRid = null;
ORID rid;
if (iLinked instanceof ORID) {
// JUST THE REFERENCE
ri... | java | private static OIdentifiable linkToStream(final StringBuilder buffer, final ODocument iParentRecord, Object iLinked) {
if (iLinked == null)
// NULL REFERENCE
return null;
OIdentifiable resultRid = null;
ORID rid;
if (iLinked instanceof ORID) {
// JUST THE REFERENCE
ri... | [
"private",
"static",
"OIdentifiable",
"linkToStream",
"(",
"final",
"StringBuilder",
"buffer",
",",
"final",
"ODocument",
"iParentRecord",
",",
"Object",
"iLinked",
")",
"{",
"if",
"(",
"iLinked",
"==",
"null",
")",
"// NULL REFERENCE\r",
"return",
"null",
";",
... | Serialize the link.
@param buffer
@param iParentRecord
@param iLinked Can be an instance of ORID or a Record<?>
@return | [
"Serialize",
"the",
"link",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerCSVAbstract.java#L64-L107 | test | Link to stream. | Of course, here is the Java code you requested:
```java
private static OIdentifiable linkToStream(final StringBuilder buffer, final ODocument iParentRecord, Object iLinked) {
if (iLinked == null)
// NULL REFERENCE
return null;
OIdentifiable resultRid = null;
ORID rid;
if (iLinked ... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/geoloc/NavigatedPanel.java | NavigatedPanel.setLatLonCenterMapArea | public void setLatLonCenterMapArea( double lat, double lon) {
ProjectionPoint center = project.latLonToProj(lat, lon);
ProjectionRect ma = getMapArea();
ma.setX( center.getX() - ma.getWidth()/2);
ma.setY( center.getY() - ma.getHeight()/2);
setMapArea(ma);
} | java | public void setLatLonCenterMapArea( double lat, double lon) {
ProjectionPoint center = project.latLonToProj(lat, lon);
ProjectionRect ma = getMapArea();
ma.setX( center.getX() - ma.getWidth()/2);
ma.setY( center.getY() - ma.getHeight()/2);
setMapArea(ma);
} | [
"public",
"void",
"setLatLonCenterMapArea",
"(",
"double",
"lat",
",",
"double",
"lon",
")",
"{",
"ProjectionPoint",
"center",
"=",
"project",
".",
"latLonToProj",
"(",
"lat",
",",
"lon",
")",
";",
"ProjectionRect",
"ma",
"=",
"getMapArea",
"(",
")",
";",
... | set the center point of the MapArea | [
"set",
"the",
"center",
"point",
"of",
"the",
"MapArea"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/geoloc/NavigatedPanel.java#L338-L346 | test | Set the map area of the map from the lat lon coordinate system. | Of course, here is the Java code you requested:
```java
public void setLatLonCenterMapArea( double lat, double lon) {
ProjectionPoint center = project.latLonToProj(lat, lon);
ProjectionRect ma = getMapArea();
ma.setX( center.getX() - ma.getWidth()/2);
ma.setY( center.getY() - ma.getHeight()/2);
s... |
spring-projects/spring-security | samples/xml/contacts/src/main/java/sample/contact/AddDeleteContactController.java | AddDeleteContactController.addContact | @RequestMapping(value = "/secure/add.htm", method = RequestMethod.POST)
public String addContact(WebContact form, BindingResult result) {
validator.validate(form, result);
if (result.hasErrors()) {
return "add";
}
Contact contact = new Contact(form.getName(), form.getEmail());
contactManager.create(cont... | java | @RequestMapping(value = "/secure/add.htm", method = RequestMethod.POST)
public String addContact(WebContact form, BindingResult result) {
validator.validate(form, result);
if (result.hasErrors()) {
return "add";
}
Contact contact = new Contact(form.getName(), form.getEmail());
contactManager.create(cont... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/secure/add.htm\"",
",",
"method",
"=",
"RequestMethod",
".",
"POST",
")",
"public",
"String",
"addContact",
"(",
"WebContact",
"form",
",",
"BindingResult",
"result",
")",
"{",
"validator",
".",
"validate",
"(",
"f... | Handles the submission of the contact form, creating a new instance if the username
and email are valid. | [
"Handles",
"the",
"submission",
"of",
"the",
"contact",
"form",
"creating",
"a",
"new",
"instance",
"if",
"the",
"username",
"and",
"email",
"are",
"valid",
"."
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/samples/xml/contacts/src/main/java/sample/contact/AddDeleteContactController.java#L57-L69 | test | Add a new contact to the security system | Of course, here is the Java code you requested:
```java
@RequestMapping(value = "/secure/add.htm", method = RequestMethod.POST)
public String addContact(WebContact form, BindingResult result) {
validator.validate(form, result);
if (result.hasErrors()) {
return "add";
}
Contact contact = new Contact(form.... |
streamsets/datacollector | salesforce-lib/src/main/java/com/streamsets/pipeline/stage/origin/salesforce/ForceSource.java | ForceSource.produce | @Override
public String produce(String lastSourceOffset, int maxBatchSize, BatchMaker batchMaker) throws StageException {
String nextSourceOffset = null;
LOG.debug("lastSourceOffset: {}", lastSourceOffset);
// send event only once for each time we run out of data.
if(shouldSendNoMoreDataEvent) {
... | java | @Override
public String produce(String lastSourceOffset, int maxBatchSize, BatchMaker batchMaker) throws StageException {
String nextSourceOffset = null;
LOG.debug("lastSourceOffset: {}", lastSourceOffset);
// send event only once for each time we run out of data.
if(shouldSendNoMoreDataEvent) {
... | [
"@",
"Override",
"public",
"String",
"produce",
"(",
"String",
"lastSourceOffset",
",",
"int",
"maxBatchSize",
",",
"BatchMaker",
"batchMaker",
")",
"throws",
"StageException",
"{",
"String",
"nextSourceOffset",
"=",
"null",
";",
"LOG",
".",
"debug",
"(",
"\"las... | {@inheritDoc} | [
"{"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/salesforce-lib/src/main/java/com/streamsets/pipeline/stage/origin/salesforce/ForceSource.java#L458-L508 | test | This method is called by the base class to produce a sequence of events. | Of course, here is the Java code you requested:
```java
@Override
public String produce(String lastSourceOffset, int maxBatchSize, BatchMaker batchMaker) throws StageException {
String nextSourceOffset = null;
LOG.debug("lastSourceOffset: {}", lastSourceOffset);
// send event only once for each time we... |
jcodec/jcodec | src/main/java/net/sourceforge/jaad/aac/sbr/SBR.java | SBR.sbr_single_channel_element | private int sbr_single_channel_element(IBitStream ld) throws AACException {
int result;
if(ld.readBool()) {
ld.readBits(4); //reserved
}
if((result = sbr_grid(ld, 0))>0)
return result;
sbr_dtdf(ld, 0);
invf_mode(ld, 0);
sbr_envelope(ld, 0);
sbr_noise(ld, 0);
NoiseEnvelope.dequantChannel(this... | java | private int sbr_single_channel_element(IBitStream ld) throws AACException {
int result;
if(ld.readBool()) {
ld.readBits(4); //reserved
}
if((result = sbr_grid(ld, 0))>0)
return result;
sbr_dtdf(ld, 0);
invf_mode(ld, 0);
sbr_envelope(ld, 0);
sbr_noise(ld, 0);
NoiseEnvelope.dequantChannel(this... | [
"private",
"int",
"sbr_single_channel_element",
"(",
"IBitStream",
"ld",
")",
"throws",
"AACException",
"{",
"int",
"result",
";",
"if",
"(",
"ld",
".",
"readBool",
"(",
")",
")",
"{",
"ld",
".",
"readBits",
"(",
"4",
")",
";",
"//reserved",
"}",
"if",
... | /* table 5 | [
"/",
"*",
"table",
"5"
] | cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75 | https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/net/sourceforge/jaad/aac/sbr/SBR.java#L571-L640 | test | SBR Single Channel Element | Of course, here is the Java code you requested:
```java
private int sbr_single_channel_element(IBitStream ld) throws AACException {
int result;
if(ld.readBool()) {
ld.readBits(4); //reserved
}
if((result = sbr_grid(ld, 0))>0)
return result;
sbr_dtdf(ld, 0);
invf_mode(ld, 0);
sbr_envelope(ld, 0);... |
Unidata/thredds | legacy/src/main/java/ucar/nc2/NetcdfFileWriteable.java | NetcdfFileWriteable.addDimension | public Dimension addDimension(String dimName, int length) {
if (!defineMode)
throw new UnsupportedOperationException("not in define mode");
if (length <= 0)
throw new IllegalArgumentException("dimension length must be > 0 :"+length);
if (!N3iosp.isValidNetcdfObjectName(dimName))
throw new ... | java | public Dimension addDimension(String dimName, int length) {
if (!defineMode)
throw new UnsupportedOperationException("not in define mode");
if (length <= 0)
throw new IllegalArgumentException("dimension length must be > 0 :"+length);
if (!N3iosp.isValidNetcdfObjectName(dimName))
throw new ... | [
"public",
"Dimension",
"addDimension",
"(",
"String",
"dimName",
",",
"int",
"length",
")",
"{",
"if",
"(",
"!",
"defineMode",
")",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"not in define mode\"",
")",
";",
"if",
"(",
"length",
"<=",
"0",
")",
... | Add a Dimension to the file. Must be in define mode.
@param dimName name of dimension
@param length size of dimension.
@return the created dimension | [
"Add",
"a",
"Dimension",
"to",
"the",
"file",
".",
"Must",
"be",
"in",
"define",
"mode",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/ucar/nc2/NetcdfFileWriteable.java#L215-L226 | test | Add a dimension to the image. | Of course, here is the Java code you requested:
```java
public Dimension addDimension(String dimName, int length) {
if (!defineMode)
throw new UnsupportedOperationException("not in define mode");
if (length <= 0)
throw new IllegalArgumentException("dimension length must be > 0 :"+length);
if (!... |
oblac/jodd | jodd-lagarto/src/main/java/jodd/lagarto/Scanner.java | Scanner.charSequence | protected final CharSequence charSequence(final int from, final int to) {
if (from == to) {
return CharArraySequence.EMPTY;
}
return CharArraySequence.of(input, from, to - from);
} | java | protected final CharSequence charSequence(final int from, final int to) {
if (from == to) {
return CharArraySequence.EMPTY;
}
return CharArraySequence.of(input, from, to - from);
} | [
"protected",
"final",
"CharSequence",
"charSequence",
"(",
"final",
"int",
"from",
",",
"final",
"int",
"to",
")",
"{",
"if",
"(",
"from",
"==",
"to",
")",
"{",
"return",
"CharArraySequence",
".",
"EMPTY",
";",
"}",
"return",
"CharArraySequence",
".",
"of"... | Creates char sub-sequence from the input. | [
"Creates",
"char",
"sub",
"-",
"sequence",
"from",
"the",
"input",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/lagarto/Scanner.java#L138-L143 | test | Returns a char sequence of characters from the specified range. | Of course, here is the Java code you requested:
```java
protected final CharSequence charSequence(final int from, final int to) {
if (from == to) {
return CharArraySequence.EMPTY;
}
return CharArraySequence.of(input, from, to - from);
}
```
Hope this helps! |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java | SameDiff.execBackwards | public Pair<Map<SDVariable, DifferentialFunction>, List<DifferentialFunction>> execBackwards() {
final SameDiff outer = this;
if (getFunction("grad") == null)
defineFunction("grad", new SameDiffFunctionDefinition() {
@Override
public SDVariable[] define(Same... | java | public Pair<Map<SDVariable, DifferentialFunction>, List<DifferentialFunction>> execBackwards() {
final SameDiff outer = this;
if (getFunction("grad") == null)
defineFunction("grad", new SameDiffFunctionDefinition() {
@Override
public SDVariable[] define(Same... | [
"public",
"Pair",
"<",
"Map",
"<",
"SDVariable",
",",
"DifferentialFunction",
">",
",",
"List",
"<",
"DifferentialFunction",
">",
">",
"execBackwards",
"(",
")",
"{",
"final",
"SameDiff",
"outer",
"=",
"this",
";",
"if",
"(",
"getFunction",
"(",
"\"grad\"",
... | Builds a backwards graph
and executes the operations
on that graph.
@return | [
"Builds",
"a",
"backwards",
"graph",
"and",
"executes",
"the",
"operations",
"on",
"that",
"graph",
"."
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L5122-L5225 | test | Execute backward operation | Of course, here is the Java code you requested:
```java
public Pair<Map<SDVariable, DifferentialFunction>, List<DifferentialFunction>> execBackwards() {
final SameDiff outer = this;
if (getFunction("grad") == null)
defineFunction("grad", new SameDiffFunctionDefinition() {
... |
orientechnologies/orientdb | object/src/main/java/com/orientechnologies/orient/object/db/OObjectDatabaseTx.java | OObjectDatabaseTx.convertParameter | protected Object convertParameter(final Object iParameter) {
if (iParameter != null)
// FILTER PARAMETERS
if (iParameter instanceof Map<?, ?>) {
Map<String, Object> map = (Map<String, Object>) iParameter;
for (Map.Entry<String, Object> e : map.entrySet()) {
map.put(e.ge... | java | protected Object convertParameter(final Object iParameter) {
if (iParameter != null)
// FILTER PARAMETERS
if (iParameter instanceof Map<?, ?>) {
Map<String, Object> map = (Map<String, Object>) iParameter;
for (Map.Entry<String, Object> e : map.entrySet()) {
map.put(e.ge... | [
"protected",
"Object",
"convertParameter",
"(",
"final",
"Object",
"iParameter",
")",
"{",
"if",
"(",
"iParameter",
"!=",
"null",
")",
"// FILTER PARAMETERS\r",
"if",
"(",
"iParameter",
"instanceof",
"Map",
"<",
"?",
",",
"?",
">",
")",
"{",
"Map",
"<",
"S... | Convert a parameter: if a POJO is used, then replace it with its record id.
@param iParameter Parameter to convert, if applicable
@see #convertParameters(Object...) | [
"Convert",
"a",
"parameter",
":",
"if",
"a",
"POJO",
"is",
"used",
"then",
"replace",
"it",
"with",
"its",
"record",
"id",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/object/src/main/java/com/orientechnologies/orient/object/db/OObjectDatabaseTx.java#L1075-L1102 | test | Convert the parameter to the corresponding object. | Of course, here is the Java code you requested:
```java
protected Object convertParameter(final Object iParameter) {
if (iParameter != null)
// FILTER PARAMETERS
if (iParameter instanceof Map<?, ?>) {
Map<String, Object> map = (Map<String, Object>) iParameter;
for (Map.Entry<Stri... |
oblac/jodd | jodd-http/src/main/java/jodd/http/net/SocketHttpConnectionProvider.java | SocketHttpConnectionProvider.getSocketFactory | protected SocketFactory getSocketFactory(
final ProxyInfo proxy,
final boolean ssl,
final boolean trustAllCertificates,
final int connectionTimeout) throws IOException {
switch (proxy.getProxyType()) {
case NONE:
if (ssl) {
return getDefaultSSLSocketFactory(trustAllCertificates);
}
el... | java | protected SocketFactory getSocketFactory(
final ProxyInfo proxy,
final boolean ssl,
final boolean trustAllCertificates,
final int connectionTimeout) throws IOException {
switch (proxy.getProxyType()) {
case NONE:
if (ssl) {
return getDefaultSSLSocketFactory(trustAllCertificates);
}
el... | [
"protected",
"SocketFactory",
"getSocketFactory",
"(",
"final",
"ProxyInfo",
"proxy",
",",
"final",
"boolean",
"ssl",
",",
"final",
"boolean",
"trustAllCertificates",
",",
"final",
"int",
"connectionTimeout",
")",
"throws",
"IOException",
"{",
"switch",
"(",
"proxy"... | Returns socket factory based on proxy type and SSL requirements. | [
"Returns",
"socket",
"factory",
"based",
"on",
"proxy",
"type",
"and",
"SSL",
"requirements",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/net/SocketHttpConnectionProvider.java#L250-L273 | test | Get the SocketFactory for the proxy. | Of course, here is the Java code you requested:
```java
protected SocketFactory getSocketFactory(
final ProxyInfo proxy,
final boolean ssl,
final boolean trustAllCertificates,
final int connectionTimeout) throws IOException {
switch (proxy.getProxyType()) {
case NONE:
if (ssl) {
return getDe... |
rupertlssmith/lojix | debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingMainWindow.java | SwingMainWindow.showHorizontalBar | private void showHorizontalBar()
{
// Left vertical bar.
Component bar = factory.createGripPanel(layout.getConsoleHeightResizer(), false);
frame.getContentPane().add(bar, DesktopAppLayout.STATUS_BAR);
} | java | private void showHorizontalBar()
{
// Left vertical bar.
Component bar = factory.createGripPanel(layout.getConsoleHeightResizer(), false);
frame.getContentPane().add(bar, DesktopAppLayout.STATUS_BAR);
} | [
"private",
"void",
"showHorizontalBar",
"(",
")",
"{",
"// Left vertical bar.",
"Component",
"bar",
"=",
"factory",
".",
"createGripPanel",
"(",
"layout",
".",
"getConsoleHeightResizer",
"(",
")",
",",
"false",
")",
";",
"frame",
".",
"getContentPane",
"(",
")",... | Creates a horizontal grip-able bar for adjusting the console height. | [
"Creates",
"a",
"horizontal",
"grip",
"-",
"able",
"bar",
"for",
"adjusting",
"the",
"console",
"height",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingMainWindow.java#L146-L152 | test | Show the HORIZONTALBAR of the record set. | Of course, here is the Java code you requested:
```java
private void showHorizontalBar()
{
// Left vertical bar.
Component bar = factory.createGripPanel(layout.getConsoleHeightResizer(), false);
frame.getContentPane().add(bar, DesktopAppLayout.STATUS_BAR);
}
```
Hope this helps! |
oblac/jodd | jodd-bean/src/main/java/jodd/bean/BeanUtilBean.java | BeanUtilBean.getIndexProperty | protected Object getIndexProperty(final BeanProperty bp) {
bp.indexString = extractIndex(bp);
Object value = _getIndexProperty(bp);
bp.indexString = null;
return value;
} | java | protected Object getIndexProperty(final BeanProperty bp) {
bp.indexString = extractIndex(bp);
Object value = _getIndexProperty(bp);
bp.indexString = null;
return value;
} | [
"protected",
"Object",
"getIndexProperty",
"(",
"final",
"BeanProperty",
"bp",
")",
"{",
"bp",
".",
"indexString",
"=",
"extractIndex",
"(",
"bp",
")",
";",
"Object",
"value",
"=",
"_getIndexProperty",
"(",
"bp",
")",
";",
"bp",
".",
"indexString",
"=",
"n... | Get non-nested property value: either simple or indexed property.
If forced, missing bean will be created if possible. | [
"Get",
"non",
"-",
"nested",
"property",
"value",
":",
"either",
"simple",
"or",
"indexed",
"property",
".",
"If",
"forced",
"missing",
"bean",
"will",
"be",
"created",
"if",
"possible",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/bean/BeanUtilBean.java#L280-L288 | test | Gets the index property. | Of course, here is the Java code you requested:
```java
protected Object getIndexProperty(final BeanProperty bp) {
bp.indexString = extractIndex(bp);
Object value = _getIndexProperty(bp);
bp.indexString = null;
return value;
}
```
Hope this helps! |
Unidata/thredds | tds/src/main/java/thredds/server/config/HtmlConfigBean.java | HtmlConfigBean.prepareUrlStringForHtml | public String prepareUrlStringForHtml(String url) {
if (url == null)
return null;
URI uri;
try {
uri = new URI(url);
} catch (URISyntaxException e) {
throw new IllegalArgumentException("Given a bad URL [" + url + "].", e);
}
if (uri.isAbsolute())
return uri.toString();
... | java | public String prepareUrlStringForHtml(String url) {
if (url == null)
return null;
URI uri;
try {
uri = new URI(url);
} catch (URISyntaxException e) {
throw new IllegalArgumentException("Given a bad URL [" + url + "].", e);
}
if (uri.isAbsolute())
return uri.toString();
... | [
"public",
"String",
"prepareUrlStringForHtml",
"(",
"String",
"url",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"return",
"null",
";",
"URI",
"uri",
";",
"try",
"{",
"uri",
"=",
"new",
"URI",
"(",
"url",
")",
";",
"}",
"catch",
"(",
"URISyntaxExc... | Return a URL ready to use in a generated HTML page from a URL that
is either absolute or relative to the webapp context path. That is,
if relative, it is relative to "http://server:port/thredds/".
<p/>
<p>For simplicity, all relative URLs are converted to URLs that are
absolute paths. For instance, "catalog.xml" become... | [
"Return",
"a",
"URL",
"ready",
"to",
"use",
"in",
"a",
"generated",
"HTML",
"page",
"from",
"a",
"URL",
"that",
"is",
"either",
"absolute",
"or",
"relative",
"to",
"the",
"webapp",
"context",
"path",
".",
"That",
"is",
"if",
"relative",
"it",
"is",
"re... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/server/config/HtmlConfigBean.java#L421-L435 | test | Prepare a URL string for HTML. | Of course, here is the Java code you requested:
```java
public String prepareUrlStringForHtml(String url) {
if (url == null)
return null;
URI uri;
try {
uri = new URI(url);
} catch (URISyntaxException e) {
throw new IllegalArgumentException("Given a bad URL [" + url + "].", e);
}
... |
robeio/robe | robe-hibernate/src/main/java/io/robe/hibernate/dao/BaseDao.java | BaseDao.queryAll | public Criteria<Map<String, Object>> queryAll(SearchModel search) {
Transformer<Map<String, Object>> transformer = new TransformerImpl<>(this.currentSession(), Criteria.MAP_CLASS);
Query<Map<String, Object>> query = new Query<>(transformer);
return query.createCriteria(this.getEntityClass(), sea... | java | public Criteria<Map<String, Object>> queryAll(SearchModel search) {
Transformer<Map<String, Object>> transformer = new TransformerImpl<>(this.currentSession(), Criteria.MAP_CLASS);
Query<Map<String, Object>> query = new Query<>(transformer);
return query.createCriteria(this.getEntityClass(), sea... | [
"public",
"Criteria",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"queryAll",
"(",
"SearchModel",
"search",
")",
"{",
"Transformer",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"transformer",
"=",
"new",
"TransformerImpl",
"<>",
"(",
"thi... | Returns modified list of the entities regarding to the search model.
{@inheritDoc}
@return List of entities. | [
"Returns",
"modified",
"list",
"of",
"the",
"entities",
"regarding",
"to",
"the",
"search",
"model",
".",
"{",
"@inheritDoc",
"}"
] | a0a8c7cebd1f70f78cf24a66a002859e937badfe | https://github.com/robeio/robe/blob/a0a8c7cebd1f70f78cf24a66a002859e937badfe/robe-hibernate/src/main/java/io/robe/hibernate/dao/BaseDao.java#L60-L64 | test | Query all the entities in the database. | Of course, here is the Java code you requested:
```java
public Criteria<Map<String, Object>> queryAll(SearchModel search) {
Transformer<Map<String, Object>> transformer = new TransformerImpl<>(this.currentSession(), Criteria.MAP_CLASS);
Query<Map<String, Object>> query = new Query<>(transformer);
... |
boonproject/boon | boon/src/main/java/org/boon/Maps.java | Maps.before | @Universal
public static <K, V> V before( NavigableMap<K, V> map, final K index ) {
return map.get( map.lowerKey( index ) );
} | java | @Universal
public static <K, V> V before( NavigableMap<K, V> map, final K index ) {
return map.get( map.lowerKey( index ) );
} | [
"@",
"Universal",
"public",
"static",
"<",
"K",
",",
"V",
">",
"V",
"before",
"(",
"NavigableMap",
"<",
"K",
",",
"V",
">",
"map",
",",
"final",
"K",
"index",
")",
"{",
"return",
"map",
".",
"get",
"(",
"map",
".",
"lowerKey",
"(",
"index",
")",
... | Grabs the value before this key from a tree map (Navigable map). | [
"Grabs",
"the",
"value",
"before",
"this",
"key",
"from",
"a",
"tree",
"map",
"(",
"Navigable",
"map",
")",
"."
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/Maps.java#L255-L258 | test | Gets the value before the given key. | Of course, here is the Java code you requested:
```java
@Universal
public static <K, V> V before( NavigableMap<K, V> map, final K index ) {
return map.get( map.lowerKey( index ) );
}
```
Hope this helps! |
jboss/jboss-common-core | src/main/java/org/jboss/util/property/PropertyMap.java | PropertyMap.put | public Object put(Object name, Object value)
{
if (name == null)
throw new NullArgumentException("name");
// value can be null
// check if this is a new addition or not prior to updating the hash
boolean add = !containsKey(name);
Object prev = super.put(name, value);
Pr... | java | public Object put(Object name, Object value)
{
if (name == null)
throw new NullArgumentException("name");
// value can be null
// check if this is a new addition or not prior to updating the hash
boolean add = !containsKey(name);
Object prev = super.put(name, value);
Pr... | [
"public",
"Object",
"put",
"(",
"Object",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"throw",
"new",
"NullArgumentException",
"(",
"\"name\"",
")",
";",
"// value can be null",
"// check if this is a new addition or not prior to ... | Set a property.
@param name Property name.
@param value Property value.
@return Previous property value or null. | [
"Set",
"a",
"property",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/property/PropertyMap.java#L171-L195 | test | Override put to add or remove a value to the hash table. | Of course, here is the Java code you requested:
```java
public Object put(Object name, Object value)
{
if (name == null)
throw new NullArgumentException("name");
// value can be null
// check if this is a new addition or not prior to updating the hash
boolean add = !containsKey(nam... |
GlenKPeterson/Paguro | src/main/java/org/organicdesign/fp/collections/PersistentTreeMap.java | PersistentTreeMap.comparator | @Override public Comparator<? super K> comparator() {
return (comp == Equator.Comp.DEFAULT) ? null : comp;
} | java | @Override public Comparator<? super K> comparator() {
return (comp == Equator.Comp.DEFAULT) ? null : comp;
} | [
"@",
"Override",
"public",
"Comparator",
"<",
"?",
"super",
"K",
">",
"comparator",
"(",
")",
"{",
"return",
"(",
"comp",
"==",
"Equator",
".",
"Comp",
".",
"DEFAULT",
")",
"?",
"null",
":",
"comp",
";",
"}"
] | Returns the comparator used to order the keys in this map, or null if it uses
Fn2.DEFAULT_COMPARATOR (for compatibility with java.util.SortedMap). | [
"Returns",
"the",
"comparator",
"used",
"to",
"order",
"the",
"keys",
"in",
"this",
"map",
"or",
"null",
"if",
"it",
"uses",
"Fn2",
".",
"DEFAULT_COMPARATOR",
"(",
"for",
"compatibility",
"with",
"java",
".",
"util",
".",
"SortedMap",
")",
"."
] | eac0d64b2eb9496967334f635cdb270cffb2197b | https://github.com/GlenKPeterson/Paguro/blob/eac0d64b2eb9496967334f635cdb270cffb2197b/src/main/java/org/organicdesign/fp/collections/PersistentTreeMap.java#L484-L486 | test | Returns the comparator for this cache entry. | Of course, here is the Java code you requested:
```java
@Override public Comparator<? super K> comparator() {
return (comp == Equator.Comp.DEFAULT) ? null : comp;
}
```
Hope this helps! |
jboss/jboss-common-core | src/main/java/org/jboss/util/property/FieldBoundPropertyListener.java | FieldBoundPropertyListener.setFieldValue | protected void setFieldValue(String value) {
try {
// filter property value
value = filterValue(value);
// coerce value to field type
Class<?> type = fieldInstance.getField().getType();
PropertyEditor editor = PropertyEditors.findEditor(type);
editor.setAsTex... | java | protected void setFieldValue(String value) {
try {
// filter property value
value = filterValue(value);
// coerce value to field type
Class<?> type = fieldInstance.getField().getType();
PropertyEditor editor = PropertyEditors.findEditor(type);
editor.setAsTex... | [
"protected",
"void",
"setFieldValue",
"(",
"String",
"value",
")",
"{",
"try",
"{",
"// filter property value",
"value",
"=",
"filterValue",
"(",
"value",
")",
";",
"// coerce value to field type",
"Class",
"<",
"?",
">",
"type",
"=",
"fieldInstance",
".",
"getF... | Coerce and set specified value to field.
@param value Field value.
@throws PropertyException Failed to set field value. | [
"Coerce",
"and",
"set",
"specified",
"value",
"to",
"field",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/property/FieldBoundPropertyListener.java#L124-L141 | test | Sets the value of the field. | Of course, here is the Java code you requested:
```java
protected void setFieldValue(String value) {
try {
// filter property value
value = filterValue(value);
// coerce value to field type
Class<?> type = fieldInstance.getField().getType();
PropertyEditor editor = P... |
basis-technology-corp/tcl-regex-java | src/main/java/com/basistech/tclre/ColorMap.java | ColorMap.getcolor | private short getcolor(int c) {
try {
return map.get(c);
} catch (NullPointerException npe) {
throw new RegexRuntimeException(String.format("Failed to map codepoint U+%08X.", c));
}
} | java | private short getcolor(int c) {
try {
return map.get(c);
} catch (NullPointerException npe) {
throw new RegexRuntimeException(String.format("Failed to map codepoint U+%08X.", c));
}
} | [
"private",
"short",
"getcolor",
"(",
"int",
"c",
")",
"{",
"try",
"{",
"return",
"map",
".",
"get",
"(",
"c",
")",
";",
"}",
"catch",
"(",
"NullPointerException",
"npe",
")",
"{",
"throw",
"new",
"RegexRuntimeException",
"(",
"String",
".",
"format",
"... | Retrieve the color for a character.
@param c input char.
@return output color. | [
"Retrieve",
"the",
"color",
"for",
"a",
"character",
"."
] | de0d5eaccf9a61b694cb8793f234cc229c395b43 | https://github.com/basis-technology-corp/tcl-regex-java/blob/de0d5eaccf9a61b694cb8793f234cc229c395b43/src/main/java/com/basistech/tclre/ColorMap.java#L95-L101 | test | Get the color of a codepoint. | Of course, here is the Java code you requested:
```java
private short getcolor(int c) {
try {
return map.get(c);
} catch (NullPointerException npe) {
throw new RegexRuntimeException(String.format("Failed to map codepoint U+%08X.", c));
}
}
```
Hope this helps! |
real-logic/aeron | aeron-samples/src/main/java/io/aeron/samples/SamplesUtil.java | SamplesUtil.printError | @SuppressWarnings("unused")
public static void printError(
final String channel,
final int streamId,
final int sessionId,
final String message,
final HeaderFlyweight cause)
{
System.out.println(message);
} | java | @SuppressWarnings("unused")
public static void printError(
final String channel,
final int streamId,
final int sessionId,
final String message,
final HeaderFlyweight cause)
{
System.out.println(message);
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"static",
"void",
"printError",
"(",
"final",
"String",
"channel",
",",
"final",
"int",
"streamId",
",",
"final",
"int",
"sessionId",
",",
"final",
"String",
"message",
",",
"final",
"HeaderFlyweight",
... | Generic error handler that just prints message to stdout.
@param channel for the error
@param streamId for the error
@param sessionId for the error, if source
@param message indicating what the error was
@param cause of the error | [
"Generic",
"error",
"handler",
"that",
"just",
"prints",
"message",
"to",
"stdout",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-samples/src/main/java/io/aeron/samples/SamplesUtil.java#L134-L143 | test | Print error. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unused")
public static void printError(
final String channel,
final int streamId,
final int sessionId,
final String message,
final HeaderFlyweight cause)
{
System.out.println(message);
... |
Unidata/thredds | ui/src/main/java/ucar/util/prefs/ui/BeanTable.java | BeanTable.getSelectedCells | public ArrayList<Object> getSelectedCells() {
ArrayList<Object> list = new ArrayList<>();
int[] viewRowIndices = jtable.getSelectedRows();
int[] viewColumnIndices = jtable.getSelectedColumns();
for (int i = 0; i < viewRowIndices.length; i++)
for (int j = 0; i < viewColumnIndices.length; j++) {
... | java | public ArrayList<Object> getSelectedCells() {
ArrayList<Object> list = new ArrayList<>();
int[] viewRowIndices = jtable.getSelectedRows();
int[] viewColumnIndices = jtable.getSelectedColumns();
for (int i = 0; i < viewRowIndices.length; i++)
for (int j = 0; i < viewColumnIndices.length; j++) {
... | [
"public",
"ArrayList",
"<",
"Object",
">",
"getSelectedCells",
"(",
")",
"{",
"ArrayList",
"<",
"Object",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"int",
"[",
"]",
"viewRowIndices",
"=",
"jtable",
".",
"getSelectedRows",
"(",
")",
";",
... | Get the currently selected cells.
Use this for multiple row selection, when columnSelection is on
@return ArrayList of currently selected cells (wont be null).
@see BeanTable#setSelectionMode(int). | [
"Get",
"the",
"currently",
"selected",
"cells",
".",
"Use",
"this",
"for",
"multiple",
"row",
"selection",
"when",
"columnSelection",
"is",
"on"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/util/prefs/ui/BeanTable.java#L297-L309 | test | Get the selected cells in the table. | Of course, here is the Java code you requested:
```java
public ArrayList<Object> getSelectedCells() {
ArrayList<Object> list = new ArrayList<>();
int[] viewRowIndices = jtable.getSelectedRows();
int[] viewColumnIndices = jtable.getSelectedColumns();
for (int i = 0; i < viewRowIndices.length; i++)
... |
oblac/jodd | jodd-joy/src/main/java/jodd/joy/JoyProps.java | JoyProps.addPropsFile | @Override
public JoyProps addPropsFile(final String namePattern) {
requireNotStarted(props);
this.propsNamePatterns.add(namePattern);
return this;
} | java | @Override
public JoyProps addPropsFile(final String namePattern) {
requireNotStarted(props);
this.propsNamePatterns.add(namePattern);
return this;
} | [
"@",
"Override",
"public",
"JoyProps",
"addPropsFile",
"(",
"final",
"String",
"namePattern",
")",
"{",
"requireNotStarted",
"(",
"props",
")",
";",
"this",
".",
"propsNamePatterns",
".",
"add",
"(",
"namePattern",
")",
";",
"return",
"this",
";",
"}"
] | Adds props files or patterns. | [
"Adds",
"props",
"files",
"or",
"patterns",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-joy/src/main/java/jodd/joy/JoyProps.java#L64-L69 | test | Add a file to the Joy props. | Of course, here is the Java code you requested:
```java
@Override
public JoyProps addPropsFile(final String namePattern) {
requireNotStarted(props);
this.propsNamePatterns.add(namePattern);
return this;
}
```
Hope this helps! |
TeachingKidsProgramming/TeachingKidsProgramming.Source.Java | src/main/java/org/teachingextensions/logo/utils/EventUtils/FancyMessageBox.java | FancyMessageBox.askForTextInput | public static String askForTextInput(String message, String title)
{
return fancyMessageBox.askForTextInput(message, title);
} | java | public static String askForTextInput(String message, String title)
{
return fancyMessageBox.askForTextInput(message, title);
} | [
"public",
"static",
"String",
"askForTextInput",
"(",
"String",
"message",
",",
"String",
"title",
")",
"{",
"return",
"fancyMessageBox",
".",
"askForTextInput",
"(",
"message",
",",
"title",
")",
";",
"}"
] | Prints a request for a text input to the window. <br>
<b>Example:</b>
{@code String name = FancyMessageBox.askForTextInput("What is your nickname?", "Nicknames");}
@param message
the text in the FancyMessageBox
@param title
the title of the FancyMessageBox
@return the user input as a string | [
"Prints",
"a",
"request",
"for",
"a",
"text",
"input",
"to",
"the",
"window",
".",
"<br",
">",
"<b",
">",
"Example",
":",
"<",
"/",
"b",
">",
"{",
"@code",
"String",
"name",
"=",
"FancyMessageBox",
".",
"askForTextInput",
"(",
"What",
"is",
"your",
"... | 516fee15e537ecdb3f4dcbe3695c5cfde7e930da | https://github.com/TeachingKidsProgramming/TeachingKidsProgramming.Source.Java/blob/516fee15e537ecdb3f4dcbe3695c5cfde7e930da/src/main/java/org/teachingextensions/logo/utils/EventUtils/FancyMessageBox.java#L43-L46 | test | Ask for text input. | Of course, here is the Java code you requested:
```java
public static String askForTextInput(String message, String title)
{
return fancyMessageBox.askForTextInput(message, title);
}
```
Hope this helps! |
Unidata/thredds | waterml/src/main/java/ucar/nc2/ogc/gml/NcTimePeriodType.java | NcTimePeriodType.initTimePeriod | public static TimePeriodType initTimePeriod(
TimePeriodType timePeriod, StationTimeSeriesFeature stationFeat) throws IOException {
// @gml:id
String id = MarshallingUtil.createIdForType(TimePeriodType.class);
timePeriod.setId(id);
CollectionInfo info;
try {
... | java | public static TimePeriodType initTimePeriod(
TimePeriodType timePeriod, StationTimeSeriesFeature stationFeat) throws IOException {
// @gml:id
String id = MarshallingUtil.createIdForType(TimePeriodType.class);
timePeriod.setId(id);
CollectionInfo info;
try {
... | [
"public",
"static",
"TimePeriodType",
"initTimePeriod",
"(",
"TimePeriodType",
"timePeriod",
",",
"StationTimeSeriesFeature",
"stationFeat",
")",
"throws",
"IOException",
"{",
"// @gml:id",
"String",
"id",
"=",
"MarshallingUtil",
".",
"createIdForType",
"(",
"TimePeriodTy... | wml2:Collection/wml2:observationMember/om:OM_Observation/om:phenomenonTime/gml:TimePeriod | [
"wml2",
":",
"Collection",
"/",
"wml2",
":",
"observationMember",
"/",
"om",
":",
"OM_Observation",
"/",
"om",
":",
"phenomenonTime",
"/",
"gml",
":",
"TimePeriod"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/waterml/src/main/java/ucar/nc2/ogc/gml/NcTimePeriodType.java#L17-L40 | test | Initialize a TimePeriodType object from a StationTimeSeriesFeature object. | Of course, here is the Java code you requested:
```java
public static TimePeriodType initTimePeriod(
TimePeriodType timePeriod, StationTimeSeriesFeature stationFeat) throws IOException {
// @gml:id
String id = MarshallingUtil.createIdForType(TimePeriodType.class);
timePeriod.setId(i... |
oblac/jodd | jodd-lagarto/src/main/java/jodd/lagarto/dom/HtmlFosterRules.java | HtmlFosterRules.findFosterNodes | protected boolean findFosterNodes(final Node node) {
boolean isTable = false;
if (!lastTables.isEmpty()) {
// if inside table
if (node.getNodeType() == Node.NodeType.TEXT) {
String value = node.getNodeValue();
if (!StringUtil.isBlank(value)) {
if (isParentNodeOneOfFosterTableElements(node.getPar... | java | protected boolean findFosterNodes(final Node node) {
boolean isTable = false;
if (!lastTables.isEmpty()) {
// if inside table
if (node.getNodeType() == Node.NodeType.TEXT) {
String value = node.getNodeValue();
if (!StringUtil.isBlank(value)) {
if (isParentNodeOneOfFosterTableElements(node.getPar... | [
"protected",
"boolean",
"findFosterNodes",
"(",
"final",
"Node",
"node",
")",
"{",
"boolean",
"isTable",
"=",
"false",
";",
"if",
"(",
"!",
"lastTables",
".",
"isEmpty",
"(",
")",
")",
"{",
"// if inside table",
"if",
"(",
"node",
".",
"getNodeType",
"(",
... | Finds foster elements. Returns <code>true</code> if there was no change in
DOM tree of the parent element. Otherwise, returns <code>false</code>
meaning that parent will scan its childs again. | [
"Finds",
"foster",
"elements",
".",
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"there",
"was",
"no",
"change",
"in",
"DOM",
"tree",
"of",
"the",
"parent",
"element",
".",
"Otherwise",
"returns",
"<code",
">",
"false<",
"/",
"code",
">",
... | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/lagarto/dom/HtmlFosterRules.java#L121-L211 | test | Find the nodes in the Foster table. | Of course, here is the Java code you requested:
```java
protected boolean findFosterNodes(final Node node) {
boolean isTable = false;
if (!lastTables.isEmpty()) {
// if inside table
if (node.getNodeType() == Node.NodeType.TEXT) {
String value = node.getNodeValue();
if (!StringUtil.isBlank(value)) {
... |
ReactiveX/RxJava | src/main/java/io/reactivex/parallel/ParallelFlowable.java | ParallelFlowable.doOnCancel | @CheckReturnValue
@NonNull
public final ParallelFlowable<T> doOnCancel(@NonNull Action onCancel) {
ObjectHelper.requireNonNull(onCancel, "onCancel is null");
return RxJavaPlugins.onAssembly(new ParallelPeek<T>(this,
Functions.emptyConsumer(),
Functions.emptyConsum... | java | @CheckReturnValue
@NonNull
public final ParallelFlowable<T> doOnCancel(@NonNull Action onCancel) {
ObjectHelper.requireNonNull(onCancel, "onCancel is null");
return RxJavaPlugins.onAssembly(new ParallelPeek<T>(this,
Functions.emptyConsumer(),
Functions.emptyConsum... | [
"@",
"CheckReturnValue",
"@",
"NonNull",
"public",
"final",
"ParallelFlowable",
"<",
"T",
">",
"doOnCancel",
"(",
"@",
"NonNull",
"Action",
"onCancel",
")",
"{",
"ObjectHelper",
".",
"requireNonNull",
"(",
"onCancel",
",",
"\"onCancel is null\"",
")",
";",
"retu... | Run the specified Action when a 'rail' receives a cancellation.
@param onCancel the callback
@return the new ParallelFlowable instance | [
"Run",
"the",
"specified",
"Action",
"when",
"a",
"rail",
"receives",
"a",
"cancellation",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/parallel/ParallelFlowable.java#L714-L728 | test | Creates a parallel flowable that will cancel the application. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@NonNull
public final ParallelFlowable<T> doOnCancel(@NonNull Action onCancel) {
ObjectHelper.requireNonNull(onCancel, "onCancel is null");
return RxJavaPlugins.onAssembly(new ParallelPeek<T>(this,
Functio... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/util/cache/FileCache.java | FileCache.getInfo | public String getInfo(FileCacheable ncfile) throws IOException {
if (ncfile == null) return "";
// find it in the file cache
CacheElement.CacheFile file = files.get(ncfile);
if (file != null) {
return "File is in cache= " + file;
}
return "File not in cache";
} | java | public String getInfo(FileCacheable ncfile) throws IOException {
if (ncfile == null) return "";
// find it in the file cache
CacheElement.CacheFile file = files.get(ncfile);
if (file != null) {
return "File is in cache= " + file;
}
return "File not in cache";
} | [
"public",
"String",
"getInfo",
"(",
"FileCacheable",
"ncfile",
")",
"throws",
"IOException",
"{",
"if",
"(",
"ncfile",
"==",
"null",
")",
"return",
"\"\"",
";",
"// find it in the file cache\r",
"CacheElement",
".",
"CacheFile",
"file",
"=",
"files",
".",
"get",... | debug | [
"debug"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/util/cache/FileCache.java#L453-L462 | test | Get the info string for a given NCFile | Of course, here is the Java code you requested:
```java
public String getInfo(FileCacheable ncfile) throws IOException {
if (ncfile == null) return "";
// find it in the file cache
CacheElement.CacheFile file = files.get(ncfile);
if (file != null) {
return "File is in cache= " + file;
... |
vigna/fastutil | src/it/unimi/dsi/fastutil/HashCommon.java | HashCommon.murmurHash3 | public static long murmurHash3(long x) {
x ^= x >>> 33;
x *= 0xff51afd7ed558ccdL;
x ^= x >>> 33;
x *= 0xc4ceb9fe1a85ec53L;
x ^= x >>> 33;
return x;
} | java | public static long murmurHash3(long x) {
x ^= x >>> 33;
x *= 0xff51afd7ed558ccdL;
x ^= x >>> 33;
x *= 0xc4ceb9fe1a85ec53L;
x ^= x >>> 33;
return x;
} | [
"public",
"static",
"long",
"murmurHash3",
"(",
"long",
"x",
")",
"{",
"x",
"^=",
"x",
">>>",
"33",
";",
"x",
"*=",
"0xff51afd7ed558ccd",
"",
"L",
";",
"x",
"^=",
"x",
">>>",
"33",
";",
"x",
"*=",
"0xc4ceb9fe1a85ec53",
"",
"L",
";",
"x",
"^=",
"x... | Avalanches the bits of a long integer by applying the finalisation step of MurmurHash3.
<p>This method implements the finalisation step of Austin Appleby's <a href="http://code.google.com/p/smhasher/">MurmurHash3</a>.
Its purpose is to avalanche the bits of the argument to within 0.25% bias.
@param x a long integer.
... | [
"Avalanches",
"the",
"bits",
"of",
"a",
"long",
"integer",
"by",
"applying",
"the",
"finalisation",
"step",
"of",
"MurmurHash3",
"."
] | 192ce83affa4a6f2ad34a96c15b5f2ec2929cf1c | https://github.com/vigna/fastutil/blob/192ce83affa4a6f2ad34a96c15b5f2ec2929cf1c/src/it/unimi/dsi/fastutil/HashCommon.java#L61-L68 | test | MurmurHash3 64 - bit hash function. | Of course, here is the Java code you requested:
```java
public static long murmurHash3(long x) {
x ^= x >>> 33;
x *= 0xff51afd7ed558ccdL;
x ^= x >>> 33;
x *= 0xc4ceb9fe1a85ec53L;
x ^= x >>> 33;
return x;
}
```
Hope this helps! |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/FlowStepRuleClient.java | FlowStepRuleClient.createFlowStepExitRule | public FlowStepRule createFlowStepExitRule(FlowStepRule flowStepRuleParam)
{
if(flowStepRuleParam != null && this.serviceTicket != null)
{
flowStepRuleParam.setServiceTicket(this.serviceTicket);
}
return new FlowStepRule(this.putJson(
flowStepRuleParam, W... | java | public FlowStepRule createFlowStepExitRule(FlowStepRule flowStepRuleParam)
{
if(flowStepRuleParam != null && this.serviceTicket != null)
{
flowStepRuleParam.setServiceTicket(this.serviceTicket);
}
return new FlowStepRule(this.putJson(
flowStepRuleParam, W... | [
"public",
"FlowStepRule",
"createFlowStepExitRule",
"(",
"FlowStepRule",
"flowStepRuleParam",
")",
"{",
"if",
"(",
"flowStepRuleParam",
"!=",
"null",
"&&",
"this",
".",
"serviceTicket",
"!=",
"null",
")",
"{",
"flowStepRuleParam",
".",
"setServiceTicket",
"(",
"this... | Create a new Flow Step Exit rule.
@param flowStepRuleParam Rule to create.
@return Created rule. | [
"Create",
"a",
"new",
"Flow",
"Step",
"Exit",
"rule",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/FlowStepRuleClient.java#L83-L92 | test | Create a FlowStepRule object in the database. | Of course, here is the Java code you requested:
```java
public FlowStepRule createFlowStepExitRule(FlowStepRule flowStepRuleParam)
{
if(flowStepRuleParam != null && this.serviceTicket != null)
{
flowStepRuleParam.setServiceTicket(this.serviceTicket);
}
return new FlowSt... |
PhantomThief/more-lambdas-java | src/main/java/com/github/phantomthief/concurrent/MoreFutures.java | MoreFutures.tryWait | @Nonnull
public static <F extends Future<V>, V> Map<F, V> tryWait(@Nonnull Iterable<F> futures,
@Nonnull Duration duration) throws TryWaitFutureUncheckedException {
checkNotNull(futures);
checkNotNull(duration);
return tryWait(futures, duration.toNanos(), NANOSECONDS);
} | java | @Nonnull
public static <F extends Future<V>, V> Map<F, V> tryWait(@Nonnull Iterable<F> futures,
@Nonnull Duration duration) throws TryWaitFutureUncheckedException {
checkNotNull(futures);
checkNotNull(duration);
return tryWait(futures, duration.toNanos(), NANOSECONDS);
} | [
"@",
"Nonnull",
"public",
"static",
"<",
"F",
"extends",
"Future",
"<",
"V",
">",
",",
"V",
">",
"Map",
"<",
"F",
",",
"V",
">",
"tryWait",
"(",
"@",
"Nonnull",
"Iterable",
"<",
"F",
">",
"futures",
",",
"@",
"Nonnull",
"Duration",
"duration",
")",... | @see #tryWait(Iterable, long, TimeUnit)
@throws TryWaitFutureUncheckedException if not all calls are successful. | [
"@see",
"#tryWait",
"(",
"Iterable",
"long",
"TimeUnit",
")"
] | 92c0590e63b2eecd0110a53cdad8534a0bd0b8d8 | https://github.com/PhantomThief/more-lambdas-java/blob/92c0590e63b2eecd0110a53cdad8534a0bd0b8d8/src/main/java/com/github/phantomthief/concurrent/MoreFutures.java#L101-L107 | test | Try wait futures for a duration. | Of course, here is the Java code you requested:
```java
@Nonnull
public static <F extends Future<V>, V> Map<F, V> tryWait(@Nonnull Iterable<F> futures,
@Nonnull Duration duration) throws TryWaitFutureUncheckedException {
checkNotNull(futures);
checkNotNull(duration);
return tryW... |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.sample | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Observable<T> sample(long period, TimeUnit unit, Scheduler scheduler) {
ObjectHelper.requireNonNull(unit, "unit is null");
ObjectHelper.requireNonNull(scheduler, "scheduler is null");
return RxJavaPlugins.onAssembl... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Observable<T> sample(long period, TimeUnit unit, Scheduler scheduler) {
ObjectHelper.requireNonNull(unit, "unit is null");
ObjectHelper.requireNonNull(scheduler, "scheduler is null");
return RxJavaPlugins.onAssembl... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"CUSTOM",
")",
"public",
"final",
"Observable",
"<",
"T",
">",
"sample",
"(",
"long",
"period",
",",
"TimeUnit",
"unit",
",",
"Scheduler",
"scheduler",
")",
"{",
"ObjectHelper",
".... | Returns an Observable that emits the most recently emitted item (if any) emitted by the source ObservableSource
within periodic time intervals, where the intervals are defined on a particular Scheduler.
<p>
<img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.s.png"... | [
"Returns",
"an",
"Observable",
"that",
"emits",
"the",
"most",
"recently",
"emitted",
"item",
"(",
"if",
"any",
")",
"emitted",
"by",
"the",
"source",
"ObservableSource",
"within",
"periodic",
"time",
"intervals",
"where",
"the",
"intervals",
"are",
"defined",
... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L11327-L11333 | test | Sample the sequence of items in the sequence using the specified period and time unit. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Observable<T> sample(long period, TimeUnit unit, Scheduler scheduler) {
ObjectHelper.requireNonNull(unit, "unit is null");
ObjectHelper.requireNonNull(scheduler, "sc... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/widget/FileManager.java | FileManager.chooseFilenameToSave | public String chooseFilenameToSave(String defaultFilename) {
chooser.setDialogType(JFileChooser.SAVE_DIALOG);
String result = (defaultFilename == null) ? chooseFilename() : chooseFilename(defaultFilename);
chooser.setDialogType(JFileChooser.OPEN_DIALOG);
return result;
} | java | public String chooseFilenameToSave(String defaultFilename) {
chooser.setDialogType(JFileChooser.SAVE_DIALOG);
String result = (defaultFilename == null) ? chooseFilename() : chooseFilename(defaultFilename);
chooser.setDialogType(JFileChooser.OPEN_DIALOG);
return result;
} | [
"public",
"String",
"chooseFilenameToSave",
"(",
"String",
"defaultFilename",
")",
"{",
"chooser",
".",
"setDialogType",
"(",
"JFileChooser",
".",
"SAVE_DIALOG",
")",
";",
"String",
"result",
"=",
"(",
"defaultFilename",
"==",
"null",
")",
"?",
"chooseFilename",
... | /* public java.io.File chooseFile() {
if (!readOk) return null;
w.show();
if (chooser.showOpenDialog( parent) == JFileChooser.APPROVE_OPTION) {
File file = chooser.getSelectedFile();
if (debug) System.out.println("FileManager result "+file.getPath());
if (file != null)
return file;
}
return null;
} | [
"/",
"*",
"public",
"java",
".",
"io",
".",
"File",
"chooseFile",
"()",
"{",
"if",
"(",
"!readOk",
")",
"return",
"null",
";",
"w",
".",
"show",
"()",
";"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/widget/FileManager.java#L230-L236 | test | Choose a filename to save. | Of course, here is the Java code you requested:
```java
public String chooseFilenameToSave(String defaultFilename) {
chooser.setDialogType(JFileChooser.SAVE_DIALOG);
String result = (defaultFilename == null) ? chooseFilename() : chooseFilename(defaultFilename);
chooser.setDialogType(JFileChooser.OPEN_DI... |
Unidata/thredds | cdm/src/main/java/ucar/atd/dorade/DoradeDescriptor.java | DoradeDescriptor.sweepfileIsLittleEndian | public static boolean sweepfileIsLittleEndian(RandomAccessFile file)
throws DescriptorException {
int descLen;
try {
file.seek(0);
//
// skip the 4-byte descriptor name
//
byte[] bytes = new byte[4];
file.readFully(bytes);
//
// get the descriptor length... | java | public static boolean sweepfileIsLittleEndian(RandomAccessFile file)
throws DescriptorException {
int descLen;
try {
file.seek(0);
//
// skip the 4-byte descriptor name
//
byte[] bytes = new byte[4];
file.readFully(bytes);
//
// get the descriptor length... | [
"public",
"static",
"boolean",
"sweepfileIsLittleEndian",
"(",
"RandomAccessFile",
"file",
")",
"throws",
"DescriptorException",
"{",
"int",
"descLen",
";",
"try",
"{",
"file",
".",
"seek",
"(",
"0",
")",
";",
"//",
"// skip the 4-byte descriptor name",
"//",
"byt... | Determine if the given DORADE sweepfile contains little-endian data
(in violation of the DORADE definition...).
@param file the DORADE sweepfile,
@return <code>true</code> iff the file contains little-endian data
@throws DescriptorException | [
"Determine",
"if",
"the",
"given",
"DORADE",
"sweepfile",
"contains",
"little",
"-",
"endian",
"data",
"(",
"in",
"violation",
"of",
"the",
"DORADE",
"definition",
"...",
")",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/atd/dorade/DoradeDescriptor.java#L167-L186 | test | Checks if the given file is a little endian file. | Of course, here is the Java code you requested:
```java
public static boolean sweepfileIsLittleEndian(RandomAccessFile file)
throws DescriptorException {
int descLen;
try {
file.seek(0);
//
// skip the 4-byte descriptor name
//
byte[] bytes = new byte[4];
file.read... |
DigitalPebble/storm-crawler | core/src/main/java/com/digitalpebble/stormcrawler/util/URLUtil.java | URLUtil.getPage | public static String getPage(String url) {
try {
// get the full url, and replace the query string with and empty
// string
url = url.toLowerCase(Locale.ROOT);
String queryStr = new URL(url).getQuery();
return (queryStr != null) ? url.replace("?" + que... | java | public static String getPage(String url) {
try {
// get the full url, and replace the query string with and empty
// string
url = url.toLowerCase(Locale.ROOT);
String queryStr = new URL(url).getQuery();
return (queryStr != null) ? url.replace("?" + que... | [
"public",
"static",
"String",
"getPage",
"(",
"String",
"url",
")",
"{",
"try",
"{",
"// get the full url, and replace the query string with and empty",
"// string",
"url",
"=",
"url",
".",
"toLowerCase",
"(",
"Locale",
".",
"ROOT",
")",
";",
"String",
"queryStr",
... | Returns the page for the url. The page consists of the protocol, host,
and path, but does not include the query string. The host is lowercased
but the path is not.
@param url
The url to check.
@return String The page for the url. | [
"Returns",
"the",
"page",
"for",
"the",
"url",
".",
"The",
"page",
"consists",
"of",
"the",
"protocol",
"host",
"and",
"path",
"but",
"does",
"not",
"include",
"the",
"query",
"string",
".",
"The",
"host",
"is",
"lowercased",
"but",
"the",
"path",
"is",
... | 5d0465192ab8fbd89a90db32cb20960a282411ea | https://github.com/DigitalPebble/storm-crawler/blob/5d0465192ab8fbd89a90db32cb20960a282411ea/core/src/main/java/com/digitalpebble/stormcrawler/util/URLUtil.java#L171-L181 | test | Get the page from the url. | Of course, here is the Java code you requested:
```java
public static String getPage(String url) {
try {
// get the full url, and replace the query string with and empty
// string
url = url.toLowerCase(Locale.ROOT);
String queryStr = new URL(url).getQuery();
... |
lessthanoptimal/GeoRegression | main/src/georegression/metric/Distance2D_F64.java | Distance2D_F64.distance | public static double distance( LineSegment2D_F64 segmentA , LineSegment2D_F64 segmentB ) {
return Math.sqrt(distanceSq(segmentA, segmentB));
} | java | public static double distance( LineSegment2D_F64 segmentA , LineSegment2D_F64 segmentB ) {
return Math.sqrt(distanceSq(segmentA, segmentB));
} | [
"public",
"static",
"double",
"distance",
"(",
"LineSegment2D_F64",
"segmentA",
",",
"LineSegment2D_F64",
"segmentB",
")",
"{",
"return",
"Math",
".",
"sqrt",
"(",
"distanceSq",
"(",
"segmentA",
",",
"segmentB",
")",
")",
";",
"}"
] | Finds the distance between the two line segments
@param segmentA Line segment. Not modified.
@param segmentB Line segment. Not modified.
@return Euclidean distance of the closest point between the two line segments. | [
"Finds",
"the",
"distance",
"between",
"the",
"two",
"line",
"segments"
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/metric/Distance2D_F64.java#L205-L207 | test | Computes the Euclidean distance between two lines. | Of course, here is the Java code you requested:
```java
public static double distance( LineSegment2D_F64 segmentA , LineSegment2D_F64 segmentB ) {
return Math.sqrt(distanceSq(segmentA, segmentB));
}
```
Hope this helps! |
real-logic/aeron | aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java | AeronArchive.stopRecording | public void stopRecording(final String channel, final int streamId)
{
lock.lock();
try
{
ensureOpen();
final long correlationId = aeron.nextCorrelationId();
if (!archiveProxy.stopRecording(channel, streamId, correlationId, controlSessionId))
... | java | public void stopRecording(final String channel, final int streamId)
{
lock.lock();
try
{
ensureOpen();
final long correlationId = aeron.nextCorrelationId();
if (!archiveProxy.stopRecording(channel, streamId, correlationId, controlSessionId))
... | [
"public",
"void",
"stopRecording",
"(",
"final",
"String",
"channel",
",",
"final",
"int",
"streamId",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"ensureOpen",
"(",
")",
";",
"final",
"long",
"correlationId",
"=",
"aeron",
".",
"nextCorrel... | Stop recording for a channel and stream pairing.
<p>
Channels that include sessionId parameters are considered different than channels without sessionIds. Stopping
a recording on a channel without a sessionId parameter will not stop the recording of any sessionId specific
recordings that use the same channel and stream... | [
"Stop",
"recording",
"for",
"a",
"channel",
"and",
"stream",
"pairing",
".",
"<p",
">",
"Channels",
"that",
"include",
"sessionId",
"parameters",
"are",
"considered",
"different",
"than",
"channels",
"without",
"sessionIds",
".",
"Stopping",
"a",
"recording",
"o... | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java#L543-L563 | test | Stop recording. | Of course, here is the Java code you requested:
```java
public void stopRecording(final String channel, final int streamId)
{
lock.lock();
try
{
ensureOpen();
final long correlationId = aeron.nextCorrelationId();
if (!archiveProxy.stopRecording(channel,... |
abmargb/jamppa | src/main/java/org/jamppa/component/XMPPComponent.java | XMPPComponent.handleIQResult | @Override
protected void handleIQResult(IQ iq) {
String packetCallbackId = iq.getID() + "@"
+ iq.getFrom().toBareJID();
PacketCallback callback = packetCallbacks.get(packetCallbackId);
if (callback != null) {
callback.handle(iq);
packetCallbacks.remove(packetCa... | java | @Override
protected void handleIQResult(IQ iq) {
String packetCallbackId = iq.getID() + "@"
+ iq.getFrom().toBareJID();
PacketCallback callback = packetCallbacks.get(packetCallbackId);
if (callback != null) {
callback.handle(iq);
packetCallbacks.remove(packetCa... | [
"@",
"Override",
"protected",
"void",
"handleIQResult",
"(",
"IQ",
"iq",
")",
"{",
"String",
"packetCallbackId",
"=",
"iq",
".",
"getID",
"(",
")",
"+",
"\"@\"",
"+",
"iq",
".",
"getFrom",
"(",
")",
".",
"toBareJID",
"(",
")",
";",
"PacketCallback",
"c... | /*
(non-Javadoc)
@see
org.xmpp.component.AbstractComponent#handleIQResult(org.xmpp.packet.IQ) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 76f253239923df40904c462e3b88e7278b36b282 | https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jamppa/component/XMPPComponent.java#L234-L243 | test | Handle an IQ result. | Of course, here is the Java code you requested:
```java
@Override
protected void handleIQResult(IQ iq) {
String packetCallbackId = iq.getID() + "@"
+ iq.getFrom().toBareJID();
PacketCallback callback = packetCallbacks.get(packetCallbackId);
if (callback != null) {
callbac... |
rupertlssmith/lojix | lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/machine/WAMBaseMachine.java | WAMBaseMachine.resolveLabelPoint | public void resolveLabelPoint(int labelName, int address)
{
// Create the label with resolved address, if it does not already exist.
WAMReservedLabel label = (WAMReservedLabel) symbolTable.get(labelName, SYMKEY_CALLPOINTS);
if (label == null)
{
label = new WAMReservedLab... | java | public void resolveLabelPoint(int labelName, int address)
{
// Create the label with resolved address, if it does not already exist.
WAMReservedLabel label = (WAMReservedLabel) symbolTable.get(labelName, SYMKEY_CALLPOINTS);
if (label == null)
{
label = new WAMReservedLab... | [
"public",
"void",
"resolveLabelPoint",
"(",
"int",
"labelName",
",",
"int",
"address",
")",
"{",
"// Create the label with resolved address, if it does not already exist.",
"WAMReservedLabel",
"label",
"=",
"(",
"WAMReservedLabel",
")",
"symbolTable",
".",
"get",
"(",
"la... | {@inheritDoc} | [
"{"
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/machine/WAMBaseMachine.java#L124-L145 | test | Resolve a label point. | Of course, here is the Java code you requested:
```java
public void resolveLabelPoint(int labelName, int address)
{
// Create the label with resolved address, if it does not already exist.
WAMReservedLabel label = (WAMReservedLabel) symbolTable.get(labelName, SYMKEY_CALLPOINTS);
if (label ... |
js-lib-com/tiny-container | src/main/java/js/servlet/AppServlet.java | AppServlet.dumpError | protected static void dumpError(RequestContext context, Throwable throwable) {
log.dump("Error on HTTP request:", throwable);
context.dump();
} | java | protected static void dumpError(RequestContext context, Throwable throwable) {
log.dump("Error on HTTP request:", throwable);
context.dump();
} | [
"protected",
"static",
"void",
"dumpError",
"(",
"RequestContext",
"context",
",",
"Throwable",
"throwable",
")",
"{",
"log",
".",
"dump",
"(",
"\"Error on HTTP request:\"",
",",
"throwable",
")",
";",
"context",
".",
"dump",
"(",
")",
";",
"}"
] | Dump throwable stack trace and request context to application logger.
@param context request context,
@param throwable throwable to dump stack trace for. | [
"Dump",
"throwable",
"stack",
"trace",
"and",
"request",
"context",
"to",
"application",
"logger",
"."
] | ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e | https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/servlet/AppServlet.java#L333-L336 | test | Dumps an error on the HTTP request. | Of course, here is the Java code you requested:
```java
protected static void dumpError(RequestContext context, Throwable throwable) {
log.dump("Error on HTTP request:", throwable);
context.dump();
}
```
Hope this helps! |
vigna/fastutil | src/it/unimi/dsi/fastutil/Arrays.java | Arrays.ensureFromTo | public static void ensureFromTo(final int arrayLength, final int from, final int to) {
if (from < 0) throw new ArrayIndexOutOfBoundsException("Start index (" + from + ") is negative");
if (from > to) throw new IllegalArgumentException("Start index (" + from + ") is greater than end index (" + to + ")");
if (to > ... | java | public static void ensureFromTo(final int arrayLength, final int from, final int to) {
if (from < 0) throw new ArrayIndexOutOfBoundsException("Start index (" + from + ") is negative");
if (from > to) throw new IllegalArgumentException("Start index (" + from + ") is greater than end index (" + to + ")");
if (to > ... | [
"public",
"static",
"void",
"ensureFromTo",
"(",
"final",
"int",
"arrayLength",
",",
"final",
"int",
"from",
",",
"final",
"int",
"to",
")",
"{",
"if",
"(",
"from",
"<",
"0",
")",
"throw",
"new",
"ArrayIndexOutOfBoundsException",
"(",
"\"Start index (\"",
"+... | Ensures that a range given by its first (inclusive) and last (exclusive) elements fits an array of given length.
<p>This method may be used whenever an array range check is needed.
@param arrayLength an array length.
@param from a start index (inclusive).
@param to an end index (inclusive).
@throws IllegalArgumentExc... | [
"Ensures",
"that",
"a",
"range",
"given",
"by",
"its",
"first",
"(",
"inclusive",
")",
"and",
"last",
"(",
"exclusive",
")",
"elements",
"fits",
"an",
"array",
"of",
"given",
"length",
"."
] | 192ce83affa4a6f2ad34a96c15b5f2ec2929cf1c | https://github.com/vigna/fastutil/blob/192ce83affa4a6f2ad34a96c15b5f2ec2929cf1c/src/it/unimi/dsi/fastutil/Arrays.java#L54-L58 | test | Ensures that the given range of indices is within the given array length. | Of course, here is the Java code you requested:
```java
public static void ensureFromTo(final int arrayLength, final int from, final int to) {
if (from < 0) throw new ArrayIndexOutOfBoundsException("Start index (" + from + ") is negative");
if (from > to) throw new IllegalArgumentException("Start index (" + from +... |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/util/sql/impl/SQLFormUtil.java | SQLFormUtil.getFormTableForms | public List<Form> getFormTableForms(
Long electronicFormIdParam,
boolean includeFieldDataParam
) {
List<Form> returnVal = new ArrayList();
if(electronicFormIdParam == null) {
return returnVal;
}
Map<Long,String> definitionAndTitle =
this.formDefUtil.getFormDefinitionIdAndTitle();
PreparedStat... | java | public List<Form> getFormTableForms(
Long electronicFormIdParam,
boolean includeFieldDataParam
) {
List<Form> returnVal = new ArrayList();
if(electronicFormIdParam == null) {
return returnVal;
}
Map<Long,String> definitionAndTitle =
this.formDefUtil.getFormDefinitionIdAndTitle();
PreparedStat... | [
"public",
"List",
"<",
"Form",
">",
"getFormTableForms",
"(",
"Long",
"electronicFormIdParam",
",",
"boolean",
"includeFieldDataParam",
")",
"{",
"List",
"<",
"Form",
">",
"returnVal",
"=",
"new",
"ArrayList",
"(",
")",
";",
"if",
"(",
"electronicFormIdParam",
... | Retrieves the Table field records as {@code List<Form>}.
@param electronicFormIdParam The Form Identifier.
@param includeFieldDataParam Whether to populate the return {@code List<Form>} fields.
@return {@code List<Form>} records. | [
"Retrieves",
"the",
"Table",
"field",
"records",
"as",
"{",
"@code",
"List<Form",
">",
"}",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/util/sql/impl/SQLFormUtil.java#L99-L154 | test | Get the form table forms for a given electronic form id. | Of course, here is the Java code you requested:
```java
public List<Form> getFormTableForms(
Long electronicFormIdParam,
boolean includeFieldDataParam
) {
List<Form> returnVal = new ArrayList();
if(electronicFormIdParam == null) {
return returnVal;
}
Map<Long,String> definitionAndTitle =
this.f... |
streamsets/datacollector | jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/JdbcBaseRecordWriter.java | JdbcBaseRecordWriter.lookupPrimaryKeys | void lookupPrimaryKeys() throws StageException {
Connection connection = null;
try {
connection = dataSource.getConnection();
primaryKeyColumns = jdbcUtil.getPrimaryKeys(connection, schema, tableName);
} catch (SQLException e) {
String formattedError = jdbcUtil.formatSqlException(e);
... | java | void lookupPrimaryKeys() throws StageException {
Connection connection = null;
try {
connection = dataSource.getConnection();
primaryKeyColumns = jdbcUtil.getPrimaryKeys(connection, schema, tableName);
} catch (SQLException e) {
String formattedError = jdbcUtil.formatSqlException(e);
... | [
"void",
"lookupPrimaryKeys",
"(",
")",
"throws",
"StageException",
"{",
"Connection",
"connection",
"=",
"null",
";",
"try",
"{",
"connection",
"=",
"dataSource",
".",
"getConnection",
"(",
")",
";",
"primaryKeyColumns",
"=",
"jdbcUtil",
".",
"getPrimaryKeys",
"... | Access the database, obtain a list of primary key columns, and store them in primaryKeyColumns.
If table has no primary keys, primaryKeyColumns stays empty.
@throws StageException | [
"Access",
"the",
"database",
"obtain",
"a",
"list",
"of",
"primary",
"key",
"columns",
"and",
"store",
"them",
"in",
"primaryKeyColumns",
".",
"If",
"table",
"has",
"no",
"primary",
"keys",
"primaryKeyColumns",
"stays",
"empty",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/JdbcBaseRecordWriter.java#L186-L205 | test | Lookup the primary keys. | Of course, here is the Java code you requested:
```java
void lookupPrimaryKeys() throws StageException {
Connection connection = null;
try {
connection = dataSource.getConnection();
primaryKeyColumns = jdbcUtil.getPrimaryKeys(connection, schema, tableName);
} catch (SQLException e) {
Stri... |
apache/parquet-mr | parquet-format-structures/src/main/java/org/apache/parquet/format/event/Consumers.java | Consumers.listOf | public static <T extends TBase<T,? extends TFieldIdEnum>> ListConsumer listOf(Class<T> c, final Consumer<List<T>> consumer) {
class ListConsumer implements Consumer<T> {
List<T> list;
@Override
public void consume(T t) {
list.add(t);
}
}
final ListConsumer co = new ListConsum... | java | public static <T extends TBase<T,? extends TFieldIdEnum>> ListConsumer listOf(Class<T> c, final Consumer<List<T>> consumer) {
class ListConsumer implements Consumer<T> {
List<T> list;
@Override
public void consume(T t) {
list.add(t);
}
}
final ListConsumer co = new ListConsum... | [
"public",
"static",
"<",
"T",
"extends",
"TBase",
"<",
"T",
",",
"?",
"extends",
"TFieldIdEnum",
">",
">",
"ListConsumer",
"listOf",
"(",
"Class",
"<",
"T",
">",
"c",
",",
"final",
"Consumer",
"<",
"List",
"<",
"T",
">",
">",
"consumer",
")",
"{",
... | To consume a list of elements
@param c the class of the list content
@param consumer the consumer that will receive the list
@param <T> the type of the list content
@return a ListConsumer that can be passed to the DelegatingFieldConsumer | [
"To",
"consume",
"a",
"list",
"of",
"elements"
] | 62dcc68acaf64012bf731e103be780956f1f446d | https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-format-structures/src/main/java/org/apache/parquet/format/event/Consumers.java#L112-L130 | test | Creates a list consumer that consumes all the elements of a single list. | Of course, here is the Java code you requested:
```java
public static <T extends TBase<T,? extends TFieldIdEnum>> ListConsumer listOf(Class<T> c, final Consumer<List<T>> consumer) {
class ListConsumer implements Consumer<T> {
List<T> list;
@Override
public void consume(T t) {
list.add(t);... |
playframework/playframework | core/play/src/main/java/play/mvc/Results.java | Results.unauthorized | public static Result unauthorized(File content, String filename) {
return unauthorized(content, filename, StaticFileMimeTypes.fileMimeTypes());
} | java | public static Result unauthorized(File content, String filename) {
return unauthorized(content, filename, StaticFileMimeTypes.fileMimeTypes());
} | [
"public",
"static",
"Result",
"unauthorized",
"(",
"File",
"content",
",",
"String",
"filename",
")",
"{",
"return",
"unauthorized",
"(",
"content",
",",
"filename",
",",
"StaticFileMimeTypes",
".",
"fileMimeTypes",
"(",
")",
")",
";",
"}"
] | Generates a 401 Unauthorized result.
@param content The file to send.
@param filename The name to send the file as.
@return the result | [
"Generates",
"a",
"401",
"Unauthorized",
"result",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L1415-L1417 | test | Returns an error if the content is not authorized. | Of course, here is the Java code you requested:
```java
public static Result unauthorized(File content, String filename) {
return unauthorized(content, filename, StaticFileMimeTypes.fileMimeTypes());
}
```
Hope this helps! |
blademainer/common_utils | common_helper/src/main/java/com/xiongyingqi/util/WeakReferenceMonitor.java | WeakReferenceMonitor.keepMonitoringThreadAlive | private static boolean keepMonitoringThreadAlive() {
synchronized (WeakReferenceMonitor.class) {
if (!trackedEntries.isEmpty()) {
return true;
} else {
logger.debug("No entries left to track - stopping reference monitor thread");
monitoring... | java | private static boolean keepMonitoringThreadAlive() {
synchronized (WeakReferenceMonitor.class) {
if (!trackedEntries.isEmpty()) {
return true;
} else {
logger.debug("No entries left to track - stopping reference monitor thread");
monitoring... | [
"private",
"static",
"boolean",
"keepMonitoringThreadAlive",
"(",
")",
"{",
"synchronized",
"(",
"WeakReferenceMonitor",
".",
"class",
")",
"{",
"if",
"(",
"!",
"trackedEntries",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"else",
"{",
... | Check whether to keep the monitoring thread alive,
i.e. whether there are still entries being tracked. | [
"Check",
"whether",
"to",
"keep",
"the",
"monitoring",
"thread",
"alive",
"i",
".",
"e",
".",
"whether",
"there",
"are",
"still",
"entries",
"being",
"tracked",
"."
] | ef6baf0367c16de95a28caab67a7d5842a6d13db | https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/WeakReferenceMonitor.java#L117-L127 | test | Keep monitoring thread alive. | Of course, here is the Java code you requested:
```java
private static boolean keepMonitoringThreadAlive() {
synchronized (WeakReferenceMonitor.class) {
if (!trackedEntries.isEmpty()) {
return true;
} else {
logger.debug("No entries left to track - stoppi... |
RestComm/jain-slee | container/services/src/main/java/org/mobicents/slee/container/deployment/ConcreteSbbGenerator.java | ConcreteSbbGenerator.generateAbstractSbbClassInfo | private void generateAbstractSbbClassInfo() {
CtClass sbbClass = null;
try {
sbbClass = pool.get(Sbb.class.getName());
} catch (NotFoundException e) {
throw new SLEEException(e.getMessage(), e);
}
AbstractSbbClassInfo abstractSbbClassInfo = sbbComponent.getAbstractSbbClassInfo();
for (CtMethod sbbC... | java | private void generateAbstractSbbClassInfo() {
CtClass sbbClass = null;
try {
sbbClass = pool.get(Sbb.class.getName());
} catch (NotFoundException e) {
throw new SLEEException(e.getMessage(), e);
}
AbstractSbbClassInfo abstractSbbClassInfo = sbbComponent.getAbstractSbbClassInfo();
for (CtMethod sbbC... | [
"private",
"void",
"generateAbstractSbbClassInfo",
"(",
")",
"{",
"CtClass",
"sbbClass",
"=",
"null",
";",
"try",
"{",
"sbbClass",
"=",
"pool",
".",
"get",
"(",
"Sbb",
".",
"class",
".",
"getName",
"(",
")",
")",
";",
"}",
"catch",
"(",
"NotFoundExceptio... | Generates info that indicates if a method from {@link Sbb} interface
should be invoked or not, in runtime. | [
"Generates",
"info",
"that",
"indicates",
"if",
"a",
"method",
"from",
"{"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/services/src/main/java/org/mobicents/slee/container/deployment/ConcreteSbbGenerator.java#L473-L501 | test | generateAbstractSbbClassInfo This method is called to generate AbstractSbbClassInfo | Of course, here is the Java code you requested:
```java
private void generateAbstractSbbClassInfo() {
CtClass sbbClass = null;
try {
sbbClass = pool.get(Sbb.class.getName());
} catch (NotFoundException e) {
throw new SLEEException(e.getMessage(), e);
}
AbstractSbbClassInfo abstractSbbClassInfo = sbbC... |
rockagen/commons-lib | src/main/java/com/rockagen/commons/http/HttpConn.java | HttpConn.getURL | public static String getURL(HttpHost targetHost, String uri) {
if (targetHost != null && !CommUtil.isBlank(targetHost.getSchemeName())
&& !CommUtil.isBlank(targetHost.getHostName())
&& targetHost.getPort() > 0) {
return targetHost + uri;
}
return "null... | java | public static String getURL(HttpHost targetHost, String uri) {
if (targetHost != null && !CommUtil.isBlank(targetHost.getSchemeName())
&& !CommUtil.isBlank(targetHost.getHostName())
&& targetHost.getPort() > 0) {
return targetHost + uri;
}
return "null... | [
"public",
"static",
"String",
"getURL",
"(",
"HttpHost",
"targetHost",
",",
"String",
"uri",
")",
"{",
"if",
"(",
"targetHost",
"!=",
"null",
"&&",
"!",
"CommUtil",
".",
"isBlank",
"(",
"targetHost",
".",
"getSchemeName",
"(",
")",
")",
"&&",
"!",
"CommU... | Get url
@param targetHost target {@link org.apache.http.HttpHost}
@param uri the uri
@return new url string | [
"Get",
"url"
] | f37141cf40be79d130db804c39ce61690541d5f1 | https://github.com/rockagen/commons-lib/blob/f37141cf40be79d130db804c39ce61690541d5f1/src/main/java/com/rockagen/commons/http/HttpConn.java#L1500-L1507 | test | Get URL. | Of course, here is the Java code you requested:
```java
public static String getURL(HttpHost targetHost, String uri) {
if (targetHost != null && !CommUtil.isBlank(targetHost.getSchemeName())
&& !CommUtil.isBlank(targetHost.getHostName())
&& targetHost.getPort() > 0) {
... |
takawitter/trie4j | trie4j/src/main/java/org/trie4j/io/TrieWriter.java | TrieWriter.writeBitVector01Divider | public void writeBitVector01Divider(BitVector01Divider divider) throws IOException{
dos.writeBoolean(divider.isFirst());
dos.writeBoolean(divider.isZeroCounting());
} | java | public void writeBitVector01Divider(BitVector01Divider divider) throws IOException{
dos.writeBoolean(divider.isFirst());
dos.writeBoolean(divider.isZeroCounting());
} | [
"public",
"void",
"writeBitVector01Divider",
"(",
"BitVector01Divider",
"divider",
")",
"throws",
"IOException",
"{",
"dos",
".",
"writeBoolean",
"(",
"divider",
".",
"isFirst",
"(",
")",
")",
";",
"dos",
".",
"writeBoolean",
"(",
"divider",
".",
"isZeroCounting... | Write BitVector01Divider to OutputStream. This method doesn't care about
r0 and r1. Caller must write these bvs.
@param divider
@throws IOException | [
"Write",
"BitVector01Divider",
"to",
"OutputStream",
".",
"This",
"method",
"doesn",
"t",
"care",
"about",
"r0",
"and",
"r1",
".",
"Caller",
"must",
"write",
"these",
"bvs",
"."
] | 927d9f745513f8f971944c9efb58ee0a78cd784a | https://github.com/takawitter/trie4j/blob/927d9f745513f8f971944c9efb58ee0a78cd784a/trie4j/src/main/java/org/trie4j/io/TrieWriter.java#L142-L145 | test | Write BitVector01Divider. | Of course, here is the Java code you requested:
```java
public void writeBitVector01Divider(BitVector01Divider divider) throws IOException{
dos.writeBoolean(divider.isFirst());
dos.writeBoolean(divider.isZeroCounting());
}
```
Hope this helps! |
jboss/jboss-common-core | src/main/java/org/jboss/util/xml/JBossEntityResolver.java | JBossEntityResolver.loadClasspathResource | protected InputStream loadClasspathResource(String resource, boolean trace)
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
URL url = loader.getResource(resource);
if( url == null )
{
/* Prefix the simple filename with the schema type patch as this is the
... | java | protected InputStream loadClasspathResource(String resource, boolean trace)
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
URL url = loader.getResource(resource);
if( url == null )
{
/* Prefix the simple filename with the schema type patch as this is the
... | [
"protected",
"InputStream",
"loadClasspathResource",
"(",
"String",
"resource",
",",
"boolean",
"trace",
")",
"{",
"ClassLoader",
"loader",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
";",
"URL",
"url",
"=",
"loader",
... | Look for the resource name on the thread context loader resource path. This
first simply tries the resource name as is, and if not found, the resource
is prepended with either "dtd/" or "schema/" depending on whether the
resource ends in ".dtd" or ".xsd".
@param resource - the classpath resource name of the schema
@pa... | [
"Look",
"for",
"the",
"resource",
"name",
"on",
"the",
"thread",
"context",
"loader",
"resource",
"path",
".",
"This",
"first",
"simply",
"tries",
"the",
"resource",
"name",
"as",
"is",
"and",
"if",
"not",
"found",
"the",
"resource",
"is",
"prepended",
"wi... | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/xml/JBossEntityResolver.java#L589-L620 | test | Load a resource from the classpath. | Of course, here is the Java code you requested:
```java
protected InputStream loadClasspathResource(String resource, boolean trace)
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
URL url = loader.getResource(resource);
if( url == null )
{
/* Prefix the simple... |
tony19/logback-android | logback-android/src/main/java/ch/qos/logback/core/net/ssl/ConfigurableSSLSocketFactory.java | ConfigurableSSLSocketFactory.createSocket | @Override
public Socket createSocket(InetAddress address, int port,
InetAddress localAddress, int localPort) throws IOException {
SSLSocket socket = (SSLSocket) delegate.createSocket(address, port,
localAddress, localPort);
parameters.configure(new SSLConfigurableSocket(socket));
return sock... | java | @Override
public Socket createSocket(InetAddress address, int port,
InetAddress localAddress, int localPort) throws IOException {
SSLSocket socket = (SSLSocket) delegate.createSocket(address, port,
localAddress, localPort);
parameters.configure(new SSLConfigurableSocket(socket));
return sock... | [
"@",
"Override",
"public",
"Socket",
"createSocket",
"(",
"InetAddress",
"address",
",",
"int",
"port",
",",
"InetAddress",
"localAddress",
",",
"int",
"localPort",
")",
"throws",
"IOException",
"{",
"SSLSocket",
"socket",
"=",
"(",
"SSLSocket",
")",
"delegate",... | {@inheritDoc} | [
"{"
] | 028489c11ccfc1237a53923db06f22a90b41809c | https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/net/ssl/ConfigurableSSLSocketFactory.java#L60-L67 | test | Override this method to create a socket using the specified address port and local address and local port. | Of course, here is the Java code you requested:
```java
@Override
public Socket createSocket(InetAddress address, int port,
InetAddress localAddress, int localPort) throws IOException {
SSLSocket socket = (SSLSocket) delegate.createSocket(address, port,
localAddress, localPort);
parameters.conf... |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java | FeatureTiles.getPointPaint | protected Paint getPointPaint(FeatureStyle featureStyle) {
Paint paint = getFeatureStylePaint(featureStyle, FeatureDrawType.CIRCLE);
if (paint == null) {
paint = pointPaint;
}
return paint;
} | java | protected Paint getPointPaint(FeatureStyle featureStyle) {
Paint paint = getFeatureStylePaint(featureStyle, FeatureDrawType.CIRCLE);
if (paint == null) {
paint = pointPaint;
}
return paint;
} | [
"protected",
"Paint",
"getPointPaint",
"(",
"FeatureStyle",
"featureStyle",
")",
"{",
"Paint",
"paint",
"=",
"getFeatureStylePaint",
"(",
"featureStyle",
",",
"FeatureDrawType",
".",
"CIRCLE",
")",
";",
"if",
"(",
"paint",
"==",
"null",
")",
"{",
"paint",
"=",... | Get the point paint for the feature style, or return the default paint
@param featureStyle feature style
@return paint | [
"Get",
"the",
"point",
"paint",
"for",
"the",
"feature",
"style",
"or",
"return",
"the",
"default",
"paint"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java#L1443-L1452 | test | Get the point paint. | Of course, here is the Java code you requested:
```java
protected Paint getPointPaint(FeatureStyle featureStyle) {
Paint paint = getFeatureStylePaint(featureStyle, FeatureDrawType.CIRCLE);
if (paint == null) {
paint = pointPaint;
}
return paint;
}
```
Hope this helps... |
wildfly/wildfly | iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ContainerAnalysis.java | ContainerAnalysis.isMutator | protected boolean isMutator(Method m) {
// JBAS-4473, look for set<name>()
String name = m.getName();
if (!(name.startsWith("set") && name.length() > "set".length()))
return false;
if (m.getReturnType() != Void.TYPE)
return false;
if (m.getParameterTypes()... | java | protected boolean isMutator(Method m) {
// JBAS-4473, look for set<name>()
String name = m.getName();
if (!(name.startsWith("set") && name.length() > "set".length()))
return false;
if (m.getReturnType() != Void.TYPE)
return false;
if (m.getParameterTypes()... | [
"protected",
"boolean",
"isMutator",
"(",
"Method",
"m",
")",
"{",
"// JBAS-4473, look for set<name>()",
"String",
"name",
"=",
"m",
".",
"getName",
"(",
")",
";",
"if",
"(",
"!",
"(",
"name",
".",
"startsWith",
"(",
"\"set\"",
")",
"&&",
"name",
".",
"l... | Check if a method is a mutator. | [
"Check",
"if",
"a",
"method",
"is",
"a",
"mutator",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ContainerAnalysis.java#L311-L321 | test | Check if method is a mutator method. | Of course, here is the Java code you requested:
```java
protected boolean isMutator(Method m) {
// JBAS-4473, look for set<name>()
String name = m.getName();
if (!(name.startsWith("set") && name.length() > "set".length()))
return false;
if (m.getReturnType() != Void.TYPE)
... |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/CollaborationClient.java | CollaborationClient.createCollaboration | public List<Collaboration> createCollaboration(
List<Collaboration> collaborationsParam
) {
CollaborationListing collaborationListing = new CollaborationListing();
collaborationListing.setListing(collaborationsParam);
if(this.serviceTicket != null) {
collaborationListing... | java | public List<Collaboration> createCollaboration(
List<Collaboration> collaborationsParam
) {
CollaborationListing collaborationListing = new CollaborationListing();
collaborationListing.setListing(collaborationsParam);
if(this.serviceTicket != null) {
collaborationListing... | [
"public",
"List",
"<",
"Collaboration",
">",
"createCollaboration",
"(",
"List",
"<",
"Collaboration",
">",
"collaborationsParam",
")",
"{",
"CollaborationListing",
"collaborationListing",
"=",
"new",
"CollaborationListing",
"(",
")",
";",
"collaborationListing",
".",
... | Create a new Form Container / Electronic Forms.
@param collaborationsParam The Collaboration's to create.
@return Created Collaboration's.
@see Collaboration | [
"Create",
"a",
"new",
"Form",
"Container",
"/",
"Electronic",
"Forms",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/CollaborationClient.java#L62-L74 | test | Creates a new collaboration. | Of course, here is the Java code you requested:
```java
public List<Collaboration> createCollaboration(
List<Collaboration> collaborationsParam
) {
CollaborationListing collaborationListing = new CollaborationListing();
collaborationListing.setListing(collaborationsParam);
if(this.... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/sql/OSQLEngine.java | OSQLEngine.getCollateNames | public static Set<String> getCollateNames() {
final Set<String> types = new HashSet<String>();
final Iterator<OCollateFactory> ite = getCollateFactories();
while (ite.hasNext()) {
types.addAll(ite.next().getNames());
}
return types;
} | java | public static Set<String> getCollateNames() {
final Set<String> types = new HashSet<String>();
final Iterator<OCollateFactory> ite = getCollateFactories();
while (ite.hasNext()) {
types.addAll(ite.next().getNames());
}
return types;
} | [
"public",
"static",
"Set",
"<",
"String",
">",
"getCollateNames",
"(",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"types",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"final",
"Iterator",
"<",
"OCollateFactory",
">",
"ite",
"=",
"getCo... | Iterates on all factories and append all collate names.
@return Set of all colate names. | [
"Iterates",
"on",
"all",
"factories",
"and",
"append",
"all",
"collate",
"names",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLEngine.java#L267-L274 | test | Returns a set of all the names of the collate types. | Of course, here is the Java code you requested:
```java
public static Set<String> getCollateNames() {
final Set<String> types = new HashSet<String>();
final Iterator<OCollateFactory> ite = getCollateFactories();
while (ite.hasNext()) {
types.addAll(ite.next().getNames());
}
return types... |
rupertlssmith/lojix | base/common/src/main/com/thesett/common/util/ReflectionUtils.java | ReflectionUtils.isSubTypeOf | public static boolean isSubTypeOf(Class parentClass, Class childClass)
{
try
{
// Check that the child class can be cast as a sub-type of the parent.
childClass.asSubclass(parentClass);
return true;
}
catch (ClassCastException e)
{
... | java | public static boolean isSubTypeOf(Class parentClass, Class childClass)
{
try
{
// Check that the child class can be cast as a sub-type of the parent.
childClass.asSubclass(parentClass);
return true;
}
catch (ClassCastException e)
{
... | [
"public",
"static",
"boolean",
"isSubTypeOf",
"(",
"Class",
"parentClass",
",",
"Class",
"childClass",
")",
"{",
"try",
"{",
"// Check that the child class can be cast as a sub-type of the parent.",
"childClass",
".",
"asSubclass",
"(",
"parentClass",
")",
";",
"return",
... | Checks that the child class is the same type or a sub-type of the parent class.
@param parentClass The parent class.
@param childClass The child class.
@return <tt>true</tt> if the child class is the same type or a sub-type of the parent class, <tt>false</tt>
otherwise. | [
"Checks",
"that",
"the",
"child",
"class",
"is",
"the",
"same",
"type",
"or",
"a",
"sub",
"-",
"type",
"of",
"the",
"parent",
"class",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/ReflectionUtils.java#L126-L142 | test | Check if the child class is a subclass of the parent class. | Of course, here is the Java code you requested:
```java
public static boolean isSubTypeOf(Class parentClass, Class childClass)
{
try
{
// Check that the child class can be cast as a sub-type of the parent.
childClass.asSubclass(parentClass);
return true;
... |
wildfly/wildfly | naming/src/main/java/org/jboss/as/naming/NamingContext.java | NamingContext.rename | public void rename(final String oldName, final String newName) throws NamingException {
rename(parseName(oldName), parseName(newName));
} | java | public void rename(final String oldName, final String newName) throws NamingException {
rename(parseName(oldName), parseName(newName));
} | [
"public",
"void",
"rename",
"(",
"final",
"String",
"oldName",
",",
"final",
"String",
"newName",
")",
"throws",
"NamingException",
"{",
"rename",
"(",
"parseName",
"(",
"oldName",
")",
",",
"parseName",
"(",
"newName",
")",
")",
";",
"}"
] | {@inheritDoc} | [
"{"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/naming/src/main/java/org/jboss/as/naming/NamingContext.java#L345-L347 | test | Renames a class or a class specification. | Of course, here is the Java code you requested:
```java
public void rename(final String oldName, final String newName) throws NamingException {
rename(parseName(oldName), parseName(newName));
}
```
Hope this helps! |
Unidata/thredds | legacy/src/main/java/ucar/nc2/NetcdfFileWriteable.java | NetcdfFileWriteable.addStringVariable | public Variable addStringVariable(String varName, List<Dimension> dims, int max_strlen) {
if (!defineMode)
throw new UnsupportedOperationException("not in define mode");
if (!N3iosp.isValidNetcdfObjectName(varName))
throw new IllegalArgumentException("illegal netCDF-3 variable name: "+varName);
... | java | public Variable addStringVariable(String varName, List<Dimension> dims, int max_strlen) {
if (!defineMode)
throw new UnsupportedOperationException("not in define mode");
if (!N3iosp.isValidNetcdfObjectName(varName))
throw new IllegalArgumentException("illegal netCDF-3 variable name: "+varName);
... | [
"public",
"Variable",
"addStringVariable",
"(",
"String",
"varName",
",",
"List",
"<",
"Dimension",
">",
"dims",
",",
"int",
"max_strlen",
")",
"{",
"if",
"(",
"!",
"defineMode",
")",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"not in define mode\"",
... | Add a variable with DataType = String to the file. Must be in define mode.
The variable will be stored in the file as a CHAR variable.
A new dimension with name "varName_strlen" is automatically added, with length max_strlen.
@param varName name of Variable, must be unique within the file.
@param dims list of... | [
"Add",
"a",
"variable",
"with",
"DataType",
"=",
"String",
"to",
"the",
"file",
".",
"Must",
"be",
"in",
"define",
"mode",
".",
"The",
"variable",
"will",
"be",
"stored",
"in",
"the",
"file",
"as",
"a",
"CHAR",
"variable",
".",
"A",
"new",
"dimension",... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/ucar/nc2/NetcdfFileWriteable.java#L444-L460 | test | Add a string variable to the netCDF - 3 data structure. | Of course, here is the Java code you requested:
```java
public Variable addStringVariable(String varName, List<Dimension> dims, int max_strlen) {
if (!defineMode)
throw new UnsupportedOperationException("not in define mode");
if (!N3iosp.isValidNetcdfObjectName(varName))
throw new IllegalArgumentEx... |
PistoiaHELM/HELMNotationParser | src/main/java/org/helm/notation2/parser/StateMachineParser.java | StateMachineParser.checkGroupId | public boolean checkGroupId(String d) {
Pattern p = Pattern.compile("G[1-9][0-9]*", Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(d);
LOG.debug("Validation of groupID:");
if (m.matches()) {
LOG.debug("GroupID is valid:");
return true;
}
LOG.debug("GroupID is not valid:");
... | java | public boolean checkGroupId(String d) {
Pattern p = Pattern.compile("G[1-9][0-9]*", Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(d);
LOG.debug("Validation of groupID:");
if (m.matches()) {
LOG.debug("GroupID is valid:");
return true;
}
LOG.debug("GroupID is not valid:");
... | [
"public",
"boolean",
"checkGroupId",
"(",
"String",
"d",
")",
"{",
"Pattern",
"p",
"=",
"Pattern",
".",
"compile",
"(",
"\"G[1-9][0-9]*\"",
",",
"Pattern",
".",
"CASE_INSENSITIVE",
")",
";",
"Matcher",
"m",
"=",
"p",
".",
"matcher",
"(",
"d",
")",
";",
... | method to validate the group id
@param d ID of a group
@return true if the connection details are valid, false otherwise | [
"method",
"to",
"validate",
"the",
"group",
"id"
] | 685d7ab7886e9b5cc15fb904025fe6eee703f8f6 | https://github.com/PistoiaHELM/HELMNotationParser/blob/685d7ab7886e9b5cc15fb904025fe6eee703f8f6/src/main/java/org/helm/notation2/parser/StateMachineParser.java#L176-L186 | test | Check if the given string is a valid group ID. | Of course, here is the Java code you requested:
```java
public boolean checkGroupId(String d) {
Pattern p = Pattern.compile("G[1-9][0-9]*", Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(d);
LOG.debug("Validation of groupID:");
if (m.matches()) {
LOG.debug("GroupID is valid:");
return... |
firepick1/firerest-client | src/main/java/org/firepick/IPv4Scanner.java | IPv4Scanner.localhostNetworkAddresses | public static List<InetAddress> localhostNetworkAddresses()
throws UnknownHostException, SocketException
{
List<InetAddress> result = new ArrayList<InetAddress>();
InetAddress localhost = null;
try {
// localhost = InetAddress.getLocalHost();
throw new UnknownHostException();
} catch(... | java | public static List<InetAddress> localhostNetworkAddresses()
throws UnknownHostException, SocketException
{
List<InetAddress> result = new ArrayList<InetAddress>();
InetAddress localhost = null;
try {
// localhost = InetAddress.getLocalHost();
throw new UnknownHostException();
} catch(... | [
"public",
"static",
"List",
"<",
"InetAddress",
">",
"localhostNetworkAddresses",
"(",
")",
"throws",
"UnknownHostException",
",",
"SocketException",
"{",
"List",
"<",
"InetAddress",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"InetAddress",
">",
"(",
")",
";",... | Return list of InetAddress for localhost that are not loopback addresses
(e.g., 127.0.0.1)
@return address list with size() >= 1 | [
"Return",
"list",
"of",
"InetAddress",
"for",
"localhost",
"that",
"are",
"not",
"loopback",
"addresses",
"(",
"e",
".",
"g",
".",
"127",
".",
"0",
".",
"0",
".",
"1",
")"
] | f43c85ca093b1f9f62f0375f905adae9351de1e6 | https://github.com/firepick1/firerest-client/blob/f43c85ca093b1f9f62f0375f905adae9351de1e6/src/main/java/org/firepick/IPv4Scanner.java#L29-L59 | test | Get localhost network addresses. | Of course, here is the Java code you requested:
```java
public static List<InetAddress> localhostNetworkAddresses()
throws UnknownHostException, SocketException
{
List<InetAddress> result = new ArrayList<InetAddress>();
InetAddress localhost = null;
try {
// localhost = InetAddress.getLocalHos... |
jkuhnert/ognl | src/main/java/ognl/OgnlOps.java | OgnlOps.isEqual | public static boolean isEqual(Object object1, Object object2)
{
boolean result = false;
if (object1 == object2) {
result = true;
} else {
if ((object1 != null) && object1.getClass().isArray()) {
if ((object2 != null) && object2.getClass().isArray() &&... | java | public static boolean isEqual(Object object1, Object object2)
{
boolean result = false;
if (object1 == object2) {
result = true;
} else {
if ((object1 != null) && object1.getClass().isArray()) {
if ((object2 != null) && object2.getClass().isArray() &&... | [
"public",
"static",
"boolean",
"isEqual",
"(",
"Object",
"object1",
",",
"Object",
"object2",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"object1",
"==",
"object2",
")",
"{",
"result",
"=",
"true",
";",
"}",
"else",
"{",
"if",
"(",
... | Returns true if object1 is equal to object2 in either the sense that they are the same object
or, if both are non-null if they are equal in the <CODE>equals()</CODE> sense.
@param object1
First object to compare
@param object2
Second object to compare
@return true if v1 == v2 | [
"Returns",
"true",
"if",
"object1",
"is",
"equal",
"to",
"object2",
"in",
"either",
"the",
"sense",
"that",
"they",
"are",
"the",
"same",
"object",
"or",
"if",
"both",
"are",
"non",
"-",
"null",
"if",
"they",
"are",
"equal",
"in",
"the",
"<CODE",
">",
... | 53d51a30c8c299b750dede779d05cb84beee73c3 | https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/OgnlOps.java#L125-L148 | test | Compare two objects. | Of course, here is the Java code you requested:
```java
public static boolean isEqual(Object object1, Object object2)
{
boolean result = false;
if (object1 == object2) {
result = true;
} else {
if ((object1 != null) && object1.getClass().isArray()) {
... |
play2-maven-plugin/play2-maven-plugin | play2-providers/play2-provider-play23/src/main/java/com/google/code/play2/provider/play23/Play23LessCompiler.java | Play23LessCompiler.resolve | public static File resolve( File originalSource, String imported )
{
return new File( originalSource.getParentFile(), imported );
} | java | public static File resolve( File originalSource, String imported )
{
return new File( originalSource.getParentFile(), imported );
} | [
"public",
"static",
"File",
"resolve",
"(",
"File",
"originalSource",
",",
"String",
"imported",
")",
"{",
"return",
"new",
"File",
"(",
"originalSource",
".",
"getParentFile",
"(",
")",
",",
"imported",
")",
";",
"}"
] | Called from Less script, must be "public" | [
"Called",
"from",
"Less",
"script",
"must",
"be",
"public"
] | 34e174b02c4245cfad64abd230f3cbeda9d9b2f4 | https://github.com/play2-maven-plugin/play2-maven-plugin/blob/34e174b02c4245cfad64abd230f3cbeda9d9b2f4/play2-providers/play2-provider-play23/src/main/java/com/google/code/play2/provider/play23/Play23LessCompiler.java#L239-L242 | test | Resolves the original source file to a CID file. | Of course, here is the Java code you requested:
```java
public static File resolve( File originalSource, String imported )
{
return new File( originalSource.getParentFile(), imported );
}
```
Hope this helps! |
Unidata/thredds | visad/src/main/java/ucar/nc2/iosp/grid/GridCoordSys.java | GridCoordSys.matchLevels | boolean matchLevels(List<GridRecord> records) {
// first create a new list
List<Double> levelList = new ArrayList<Double>(records.size());
for (GridRecord record : records) {
Double d = new Double(record.getLevel1());
if (!levelList.contains(d)) {
levelList.add(d);
}
}
Co... | java | boolean matchLevels(List<GridRecord> records) {
// first create a new list
List<Double> levelList = new ArrayList<Double>(records.size());
for (GridRecord record : records) {
Double d = new Double(record.getLevel1());
if (!levelList.contains(d)) {
levelList.add(d);
}
}
Co... | [
"boolean",
"matchLevels",
"(",
"List",
"<",
"GridRecord",
">",
"records",
")",
"{",
"// first create a new list",
"List",
"<",
"Double",
">",
"levelList",
"=",
"new",
"ArrayList",
"<",
"Double",
">",
"(",
"records",
".",
"size",
"(",
")",
")",
";",
"for",
... | Match levels
@param records list of GridRecords
@return true if they match | [
"Match",
"levels"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/grid/GridCoordSys.java#L172-L190 | test | Checks if the levels of the records are the same. | Of course, here is the Java code you requested:
```java
boolean matchLevels(List<GridRecord> records) {
// first create a new list
List<Double> levelList = new ArrayList<Double>(records.size());
for (GridRecord record : records) {
Double d = new Double(record.getLevel1());
if (!levelList.conta... |
objectify/objectify | src/main/java/com/googlecode/objectify/util/GenericUtils.java | GenericUtils.getCollectionComponentType | public static Type getCollectionComponentType(Type collectionType) {
Type componentType = GenericTypeReflector.getTypeParameter(collectionType, Collection.class.getTypeParameters()[0]);
if (componentType == null) // if it was a raw type, just assume Object
return Object.class;
else
return componentType;
} | java | public static Type getCollectionComponentType(Type collectionType) {
Type componentType = GenericTypeReflector.getTypeParameter(collectionType, Collection.class.getTypeParameters()[0]);
if (componentType == null) // if it was a raw type, just assume Object
return Object.class;
else
return componentType;
} | [
"public",
"static",
"Type",
"getCollectionComponentType",
"(",
"Type",
"collectionType",
")",
"{",
"Type",
"componentType",
"=",
"GenericTypeReflector",
".",
"getTypeParameter",
"(",
"collectionType",
",",
"Collection",
".",
"class",
".",
"getTypeParameters",
"(",
")"... | Get the component type of a Collection. | [
"Get",
"the",
"component",
"type",
"of",
"a",
"Collection",
"."
] | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/util/GenericUtils.java#L19-L25 | test | Get the component type of the given collection type. | Of course, here is the Java code you requested:
```java
public static Type getCollectionComponentType(Type collectionType) {
Type componentType = GenericTypeReflector.getTypeParameter(collectionType, Collection.class.getTypeParameters()[0]);
if (componentType == null) // if it was a raw type, just assume Object
... |
oblac/jodd | jodd-core/src/main/java/jodd/io/FileUtil.java | FileUtil.toFile | public static File toFile(final URL url) {
String fileName = toFileName(url);
if (fileName == null) {
return null;
}
return file(fileName);
} | java | public static File toFile(final URL url) {
String fileName = toFileName(url);
if (fileName == null) {
return null;
}
return file(fileName);
} | [
"public",
"static",
"File",
"toFile",
"(",
"final",
"URL",
"url",
")",
"{",
"String",
"fileName",
"=",
"toFileName",
"(",
"url",
")",
";",
"if",
"(",
"fileName",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"file",
"(",
"fileName",
"... | Converts {@link File} {@link URL}s to {@link File}. Ignores other schemes and returns {@code null}. | [
"Converts",
"{"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/FileUtil.java#L113-L119 | test | Converts a URL to a File. | Of course, here is the Java code you requested:
```java
public static File toFile(final URL url) {
String fileName = toFileName(url);
if (fileName == null) {
return null;
}
return file(fileName);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/units/SimpleUnit.java | SimpleUnit.makeUnit | static protected Unit makeUnit(String name) throws UnitException {
UnitFormat format = UnitFormatManager.instance();
return format.parse(name);
} | java | static protected Unit makeUnit(String name) throws UnitException {
UnitFormat format = UnitFormatManager.instance();
return format.parse(name);
} | [
"static",
"protected",
"Unit",
"makeUnit",
"(",
"String",
"name",
")",
"throws",
"UnitException",
"{",
"UnitFormat",
"format",
"=",
"UnitFormatManager",
".",
"instance",
"(",
")",
";",
"return",
"format",
".",
"parse",
"(",
"name",
")",
";",
"}"
] | need subclass access | [
"need",
"subclass",
"access"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/units/SimpleUnit.java#L86-L89 | test | Create a Unit object from a string. | Of course, here is the Java code you requested:
```java
static protected Unit makeUnit(String name) throws UnitException {
UnitFormat format = UnitFormatManager.instance();
return format.parse(name);
}
```
Hope this helps! |
dschulten/hydra-java | spring-hateoas-ext/src/main/java/de/escalon/hypermedia/affordance/PartialUriTemplate.java | PartialUriTemplate.stripOptionalVariables | public PartialUriTemplateComponents stripOptionalVariables(List<ActionDescriptor> actionDescriptors) {
return getUriTemplateComponents(Collections.<String, Object>emptyMap(), getRequiredArgNames(actionDescriptors));
} | java | public PartialUriTemplateComponents stripOptionalVariables(List<ActionDescriptor> actionDescriptors) {
return getUriTemplateComponents(Collections.<String, Object>emptyMap(), getRequiredArgNames(actionDescriptors));
} | [
"public",
"PartialUriTemplateComponents",
"stripOptionalVariables",
"(",
"List",
"<",
"ActionDescriptor",
">",
"actionDescriptors",
")",
"{",
"return",
"getUriTemplateComponents",
"(",
"Collections",
".",
"<",
"String",
",",
"Object",
">",
"emptyMap",
"(",
")",
",",
... | Strips all variables which are not required by any of the given action descriptors. If no action descriptors are
given, nothing will be stripped.
@param actionDescriptors
to decide which variables are optional, may be empty
@return partial uri template components without optional variables, if actionDescriptors was no... | [
"Strips",
"all",
"variables",
"which",
"are",
"not",
"required",
"by",
"any",
"of",
"the",
"given",
"action",
"descriptors",
".",
"If",
"no",
"action",
"descriptors",
"are",
"given",
"nothing",
"will",
"be",
"stripped",
"."
] | 21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a | https://github.com/dschulten/hydra-java/blob/21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a/spring-hateoas-ext/src/main/java/de/escalon/hypermedia/affordance/PartialUriTemplate.java#L269-L271 | test | Returns a partial URI template with optional variables stripped. | Of course, here is the Java code you requested:
```java
public PartialUriTemplateComponents stripOptionalVariables(List<ActionDescriptor> actionDescriptors) {
return getUriTemplateComponents(Collections.<String, Object>emptyMap(), getRequiredArgNames(actionDescriptors));
}
```
Hope this helps! |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/extension/style/FeatureStyleExtension.java | FeatureStyleExtension.getOrInsertIcon | private long getOrInsertIcon(IconRow icon) {
long iconId;
if (icon.hasId()) {
iconId = icon.getId();
} else {
IconDao iconDao = getIconDao();
iconId = iconDao.create(icon);
}
return iconId;
} | java | private long getOrInsertIcon(IconRow icon) {
long iconId;
if (icon.hasId()) {
iconId = icon.getId();
} else {
IconDao iconDao = getIconDao();
iconId = iconDao.create(icon);
}
return iconId;
} | [
"private",
"long",
"getOrInsertIcon",
"(",
"IconRow",
"icon",
")",
"{",
"long",
"iconId",
";",
"if",
"(",
"icon",
".",
"hasId",
"(",
")",
")",
"{",
"iconId",
"=",
"icon",
".",
"getId",
"(",
")",
";",
"}",
"else",
"{",
"IconDao",
"iconDao",
"=",
"ge... | Get the icon id, either from the existing icon or by inserting a new one
@param icon icon row
@return icon id | [
"Get",
"the",
"icon",
"id",
"either",
"from",
"the",
"existing",
"icon",
"or",
"by",
"inserting",
"a",
"new",
"one"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/style/FeatureStyleExtension.java#L1304-L1313 | test | Get or insert an icon in the database. | Of course, here is the Java code you requested:
```java
private long getOrInsertIcon(IconRow icon) {
long iconId;
if (icon.hasId()) {
iconId = icon.getId();
} else {
IconDao iconDao = getIconDao();
iconId = iconDao.create(icon);
}
return iconI... |
Unidata/thredds | cdm/src/main/java/ucar/ma2/StructureDataW.java | StructureDataW.getJavaArrayShort | public short[] getJavaArrayShort(StructureMembers.Member m) {
Array data = getArray(m);
return (short []) data.getStorage();
} | java | public short[] getJavaArrayShort(StructureMembers.Member m) {
Array data = getArray(m);
return (short []) data.getStorage();
} | [
"public",
"short",
"[",
"]",
"getJavaArrayShort",
"(",
"StructureMembers",
".",
"Member",
"m",
")",
"{",
"Array",
"data",
"=",
"getArray",
"(",
"m",
")",
";",
"return",
"(",
"short",
"[",
"]",
")",
"data",
".",
"getStorage",
"(",
")",
";",
"}"
] | Get java short array for a member of type short.
@param m get data from this StructureMembers.Member. Must be of type short.
@return 1D java array of shorts | [
"Get",
"java",
"short",
"array",
"for",
"a",
"member",
"of",
"type",
"short",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/StructureDataW.java#L198-L201 | test | Get the Java short array from a StructureMembers. Member | Of course, here is the Java code you requested:
```java
public short[] getJavaArrayShort(StructureMembers.Member m) {
Array data = getArray(m);
return (short []) data.getStorage();
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/NetcdfFileWriter.java | NetcdfFileWriter.addDimension | public Dimension addDimension(Group g, String dimName, int length, boolean isUnlimited, boolean isVariableLength) {
if (!defineMode) throw new UnsupportedOperationException("not in define mode");
if (!isValidObjectName(dimName))
throw new IllegalArgumentException("illegal dimension name " + dimName);
... | java | public Dimension addDimension(Group g, String dimName, int length, boolean isUnlimited, boolean isVariableLength) {
if (!defineMode) throw new UnsupportedOperationException("not in define mode");
if (!isValidObjectName(dimName))
throw new IllegalArgumentException("illegal dimension name " + dimName);
... | [
"public",
"Dimension",
"addDimension",
"(",
"Group",
"g",
",",
"String",
"dimName",
",",
"int",
"length",
",",
"boolean",
"isUnlimited",
",",
"boolean",
"isVariableLength",
")",
"{",
"if",
"(",
"!",
"defineMode",
")",
"throw",
"new",
"UnsupportedOperationExcepti... | Add a shared Dimension to the file. Must be in define mode.
@param dimName name of dimension
@param length size of dimension.
@param isUnlimited if dimension is unlimited
@param isVariableLength if dimension is variable length
@return the created dimension | [
"Add",
"a",
"shared",
"Dimension",
"to",
"the",
"file",
".",
"Must",
"be",
"in",
"define",
"mode",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/NetcdfFileWriter.java#L331-L339 | test | Add a new Dimension to a group. | Of course, here is the Java code you requested:
```java
public Dimension addDimension(Group g, String dimName, int length, boolean isUnlimited, boolean isVariableLength) {
if (!defineMode) throw new UnsupportedOperationException("not in define mode");
if (!isValidObjectName(dimName))
throw new Illegal... |
intellimate/IzouSDK | src/main/java/org/intellimate/izou/sdk/frameworks/music/events/PlayerUpdate.java | PlayerUpdate.createPlayerUpdate | public static Optional<PlayerUpdate> createPlayerUpdate(Identification source, TrackInfo trackInfo) {
if (trackInfo == null)
return Optional.empty();
try {
PlayerUpdate playerUpdate = new PlayerUpdate(source);
playerUpdate.addResource(new TrackInfoResource(source, tra... | java | public static Optional<PlayerUpdate> createPlayerUpdate(Identification source, TrackInfo trackInfo) {
if (trackInfo == null)
return Optional.empty();
try {
PlayerUpdate playerUpdate = new PlayerUpdate(source);
playerUpdate.addResource(new TrackInfoResource(source, tra... | [
"public",
"static",
"Optional",
"<",
"PlayerUpdate",
">",
"createPlayerUpdate",
"(",
"Identification",
"source",
",",
"TrackInfo",
"trackInfo",
")",
"{",
"if",
"(",
"trackInfo",
"==",
"null",
")",
"return",
"Optional",
".",
"empty",
"(",
")",
";",
"try",
"{"... | Creates a new Event Object
@param source the source of the Event, most likely a this reference.
@param trackInfo the current song
@return the optional PlayerUpdate (if no illegal arguments got passed)
@throws IllegalArgumentException if one of the Arguments is null or empty | [
"Creates",
"a",
"new",
"Event",
"Object"
] | bc8705ad48a6ca12a722f2b787be435949fa5d08 | https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/frameworks/music/events/PlayerUpdate.java#L97-L107 | test | Create a player update. | Of course, here is the Java code you requested:
```java
public static Optional<PlayerUpdate> createPlayerUpdate(Identification source, TrackInfo trackInfo) {
if (trackInfo == null)
return Optional.empty();
try {
PlayerUpdate playerUpdate = new PlayerUpdate(source);
p... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerJSON.java | ORecordSerializerJSON.getValueAsObjectOrMap | private Object getValueAsObjectOrMap(ODocument iRecord, String iFieldValue, OType iType, OType iLinkedType,
Map<String, Character> iFieldTypes, boolean iNoMap, String iOptions) {
final String[] fields = OStringParser.getWords(iFieldValue.substring(1, iFieldValue.length() - 1), ":,", true);
if (fields... | java | private Object getValueAsObjectOrMap(ODocument iRecord, String iFieldValue, OType iType, OType iLinkedType,
Map<String, Character> iFieldTypes, boolean iNoMap, String iOptions) {
final String[] fields = OStringParser.getWords(iFieldValue.substring(1, iFieldValue.length() - 1), ":,", true);
if (fields... | [
"private",
"Object",
"getValueAsObjectOrMap",
"(",
"ODocument",
"iRecord",
",",
"String",
"iFieldValue",
",",
"OType",
"iType",
",",
"OType",
"iLinkedType",
",",
"Map",
"<",
"String",
",",
"Character",
">",
"iFieldTypes",
",",
"boolean",
"iNoMap",
",",
"String",... | OBJECT OR MAP. CHECK THE TYPE ATTRIBUTE TO KNOW IT. | [
"OBJECT",
"OR",
"MAP",
".",
"CHECK",
"THE",
"TYPE",
"ATTRIBUTE",
"TO",
"KNOW",
"IT",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerJSON.java#L587-L604 | test | Gets the value as object or map. | Of course, here is the Java code you requested:
```java
private Object getValueAsObjectOrMap(ODocument iRecord, String iFieldValue, OType iType, OType iLinkedType,
Map<String, Character> iFieldTypes, boolean iNoMap, String iOptions) {
final String[] fields = OStringParser.getWords(iFieldValue.substring(1, ... |
Unidata/thredds | udunits/src/main/java/ucar/units/Dimension.java | Dimension.pow | protected Factor[] pow(final int power) {
Factor[] factors;
if (power == 0) {
factors = new Factor[0];
}
else {
factors = getFactors();
if (power != 1) {
for (int i = factors.length; --i >= 0;) {
factors[i] = factors... | java | protected Factor[] pow(final int power) {
Factor[] factors;
if (power == 0) {
factors = new Factor[0];
}
else {
factors = getFactors();
if (power != 1) {
for (int i = factors.length; --i >= 0;) {
factors[i] = factors... | [
"protected",
"Factor",
"[",
"]",
"pow",
"(",
"final",
"int",
"power",
")",
"{",
"Factor",
"[",
"]",
"factors",
";",
"if",
"(",
"power",
"==",
"0",
")",
"{",
"factors",
"=",
"new",
"Factor",
"[",
"0",
"]",
";",
"}",
"else",
"{",
"factors",
"=",
... | Raises this dimension to a power.
@param power
The power to raise this dimension by.
@return The Factor-s of this dimension raised to the power
<code>power</code>. | [
"Raises",
"this",
"dimension",
"to",
"a",
"power",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/udunits/src/main/java/ucar/units/Dimension.java#L138-L152 | test | Get the factors of the class with the given power. | Of course, here is the Java code you requested:
```java
protected Factor[] pow(final int power) {
Factor[] factors;
if (power == 0) {
factors = new Factor[0];
}
else {
factors = getFactors();
if (power != 1) {
for (int i = factors.leng... |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java | ObjectFactory.createNettorenditeSoll | @XmlElementDecl(namespace = "", name = "nettorendite_soll")
@XmlJavaTypeAdapter(Adapter2 .class)
public JAXBElement<BigDecimal> createNettorenditeSoll(BigDecimal value) {
return new JAXBElement<BigDecimal>(_NettorenditeSoll_QNAME, BigDecimal.class, null, value);
} | java | @XmlElementDecl(namespace = "", name = "nettorendite_soll")
@XmlJavaTypeAdapter(Adapter2 .class)
public JAXBElement<BigDecimal> createNettorenditeSoll(BigDecimal value) {
return new JAXBElement<BigDecimal>(_NettorenditeSoll_QNAME, BigDecimal.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"\"",
",",
"name",
"=",
"\"nettorendite_soll\"",
")",
"@",
"XmlJavaTypeAdapter",
"(",
"Adapter2",
".",
"class",
")",
"public",
"JAXBElement",
"<",
"BigDecimal",
">",
"createNettorenditeSoll",
"(",
"BigDecimal",
"valu... | Create an instance of {@link JAXBElement }{@code <}{@link BigDecimal }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"BigDecimal",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L2023-L2027 | test | Create an instance of a Nettorendite_soll value. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "", name = "nettorendite_soll")
@XmlJavaTypeAdapter(Adapter2 .class)
public JAXBElement<BigDecimal> createNettorenditeSoll(BigDecimal value) {
return new JAXBElement<BigDecimal>(_NettorenditeSoll_QNAME, BigDecimal.class... |
algolia/algoliasearch-client-android | algoliasearch/src/main/java/com/algolia/search/saas/ExpiringCache.java | ExpiringCache.put | public V put(K key, V value) {
V previous = null;
synchronized (this) {
long timeout = System.currentTimeMillis() + TimeUnit.MILLISECONDS.convert(expirationTimeout, expirationTimeUnit);
final Pair<V, Long> previousPair = lruCache.put(key, new Pair<>(value, timeout));
... | java | public V put(K key, V value) {
V previous = null;
synchronized (this) {
long timeout = System.currentTimeMillis() + TimeUnit.MILLISECONDS.convert(expirationTimeout, expirationTimeUnit);
final Pair<V, Long> previousPair = lruCache.put(key, new Pair<>(value, timeout));
... | [
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"V",
"previous",
"=",
"null",
";",
"synchronized",
"(",
"this",
")",
"{",
"long",
"timeout",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"TimeUnit",
".",
"MILLISECONDS",
... | Puts a value in the cache, computing an expiration time
@return the previous value for this key, if any | [
"Puts",
"a",
"value",
"in",
"the",
"cache",
"computing",
"an",
"expiration",
"time"
] | 3293ba6e6116a4f6c1face2cc606bc047d6d4a3c | https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/ExpiringCache.java#L34-L45 | test | Put a value into the cache. | Of course, here is the Java code you requested:
```java
public V put(K key, V value) {
V previous = null;
synchronized (this) {
long timeout = System.currentTimeMillis() + TimeUnit.MILLISECONDS.convert(expirationTimeout, expirationTimeUnit);
final Pair<V, Long> previousPair = l... |
nyla-solutions/gedi-geode | gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/util/GemFireMgmt.java | GemFireMgmt.shutDownRedundancyZone | public static void shutDownRedundancyZone(String redundancyZone)
{
if (redundancyZone == null || redundancyZone.length() == 0)
throw new IllegalArgumentException("redundancyZone required");
String objectNamePattern = "GemFire:type=Member,member=*";
QueryExp exp = Query.eq(Query.attr("Redundancy... | java | public static void shutDownRedundancyZone(String redundancyZone)
{
if (redundancyZone == null || redundancyZone.length() == 0)
throw new IllegalArgumentException("redundancyZone required");
String objectNamePattern = "GemFire:type=Member,member=*";
QueryExp exp = Query.eq(Query.attr("Redundancy... | [
"public",
"static",
"void",
"shutDownRedundancyZone",
"(",
"String",
"redundancyZone",
")",
"{",
"if",
"(",
"redundancyZone",
"==",
"null",
"||",
"redundancyZone",
".",
"length",
"(",
")",
"==",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"redun... | Shut down each member in a given RedundancyZone
@param redundancyZone the Redundancy Zone to shutdown | [
"Shut",
"down",
"each",
"member",
"in",
"a",
"given",
"RedundancyZone"
] | 3dd71d6e66e941ce350b306b70677ee95a7d9eee | https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/util/GemFireMgmt.java#L216-L229 | test | Shut down the GemFire instance. | Of course, here is the Java code you requested:
```java
public static void shutDownRedundancyZone(String redundancyZone)
{
if (redundancyZone == null || redundancyZone.length() == 0)
throw new IllegalArgumentException("redundancyZone required");
String objectNamePattern = "GemFire:type=Member,memb... |
apache/parquet-mr | parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java | ParquetFileReader.readAllFootersInParallel | @Deprecated
public static List<Footer> readAllFootersInParallel(Configuration configuration, FileStatus fileStatus) throws IOException {
return readAllFootersInParallel(configuration, fileStatus, false);
} | java | @Deprecated
public static List<Footer> readAllFootersInParallel(Configuration configuration, FileStatus fileStatus) throws IOException {
return readAllFootersInParallel(configuration, fileStatus, false);
} | [
"@",
"Deprecated",
"public",
"static",
"List",
"<",
"Footer",
">",
"readAllFootersInParallel",
"(",
"Configuration",
"configuration",
",",
"FileStatus",
"fileStatus",
")",
"throws",
"IOException",
"{",
"return",
"readAllFootersInParallel",
"(",
"configuration",
",",
"... | Read the footers of all the files under that path (recursively)
not using summary files.
rowGroups are not skipped
@param configuration the configuration to access the FS
@param fileStatus the root dir
@return all the footers
@throws IOException if an exception is thrown while reading the footers
@deprecated will be re... | [
"Read",
"the",
"footers",
"of",
"all",
"the",
"files",
"under",
"that",
"path",
"(",
"recursively",
")",
"not",
"using",
"summary",
"files",
".",
"rowGroups",
"are",
"not",
"skipped"
] | 62dcc68acaf64012bf731e103be780956f1f446d | https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java#L314-L317 | test | read all the footers in parallel | Of course, here is the Java code you requested:
```java
@Deprecated
public static List<Footer> readAllFootersInParallel(Configuration configuration, FileStatus fileStatus) throws IOException {
return readAllFootersInParallel(configuration, fileStatus, false);
}
```
Hope this helps! |
playframework/playframework | core/play/src/main/java/play/inject/BindingKey.java | BindingKey.qualifiedWith | public <A extends Annotation> BindingKey<T> qualifiedWith(final A instance) {
return underlying.qualifiedWith(instance).asJava();
} | java | public <A extends Annotation> BindingKey<T> qualifiedWith(final A instance) {
return underlying.qualifiedWith(instance).asJava();
} | [
"public",
"<",
"A",
"extends",
"Annotation",
">",
"BindingKey",
"<",
"T",
">",
"qualifiedWith",
"(",
"final",
"A",
"instance",
")",
"{",
"return",
"underlying",
".",
"qualifiedWith",
"(",
"instance",
")",
".",
"asJava",
"(",
")",
";",
"}"
] | Qualify this binding key with the given instance of an annotation.
<p>This can be used to specify bindings with annotations that have particular values. | [
"Qualify",
"this",
"binding",
"key",
"with",
"the",
"given",
"instance",
"of",
"an",
"annotation",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/inject/BindingKey.java#L63-L65 | test | Returns a qualified key that is the same as this key but with the given instance. | Of course, here is the Java code you requested:
```java
public <A extends Annotation> BindingKey<T> qualifiedWith(final A instance) {
return underlying.qualifiedWith(instance).asJava();
}
```
Hope this helps! |
liveontologies/elk-reasoner | elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/stages/AbstractReasonerState.java | AbstractReasonerState.getInstanceTaxonomyQuietly | public synchronized InstanceTaxonomy<ElkClass, ElkNamedIndividual> getInstanceTaxonomyQuietly()
throws ElkException {
InstanceTaxonomy<ElkClass, ElkNamedIndividual> result;
try {
result = getInstanceTaxonomy();
} catch (ElkInconsistentOntologyException e) {
LOGGER_.debug("Ontology is inconsistent");
... | java | public synchronized InstanceTaxonomy<ElkClass, ElkNamedIndividual> getInstanceTaxonomyQuietly()
throws ElkException {
InstanceTaxonomy<ElkClass, ElkNamedIndividual> result;
try {
result = getInstanceTaxonomy();
} catch (ElkInconsistentOntologyException e) {
LOGGER_.debug("Ontology is inconsistent");
... | [
"public",
"synchronized",
"InstanceTaxonomy",
"<",
"ElkClass",
",",
"ElkNamedIndividual",
">",
"getInstanceTaxonomyQuietly",
"(",
")",
"throws",
"ElkException",
"{",
"InstanceTaxonomy",
"<",
"ElkClass",
",",
"ElkNamedIndividual",
">",
"result",
";",
"try",
"{",
"resul... | Compute the inferred taxonomy of the named classes with instances if this
has not been done yet.
@return the instance taxonomy implied by the current ontology
@throws ElkException
if the reasoning process cannot be completed successfully | [
"Compute",
"the",
"inferred",
"taxonomy",
"of",
"the",
"named",
"classes",
"with",
"instances",
"if",
"this",
"has",
"not",
"been",
"done",
"yet",
"."
] | cfbe5279a57e0433d45c1676c7658ddb6e29b9eb | https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/stages/AbstractReasonerState.java#L651-L690 | test | Gets the instance taxonomy. | Of course, here is the Java code you requested:
```java
public synchronized InstanceTaxonomy<ElkClass, ElkNamedIndividual> getInstanceTaxonomyQuietly()
throws ElkException {
InstanceTaxonomy<ElkClass, ElkNamedIndividual> result;
try {
result = getInstanceTaxonomy();
} catch (ElkInconsistentOntologyExcept... |
RestComm/jain-slee | container/profiles/src/main/java/org/mobicents/slee/container/profile/ProfileContextImpl.java | ProfileContextImpl.getProfileLocalObject | public ProfileLocalObject getProfileLocalObject()
throws IllegalStateException, SLEEException {
// check state
if (profileObject == null
|| profileObject.getState() == ProfileObjectState.PROFILE_INITIALIZATION
|| profileObject.getProfileEntity() == null) {
throw new IllegalStateException();
}... | java | public ProfileLocalObject getProfileLocalObject()
throws IllegalStateException, SLEEException {
// check state
if (profileObject == null
|| profileObject.getState() == ProfileObjectState.PROFILE_INITIALIZATION
|| profileObject.getProfileEntity() == null) {
throw new IllegalStateException();
}... | [
"public",
"ProfileLocalObject",
"getProfileLocalObject",
"(",
")",
"throws",
"IllegalStateException",
",",
"SLEEException",
"{",
"// check state\r",
"if",
"(",
"profileObject",
"==",
"null",
"||",
"profileObject",
".",
"getState",
"(",
")",
"==",
"ProfileObjectState",
... | /*
(non-Javadoc)
@see javax.slee.profile.ProfileContext#getProfileLocalObject() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/profiles/src/main/java/org/mobicents/slee/container/profile/ProfileContextImpl.java#L82-L95 | test | Gets the ProfileLocalObject object that this Session is associated with. | Of course, here is the Java code you requested:
```java
public ProfileLocalObject getProfileLocalObject()
throws IllegalStateException, SLEEException {
// check state
if (profileObject == null
|| profileObject.getState() == ProfileObjectState.PROFILE_INITIALIZATION
|| profileObject.getProfileEntity... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.